@camstack/addon-agent-ui 1.2.306 → 1.2.307

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
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- //#region ../types/dist/event-category-DmZDPDf_.mjs
3
+ //#region ../types/dist/event-category-CaURIwQA.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -716,6 +716,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
716
716
  EventCategory["NotificationRuleBroken"] = "notification.rule-broken";
717
717
  /** The clear of {@link NotificationRuleBroken}: the rule loads and names nothing deleted. */
718
718
  EventCategory["NotificationRuleRepaired"] = "notification.rule-repaired";
719
+ /** A migration failed or was blocked; the Alert Center re-reads the ledger. */
720
+ EventCategory["MigrationFailed"] = "migration.failed";
721
+ /** A migration applied or a failure cleared; the Alert Center re-reads the ledger. */
722
+ EventCategory["MigrationApplied"] = "migration.applied";
719
723
  EventCategory["DeviceUpdated"] = "device.updated";
720
724
  /**
721
725
  * Transport-level connectivity. Emitted by the device driver when
@@ -778,6 +782,378 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
778
782
  return EventCategory;
779
783
  }({});
780
784
  //#endregion
785
+ //#region ../types/dist/device-type-CEqjmUnR.mjs
786
+ /**
787
+ import { errMsg } from '@camstack/types'
788
+ * Extract a human-readable message from an unknown error value.
789
+ * Replaces the ubiquitous `errMsg(err)` pattern.
790
+ */
791
+ function errMsg(err) {
792
+ if (err instanceof Error) return err.message;
793
+ if (typeof err === "string") return err;
794
+ return String(err);
795
+ }
796
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
797
+ DeviceType["Camera"] = "camera";
798
+ DeviceType["Hub"] = "hub";
799
+ DeviceType["Light"] = "light";
800
+ DeviceType["Siren"] = "siren";
801
+ DeviceType["Switch"] = "switch";
802
+ DeviceType["Sensor"] = "sensor";
803
+ DeviceType["Thermostat"] = "thermostat";
804
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
805
+ * `climate-control` cap surface with `Thermostat` but renders a
806
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
807
+ * independent vertical/horizontal swing). Sources: native Gree, and
808
+ * reusable by other AC integrations. */
809
+ DeviceType["Climate"] = "climate";
810
+ DeviceType["Button"] = "button";
811
+ /** Generic stateless event emitter — carries a device's EXACT declared
812
+ * event vocabulary verbatim (no normalization). Installed with the
813
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
814
+ * HA bus events (e.g. `zha_event`, generic). */
815
+ DeviceType["EventEmitter"] = "event-emitter";
816
+ /** Firmware/software update entity — current vs available version,
817
+ * updatable flag, update state, and an install action. Installed with
818
+ * the `update` cap. Sources: Homematic firmware-update channels (and
819
+ * reusable by other providers, e.g. HA `update.*` entities). */
820
+ DeviceType["Update"] = "update";
821
+ DeviceType["Generic"] = "generic";
822
+ /** Generic notification delivery target (HA `notify.<service>`, future
823
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
824
+ * endpoint; the `notifier` cap defines the send surface. */
825
+ DeviceType["Notifier"] = "notifier";
826
+ /** Pre-recorded action sequence with optional parameters
827
+ * (HA `script.*`). Runnable via `script-runner` cap. */
828
+ DeviceType["Script"] = "script";
829
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
830
+ * trigger surface exposed via `automation-control` cap. */
831
+ DeviceType["Automation"] = "automation";
832
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
833
+ DeviceType["Lock"] = "lock";
834
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
835
+ * `valve.*`). `cover` cap with sub-roles for variant. */
836
+ DeviceType["Cover"] = "cover";
837
+ /** Pipe / water / gas valve with open/close/stop and optional
838
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
839
+ * modelled on the same open/closed lifecycle. */
840
+ DeviceType["Valve"] = "valve";
841
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
842
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
843
+ * modelled on the same target / mode lifecycle. */
844
+ DeviceType["Humidifier"] = "humidifier";
845
+ /** Water heater / boiler with target temperature + operation mode +
846
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
847
+ * climate-family actuator. */
848
+ DeviceType["WaterHeater"] = "water-heater";
849
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
850
+ DeviceType["Fan"] = "fan";
851
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
852
+ * the camera surface — those use `Camera`. `media-player` cap. */
853
+ DeviceType["MediaPlayer"] = "media-player";
854
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
855
+ * `alarm-panel` cap. */
856
+ DeviceType["AlarmPanel"] = "alarm-panel";
857
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
858
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
859
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
860
+ * TextControl / DateTimeControl. */
861
+ DeviceType["Control"] = "control";
862
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
863
+ * `presence` cap. */
864
+ DeviceType["Presence"] = "presence";
865
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
866
+ * `weather` cap. */
867
+ DeviceType["Weather"] = "weather";
868
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
869
+ DeviceType["Vacuum"] = "vacuum";
870
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
871
+ * `lawn-mower-control` cap. */
872
+ DeviceType["LawnMower"] = "lawn-mower";
873
+ /** Physical HA device group — parent container for entity-children
874
+ * adopted from a single HA device entry. Not renderable as a
875
+ * standalone device; exists only to anchor child entities. */
876
+ DeviceType["Container"] = "container";
877
+ /** Single still-image entity (HA `image.*`). Read-only display of an
878
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
879
+ DeviceType["Image"] = "image";
880
+ /** Smart pet feeder — cloud-connected food dispenser with a bowl food
881
+ * level, battery, desiccant life, feeding state and manual-feed /
882
+ * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
883
+ * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
884
+ * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
885
+ * integrations sharing the same food/desiccant/hopper surface. */
886
+ DeviceType["PetFeeder"] = "pet-feeder";
887
+ /** Pet water fountain — tank level, water drunk, pump and its duty cycle.
888
+ * Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
889
+ * of a container and is BUILT as a composed device (D967). */
890
+ DeviceType["PetFountain"] = "pet-fountain";
891
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
892
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
893
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
894
+ * A plug-built dishwasher carries running-state and power instead. */
895
+ DeviceType["Dishwasher"] = "dishwasher";
896
+ /** Washing machine. A plug-built one is running while its power stays
897
+ * above a threshold. No program cap — that surface is the dishwasher's. */
898
+ DeviceType["Washer"] = "washer";
899
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
900
+ DeviceType["Dryer"] = "dryer";
901
+ /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
902
+ * other radio-to-IP bridges). It carries the box's own facts (firmware,
903
+ * address, connection state) and the actions the box really supports
904
+ * (`reboot`, `device-admin-link`). Products are NOT its children — they are
905
+ * adopted beside it — and its connection settings stay on the integration. */
906
+ DeviceType["Gateway"] = "gateway";
907
+ return DeviceType;
908
+ }({});
909
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
910
+ DeviceFeature["BatteryOperated"] = "battery-operated";
911
+ DeviceFeature["Rebootable"] = "rebootable";
912
+ /**
913
+ * Device supports an on-demand re-sync of its derived spec with its
914
+ * upstream source — drives the generic Re-sync button. The owning
915
+ * provider implements the action via the `device-adoption.resync` cap.
916
+ */
917
+ DeviceFeature["Resyncable"] = "resyncable";
918
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
919
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
920
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
921
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
922
+ /**
923
+ * Camera supports the on-firmware autotrack subsystem (subject-
924
+ * following). Distinct from `PanTiltZoom` because not every PTZ
925
+ * camera ships autotrack — the admin UI uses this flag to gate
926
+ * the autotrack toggle / settings card without re-deriving from
927
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
928
+ * driver sets this feature when probe confirms the firmware
929
+ * surface, and registers the cap in the same code path.
930
+ */
931
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
932
+ /**
933
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
934
+ * motion detection automatically activates this device. Mirrors
935
+ * `motion-trigger` cap registration: drivers set this feature in the
936
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
937
+ *
938
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
939
+ * fast scalar without binding fetch), notifier rules, and `listAll`
940
+ * filters that want "all devices with on-motion behaviour".
941
+ */
942
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
943
+ /** Light supports rgb-triplet color via `color` cap. */
944
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
945
+ /** Light supports HSV color via `color` cap. */
946
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
947
+ /** Light supports color-temperature (mired) via `color` cap. */
948
+ DeviceFeature["LightColorMired"] = "light-color-mired";
949
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
950
+ * targetHigh). Gates the range slider UI. */
951
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
952
+ /** Thermostat exposes target humidity and/or current humidity
953
+ * readings. Gates the humidity controls. */
954
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
955
+ /** Thermostat exposes a fan-mode selector. */
956
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
957
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
958
+ DeviceFeature["ClimatePreset"] = "climate-preset";
959
+ /** Thermostat exposes a vertical louver swing toggle. Gates the
960
+ * vertical-swing switch in the climate UI. Independent of horizontal. */
961
+ DeviceFeature["ClimateSwingVertical"] = "climate-swing-vertical";
962
+ /** Thermostat exposes a horizontal louver swing toggle. Gates the
963
+ * horizontal-swing switch in the climate UI. Independent of vertical. */
964
+ DeviceFeature["ClimateSwingHorizontal"] = "climate-swing-horizontal";
965
+ /** Cover exposes intermediate position control (0..100). Gates the
966
+ * position slider UI. */
967
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
968
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
969
+ DeviceFeature["CoverTilt"] = "cover-tilt";
970
+ /** Valve exposes intermediate position control (0..100). Gates the
971
+ * position slider / drag surface UI. */
972
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
973
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
974
+ DeviceFeature["FanSpeed"] = "fan-speed";
975
+ /** Fan exposes a preset mode selector. */
976
+ DeviceFeature["FanPreset"] = "fan-preset";
977
+ /** Fan exposes blade direction (forward/reverse) — typical of
978
+ * ceiling fans. */
979
+ DeviceFeature["FanDirection"] = "fan-direction";
980
+ /** Fan exposes an oscillation toggle. */
981
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
982
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
983
+ * field on the UI lock-controls panel. */
984
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
985
+ /** Lock supports a latch-release ("open door") action distinct from
986
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
987
+ * `supported_features`. Gates the Open Door button in the UI. */
988
+ DeviceFeature["LockOpen"] = "lock-open";
989
+ /** Media player exposes a seek-to-position surface. */
990
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
991
+ /** Media player exposes a volume-level setter. */
992
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
993
+ /** Media player exposes a mute toggle distinct from volume=0. */
994
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
995
+ /** Media player exposes a shuffle toggle. */
996
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
997
+ /** Media player exposes a repeat mode (off / all / one). */
998
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
999
+ /** Media player exposes a source / input selector. */
1000
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
1001
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
1002
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
1003
+ /** Media player exposes next-track. */
1004
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
1005
+ /** Media player exposes previous-track. */
1006
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1007
+ /** Media player exposes stop distinct from pause. */
1008
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1009
+ /** Alarm panel requires a PIN code on arm/disarm. */
1010
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1011
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
1012
+ * addition to a textual location. */
1013
+ DeviceFeature["PresenceGps"] = "presence-gps";
1014
+ /** Notifier accepts an inline / URL image attachment. */
1015
+ DeviceFeature["NotifierImage"] = "notifier-image";
1016
+ /** Notifier accepts a priority hint (high/normal/low). */
1017
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
1018
+ /** Notifier accepts a free-form `data` payload for platform-specific
1019
+ * fields. */
1020
+ DeviceFeature["NotifierData"] = "notifier-data";
1021
+ /** Notifier supports interactive action buttons / callbacks. */
1022
+ DeviceFeature["NotifierActions"] = "notifier-actions";
1023
+ /** Notifier supports per-call recipient targeting (multi-user). */
1024
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
1025
+ /** Script runner accepts a variables map on each run invocation. */
1026
+ DeviceFeature["ScriptVariables"] = "script-variables";
1027
+ /** Automation `trigger` accepts a skipCondition flag — fires the
1028
+ * automation's actions while bypassing its condition block. */
1029
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
1030
+ /** Robot vacuum exposes a live cleaning map (image child). Gates the
1031
+ * map tile in the vacuum UI. */
1032
+ DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
1033
+ /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
1034
+ * switches group. */
1035
+ DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
1036
+ /** Robot mower exposes a live mowing map (SVG image child). Gates the
1037
+ * mower map tile. */
1038
+ DeviceFeature["MowerHasMap"] = "mower-has-map";
1039
+ /** Robot mower exposes targeted mowing (all-area / zones / edges /
1040
+ * spots) — gates the Mow action + map selectors. */
1041
+ DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
1042
+ return DeviceFeature;
1043
+ }({});
1044
+ /**
1045
+ * Semantic role a device plays within its parent. Populated by driver
1046
+ * addons when creating accessory devices (Reolink siren/floodlight/
1047
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
1048
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
1049
+ * `role: Floodlight` renders as a bulb with a brightness slider,
1050
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
1051
+ *
1052
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
1053
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
1054
+ */
1055
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1056
+ DeviceRole["Siren"] = "siren";
1057
+ DeviceRole["Floodlight"] = "floodlight";
1058
+ DeviceRole["Spotlight"] = "spotlight";
1059
+ DeviceRole["PirSensor"] = "pir-sensor";
1060
+ DeviceRole["Chime"] = "chime";
1061
+ DeviceRole["Autotrack"] = "autotrack";
1062
+ DeviceRole["Nightvision"] = "nightvision";
1063
+ DeviceRole["PrivacyMask"] = "privacy-mask";
1064
+ DeviceRole["Doorbell"] = "doorbell";
1065
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
1066
+ DeviceRole["CoverBlind"] = "cover-blind";
1067
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
1068
+ DeviceRole["CoverShutter"] = "cover-shutter";
1069
+ /** Exterior awning. HA `device_class: awning`. */
1070
+ DeviceRole["CoverAwning"] = "cover-awning";
1071
+ /** Curtain / drape. HA `device_class: curtain`. */
1072
+ DeviceRole["CoverCurtain"] = "cover-curtain";
1073
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
1074
+ DeviceRole["CoverGarage"] = "cover-garage";
1075
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
1076
+ DeviceRole["CoverGate"] = "cover-gate";
1077
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
1078
+ DeviceRole["CoverDoor"] = "cover-door";
1079
+ /** Window. HA `device_class: window`. */
1080
+ DeviceRole["CoverWindow"] = "cover-window";
1081
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
1082
+ * real Switch device for UI rendering / export adapters. */
1083
+ DeviceRole["BinaryHelper"] = "binary-helper";
1084
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
1085
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
1086
+ DeviceRole["Outlet"] = "outlet";
1087
+ /** Generic motion / occupancy / moving event source. Distinct from
1088
+ * the camera accessory PirSensor role: that one is a camera child;
1089
+ * this is a standalone HA / 3rd-party motion sensor. */
1090
+ DeviceRole["MotionSensor"] = "motion-sensor";
1091
+ DeviceRole["ContactSensor"] = "contact-sensor";
1092
+ DeviceRole["LeakSensor"] = "leak-sensor";
1093
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
1094
+ DeviceRole["COSensor"] = "co-sensor";
1095
+ DeviceRole["GasSensor"] = "gas-sensor";
1096
+ DeviceRole["TamperSensor"] = "tamper-sensor";
1097
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
1098
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
1099
+ DeviceRole["SoundSensor"] = "sound-sensor";
1100
+ /** Fallback for `binary_sensor` without a known `device_class`. */
1101
+ DeviceRole["BinarySensor"] = "binary-sensor";
1102
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
1103
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
1104
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
1105
+ DeviceRole["PressureSensor"] = "pressure-sensor";
1106
+ /** Wind speed or direction (weather-station `wind-sensor` cap). */
1107
+ DeviceRole["WindSensor"] = "wind-sensor";
1108
+ /** Rain accumulation or rate (weather-station `rain-sensor` cap). */
1109
+ DeviceRole["RainSensor"] = "rain-sensor";
1110
+ /** UV index (weather-station `uv-sensor` cap). */
1111
+ DeviceRole["UvSensor"] = "uv-sensor";
1112
+ /** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
1113
+ * Distinct from AmbientLightSensor (lux). */
1114
+ DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
1115
+ /** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
1116
+ DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
1117
+ DeviceRole["PowerSensor"] = "power-sensor";
1118
+ DeviceRole["EnergySensor"] = "energy-sensor";
1119
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
1120
+ DeviceRole["CurrentSensor"] = "current-sensor";
1121
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
1122
+ /** Battery level (numeric % via `sensor` OR low-bool via
1123
+ * `binary_sensor` — the cap distinguishes via the value type). */
1124
+ DeviceRole["BatterySensor"] = "battery-sensor";
1125
+ /** Fallback for `sensor` numeric without a known `device_class`. */
1126
+ DeviceRole["NumericSensor"] = "numeric-sensor";
1127
+ /** String / enum state (HA `sensor` with `state_class: enum` or
1128
+ * `attributes.options`). */
1129
+ DeviceRole["EnumSensor"] = "enum-sensor";
1130
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
1131
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
1132
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
1133
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
1134
+ /** Last-resort fallback when nothing else matches. */
1135
+ DeviceRole["GenericSensor"] = "generic-sensor";
1136
+ DeviceRole["NumericControl"] = "numeric-control";
1137
+ DeviceRole["SelectControl"] = "select-control";
1138
+ DeviceRole["TextControl"] = "text-control";
1139
+ DeviceRole["DateTimeControl"] = "datetime-control";
1140
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
1141
+ * rich features (image, priority, channel routing). */
1142
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
1143
+ /** Chat / messaging service (HA `notify.telegram_*`,
1144
+ * `notify.discord_*`, etc.). */
1145
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
1146
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
1147
+ DeviceRole["EmailNotifier"] = "email-notifier";
1148
+ /** Fallback when the notifier service name doesn't match a known
1149
+ * pattern. */
1150
+ DeviceRole["GenericNotifier"] = "generic-notifier";
1151
+ /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
1152
+ * cap. A `DeviceType.Generic` device. */
1153
+ DeviceRole["IrTransmitter"] = "ir-transmitter";
1154
+ return DeviceRole;
1155
+ }({});
1156
+ //#endregion
781
1157
  //#region ../../node_modules/zod/v4/core/core.js
782
1158
  var _a$1;
783
1159
  function $constructor(name, initializer, params) {
@@ -5456,7 +5832,7 @@ var ZodIssueCode = {
5456
5832
  var ZodFirstPartyTypeKind;
5457
5833
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5458
5834
  //#endregion
5459
- //#region ../types/dist/sleep-dco0-jRo.mjs
5835
+ //#region ../types/dist/sleep-CSYuxssh.mjs
5460
5836
  /**
5461
5837
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5462
5838
  * window to float samples (D455).
@@ -5972,6 +6348,102 @@ function emitReadiness(bus, params) {
5972
6348
  ts
5973
6349
  }));
5974
6350
  }
6351
+ var NOT_RUN = {
6352
+ declared: false,
6353
+ snapshot: null,
6354
+ applied: [],
6355
+ failed: [],
6356
+ blocked: [],
6357
+ skipped: [],
6358
+ blockOwner: []
6359
+ };
6360
+ /**
6361
+ * Offer `migrations` to the engine and run what it says to run, in its order. Never
6362
+ * throws: an unreachable or refusing engine is logged and reported `declared: false`,
6363
+ * because the hub (and this addon's boot) must not hang on a migration.
6364
+ */
6365
+ async function runAddonMigrations(host, migrations, logger) {
6366
+ const first = migrations[0];
6367
+ if (first === void 0) return NOT_RUN;
6368
+ const owner = first.meta.owner;
6369
+ const log = logger.withTags({ migrationOwner: owner });
6370
+ const byId = new Map(migrations.map((m) => [m.meta.id, m]));
6371
+ let declaration;
6372
+ try {
6373
+ declaration = await host.declareOwner({
6374
+ owner,
6375
+ metas: migrations.map((m) => m.meta)
6376
+ });
6377
+ } catch (err) {
6378
+ log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
6379
+ return {
6380
+ ...NOT_RUN,
6381
+ blockOwner: migrations.filter((m) => m.meta.onFailure === "block-owner").map((m) => m.meta.id)
6382
+ };
6383
+ }
6384
+ const applied = [];
6385
+ const failed = [];
6386
+ const blocked = [];
6387
+ const skipped = [];
6388
+ const settle = (id, status) => {
6389
+ if (status === "applied") applied.push(id);
6390
+ else if (status === "failed") failed.push(id);
6391
+ else if (status === "blocked") blocked.push(id);
6392
+ else skipped.push(id);
6393
+ };
6394
+ for (const step of declaration.steps) {
6395
+ const bound = byId.get(step.id);
6396
+ if (bound === void 0 || step.action === "skip") {
6397
+ skipped.push(step.id);
6398
+ continue;
6399
+ }
6400
+ const tags = { migrationId: step.id };
6401
+ try {
6402
+ const gate = await host.startMigration({ id: step.id });
6403
+ if (!gate.proceed) {
6404
+ log.warn("migration not run", {
6405
+ tags,
6406
+ meta: {
6407
+ state: gate.state,
6408
+ reason: gate.reason
6409
+ }
6410
+ });
6411
+ settle(step.id, gate.state === "pending" ? "blocked" : gate.state);
6412
+ continue;
6413
+ }
6414
+ const result = await bound.execute();
6415
+ const outcome = await host.finishMigration({
6416
+ id: step.id,
6417
+ result
6418
+ });
6419
+ if (outcome.status === "applied") log.info("migration applied", {
6420
+ tags,
6421
+ meta: { rowsChanged: outcome.rowsChanged }
6422
+ });
6423
+ else log.error("migration failed", {
6424
+ tags,
6425
+ meta: { error: outcome.error }
6426
+ });
6427
+ settle(step.id, outcome.status);
6428
+ } catch (err) {
6429
+ log.error("migration could not be completed with the engine", {
6430
+ tags,
6431
+ meta: { error: errMsg(err) }
6432
+ });
6433
+ failed.push(step.id);
6434
+ }
6435
+ }
6436
+ const blockOwner = [...failed, ...blocked].filter((id) => byId.get(id)?.meta.onFailure === "block-owner");
6437
+ return {
6438
+ declared: true,
6439
+ snapshot: declaration.snapshot,
6440
+ applied,
6441
+ failed,
6442
+ blocked,
6443
+ skipped,
6444
+ blockOwner
6445
+ };
6446
+ }
5975
6447
  /**
5976
6448
  * Build a {@link DurableState} over a single store key. Transport-agnostic:
5977
6449
  * `read`/`write` are the addon-store or device-store accessors. The whole
@@ -7027,6 +7499,28 @@ var BaseAddon = class {
7027
7499
  return normalized;
7028
7500
  }
7029
7501
  /**
7502
+ * Run this addon's migration catalogue (D987 M3) through the hub's `migrations`
7503
+ * engine. Call it at the point of the boot where the data must already have the new
7504
+ * shape — `onInitialize`, or `onRestoreDevices` for a migration that needs the
7505
+ * restored devices — with the catalogue bound to the addon's ports
7506
+ * (`defineAddonMigrations(ADDON_MIGRATIONS, ports)`).
7507
+ *
7508
+ * An engine that cannot be reached or refuses the catalogue is logged and runs
7509
+ * nothing; the boot continues. A migration that FAILED (or was blocked by one)
7510
+ * and declares `onFailure: 'block-owner'` makes this throw, so the addon does not
7511
+ * serve data whose shape it cannot trust; `tolerate` migrations never do.
7512
+ */
7513
+ async runMigrations(migrations) {
7514
+ const api = this.ctx.api.migrations;
7515
+ const report = await runAddonMigrations({
7516
+ declareOwner: (input) => api.declareOwner.mutate(input),
7517
+ startMigration: (input) => api.startMigration.mutate(input),
7518
+ finishMigration: (input) => api.finishMigration.mutate(input)
7519
+ }, migrations, this.ctx.logger);
7520
+ if (report.blockOwner.length > 0) throw new Error(`migration(s) ${report.blockOwner.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
7521
+ return report;
7522
+ }
7523
+ /**
7030
7524
  * Called by the isolated-process runner AFTER `broker.start()`.
7031
7525
  * In-process addons never need this because the hub broker is already
7032
7526
  * running when `initialize()` fires. For forked children the broker
@@ -8069,6 +8563,94 @@ var RecordKindDeclarationSchema = object({
8069
8563
  }).strict();
8070
8564
  /** The kind names: lower-case, dash separated, short enough for an index name. */
8071
8565
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8566
+ object({
8567
+ field: string().min(1),
8568
+ on: literal("advance")
8569
+ });
8570
+ /**
8571
+ * Output schema shared by the contribution + live methods.
8572
+ *
8573
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
8574
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
8575
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
8576
+ * (using `z.unknown()` here collapses unrelated router branches to
8577
+ * `unknown` when the generator re-inlines the huge AppRouter type).
8578
+ *
8579
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
8580
+ * extensions the caller adds (showWhen, displayScale, …) without
8581
+ * rebuilding every time a new field kind is introduced.
8582
+ */
8583
+ var ContributionSectionSchema = object({
8584
+ id: string(),
8585
+ title: string(),
8586
+ description: string().optional(),
8587
+ style: _enum(["card", "accordion"]).optional(),
8588
+ defaultCollapsed: boolean().optional(),
8589
+ columns: union([
8590
+ literal(1),
8591
+ literal(2),
8592
+ literal(3),
8593
+ literal(4)
8594
+ ]).optional(),
8595
+ tab: string().optional(),
8596
+ location: _enum([
8597
+ "settings",
8598
+ "top-tab",
8599
+ "hero"
8600
+ ]).optional(),
8601
+ order: number().optional(),
8602
+ fields: array(any())
8603
+ });
8604
+ object({
8605
+ tabs: array(object({
8606
+ id: string(),
8607
+ label: string(),
8608
+ icon: string(),
8609
+ order: number().optional()
8610
+ })).optional(),
8611
+ sections: array(ContributionSectionSchema)
8612
+ }).nullable();
8613
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
8614
+ deviceId: number(),
8615
+ patch: record(string(), unknown())
8616
+ }), object({ success: literal(true) });
8617
+ object({ deviceId: number() }), unknown().nullable();
8618
+ function method(input, output, options) {
8619
+ return {
8620
+ input,
8621
+ output,
8622
+ kind: options?.kind ?? "query",
8623
+ ...options?.auth !== void 0 ? { auth: options.auth } : {},
8624
+ ...options?.access !== void 0 ? { access: options.access } : {},
8625
+ ...options?.role !== void 0 ? { role: options.role } : {},
8626
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
8627
+ timeoutMs: options?.timeoutMs
8628
+ };
8629
+ }
8630
+ /**
8631
+ * A wrapper/system-only method: served exclusively by the cap's system-level
8632
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
8633
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
8634
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
8635
+ */
8636
+ function systemMethod(input, output, options) {
8637
+ return {
8638
+ ...method(input, output, options),
8639
+ systemOnly: true
8640
+ };
8641
+ }
8642
+ /**
8643
+ * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
8644
+ * on `InferProvider`. The `providerOptional: true` literal is what
8645
+ * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
8646
+ * for when this is the honest answer and when it is a soft stub.
8647
+ */
8648
+ function optionalMethod(input, output, options) {
8649
+ return {
8650
+ ...method(input, output, options),
8651
+ providerOptional: true
8652
+ };
8653
+ }
8072
8654
  var READING_QUANTITIES = [
8073
8655
  "temperature",
8074
8656
  "pressure",
@@ -8458,7 +9040,7 @@ var ProfileRtspEntrySchema = object({
8458
9040
  /**
8459
9041
  * The model weight formats a catalog entry can ship. Schema-free on purpose:
8460
9042
  * `types/models.ts` builds Zod schemas from it, but a runner-closure consumer
8461
- * (the model downloader in `@camstack/system`) needs only the list and must
9043
+ * (the model downloader in `@camstack/server/system`) needs only the list and must
8462
9044
  * reach it through `@camstack/types/addon` without building the cap schema
8463
9045
  * graph (D28).
8464
9046
  */
@@ -8470,94 +9052,6 @@ var MODEL_FORMATS = [
8470
9052
  "pt",
8471
9053
  "gguf"
8472
9054
  ];
8473
- object({
8474
- field: string().min(1),
8475
- on: literal("advance")
8476
- });
8477
- /**
8478
- * Output schema shared by the contribution + live methods.
8479
- *
8480
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
8481
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
8482
- * concrete-but-lenient Zod object keeps tRPC output inference happy
8483
- * (using `z.unknown()` here collapses unrelated router branches to
8484
- * `unknown` when the generator re-inlines the huge AppRouter type).
8485
- *
8486
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
8487
- * extensions the caller adds (showWhen, displayScale, …) without
8488
- * rebuilding every time a new field kind is introduced.
8489
- */
8490
- var ContributionSectionSchema = object({
8491
- id: string(),
8492
- title: string(),
8493
- description: string().optional(),
8494
- style: _enum(["card", "accordion"]).optional(),
8495
- defaultCollapsed: boolean().optional(),
8496
- columns: union([
8497
- literal(1),
8498
- literal(2),
8499
- literal(3),
8500
- literal(4)
8501
- ]).optional(),
8502
- tab: string().optional(),
8503
- location: _enum([
8504
- "settings",
8505
- "top-tab",
8506
- "hero"
8507
- ]).optional(),
8508
- order: number().optional(),
8509
- fields: array(any())
8510
- });
8511
- object({
8512
- tabs: array(object({
8513
- id: string(),
8514
- label: string(),
8515
- icon: string(),
8516
- order: number().optional()
8517
- })).optional(),
8518
- sections: array(ContributionSectionSchema)
8519
- }).nullable();
8520
- object({ deviceId: number() }), object({ deviceId: number() }), object({
8521
- deviceId: number(),
8522
- patch: record(string(), unknown())
8523
- }), object({ success: literal(true) });
8524
- object({ deviceId: number() }), unknown().nullable();
8525
- function method(input, output, options) {
8526
- return {
8527
- input,
8528
- output,
8529
- kind: options?.kind ?? "query",
8530
- ...options?.auth !== void 0 ? { auth: options.auth } : {},
8531
- ...options?.access !== void 0 ? { access: options.access } : {},
8532
- ...options?.role !== void 0 ? { role: options.role } : {},
8533
- ...options?.caller !== void 0 ? { caller: options.caller } : {},
8534
- timeoutMs: options?.timeoutMs
8535
- };
8536
- }
8537
- /**
8538
- * A wrapper/system-only method: served exclusively by the cap's system-level
8539
- * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
8540
- * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
8541
- * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
8542
- */
8543
- function systemMethod(input, output, options) {
8544
- return {
8545
- ...method(input, output, options),
8546
- systemOnly: true
8547
- };
8548
- }
8549
- /**
8550
- * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
8551
- * on `InferProvider`. The `providerOptional: true` literal is what
8552
- * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
8553
- * for when this is the honest answer and when it is a soft stub.
8554
- */
8555
- function optionalMethod(input, output, options) {
8556
- return {
8557
- ...method(input, output, options),
8558
- providerOptional: true
8559
- };
8560
- }
8561
9055
  /**
8562
9056
  * `addon-pages-source` — collection cap exposing per-provider raw page
8563
9057
  * declarations. Every addon that contributes a UI page registers a
@@ -8817,6 +9311,7 @@ var CAP_NAMES = Object.freeze([
8817
9311
  "mesh-network",
8818
9312
  "meter",
8819
9313
  "metrics-provider",
9314
+ "migrations",
8820
9315
  "model-convert",
8821
9316
  "model-distributor",
8822
9317
  "motion",
@@ -10719,369 +11214,7 @@ object({
10719
11214
  params: record(string(), union([string(), number()])).optional()
10720
11215
  });
10721
11216
  //#endregion
10722
- //#region ../types/dist/err-msg-BD5buxvT.mjs
10723
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
10724
- DeviceType["Camera"] = "camera";
10725
- DeviceType["Hub"] = "hub";
10726
- DeviceType["Light"] = "light";
10727
- DeviceType["Siren"] = "siren";
10728
- DeviceType["Switch"] = "switch";
10729
- DeviceType["Sensor"] = "sensor";
10730
- DeviceType["Thermostat"] = "thermostat";
10731
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
10732
- * `climate-control` cap surface with `Thermostat` but renders a
10733
- * dedicated AC-appropriate control UI (mode chips, fan speed,
10734
- * independent vertical/horizontal swing). Sources: native Gree, and
10735
- * reusable by other AC integrations. */
10736
- DeviceType["Climate"] = "climate";
10737
- DeviceType["Button"] = "button";
10738
- /** Generic stateless event emitter — carries a device's EXACT declared
10739
- * event vocabulary verbatim (no normalization). Installed with the
10740
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
10741
- * HA bus events (e.g. `zha_event`, generic). */
10742
- DeviceType["EventEmitter"] = "event-emitter";
10743
- /** Firmware/software update entity — current vs available version,
10744
- * updatable flag, update state, and an install action. Installed with
10745
- * the `update` cap. Sources: Homematic firmware-update channels (and
10746
- * reusable by other providers, e.g. HA `update.*` entities). */
10747
- DeviceType["Update"] = "update";
10748
- DeviceType["Generic"] = "generic";
10749
- /** Generic notification delivery target (HA `notify.<service>`, future
10750
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
10751
- * endpoint; the `notifier` cap defines the send surface. */
10752
- DeviceType["Notifier"] = "notifier";
10753
- /** Pre-recorded action sequence with optional parameters
10754
- * (HA `script.*`). Runnable via `script-runner` cap. */
10755
- DeviceType["Script"] = "script";
10756
- /** Automation rule (HA `automation.*`) — enable/disable + manual
10757
- * trigger surface exposed via `automation-control` cap. */
10758
- DeviceType["Automation"] = "automation";
10759
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
10760
- DeviceType["Lock"] = "lock";
10761
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
10762
- * `valve.*`). `cover` cap with sub-roles for variant. */
10763
- DeviceType["Cover"] = "cover";
10764
- /** Pipe / water / gas valve with open/close/stop and optional
10765
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
10766
- * modelled on the same open/closed lifecycle. */
10767
- DeviceType["Valve"] = "valve";
10768
- /** Humidifier / dehumidifier with on/off + target humidity + mode
10769
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
10770
- * modelled on the same target / mode lifecycle. */
10771
- DeviceType["Humidifier"] = "humidifier";
10772
- /** Water heater / boiler with target temperature + operation mode +
10773
- * away mode (HA `water_heater.*`). `water-heater` cap — a
10774
- * climate-family actuator. */
10775
- DeviceType["WaterHeater"] = "water-heater";
10776
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
10777
- DeviceType["Fan"] = "fan";
10778
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
10779
- * the camera surface — those use `Camera`. `media-player` cap. */
10780
- DeviceType["MediaPlayer"] = "media-player";
10781
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
10782
- * `alarm-panel` cap. */
10783
- DeviceType["AlarmPanel"] = "alarm-panel";
10784
- /** Generic user-settable input (HA `number` / `input_number` / `select`
10785
- * / `input_select` / `text` / `input_text` / `input_datetime`).
10786
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
10787
- * TextControl / DateTimeControl. */
10788
- DeviceType["Control"] = "control";
10789
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
10790
- * `presence` cap. */
10791
- DeviceType["Presence"] = "presence";
10792
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
10793
- * `weather` cap. */
10794
- DeviceType["Weather"] = "weather";
10795
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
10796
- DeviceType["Vacuum"] = "vacuum";
10797
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
10798
- * `lawn-mower-control` cap. */
10799
- DeviceType["LawnMower"] = "lawn-mower";
10800
- /** Physical HA device group — parent container for entity-children
10801
- * adopted from a single HA device entry. Not renderable as a
10802
- * standalone device; exists only to anchor child entities. */
10803
- DeviceType["Container"] = "container";
10804
- /** Single still-image entity (HA `image.*`). Read-only display of an
10805
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
10806
- DeviceType["Image"] = "image";
10807
- /** Smart pet feeder — cloud-connected food dispenser with a bowl food
10808
- * level, battery, desiccant life, feeding state and manual-feed /
10809
- * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
10810
- * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
10811
- * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
10812
- * integrations sharing the same food/desiccant/hopper surface. */
10813
- DeviceType["PetFeeder"] = "pet-feeder";
10814
- /** Pet water fountain — tank level, water drunk, pump and its duty cycle.
10815
- * Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
10816
- * of a container and is BUILT as a composed device (D967). */
10817
- DeviceType["PetFountain"] = "pet-fountain";
10818
- /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10819
- * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10820
- * Sources: native Bosch Home Connect, reusable by similar integrations.
10821
- * A plug-built dishwasher carries running-state and power instead. */
10822
- DeviceType["Dishwasher"] = "dishwasher";
10823
- /** Washing machine. A plug-built one is running while its power stays
10824
- * above a threshold. No program cap — that surface is the dishwasher's. */
10825
- DeviceType["Washer"] = "washer";
10826
- /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10827
- DeviceType["Dryer"] = "dryer";
10828
- /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
10829
- * other radio-to-IP bridges). It carries the box's own facts (firmware,
10830
- * address, connection state) and the actions the box really supports
10831
- * (`reboot`, `device-admin-link`). Products are NOT its children — they are
10832
- * adopted beside it — and its connection settings stay on the integration. */
10833
- DeviceType["Gateway"] = "gateway";
10834
- return DeviceType;
10835
- }({});
10836
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
10837
- DeviceFeature["BatteryOperated"] = "battery-operated";
10838
- DeviceFeature["Rebootable"] = "rebootable";
10839
- /**
10840
- * Device supports an on-demand re-sync of its derived spec with its
10841
- * upstream source — drives the generic Re-sync button. The owning
10842
- * provider implements the action via the `device-adoption.resync` cap.
10843
- */
10844
- DeviceFeature["Resyncable"] = "resyncable";
10845
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
10846
- DeviceFeature["DoorbellButton"] = "doorbell-button";
10847
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
10848
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
10849
- /**
10850
- * Camera supports the on-firmware autotrack subsystem (subject-
10851
- * following). Distinct from `PanTiltZoom` because not every PTZ
10852
- * camera ships autotrack — the admin UI uses this flag to gate
10853
- * the autotrack toggle / settings card without re-deriving from
10854
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
10855
- * driver sets this feature when probe confirms the firmware
10856
- * surface, and registers the cap in the same code path.
10857
- */
10858
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
10859
- /**
10860
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
10861
- * motion detection automatically activates this device. Mirrors
10862
- * `motion-trigger` cap registration: drivers set this feature in the
10863
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
10864
- *
10865
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
10866
- * fast scalar without binding fetch), notifier rules, and `listAll`
10867
- * filters that want "all devices with on-motion behaviour".
10868
- */
10869
- DeviceFeature["MotionTrigger"] = "motion-trigger";
10870
- /** Light supports rgb-triplet color via `color` cap. */
10871
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
10872
- /** Light supports HSV color via `color` cap. */
10873
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
10874
- /** Light supports color-temperature (mired) via `color` cap. */
10875
- DeviceFeature["LightColorMired"] = "light-color-mired";
10876
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
10877
- * targetHigh). Gates the range slider UI. */
10878
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
10879
- /** Thermostat exposes target humidity and/or current humidity
10880
- * readings. Gates the humidity controls. */
10881
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
10882
- /** Thermostat exposes a fan-mode selector. */
10883
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
10884
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
10885
- DeviceFeature["ClimatePreset"] = "climate-preset";
10886
- /** Thermostat exposes a vertical louver swing toggle. Gates the
10887
- * vertical-swing switch in the climate UI. Independent of horizontal. */
10888
- DeviceFeature["ClimateSwingVertical"] = "climate-swing-vertical";
10889
- /** Thermostat exposes a horizontal louver swing toggle. Gates the
10890
- * horizontal-swing switch in the climate UI. Independent of vertical. */
10891
- DeviceFeature["ClimateSwingHorizontal"] = "climate-swing-horizontal";
10892
- /** Cover exposes intermediate position control (0..100). Gates the
10893
- * position slider UI. */
10894
- DeviceFeature["CoverPositionable"] = "cover-positionable";
10895
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
10896
- DeviceFeature["CoverTilt"] = "cover-tilt";
10897
- /** Valve exposes intermediate position control (0..100). Gates the
10898
- * position slider / drag surface UI. */
10899
- DeviceFeature["ValvePositionable"] = "valve-positionable";
10900
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
10901
- DeviceFeature["FanSpeed"] = "fan-speed";
10902
- /** Fan exposes a preset mode selector. */
10903
- DeviceFeature["FanPreset"] = "fan-preset";
10904
- /** Fan exposes blade direction (forward/reverse) — typical of
10905
- * ceiling fans. */
10906
- DeviceFeature["FanDirection"] = "fan-direction";
10907
- /** Fan exposes an oscillation toggle. */
10908
- DeviceFeature["FanOscillating"] = "fan-oscillating";
10909
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
10910
- * field on the UI lock-controls panel. */
10911
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
10912
- /** Lock supports a latch-release ("open door") action distinct from
10913
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
10914
- * `supported_features`. Gates the Open Door button in the UI. */
10915
- DeviceFeature["LockOpen"] = "lock-open";
10916
- /** Media player exposes a seek-to-position surface. */
10917
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
10918
- /** Media player exposes a volume-level setter. */
10919
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
10920
- /** Media player exposes a mute toggle distinct from volume=0. */
10921
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
10922
- /** Media player exposes a shuffle toggle. */
10923
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
10924
- /** Media player exposes a repeat mode (off / all / one). */
10925
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
10926
- /** Media player exposes a source / input selector. */
10927
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
10928
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
10929
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
10930
- /** Media player exposes next-track. */
10931
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
10932
- /** Media player exposes previous-track. */
10933
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
10934
- /** Media player exposes stop distinct from pause. */
10935
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
10936
- /** Alarm panel requires a PIN code on arm/disarm. */
10937
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
10938
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
10939
- * addition to a textual location. */
10940
- DeviceFeature["PresenceGps"] = "presence-gps";
10941
- /** Notifier accepts an inline / URL image attachment. */
10942
- DeviceFeature["NotifierImage"] = "notifier-image";
10943
- /** Notifier accepts a priority hint (high/normal/low). */
10944
- DeviceFeature["NotifierPriority"] = "notifier-priority";
10945
- /** Notifier accepts a free-form `data` payload for platform-specific
10946
- * fields. */
10947
- DeviceFeature["NotifierData"] = "notifier-data";
10948
- /** Notifier supports interactive action buttons / callbacks. */
10949
- DeviceFeature["NotifierActions"] = "notifier-actions";
10950
- /** Notifier supports per-call recipient targeting (multi-user). */
10951
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
10952
- /** Script runner accepts a variables map on each run invocation. */
10953
- DeviceFeature["ScriptVariables"] = "script-variables";
10954
- /** Automation `trigger` accepts a skipCondition flag — fires the
10955
- * automation's actions while bypassing its condition block. */
10956
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
10957
- /** Robot vacuum exposes a live cleaning map (image child). Gates the
10958
- * map tile in the vacuum UI. */
10959
- DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
10960
- /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
10961
- * switches group. */
10962
- DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
10963
- /** Robot mower exposes a live mowing map (SVG image child). Gates the
10964
- * mower map tile. */
10965
- DeviceFeature["MowerHasMap"] = "mower-has-map";
10966
- /** Robot mower exposes targeted mowing (all-area / zones / edges /
10967
- * spots) — gates the Mow action + map selectors. */
10968
- DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
10969
- return DeviceFeature;
10970
- }({});
10971
- /**
10972
- * Semantic role a device plays within its parent. Populated by driver
10973
- * addons when creating accessory devices (Reolink siren/floodlight/
10974
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
10975
- * admin UI to pick icons, labels, and widgets — a `Switch` with
10976
- * `role: Floodlight` renders as a bulb with a brightness slider,
10977
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
10978
- *
10979
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
10980
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
10981
- */
10982
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10983
- DeviceRole["Siren"] = "siren";
10984
- DeviceRole["Floodlight"] = "floodlight";
10985
- DeviceRole["Spotlight"] = "spotlight";
10986
- DeviceRole["PirSensor"] = "pir-sensor";
10987
- DeviceRole["Chime"] = "chime";
10988
- DeviceRole["Autotrack"] = "autotrack";
10989
- DeviceRole["Nightvision"] = "nightvision";
10990
- DeviceRole["PrivacyMask"] = "privacy-mask";
10991
- DeviceRole["Doorbell"] = "doorbell";
10992
- /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
10993
- DeviceRole["CoverBlind"] = "cover-blind";
10994
- /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
10995
- DeviceRole["CoverShutter"] = "cover-shutter";
10996
- /** Exterior awning. HA `device_class: awning`. */
10997
- DeviceRole["CoverAwning"] = "cover-awning";
10998
- /** Curtain / drape. HA `device_class: curtain`. */
10999
- DeviceRole["CoverCurtain"] = "cover-curtain";
11000
- /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
11001
- DeviceRole["CoverGarage"] = "cover-garage";
11002
- /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
11003
- DeviceRole["CoverGate"] = "cover-gate";
11004
- /** Door. HA `device_class: door`. A security actuator: exports gate it. */
11005
- DeviceRole["CoverDoor"] = "cover-door";
11006
- /** Window. HA `device_class: window`. */
11007
- DeviceRole["CoverWindow"] = "cover-window";
11008
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
11009
- * real Switch device for UI rendering / export adapters. */
11010
- DeviceRole["BinaryHelper"] = "binary-helper";
11011
- /** A smart plug: a `switch` whose source says it is an outlet (HA
11012
- * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
11013
- DeviceRole["Outlet"] = "outlet";
11014
- /** Generic motion / occupancy / moving event source. Distinct from
11015
- * the camera accessory PirSensor role: that one is a camera child;
11016
- * this is a standalone HA / 3rd-party motion sensor. */
11017
- DeviceRole["MotionSensor"] = "motion-sensor";
11018
- DeviceRole["ContactSensor"] = "contact-sensor";
11019
- DeviceRole["LeakSensor"] = "leak-sensor";
11020
- DeviceRole["SmokeSensor"] = "smoke-sensor";
11021
- DeviceRole["COSensor"] = "co-sensor";
11022
- DeviceRole["GasSensor"] = "gas-sensor";
11023
- DeviceRole["TamperSensor"] = "tamper-sensor";
11024
- DeviceRole["VibrationSensor"] = "vibration-sensor";
11025
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
11026
- DeviceRole["SoundSensor"] = "sound-sensor";
11027
- /** Fallback for `binary_sensor` without a known `device_class`. */
11028
- DeviceRole["BinarySensor"] = "binary-sensor";
11029
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
11030
- DeviceRole["HumiditySensor"] = "humidity-sensor";
11031
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
11032
- DeviceRole["PressureSensor"] = "pressure-sensor";
11033
- /** Wind speed or direction (weather-station `wind-sensor` cap). */
11034
- DeviceRole["WindSensor"] = "wind-sensor";
11035
- /** Rain accumulation or rate (weather-station `rain-sensor` cap). */
11036
- DeviceRole["RainSensor"] = "rain-sensor";
11037
- /** UV index (weather-station `uv-sensor` cap). */
11038
- DeviceRole["UvSensor"] = "uv-sensor";
11039
- /** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
11040
- * Distinct from AmbientLightSensor (lux). */
11041
- DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
11042
- /** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
11043
- DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
11044
- DeviceRole["PowerSensor"] = "power-sensor";
11045
- DeviceRole["EnergySensor"] = "energy-sensor";
11046
- DeviceRole["VoltageSensor"] = "voltage-sensor";
11047
- DeviceRole["CurrentSensor"] = "current-sensor";
11048
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
11049
- /** Battery level (numeric % via `sensor` OR low-bool via
11050
- * `binary_sensor` — the cap distinguishes via the value type). */
11051
- DeviceRole["BatterySensor"] = "battery-sensor";
11052
- /** Fallback for `sensor` numeric without a known `device_class`. */
11053
- DeviceRole["NumericSensor"] = "numeric-sensor";
11054
- /** String / enum state (HA `sensor` with `state_class: enum` or
11055
- * `attributes.options`). */
11056
- DeviceRole["EnumSensor"] = "enum-sensor";
11057
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
11058
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
11059
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
11060
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
11061
- /** Last-resort fallback when nothing else matches. */
11062
- DeviceRole["GenericSensor"] = "generic-sensor";
11063
- DeviceRole["NumericControl"] = "numeric-control";
11064
- DeviceRole["SelectControl"] = "select-control";
11065
- DeviceRole["TextControl"] = "text-control";
11066
- DeviceRole["DateTimeControl"] = "datetime-control";
11067
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
11068
- * rich features (image, priority, channel routing). */
11069
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
11070
- /** Chat / messaging service (HA `notify.telegram_*`,
11071
- * `notify.discord_*`, etc.). */
11072
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
11073
- /** Email-based delivery (HA `notify.smtp`, etc.). */
11074
- DeviceRole["EmailNotifier"] = "email-notifier";
11075
- /** Fallback when the notifier service name doesn't match a known
11076
- * pattern. */
11077
- DeviceRole["GenericNotifier"] = "generic-notifier";
11078
- /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
11079
- * cap. A `DeviceType.Generic` device. */
11080
- DeviceRole["IrTransmitter"] = "ir-transmitter";
11081
- return DeviceRole;
11082
- }({});
11083
- //#endregion
11084
- //#region ../types/dist/composition-C7WdThmP.mjs
11217
+ //#region ../types/dist/composition-BBzVf2xd.mjs
11085
11218
  /**
11086
11219
  * The ffmpeg build every CamStack node downloads, per platform and arch.
11087
11220
  *
@@ -12300,6 +12433,71 @@ var EventOwnerTypeSchema = _enum(EVENT_OWNER_TYPES);
12300
12433
  var MediaPresenceOwnerKindSchema = _enum([...EVENT_OWNER_TYPES, "track"]);
12301
12434
  new Set(EVENT_OWNER_TYPES);
12302
12435
  /**
12436
+ * What a published package needs from the rest of the install (D989).
12437
+ *
12438
+ * One published framework package (`@camstack/server`) carries the kernel, the
12439
+ * builtins and the capability contracts, so "which addon runs on which
12440
+ * framework" is a question of version, and the answer is DECLARED by the
12441
+ * package that knows it:
12442
+ *
12443
+ * - an addon says the oldest server it runs on (`requires.server: ">=X"`);
12444
+ * - the server says the oldest addon it works with
12445
+ * (`requires.addons: { "@camstack/addon-x": ">=Y" }`) and the oldest shell
12446
+ * around it (`requires.wrapper: { desktop, image }`);
12447
+ * - a wrapper (the desktop app, the container starter) says which server
12448
+ * range it can host, and reports its own kind and version.
12449
+ *
12450
+ * The publish workflow STAMPS these after the version bump
12451
+ * (`scripts/ci/stamp-requires.mjs`); nobody types a number by hand.
12452
+ *
12453
+ * A requirement that cannot be checked is NOT met: a shell that reports no
12454
+ * version counts as below the minimum, and an unreadable running version is
12455
+ * named in the result (a failed read is never a pass).
12456
+ */
12457
+ /** `>=MAJOR.MINOR.PATCH[-prerelease]` — the only range shape a requirement uses. */
12458
+ var MinVersionSchema = string().regex(/^>=\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/, "a minimum is written \">=X.Y.Z\"");
12459
+ object({
12460
+ /** The oldest `@camstack/server` this package runs on. */
12461
+ server: MinVersionSchema.optional(),
12462
+ /** The oldest installed version of each named addon package. */
12463
+ addons: record(string(), MinVersionSchema).optional(),
12464
+ /** The oldest shell around the server, per shell kind. */
12465
+ wrapper: object({
12466
+ desktop: MinVersionSchema.optional(),
12467
+ image: MinVersionSchema.optional()
12468
+ }).optional()
12469
+ });
12470
+ /** One unmet requirement; each names the versions on both sides. */
12471
+ var UnmetRequirementSchema = discriminatedUnion("kind", [
12472
+ object({
12473
+ kind: literal("server-too-old"),
12474
+ required: string(),
12475
+ /** `null` — the running server version could not be read. */
12476
+ running: string().nullable()
12477
+ }),
12478
+ object({
12479
+ kind: literal("addon-too-old"),
12480
+ packageName: string(),
12481
+ required: string(),
12482
+ /** `null` — the addon is not installed (or its version is unreadable). */
12483
+ running: string().nullable()
12484
+ }),
12485
+ object({
12486
+ kind: literal("wrapper-too-old"),
12487
+ wrapper: _enum(["desktop", "image"]),
12488
+ required: string(),
12489
+ /** `null` — the wrapper reported no version. */
12490
+ running: string().nullable()
12491
+ })
12492
+ ]);
12493
+ var RequiredAddonUpdateSchema = object({
12494
+ packageName: string(),
12495
+ /** The minimum the target server declares. */
12496
+ required: string(),
12497
+ /** What this node has; `null` when the addon is not installed. */
12498
+ installed: string().nullable()
12499
+ });
12500
+ /**
12303
12501
  * Which integration instance a settings form is for. An addon that serves several instances
12304
12502
  * (`instanceMode: multiple`) can show a different form per instance — an NVR integration
12305
12503
  * needs its connection, the default integration needs the addon's own sections.
@@ -12774,6 +12972,613 @@ var CameraSwitchGroupSchema = object({
12774
12972
  fetchedAt: number()
12775
12973
  });
12776
12974
  /**
12975
+ * Query filter for settings-store collections.
12976
+ */
12977
+ var QueryFilterSchema = object({
12978
+ where: record(string(), unknown()).optional(),
12979
+ whereIn: record(string(), array(unknown())).optional(),
12980
+ whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
12981
+ /** NULL-safe exclusion: matches rows whose field is NULL OR != the value. */
12982
+ whereNot: record(string(), unknown()).optional(),
12983
+ /** NULL-safe exclusion of a SET — `whereNot` for more than one value. An
12984
+ * empty list excludes nothing. See `QueryFilter.whereNotIn`. */
12985
+ whereNotIn: record(string(), array(unknown())).optional(),
12986
+ orderBy: object({
12987
+ field: string(),
12988
+ direction: _enum(["asc", "desc"])
12989
+ }).optional(),
12990
+ limit: number().optional(),
12991
+ offset: number().optional()
12992
+ });
12993
+ /**
12994
+ * The predicate half of a filter, for BULK MUTATIONS.
12995
+ *
12996
+ * Deliberately not `QueryFilterSchema`: `orderBy` / `limit` / `offset` have no
12997
+ * meaning for a statement that rewrites a set, and accepting them would invite
12998
+ * a caller to believe `limit` bounds the damage. Every field is optional here
12999
+ * only so the shape stays composable — the implementation REJECTS a filter
13000
+ * that compiles to no predicate, because that is the whole collection.
13001
+ */
13002
+ var MutationFilterSchema = object({
13003
+ where: record(string(), unknown()).optional(),
13004
+ whereIn: record(string(), array(unknown())).optional(),
13005
+ whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
13006
+ whereNot: record(string(), unknown()).optional(),
13007
+ whereNotIn: record(string(), array(unknown())).optional()
13008
+ });
13009
+ /**
13010
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
13011
+ *
13012
+ * `as` names the slot in the result, so the SAME column may be asked twice with
13013
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
13014
+ * a `Record<column, op>` shape could not express.
13015
+ */
13016
+ var AggregateFieldSchema = object({
13017
+ /** Result key. */
13018
+ as: string().min(1),
13019
+ /** Column to aggregate. Must be a real column of a declared collection. */
13020
+ field: string().min(1),
13021
+ op: _enum([
13022
+ "sum",
13023
+ "min",
13024
+ "max"
13025
+ ])
13026
+ });
13027
+ /**
13028
+ * `COUNT(*)` plus one number per requested field.
13029
+ *
13030
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
13031
+ * that really is 0 are different facts, and an accounting caller that renders
13032
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
13033
+ */
13034
+ var AggregateResultSchema = object({
13035
+ count: number().int(),
13036
+ values: record(string(), number().nullable())
13037
+ });
13038
+ /** A single stored record: `{ id, data }`. */
13039
+ var SettingsRecordSchema = object({
13040
+ id: string(),
13041
+ data: record(string(), unknown())
13042
+ });
13043
+ /**
13044
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
13045
+ * optional.
13046
+ *
13047
+ * A separate schema rather than loosening the shared one: every other method
13048
+ * on this cap addresses a row BY its id, and making that field optional
13049
+ * everywhere would turn a forgotten key into a silently generated one on
13050
+ * `update` and `delete` as well.
13051
+ */
13052
+ var BulkRecordSchema = object({
13053
+ id: string().optional(),
13054
+ data: record(string(), unknown())
13055
+ });
13056
+ /**
13057
+ * The database FILES one `sqlite-settings` engine process owns (D851).
13058
+ * Closed on purpose: a file is a thing the engine opens, backs up and gives a
13059
+ * serving thread, so a new one is a code change, never a string a caller
13060
+ * invents. `settings` is `camstack.db` and the default for every collection
13061
+ * that names no file.
13062
+ */
13063
+ var DataStoreDatabaseSchema = _enum([
13064
+ "settings",
13065
+ "events",
13066
+ "history"
13067
+ ]);
13068
+ DataStoreDatabaseSchema.options;
13069
+ /**
13070
+ * One write inside a {@link settingsStoreCapability.methods.transact} call.
13071
+ * The three that a "replace this set, bump that revision" write needs, plus
13072
+ * the batched upsert a rollup writer needs.
13073
+ */
13074
+ var TransactOpSchema = discriminatedUnion("op", [
13075
+ object({
13076
+ op: literal("deleteWhere"),
13077
+ collection: string(),
13078
+ filter: MutationFilterSchema
13079
+ }),
13080
+ object({
13081
+ op: literal("insertMany"),
13082
+ collection: string(),
13083
+ records: array(BulkRecordSchema).readonly()
13084
+ }),
13085
+ object({
13086
+ op: literal("update"),
13087
+ collection: string(),
13088
+ id: string(),
13089
+ data: record(string(), unknown())
13090
+ }),
13091
+ object({
13092
+ op: literal("upsertMany"),
13093
+ collection: string(),
13094
+ conflict: array(string()).readonly(),
13095
+ records: array(BulkRecordSchema).readonly()
13096
+ })
13097
+ ]);
13098
+ /**
13099
+ * The precondition of a transaction: the row `key` of `collection` must hold
13100
+ * `equals` in `column`, read INSIDE the transaction.
13101
+ */
13102
+ var TransactGuardSchema = object({
13103
+ collection: string(),
13104
+ key: string(),
13105
+ column: string(),
13106
+ equals: unknown()
13107
+ });
13108
+ /**
13109
+ * Column declaration for a structured (SQL-backed) collection.
13110
+ *
13111
+ * Logical types — the backend translates each to the matching SQLite
13112
+ * storage class and handles per-type marshaling:
13113
+ * - `TEXT` / `INTEGER` / `REAL` — native SQLite types, pass-through
13114
+ * - `JSON` — TEXT under the hood; serialised on write, parsed on read
13115
+ * - `BOOLEAN` — INTEGER 0/1 under the hood; coerced both directions
13116
+ */
13117
+ var CollectionColumnSchema = object({
13118
+ name: string(),
13119
+ type: _enum([
13120
+ "TEXT",
13121
+ "INTEGER",
13122
+ "REAL",
13123
+ "JSON",
13124
+ "BOOLEAN"
13125
+ ]),
13126
+ primaryKey: boolean().optional(),
13127
+ notNull: boolean().optional(),
13128
+ unique: boolean().optional(),
13129
+ /**
13130
+ * Column DEFAULT. Required for B2: the four `ensureTable` consumers declare
13131
+ * columns like `enabled INTEGER NOT NULL DEFAULT 1`, and without this the
13132
+ * collection surface simply cannot express their existing tables — which is
13133
+ * why they were still on the uncapped `table*` API.
13134
+ */
13135
+ defaultValue: union([
13136
+ string(),
13137
+ number(),
13138
+ boolean()
13139
+ ]).optional()
13140
+ });
13141
+ var CollectionIndexSchema = object({
13142
+ name: string(),
13143
+ columns: array(string()).readonly(),
13144
+ unique: boolean().optional()
13145
+ });
13146
+ /**
13147
+ * The input of `declareCollection` — ONE schema for the door and for the
13148
+ * engine behind it, so the two surfaces cannot drift (the dispatcher forwards
13149
+ * the payload untouched).
13150
+ *
13151
+ * - `database` — the file the collection lives in (D851). Absent means
13152
+ * `settings`. A declaration naming a file other than the one the table is
13153
+ * already in is REFUSED by the engine, never moved.
13154
+ * - `primaryKey` — a COMPOSITE key, as column names. A single name is the same
13155
+ * as `primaryKey: true` on that column. A composite-keyed collection has no
13156
+ * `id`: it is written with `insertMany` / `upsertMany` / `transact` and read
13157
+ * with `query` / `count` / `aggregate` / `deleteWhere`; the calls that
13158
+ * address one row by id are refused.
13159
+ * - `withoutRowid` — emit `WITHOUT ROWID`. Requires a primary key.
13160
+ */
13161
+ var DeclareCollectionInputSchema = object({
13162
+ namespace: string().optional(),
13163
+ collection: string(),
13164
+ columns: array(CollectionColumnSchema).readonly(),
13165
+ indexes: array(CollectionIndexSchema).readonly().optional(),
13166
+ database: DataStoreDatabaseSchema.optional(),
13167
+ primaryKey: array(string()).readonly().optional(),
13168
+ withoutRowid: boolean().optional()
13169
+ });
13170
+ method(object({
13171
+ namespace: string().optional(),
13172
+ collection: string(),
13173
+ key: string()
13174
+ }), unknown(), { auth: "admin" }), method(object({
13175
+ namespace: string().optional(),
13176
+ collection: string(),
13177
+ key: string(),
13178
+ value: unknown()
13179
+ }), _void(), {
13180
+ kind: "mutation",
13181
+ auth: "admin"
13182
+ }), method(object({
13183
+ namespace: string().optional(),
13184
+ collection: string(),
13185
+ filter: QueryFilterSchema.optional(),
13186
+ columns: array(string()).readonly().optional()
13187
+ }), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
13188
+ namespace: string().optional(),
13189
+ collection: string(),
13190
+ /** Declared columns identifying the slot; must be covered by a UNIQUE
13191
+ * index on the collection. Never empty. */
13192
+ conflict: array(string()).readonly(),
13193
+ record: BulkRecordSchema
13194
+ }), object({
13195
+ /** The id the row HAS: assigned by SQLite on an insert, or the existing
13196
+ * row's own id on an update. */
13197
+ id: union([string(), number()]) }), {
13198
+ kind: "mutation",
13199
+ auth: "admin"
13200
+ }), method(object({
13201
+ namespace: string().optional(),
13202
+ collection: string(),
13203
+ conflict: array(string()).readonly(),
13204
+ records: array(BulkRecordSchema).readonly()
13205
+ }), object({ upserted: number().int() }), {
13206
+ kind: "mutation",
13207
+ auth: "admin"
13208
+ }), method(object({
13209
+ namespace: string().optional(),
13210
+ collection: string(),
13211
+ record: object({
13212
+ id: string().optional(),
13213
+ data: record(string(), unknown())
13214
+ })
13215
+ }), object({
13216
+ /**
13217
+ * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
13218
+ * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
13219
+ * primary key — which is the only place an auto key is knowable.
13220
+ */
13221
+ id: union([string(), number()]) }), {
13222
+ kind: "mutation",
13223
+ auth: "admin"
13224
+ }), method(object({
13225
+ namespace: string().optional(),
13226
+ collection: string(),
13227
+ records: array(BulkRecordSchema).readonly()
13228
+ }), object({ inserted: number().int() }), {
13229
+ kind: "mutation",
13230
+ auth: "admin"
13231
+ }), method(object({
13232
+ namespace: string().optional(),
13233
+ guard: TransactGuardSchema.optional(),
13234
+ ops: array(TransactOpSchema).readonly()
13235
+ }), object({
13236
+ applied: boolean(),
13237
+ current: unknown().optional()
13238
+ }), {
13239
+ kind: "mutation",
13240
+ auth: "admin"
13241
+ }), method(object({
13242
+ namespace: string().optional(),
13243
+ collection: string(),
13244
+ id: string(),
13245
+ data: record(string(), unknown())
13246
+ }), _void(), {
13247
+ kind: "mutation",
13248
+ auth: "admin"
13249
+ }), method(object({
13250
+ namespace: string().optional(),
13251
+ collection: string(),
13252
+ key: string()
13253
+ }), _void(), {
13254
+ kind: "mutation",
13255
+ auth: "admin"
13256
+ }), method(object({
13257
+ namespace: string().optional(),
13258
+ collection: string(),
13259
+ filter: MutationFilterSchema
13260
+ }), object({ deleted: number().int() }), {
13261
+ kind: "mutation",
13262
+ auth: "admin"
13263
+ }), method(object({
13264
+ namespace: string().optional(),
13265
+ collection: string(),
13266
+ filter: MutationFilterSchema,
13267
+ data: record(string(), unknown())
13268
+ }), object({ updated: number().int() }), {
13269
+ kind: "mutation",
13270
+ auth: "admin"
13271
+ }), method(object({
13272
+ namespace: string().optional(),
13273
+ collection: string(),
13274
+ filter: QueryFilterSchema.optional()
13275
+ }), number(), { auth: "admin" }), method(object({
13276
+ namespace: string().optional(),
13277
+ collection: string(),
13278
+ fields: array(AggregateFieldSchema).readonly(),
13279
+ filter: QueryFilterSchema.optional()
13280
+ }), AggregateResultSchema, { auth: "admin" }), method(object({
13281
+ namespace: string().optional(),
13282
+ collection: string(),
13283
+ field: string(),
13284
+ bucketSize: number().int().positive(),
13285
+ origin: number().int(),
13286
+ filter: QueryFilterSchema.optional()
13287
+ }), array(object({
13288
+ bucket: number().int(),
13289
+ count: number().int()
13290
+ })).readonly(), { auth: "admin" }), method(object({
13291
+ namespace: string().optional(),
13292
+ collection: string()
13293
+ }), boolean(), { auth: "admin" }), method(DeclareCollectionInputSchema, _void(), {
13294
+ kind: "mutation",
13295
+ auth: "admin"
13296
+ });
13297
+ var MigrationIdSchema = string().regex(/^[a-z0-9-]+\/\d{4}-\d{2}-\d{2}-[a-z0-9-]+$/, "a migration id is \"<owner>/<yyyy-mm-dd>-<slug>\"");
13298
+ var MigrationLevelSchema = _enum([
13299
+ "hub-store",
13300
+ "addon-state",
13301
+ "node-config",
13302
+ "viewer",
13303
+ "addon-internal"
13304
+ ]);
13305
+ var MigrationStoreSchema = _enum([
13306
+ "settings",
13307
+ "events",
13308
+ "history",
13309
+ "node-local",
13310
+ "addon-files"
13311
+ ]);
13312
+ var MigrationScopeSchema = _enum(["cluster", "per-node"]);
13313
+ /** What depends on a migration while it is pending: `block-owner` is the default. */
13314
+ var MigrationOnFailureSchema = _enum(["block-owner", "tolerate"]);
13315
+ /**
13316
+ * `sql` is a hub-only body over the owner's connection. `plan` returns edits the
13317
+ * engine applies inside the migration's own transaction (hub-owned: computed in
13318
+ * that transaction; addon-owned: computed by the owner and shipped to the engine).
13319
+ * `procedure` is addon-owned work that is not SQL (keychain, integration registry,
13320
+ * device tombstones); the ledger records its outcome and it must be idempotent.
13321
+ */
13322
+ var MigrationBodyKindSchema = _enum([
13323
+ "sql",
13324
+ "plan",
13325
+ "procedure"
13326
+ ]);
13327
+ var MigrationMetaSchema = object({
13328
+ id: MigrationIdSchema,
13329
+ /** `hub`, an addon id, `node` or `viewer`. */
13330
+ owner: string().regex(/^[a-z0-9-]+$/),
13331
+ level: MigrationLevelSchema,
13332
+ /** Strictly increasing per owner: the order within an owner. */
13333
+ seq: number().int().positive(),
13334
+ /** Ids of any owner: the order across owners. */
13335
+ dependsOn: array(MigrationIdSchema),
13336
+ store: MigrationStoreSchema,
13337
+ scope: MigrationScopeSchema,
13338
+ onFailure: MigrationOnFailureSchema,
13339
+ bodyKind: MigrationBodyKindSchema,
13340
+ description: string().min(1),
13341
+ /** The marked field the migration's spec must assert survived. */
13342
+ fixtureMark: string().min(1)
13343
+ }).refine((m) => m.id.startsWith(`${m.owner}/`), {
13344
+ message: "the id must start with \"<owner>/\"",
13345
+ path: ["id"]
13346
+ });
13347
+ /** A cycle in the dependency graph, named by the ids on it. */
13348
+ var MigrationCycleError = class extends Error {
13349
+ ids;
13350
+ constructor(ids) {
13351
+ super(`migration dependsOn cycle: ${ids.join(" -> ")}`);
13352
+ this.ids = ids;
13353
+ this.name = "MigrationCycleError";
13354
+ }
13355
+ };
13356
+ /**
13357
+ * Topological order over `dependsOn` plus the implicit edge "a lower `seq` of an
13358
+ * owner runs first". Ties are broken by `(owner, seq)`. Throws
13359
+ * {@link MigrationCycleError} on a cycle. A `dependsOn` id that is not in the list
13360
+ * is ignored here — the catalogue schema is what refuses it.
13361
+ */
13362
+ function orderMigrations(items) {
13363
+ const byId = new Map(items.map((item) => [item.id, item]));
13364
+ const deps = /* @__PURE__ */ new Map();
13365
+ const ownerSorted = /* @__PURE__ */ new Map();
13366
+ for (const item of items) {
13367
+ const list = ownerSorted.get(item.owner) ?? [];
13368
+ list.push(item);
13369
+ ownerSorted.set(item.owner, list);
13370
+ }
13371
+ for (const item of items) deps.set(item.id, new Set(item.dependsOn.filter((id) => byId.has(id))));
13372
+ for (const list of ownerSorted.values()) {
13373
+ list.sort((a, b) => a.seq - b.seq);
13374
+ for (let i = 1; i < list.length; i++) {
13375
+ const previous = list[i - 1];
13376
+ const current = list[i];
13377
+ if (previous !== void 0 && current !== void 0) deps.get(current.id)?.add(previous.id);
13378
+ }
13379
+ }
13380
+ const tie = (a, b) => a.owner < b.owner ? -1 : a.owner > b.owner ? 1 : a.seq - b.seq;
13381
+ const done = /* @__PURE__ */ new Set();
13382
+ const ordered = [];
13383
+ let remaining = [...items];
13384
+ while (remaining.length > 0) {
13385
+ const ready = remaining.filter((item) => [...deps.get(item.id) ?? []].every((dep) => done.has(dep)));
13386
+ if (ready.length === 0) throw new MigrationCycleError(remaining.map((item) => item.id).sort());
13387
+ ready.sort(tie);
13388
+ const next = ready[0];
13389
+ if (next === void 0) break;
13390
+ ordered.push(next);
13391
+ done.add(next.id);
13392
+ remaining = remaining.filter((item) => item.id !== next.id);
13393
+ }
13394
+ return ordered;
13395
+ }
13396
+ /** Every way a list of migrations (in declaration order) is not a catalogue. */
13397
+ function catalogueIssues(items) {
13398
+ const issues = [];
13399
+ const seen = /* @__PURE__ */ new Set();
13400
+ const known = new Set(items.map((item) => item.id));
13401
+ const lastSeq = /* @__PURE__ */ new Map();
13402
+ const seqUsed = /* @__PURE__ */ new Map();
13403
+ for (const item of items) {
13404
+ if (seen.has(item.id)) issues.push({
13405
+ code: "duplicate-id",
13406
+ ids: [item.id],
13407
+ message: `duplicate id ${item.id}`
13408
+ });
13409
+ seen.add(item.id);
13410
+ const used = seqUsed.get(item.owner) ?? /* @__PURE__ */ new Set();
13411
+ if (used.has(item.seq)) issues.push({
13412
+ code: "duplicate-seq",
13413
+ ids: [item.id],
13414
+ message: `owner ${item.owner} has two migrations with seq ${item.seq}`
13415
+ });
13416
+ else if (item.seq < (lastSeq.get(item.owner) ?? 0)) issues.push({
13417
+ code: "seq-order",
13418
+ ids: [item.id],
13419
+ message: `seq ${item.seq} of ${item.id} does not increase in declaration order (owner ${item.owner})`
13420
+ });
13421
+ used.add(item.seq);
13422
+ seqUsed.set(item.owner, used);
13423
+ lastSeq.set(item.owner, Math.max(item.seq, lastSeq.get(item.owner) ?? 0));
13424
+ for (const dep of item.dependsOn) if (!known.has(dep)) issues.push({
13425
+ code: "unknown-dependency",
13426
+ ids: [item.id, dep],
13427
+ message: `${item.id} dependsOn unknown id ${dep}`
13428
+ });
13429
+ }
13430
+ try {
13431
+ orderMigrations(items);
13432
+ } catch (err) {
13433
+ if (err instanceof MigrationCycleError) issues.push({
13434
+ code: "cycle",
13435
+ ids: err.ids,
13436
+ message: err.message
13437
+ });
13438
+ else throw err;
13439
+ }
13440
+ return issues;
13441
+ }
13442
+ array(MigrationMetaSchema).superRefine((items, ctx) => {
13443
+ for (const issue of catalogueIssues(items)) ctx.addIssue({
13444
+ code: "custom",
13445
+ message: `${issue.code}: ${issue.message}`
13446
+ });
13447
+ });
13448
+ /**
13449
+ * The canonical JSON (`preconditionOf`) of the value a plan read; the apply step
13450
+ * re-reads, and a plan whose read no longer matches is refused (the migration is
13451
+ * `failed`, nothing it edited is kept).
13452
+ */
13453
+ var PreconditionSchema = string().min(1).optional();
13454
+ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
13455
+ object({
13456
+ op: literal("setKeys"),
13457
+ scope: string().min(1),
13458
+ values: record(string(), unknown()),
13459
+ precondition: PreconditionSchema
13460
+ }),
13461
+ object({
13462
+ op: literal("deleteKeys"),
13463
+ scope: string().min(1),
13464
+ keys: array(string().min(1)).min(1),
13465
+ precondition: PreconditionSchema
13466
+ }),
13467
+ object({
13468
+ op: literal("putRow"),
13469
+ table: string().min(1),
13470
+ key: record(string(), unknown()),
13471
+ row: record(string(), unknown()),
13472
+ precondition: PreconditionSchema
13473
+ }),
13474
+ object({
13475
+ op: literal("deleteRow"),
13476
+ table: string().min(1),
13477
+ key: record(string(), unknown()),
13478
+ precondition: PreconditionSchema
13479
+ }),
13480
+ object({
13481
+ op: literal("upsertRecord"),
13482
+ kind: string().min(1),
13483
+ recordKey: string().min(1),
13484
+ value: unknown(),
13485
+ precondition: PreconditionSchema
13486
+ }),
13487
+ object({
13488
+ op: literal("deleteRecord"),
13489
+ kind: string().min(1),
13490
+ recordKey: string().min(1),
13491
+ precondition: PreconditionSchema
13492
+ })
13493
+ ])) });
13494
+ /**
13495
+ * What a `procedure` body reports. `already-done` means the rerun observed the
13496
+ * work finished (a crash between the work and the ledger row, or a manual fix)
13497
+ * and did none of it again; the ledger records `applied` either way.
13498
+ */
13499
+ var MigrationProcedureResultSchema = object({
13500
+ outcome: _enum(["done", "already-done"]),
13501
+ summary: record(string(), unknown())
13502
+ });
13503
+ /** What an owner hands the engine when one of its migrations ran. */
13504
+ var MigrationOwnerResultSchema = discriminatedUnion("kind", [
13505
+ object({
13506
+ kind: literal("plan"),
13507
+ plan: MigrationPlanSchema
13508
+ }),
13509
+ object({
13510
+ kind: literal("procedure"),
13511
+ result: MigrationProcedureResultSchema
13512
+ }),
13513
+ object({
13514
+ kind: literal("failed"),
13515
+ error: string().min(1)
13516
+ })
13517
+ ]);
13518
+ /**
13519
+ * `held`: a restore of a pre-migration snapshot undid this id; it does not rerun
13520
+ * until the operator retries or a new code version ships.
13521
+ * `skipped-newer`: the database knows an id this code does not.
13522
+ */
13523
+ var MigrationStatusSchema = _enum([
13524
+ "applied",
13525
+ "failed",
13526
+ "blocked",
13527
+ "running",
13528
+ "held",
13529
+ "skipped-newer"
13530
+ ]);
13531
+ var MigrationLedgerEntrySchema = object({
13532
+ id: string(),
13533
+ database: DataStoreDatabaseSchema,
13534
+ owner: string(),
13535
+ level: MigrationLevelSchema,
13536
+ seq: number().int().nonnegative(),
13537
+ status: MigrationStatusSchema,
13538
+ attempts: number().int().nonnegative(),
13539
+ appliedAt: number().nullable(),
13540
+ codeVersion: string().nullable(),
13541
+ /** What the apply changed: rows per table, as the engine counted them. */
13542
+ planSummary: record(string(), unknown()).nullable(),
13543
+ progress: record(string(), unknown()).nullable(),
13544
+ error: string().nullable(),
13545
+ /** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
13546
+ reason: string().nullable(),
13547
+ nodeId: string().nullable(),
13548
+ bootId: string().nullable()
13549
+ });
13550
+ /** A catalogued migration that is not applied, with where it stands. */
13551
+ var MigrationPendingEntrySchema = object({
13552
+ meta: MigrationMetaSchema,
13553
+ database: DataStoreDatabaseSchema,
13554
+ state: _enum([
13555
+ "pending",
13556
+ "failed",
13557
+ "blocked",
13558
+ "held"
13559
+ ]),
13560
+ reason: string().nullable()
13561
+ });
13562
+ /** Rows per table before and after a dry run, and what it would have changed. */
13563
+ var MigrationDryRunResultSchema = object({
13564
+ id: string(),
13565
+ ok: boolean(),
13566
+ error: string().nullable(),
13567
+ rowsChanged: number().int().nonnegative(),
13568
+ tables: array(object({
13569
+ table: string(),
13570
+ before: number().int().nonnegative(),
13571
+ after: number().int().nonnegative()
13572
+ }))
13573
+ });
13574
+ /** One of an owner's migrations, as the engine tells the owner to treat it this boot. */
13575
+ var MigrationOwnerStepSchema = object({
13576
+ id: MigrationIdSchema,
13577
+ action: _enum(["run", "skip"]),
13578
+ /** The ledger state the engine found: `pending` has no row yet. */
13579
+ state: union([literal("pending"), MigrationStatusSchema])
13580
+ });
13581
+ /**
12777
13582
  * The trainer contract — what the hub hands the cloud trainer and what it
12778
13583
  * gets back (cloud training, D805+).
12779
13584
  *
@@ -19764,6 +20569,7 @@ var SYSTEM_CAP_VOCABULARY = {
19764
20569
  "login-method": system(IDENTITY),
19765
20570
  "mesh-network": system(NETWORK),
19766
20571
  "metrics-provider": system(CLUSTER),
20572
+ migrations: system(INTERNAL),
19767
20573
  "model-convert": system(ML),
19768
20574
  "model-distributor": system(ML),
19769
20575
  "mqtt-broker": system(NETWORK),
@@ -42047,7 +42853,7 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
42047
42853
  * rebuilds without manual reload.
42048
42854
  *
42049
42855
  * The hub-local builtin `addon-pages-aggregator` (see
42050
- * `@camstack/system/builtins/addon-pages-aggregator`) registers the
42856
+ * `@camstack/server/system/builtins/addon-pages-aggregator`) registers the
42051
42857
  * provider. Splitting the public aggregator from the raw collection
42052
42858
  * keeps both ends in codegen — there's no hand-written
42053
42859
  * `addon-pages.router.ts` wrapper anymore.
@@ -42347,7 +43153,7 @@ method(_void(), array(WidgetMetadataSchema).readonly(), { auth: "admin" });
42347
43153
  * manual reload — same scheme used by `addon-pages`.
42348
43154
  *
42349
43155
  * The hub-local builtin `addon-widgets-aggregator` (see
42350
- * `@camstack/system/builtins/addon-widgets-aggregator`) registers the
43156
+ * `@camstack/server/system/builtins/addon-widgets-aggregator`) registers the
42351
43157
  * provider. Splitting the public aggregator from the raw collection
42352
43158
  * keeps both ends in codegen — there's no hand-written wrapper.
42353
43159
  */
@@ -42708,329 +43514,6 @@ method(object({
42708
43514
  password: string()
42709
43515
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
42710
43516
  /**
42711
- * Query filter for settings-store collections.
42712
- */
42713
- var QueryFilterSchema = object({
42714
- where: record(string(), unknown()).optional(),
42715
- whereIn: record(string(), array(unknown())).optional(),
42716
- whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
42717
- /** NULL-safe exclusion: matches rows whose field is NULL OR != the value. */
42718
- whereNot: record(string(), unknown()).optional(),
42719
- /** NULL-safe exclusion of a SET — `whereNot` for more than one value. An
42720
- * empty list excludes nothing. See `QueryFilter.whereNotIn`. */
42721
- whereNotIn: record(string(), array(unknown())).optional(),
42722
- orderBy: object({
42723
- field: string(),
42724
- direction: _enum(["asc", "desc"])
42725
- }).optional(),
42726
- limit: number().optional(),
42727
- offset: number().optional()
42728
- });
42729
- /**
42730
- * The predicate half of a filter, for BULK MUTATIONS.
42731
- *
42732
- * Deliberately not `QueryFilterSchema`: `orderBy` / `limit` / `offset` have no
42733
- * meaning for a statement that rewrites a set, and accepting them would invite
42734
- * a caller to believe `limit` bounds the damage. Every field is optional here
42735
- * only so the shape stays composable — the implementation REJECTS a filter
42736
- * that compiles to no predicate, because that is the whole collection.
42737
- */
42738
- var MutationFilterSchema = object({
42739
- where: record(string(), unknown()).optional(),
42740
- whereIn: record(string(), array(unknown())).optional(),
42741
- whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
42742
- whereNot: record(string(), unknown()).optional(),
42743
- whereNotIn: record(string(), array(unknown())).optional()
42744
- });
42745
- /**
42746
- * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
42747
- *
42748
- * `as` names the slot in the result, so the SAME column may be asked twice with
42749
- * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
42750
- * a `Record<column, op>` shape could not express.
42751
- */
42752
- var AggregateFieldSchema = object({
42753
- /** Result key. */
42754
- as: string().min(1),
42755
- /** Column to aggregate. Must be a real column of a declared collection. */
42756
- field: string().min(1),
42757
- op: _enum([
42758
- "sum",
42759
- "min",
42760
- "max"
42761
- ])
42762
- });
42763
- /**
42764
- * `COUNT(*)` plus one number per requested field.
42765
- *
42766
- * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
42767
- * that really is 0 are different facts, and an accounting caller that renders
42768
- * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
42769
- */
42770
- var AggregateResultSchema = object({
42771
- count: number().int(),
42772
- values: record(string(), number().nullable())
42773
- });
42774
- /** A single stored record: `{ id, data }`. */
42775
- var SettingsRecordSchema = object({
42776
- id: string(),
42777
- data: record(string(), unknown())
42778
- });
42779
- /**
42780
- * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
42781
- * optional.
42782
- *
42783
- * A separate schema rather than loosening the shared one: every other method
42784
- * on this cap addresses a row BY its id, and making that field optional
42785
- * everywhere would turn a forgotten key into a silently generated one on
42786
- * `update` and `delete` as well.
42787
- */
42788
- var BulkRecordSchema = object({
42789
- id: string().optional(),
42790
- data: record(string(), unknown())
42791
- });
42792
- /**
42793
- * The database FILES one `sqlite-settings` engine process owns (D851).
42794
- * Closed on purpose: a file is a thing the engine opens, backs up and gives a
42795
- * serving thread, so a new one is a code change, never a string a caller
42796
- * invents. `settings` is `camstack.db` and the default for every collection
42797
- * that names no file.
42798
- */
42799
- var DataStoreDatabaseSchema = _enum([
42800
- "settings",
42801
- "events",
42802
- "history"
42803
- ]);
42804
- DataStoreDatabaseSchema.options;
42805
- /**
42806
- * One write inside a {@link settingsStoreCapability.methods.transact} call.
42807
- * The three that a "replace this set, bump that revision" write needs, plus
42808
- * the batched upsert a rollup writer needs.
42809
- */
42810
- var TransactOpSchema = discriminatedUnion("op", [
42811
- object({
42812
- op: literal("deleteWhere"),
42813
- collection: string(),
42814
- filter: MutationFilterSchema
42815
- }),
42816
- object({
42817
- op: literal("insertMany"),
42818
- collection: string(),
42819
- records: array(BulkRecordSchema).readonly()
42820
- }),
42821
- object({
42822
- op: literal("update"),
42823
- collection: string(),
42824
- id: string(),
42825
- data: record(string(), unknown())
42826
- }),
42827
- object({
42828
- op: literal("upsertMany"),
42829
- collection: string(),
42830
- conflict: array(string()).readonly(),
42831
- records: array(BulkRecordSchema).readonly()
42832
- })
42833
- ]);
42834
- /**
42835
- * The precondition of a transaction: the row `key` of `collection` must hold
42836
- * `equals` in `column`, read INSIDE the transaction.
42837
- */
42838
- var TransactGuardSchema = object({
42839
- collection: string(),
42840
- key: string(),
42841
- column: string(),
42842
- equals: unknown()
42843
- });
42844
- /**
42845
- * Column declaration for a structured (SQL-backed) collection.
42846
- *
42847
- * Logical types — the backend translates each to the matching SQLite
42848
- * storage class and handles per-type marshaling:
42849
- * - `TEXT` / `INTEGER` / `REAL` — native SQLite types, pass-through
42850
- * - `JSON` — TEXT under the hood; serialised on write, parsed on read
42851
- * - `BOOLEAN` — INTEGER 0/1 under the hood; coerced both directions
42852
- */
42853
- var CollectionColumnSchema = object({
42854
- name: string(),
42855
- type: _enum([
42856
- "TEXT",
42857
- "INTEGER",
42858
- "REAL",
42859
- "JSON",
42860
- "BOOLEAN"
42861
- ]),
42862
- primaryKey: boolean().optional(),
42863
- notNull: boolean().optional(),
42864
- unique: boolean().optional(),
42865
- /**
42866
- * Column DEFAULT. Required for B2: the four `ensureTable` consumers declare
42867
- * columns like `enabled INTEGER NOT NULL DEFAULT 1`, and without this the
42868
- * collection surface simply cannot express their existing tables — which is
42869
- * why they were still on the uncapped `table*` API.
42870
- */
42871
- defaultValue: union([
42872
- string(),
42873
- number(),
42874
- boolean()
42875
- ]).optional()
42876
- });
42877
- var CollectionIndexSchema = object({
42878
- name: string(),
42879
- columns: array(string()).readonly(),
42880
- unique: boolean().optional()
42881
- });
42882
- /**
42883
- * The input of `declareCollection` — ONE schema for the door and for the
42884
- * engine behind it, so the two surfaces cannot drift (the dispatcher forwards
42885
- * the payload untouched).
42886
- *
42887
- * - `database` — the file the collection lives in (D851). Absent means
42888
- * `settings`. A declaration naming a file other than the one the table is
42889
- * already in is REFUSED by the engine, never moved.
42890
- * - `primaryKey` — a COMPOSITE key, as column names. A single name is the same
42891
- * as `primaryKey: true` on that column. A composite-keyed collection has no
42892
- * `id`: it is written with `insertMany` / `upsertMany` / `transact` and read
42893
- * with `query` / `count` / `aggregate` / `deleteWhere`; the calls that
42894
- * address one row by id are refused.
42895
- * - `withoutRowid` — emit `WITHOUT ROWID`. Requires a primary key.
42896
- */
42897
- var DeclareCollectionInputSchema = object({
42898
- namespace: string().optional(),
42899
- collection: string(),
42900
- columns: array(CollectionColumnSchema).readonly(),
42901
- indexes: array(CollectionIndexSchema).readonly().optional(),
42902
- database: DataStoreDatabaseSchema.optional(),
42903
- primaryKey: array(string()).readonly().optional(),
42904
- withoutRowid: boolean().optional()
42905
- });
42906
- method(object({
42907
- namespace: string().optional(),
42908
- collection: string(),
42909
- key: string()
42910
- }), unknown(), { auth: "admin" }), method(object({
42911
- namespace: string().optional(),
42912
- collection: string(),
42913
- key: string(),
42914
- value: unknown()
42915
- }), _void(), {
42916
- kind: "mutation",
42917
- auth: "admin"
42918
- }), method(object({
42919
- namespace: string().optional(),
42920
- collection: string(),
42921
- filter: QueryFilterSchema.optional(),
42922
- columns: array(string()).readonly().optional()
42923
- }), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
42924
- namespace: string().optional(),
42925
- collection: string(),
42926
- /** Declared columns identifying the slot; must be covered by a UNIQUE
42927
- * index on the collection. Never empty. */
42928
- conflict: array(string()).readonly(),
42929
- record: BulkRecordSchema
42930
- }), object({
42931
- /** The id the row HAS: assigned by SQLite on an insert, or the existing
42932
- * row's own id on an update. */
42933
- id: union([string(), number()]) }), {
42934
- kind: "mutation",
42935
- auth: "admin"
42936
- }), method(object({
42937
- namespace: string().optional(),
42938
- collection: string(),
42939
- conflict: array(string()).readonly(),
42940
- records: array(BulkRecordSchema).readonly()
42941
- }), object({ upserted: number().int() }), {
42942
- kind: "mutation",
42943
- auth: "admin"
42944
- }), method(object({
42945
- namespace: string().optional(),
42946
- collection: string(),
42947
- record: object({
42948
- id: string().optional(),
42949
- data: record(string(), unknown())
42950
- })
42951
- }), object({
42952
- /**
42953
- * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
42954
- * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
42955
- * primary key — which is the only place an auto key is knowable.
42956
- */
42957
- id: union([string(), number()]) }), {
42958
- kind: "mutation",
42959
- auth: "admin"
42960
- }), method(object({
42961
- namespace: string().optional(),
42962
- collection: string(),
42963
- records: array(BulkRecordSchema).readonly()
42964
- }), object({ inserted: number().int() }), {
42965
- kind: "mutation",
42966
- auth: "admin"
42967
- }), method(object({
42968
- namespace: string().optional(),
42969
- guard: TransactGuardSchema.optional(),
42970
- ops: array(TransactOpSchema).readonly()
42971
- }), object({
42972
- applied: boolean(),
42973
- current: unknown().optional()
42974
- }), {
42975
- kind: "mutation",
42976
- auth: "admin"
42977
- }), method(object({
42978
- namespace: string().optional(),
42979
- collection: string(),
42980
- id: string(),
42981
- data: record(string(), unknown())
42982
- }), _void(), {
42983
- kind: "mutation",
42984
- auth: "admin"
42985
- }), method(object({
42986
- namespace: string().optional(),
42987
- collection: string(),
42988
- key: string()
42989
- }), _void(), {
42990
- kind: "mutation",
42991
- auth: "admin"
42992
- }), method(object({
42993
- namespace: string().optional(),
42994
- collection: string(),
42995
- filter: MutationFilterSchema
42996
- }), object({ deleted: number().int() }), {
42997
- kind: "mutation",
42998
- auth: "admin"
42999
- }), method(object({
43000
- namespace: string().optional(),
43001
- collection: string(),
43002
- filter: MutationFilterSchema,
43003
- data: record(string(), unknown())
43004
- }), object({ updated: number().int() }), {
43005
- kind: "mutation",
43006
- auth: "admin"
43007
- }), method(object({
43008
- namespace: string().optional(),
43009
- collection: string(),
43010
- filter: QueryFilterSchema.optional()
43011
- }), number(), { auth: "admin" }), method(object({
43012
- namespace: string().optional(),
43013
- collection: string(),
43014
- fields: array(AggregateFieldSchema).readonly(),
43015
- filter: QueryFilterSchema.optional()
43016
- }), AggregateResultSchema, { auth: "admin" }), method(object({
43017
- namespace: string().optional(),
43018
- collection: string(),
43019
- field: string(),
43020
- bucketSize: number().int().positive(),
43021
- origin: number().int(),
43022
- filter: QueryFilterSchema.optional()
43023
- }), array(object({
43024
- bucket: number().int(),
43025
- count: number().int()
43026
- })).readonly(), { auth: "admin" }), method(object({
43027
- namespace: string().optional(),
43028
- collection: string()
43029
- }), boolean(), { auth: "admin" }), method(DeclareCollectionInputSchema, _void(), {
43030
- kind: "mutation",
43031
- auth: "admin"
43032
- });
43033
- /**
43034
43517
  * How long one snapshot may take end to end: the pinned copy of the whole
43035
43518
  * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
43036
43519
  * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
@@ -44838,7 +45321,7 @@ method(object({
44838
45321
  kind: "mutation",
44839
45322
  auth: "admin"
44840
45323
  }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
44841
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
45324
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
44842
45325
  var NUMBER = {
44843
45326
  kind: "fixed",
44844
45327
  result: ["number"]
@@ -45849,6 +46332,57 @@ id: union([string(), number()]) }), {
45849
46332
  kind: "mutation",
45850
46333
  auth: "admin"
45851
46334
  });
46335
+ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { auth: "admin" }), method(object({ owner: string().optional() }), object({ pending: array(MigrationPendingEntrySchema) }), { auth: "admin" }), method(object({ id: string().min(1) }), MigrationDryRunResultSchema, { auth: "admin" }), method(object({
46336
+ id: string().min(1),
46337
+ error: string().min(1)
46338
+ }), MigrationLedgerEntrySchema, {
46339
+ kind: "mutation",
46340
+ auth: "admin"
46341
+ }), method(object({ id: string().min(1) }), object({ entries: array(MigrationLedgerEntrySchema) }), {
46342
+ kind: "mutation",
46343
+ auth: "admin"
46344
+ }), method(object({
46345
+ database: DataStoreDatabaseSchema,
46346
+ snapshotId: string().min(1)
46347
+ }), object({
46348
+ scheduled: boolean(),
46349
+ held: array(string()),
46350
+ restartRequired: boolean()
46351
+ }), {
46352
+ kind: "mutation",
46353
+ auth: "admin"
46354
+ }), method(object({
46355
+ owner: string().min(1),
46356
+ metas: array(MigrationMetaSchema)
46357
+ }), object({
46358
+ bootId: string(),
46359
+ snapshot: _enum([
46360
+ "none",
46361
+ "written",
46362
+ "refused"
46363
+ ]),
46364
+ steps: array(MigrationOwnerStepSchema)
46365
+ }), {
46366
+ kind: "mutation",
46367
+ auth: "admin"
46368
+ }), method(object({ id: string().min(1) }), object({
46369
+ proceed: boolean(),
46370
+ state: union([literal("pending"), MigrationStatusSchema]),
46371
+ reason: string().nullable()
46372
+ }), {
46373
+ kind: "mutation",
46374
+ auth: "admin"
46375
+ }), method(object({
46376
+ id: string().min(1),
46377
+ result: MigrationOwnerResultSchema
46378
+ }), object({
46379
+ status: MigrationStatusSchema,
46380
+ error: string().nullable(),
46381
+ rowsChanged: number().int().nonnegative()
46382
+ }), {
46383
+ kind: "mutation",
46384
+ auth: "admin"
46385
+ });
45852
46386
  /**
45853
46387
  * records - an addon's own facts and documents (D881): ledgers, audit rows,
45854
46388
  * config documents, mirrors. The third storage API next to `ctx.settings`
@@ -60351,7 +60885,18 @@ var ServerUpdateActionResultSchema = object({
60351
60885
  * store (D877), present when the pre-flight refused the update
60352
60886
  * (`reason: 'addon-would-refuse'`). Optional for version skew.
60353
60887
  */
60354
- blockers: array(UpdateBlockerSchema).optional()
60888
+ blockers: array(UpdateBlockerSchema).optional(),
60889
+ /**
60890
+ * The minimums the target server declares and this node does not meet
60891
+ * (D989), present when the update was refused with
60892
+ * `reason: 'requirements-unmet'`. Each names the versions on both sides.
60893
+ */
60894
+ unmet: array(UnmetRequirementSchema).optional(),
60895
+ /**
60896
+ * The addons this node has below the minimum the staged server declares —
60897
+ * the ones to update WITH the server. Present on an accepted update.
60898
+ */
60899
+ requiredAddonUpdates: array(RequiredAddonUpdateSchema).optional()
60355
60900
  });
60356
60901
  var LaunchOverridesSchema = object({
60357
60902
  /** The persisted heap ceiling in MB, or `null` when none is set. */
@@ -62862,7 +63407,9 @@ var PackageUpdateSchema = object({
62862
63407
  latestVersion: string(),
62863
63408
  category: _enum(["addon", "core"]),
62864
63409
  requiresRestart: boolean(),
62865
- isSystem: boolean()
63410
+ isSystem: boolean(),
63411
+ /** Held: what the newer version needs and this node does not meet (D989). */
63412
+ blockedBy: array(UnmetRequirementSchema).readonly().optional()
62866
63413
  });
62867
63414
  var PackageVersionInfoSchema = object({
62868
63415
  version: string(),
@@ -66401,7 +66948,7 @@ DeviceType.LawnMower, method(object({ deviceId: number().int().nonnegative() }),
66401
66948
  * clients — they reverse-connect to the hub. Exposing their interfaces
66402
66949
  * via the same surface would leak internal topology with no upside.
66403
66950
  *
66404
- * Implementation in `@camstack/system/builtins/local-network/`.
66951
+ * Implementation in `@camstack/server/system/builtins/local-network/`.
66405
66952
  */
66406
66953
  /** Coarse classification derived from the interface name + IP range. */
66407
66954
  var InterfaceKindEnum = _enum([
@@ -66861,7 +67408,7 @@ object({
66861
67408
  offSeconds: number().int(),
66862
67409
  lastFetchedAt: number()
66863
67410
  });
66864
- DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic;
67411
+ DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
66865
67412
  var deviceInput = object({ deviceId: number().int().nonnegative() });
66866
67413
  systemMethod(deviceInput, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput, PowerSourceActionResultSchema, {
66867
67414
  kind: "mutation",
@@ -67681,7 +68228,7 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, Devi
67681
68228
  * jitter, and observed/peak bandwidth per device + per client.
67682
68229
  *
67683
68230
  * Implementation lives in the server's `NetworkQualityService` (thin
67684
- * wrapper over the shared `NetworkQualityTracker` from `@camstack/system`).
68231
+ * wrapper over the shared `NetworkQualityTracker` from `@camstack/server/system`).
67685
68232
  * The provider is registered from `trpc.router.ts` against the existing
67686
68233
  * service instance — no addon owns this state.
67687
68234
  *
@@ -77793,6 +78340,69 @@ Object.freeze({
77793
78340
  access: "view",
77794
78341
  role: "admin"
77795
78342
  },
78343
+ "migrations.declareOwner": {
78344
+ capName: "migrations",
78345
+ capScope: "system",
78346
+ addonId: null,
78347
+ access: "create",
78348
+ role: "admin"
78349
+ },
78350
+ "migrations.dryRun": {
78351
+ capName: "migrations",
78352
+ capScope: "system",
78353
+ addonId: null,
78354
+ access: "view",
78355
+ role: "admin"
78356
+ },
78357
+ "migrations.finishMigration": {
78358
+ capName: "migrations",
78359
+ capScope: "system",
78360
+ addonId: null,
78361
+ access: "create",
78362
+ role: "admin"
78363
+ },
78364
+ "migrations.listLedger": {
78365
+ capName: "migrations",
78366
+ capScope: "system",
78367
+ addonId: null,
78368
+ access: "view",
78369
+ role: "admin"
78370
+ },
78371
+ "migrations.listPending": {
78372
+ capName: "migrations",
78373
+ capScope: "system",
78374
+ addonId: null,
78375
+ access: "view",
78376
+ role: "admin"
78377
+ },
78378
+ "migrations.markFailed": {
78379
+ capName: "migrations",
78380
+ capScope: "system",
78381
+ addonId: null,
78382
+ access: "create",
78383
+ role: "admin"
78384
+ },
78385
+ "migrations.restorePreMigration": {
78386
+ capName: "migrations",
78387
+ capScope: "system",
78388
+ addonId: null,
78389
+ access: "create",
78390
+ role: "admin"
78391
+ },
78392
+ "migrations.retry": {
78393
+ capName: "migrations",
78394
+ capScope: "system",
78395
+ addonId: null,
78396
+ access: "create",
78397
+ role: "admin"
78398
+ },
78399
+ "migrations.startMigration": {
78400
+ capName: "migrations",
78401
+ capScope: "system",
78402
+ addonId: null,
78403
+ access: "create",
78404
+ role: "admin"
78405
+ },
77796
78406
  "modelConvert.convert": {
77797
78407
  capName: "model-convert",
77798
78408
  capScope: "system",
@@ -87820,7 +88430,7 @@ var AgentUIAddon = class extends BaseAddon {
87820
88430
  capability: adminUiCapability,
87821
88431
  provider: {
87822
88432
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
87823
- getVersion: async () => ({ version: "1.2.306" })
88433
+ getVersion: async () => ({ version: "1.2.307" })
87824
88434
  }
87825
88435
  }];
87826
88436
  }