@camstack/types 1.2.540 → 1.2.542

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +18 -4
  2. package/dist/addon.js +1 -1
  3. package/dist/addon.mjs +1 -1
  4. package/dist/capabilities/cluster-update.cap.d.ts +376 -0
  5. package/dist/capabilities/device-manager.cap.d.ts +103 -0
  6. package/dist/capabilities/device-search.d.ts +168 -0
  7. package/dist/capabilities/hero-layout.cap.d.ts +69 -299
  8. package/dist/capabilities/hub-address.d.ts +10 -0
  9. package/dist/capabilities/index.d.ts +6 -3
  10. package/dist/capabilities/notification-rules.cap.d.ts +115 -1
  11. package/dist/client.d.ts +2 -1
  12. package/dist/client.js +54 -8
  13. package/dist/client.mjs +54 -9
  14. package/dist/device/container-primary-child.d.ts +39 -4
  15. package/dist/device/device-management.d.ts +9 -0
  16. package/dist/device/hero/hero-model.d.ts +57 -553
  17. package/dist/device/hero/hero-row.d.ts +76 -69
  18. package/dist/device/hero/index.d.ts +1 -1
  19. package/dist/device/linked-device-resolve.d.ts +2 -0
  20. package/dist/generated/addon-api.d.ts +43 -0
  21. package/dist/generated/capability-router-map.d.ts +5 -2
  22. package/dist/generated/device-proxy.d.ts +1 -1
  23. package/dist/generated/method-access-map.d.ts +1 -1
  24. package/dist/generated/method-device-selectors.d.ts +2 -2
  25. package/dist/generated/system-proxy.d.ts +3 -1
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +592 -29
  28. package/dist/index.mjs +562 -30
  29. package/dist/notification/degrade-engine.d.ts +7 -1
  30. package/dist/notification/notification-fields.d.ts +20 -2
  31. package/dist/notification/timelapse-rule.d.ts +69 -0
  32. package/dist/{sleep-Dz1P6--1.mjs → sleep-Cw1uUXvl.mjs} +3 -0
  33. package/dist/{sleep-DPMn-Sik.js → sleep-PfAAmxV-.js} +3 -0
  34. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-DPMn-Sik.js");
2
+ const require_sleep = require("./sleep-PfAAmxV-.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-BtaMj_W7.js");
5
5
  const require_implemented_methods = require("./implemented-methods-C_iV6BiP.js");
@@ -42211,6 +42211,162 @@ var climateControlCapability = {
42211
42211
  } }
42212
42212
  };
42213
42213
  //#endregion
42214
+ //#region src/capabilities/cluster-update.cap.ts
42215
+ /**
42216
+ * cluster-update — the ONE flow that brings the whole cluster to a release
42217
+ * (planning#493). Hub-provided (`server-provided`), hub-only: the hub runs
42218
+ * the sequence itself, so the admin UI, the MCP and the CLI all start the same
42219
+ * job and read the same report instead of each driving their own loop.
42220
+ *
42221
+ * 1. backup (`backup.trigger`) — skipped only when the caller says so
42222
+ * 2. the hub's server closure (`applyServerUpdate`); the hub restarts and the
42223
+ * job RESUMES on the new boot, verified against the hub's running version
42224
+ * 3. every online agent behind the target, one at a time, verified: runs the
42225
+ * target, settled, online, and its capabilities registered (D848) — an
42226
+ * agent that comes back capless is a FAILED step, never a done one
42227
+ * 4. every stale addon on the hub (`addons.updatePackage`); agents follow by
42228
+ * reconciliation, which is verified, never pushed
42229
+ *
42230
+ * The job stops on the first failed step with a typed reason (D877). Its state
42231
+ * is durable on the hub and read by RPC (`getClusterUpdateJob`) — events are
42232
+ * telemetry and never carry it (D8, D11).
42233
+ */
42234
+ /** The steps, in the order they run. */
42235
+ var ClusterUpdateStepKindSchema = zod.z.enum([
42236
+ "backup",
42237
+ "hub-server",
42238
+ "agent-server",
42239
+ "addons"
42240
+ ]);
42241
+ /**
42242
+ * - `pending` — not reached yet.
42243
+ * - `running` — in progress (for `hub-server`: possibly across the restart).
42244
+ * - `ok` — done AND verified.
42245
+ * - `failed` — did not land; `reason` + `detail` say why. Stops the job.
42246
+ * - `skipped` — not run: nothing to do, opted out, the node is offline, or a
42247
+ * step before it failed. `detail` says which.
42248
+ */
42249
+ var ClusterUpdateStepStatusSchema = zod.z.enum([
42250
+ "pending",
42251
+ "running",
42252
+ "ok",
42253
+ "failed",
42254
+ "skipped"
42255
+ ]);
42256
+ /**
42257
+ * Why a step (and with it the job) failed. Stable, greppable; `detail` carries
42258
+ * the prose.
42259
+ */
42260
+ var ClusterUpdateFailureReasonSchema = zod.z.enum([
42261
+ "backup-unavailable",
42262
+ "backup-failed",
42263
+ "server-refused",
42264
+ "server-not-on-target",
42265
+ "node-capless",
42266
+ "status-unreadable",
42267
+ "addon-update-failed",
42268
+ "addons-not-converged",
42269
+ "interrupted"
42270
+ ]);
42271
+ var ClusterUpdateStepSchema = zod.z.object({
42272
+ kind: ClusterUpdateStepKindSchema,
42273
+ /** The node the step acts on; absent for `backup` and `addons`. */
42274
+ nodeId: zod.z.string().optional(),
42275
+ status: ClusterUpdateStepStatusSchema,
42276
+ /** One line for the operator: what happened, or why not. */
42277
+ detail: zod.z.string(),
42278
+ reason: ClusterUpdateFailureReasonSchema.optional(),
42279
+ /** `hub-server` / `agent-server`: the version the node ran before. */
42280
+ fromVersion: zod.z.string().nullable().optional(),
42281
+ /** `addons`: the packages this step updates, `name from -> to`. */
42282
+ packages: zod.z.array(zod.z.string()).readonly().optional(),
42283
+ startedAt: zod.z.number().optional(),
42284
+ finishedAt: zod.z.number().optional()
42285
+ });
42286
+ var ClusterUpdateJobStateSchema = zod.z.enum([
42287
+ "running",
42288
+ "succeeded",
42289
+ "failed"
42290
+ ]);
42291
+ var ClusterUpdateJobSchema = zod.z.object({
42292
+ id: zod.z.string(),
42293
+ state: ClusterUpdateJobStateSchema,
42294
+ /** The server version every node is brought to. */
42295
+ targetVersion: zod.z.string(),
42296
+ /** Who started it (the user name, or `system`). */
42297
+ requestedBy: zod.z.string(),
42298
+ startedAt: zod.z.number(),
42299
+ finishedAt: zod.z.number().optional(),
42300
+ /** Every step, in run order; later steps stay `pending` while it runs. */
42301
+ steps: zod.z.array(ClusterUpdateStepSchema).readonly(),
42302
+ /** On `failed`: the step that stopped it (`nodeId` or the step kind). */
42303
+ stoppedAt: zod.z.string().optional(),
42304
+ reason: ClusterUpdateFailureReasonSchema.optional(),
42305
+ /** Agents offline when the plan was read: never touched. */
42306
+ skippedOffline: zod.z.array(zod.z.string()).readonly()
42307
+ });
42308
+ var ClusterUpdateOptionsSchema = zod.z.object({
42309
+ /** Explicit server target; omitted = the hub's latest registry check. */
42310
+ version: zod.z.string().optional(),
42311
+ /** Update the addons too (default true). */
42312
+ addons: zod.z.boolean().optional(),
42313
+ /**
42314
+ * Back up before touching anything (default true). `false` is an explicit
42315
+ * operator opt-out; a missing backup provider is otherwise a failure.
42316
+ */
42317
+ backup: zod.z.boolean().optional()
42318
+ });
42319
+ /** Why a plan cannot start. */
42320
+ var ClusterUpdateBlockerSchema = zod.z.enum([
42321
+ "no-target",
42322
+ "node-busy",
42323
+ "job-running",
42324
+ "nothing-to-do",
42325
+ "status-unreadable"
42326
+ ]);
42327
+ var ClusterUpdatePlanSchema = zod.z.object({
42328
+ /** `null` when no target could be resolved (`blocker: 'no-target'`). */
42329
+ targetVersion: zod.z.string().nullable(),
42330
+ /** The steps the job WOULD run, all `pending` (or `skipped` with a reason). */
42331
+ steps: zod.z.array(ClusterUpdateStepSchema).readonly(),
42332
+ skippedOffline: zod.z.array(zod.z.string()).readonly(),
42333
+ /** `null` = the plan can start. */
42334
+ blocker: ClusterUpdateBlockerSchema.nullable(),
42335
+ /** Prose for `blocker`. */
42336
+ blockerDetail: zod.z.string().nullable()
42337
+ });
42338
+ var StartClusterUpdateResultSchema = zod.z.object({
42339
+ accepted: zod.z.boolean(),
42340
+ /** The job to follow with `getClusterUpdateJob`; `null` when refused. */
42341
+ jobId: zod.z.string().nullable(),
42342
+ blocker: ClusterUpdateBlockerSchema.nullable(),
42343
+ message: zod.z.string()
42344
+ });
42345
+ var clusterUpdateCapability = {
42346
+ name: "cluster-update",
42347
+ scope: "system",
42348
+ mode: "singleton",
42349
+ methods: {
42350
+ /** What `startClusterUpdate` would do now, and whether it can start. Reads only. */
42351
+ previewClusterUpdate: require_sleep.method(ClusterUpdateOptionsSchema, ClusterUpdatePlanSchema, { auth: "admin" }),
42352
+ /**
42353
+ * Start the job and return at once with its id; the job runs on the hub
42354
+ * (minutes to hours, across the hub's own restart). Refused, with a
42355
+ * `blocker`, when the plan cannot start — one job at a time.
42356
+ */
42357
+ startClusterUpdate: require_sleep.method(ClusterUpdateOptionsSchema, StartClusterUpdateResultSchema, {
42358
+ kind: "mutation",
42359
+ auth: "admin"
42360
+ }),
42361
+ /**
42362
+ * A job's state. Without `jobId`: the latest job, or `null` when none ever
42363
+ * ran. Survives the hub restart the job itself causes.
42364
+ */
42365
+ getClusterUpdateJob: require_sleep.method(zod.z.object({ jobId: zod.z.string().optional() }), ClusterUpdateJobSchema.nullable(), { auth: "admin" })
42366
+ },
42367
+ mount: { kind: "server-provided" }
42368
+ };
42369
+ //#endregion
42214
42370
  //#region src/capabilities/color.cap.ts
42215
42371
  /**
42216
42372
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -49929,6 +50085,105 @@ function siteZoneKey(label) {
49929
50085
  return label.trim().toLowerCase();
49930
50086
  }
49931
50087
  //#endregion
50088
+ //#region src/capabilities/device-search.ts
50089
+ /**
50090
+ * `deviceManager.search` — the query behind the device → value picker.
50091
+ *
50092
+ * One server-side question answers everything a picker draws: which devices
50093
+ * can supply a value of the required capability(ies), narrowed by text and by
50094
+ * three generic facets, one cursor page at a time, with the facet counts and
50095
+ * the live reading of each matching value. The schemas live here (not in the
50096
+ * cap file) so the UI model files and the provider import one source; types
50097
+ * are `z.infer` of them.
50098
+ */
50099
+ /** Page size when the caller names none, and the ceiling it may ask for. */
50100
+ var DEVICE_SEARCH_DEFAULT_LIMIT = 50;
50101
+ var DEVICE_SEARCH_MAX_LIMIT = 200;
50102
+ var DeviceSearchRequiresSchema = zod.z.object({
50103
+ /** Capability names the field wants a value of. */
50104
+ caps: zod.z.array(zod.z.string()).readonly(),
50105
+ /** `any` (default): a device with one of them is compatible. `all`: it must hold every one. */
50106
+ mode: zod.z.enum(["any", "all"]).optional()
50107
+ });
50108
+ var DeviceSearchFiltersSchema = zod.z.object({
50109
+ locations: zod.z.array(zod.z.string()).readonly().optional(),
50110
+ integrationIds: zod.z.array(zod.z.string()).readonly().optional(),
50111
+ types: zod.z.array(zod.z.string()).readonly().optional()
50112
+ });
50113
+ var DeviceSearchInputSchema = zod.z.object({
50114
+ /** Matches name, location, type, integration (id and label) and id. Case-insensitive. */
50115
+ text: zod.z.string().optional(),
50116
+ requires: DeviceSearchRequiresSchema.optional(),
50117
+ filters: DeviceSearchFiltersSchema.optional(),
50118
+ /** List the devices that do not provide the required cap too (greyed, not pickable). */
50119
+ includeIncompatible: zod.z.boolean().optional(),
50120
+ /** The device the field belongs to: its location drives `suggested`. */
50121
+ contextDeviceId: zod.z.number().optional(),
50122
+ /**
50123
+ * Resolve exactly these devices, regardless of every filter, so a picked
50124
+ * value can be rendered. When given, `items` is these devices in the order
50125
+ * asked (no paging, `nextCursor` null) and the ones that do not exist are
50126
+ * listed in `missingIds`.
50127
+ */
50128
+ ids: zod.z.array(zod.z.number()).readonly().optional(),
50129
+ cursor: zod.z.string().nullable().optional(),
50130
+ limit: zod.z.number().int().min(1).max(200).optional()
50131
+ });
50132
+ var DeviceValueOptionSchema = zod.z.object({
50133
+ cap: zod.z.string(),
50134
+ /** Status-schema field path inside the cap (same paths as `getWireableFields`). */
50135
+ path: zod.z.string(),
50136
+ label: zod.z.string(),
50137
+ /** The current value as text; `null` when it is unknown or the read FAILED — never `0`. */
50138
+ reading: zod.z.string().nullable(),
50139
+ unit: zod.z.string().nullable().optional(),
50140
+ /** The field's measured quantity, when the cap declares one, so a client can format the reading. */
50141
+ quantity: require_sleep.ReadingQuantitySchema.optional()
50142
+ });
50143
+ var DeviceSearchItemSchema = zod.z.object({
50144
+ id: zod.z.number(),
50145
+ name: zod.z.string(),
50146
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
50147
+ location: zod.z.string().nullable(),
50148
+ integrationId: zod.z.string().nullable(),
50149
+ integrationLabel: zod.z.string().nullable(),
50150
+ online: zod.z.boolean().nullable(),
50151
+ disabled: zod.z.boolean(),
50152
+ compatible: zod.z.boolean(),
50153
+ /** Only the required caps' fields; empty when nothing was required or the device is incompatible. */
50154
+ values: zod.z.array(DeviceValueOptionSchema).readonly()
50155
+ });
50156
+ var DeviceSearchFacetValueSchema = zod.z.object({
50157
+ value: zod.z.string(),
50158
+ count: zod.z.number()
50159
+ });
50160
+ var DeviceSearchFacetIntegrationSchema = zod.z.object({
50161
+ id: zod.z.string(),
50162
+ label: zod.z.string(),
50163
+ count: zod.z.number()
50164
+ });
50165
+ var DeviceSearchFacetsSchema = zod.z.object({
50166
+ locations: zod.z.array(DeviceSearchFacetValueSchema).readonly(),
50167
+ integrations: zod.z.array(DeviceSearchFacetIntegrationSchema).readonly(),
50168
+ types: zod.z.array(DeviceSearchFacetValueSchema).readonly()
50169
+ });
50170
+ var DeviceSearchResultSchema = zod.z.object({
50171
+ items: zod.z.array(DeviceSearchItemSchema).readonly(),
50172
+ nextCursor: zod.z.string().nullable(),
50173
+ /** Devices listed by this query across all pages (filters + text applied; incompatible counted only when `includeIncompatible`). */
50174
+ total: zod.z.number(),
50175
+ /** Compatible devices after filters + text. */
50176
+ compatibleTotal: zod.z.number(),
50177
+ /** Every device the caller's fleet holds, before anything is applied. */
50178
+ fleetTotal: zod.z.number(),
50179
+ /** Incompatible devices after filters + text — the K of "show the K that don't". */
50180
+ hiddenIncompatible: zod.z.number(),
50181
+ facets: DeviceSearchFacetsSchema,
50182
+ /** Same location as `contextDeviceId`; first page only. */
50183
+ suggested: zod.z.array(DeviceSearchItemSchema).readonly(),
50184
+ missingIds: zod.z.array(zod.z.number()).readonly()
50185
+ });
50186
+ //#endregion
49932
50187
  //#region src/capabilities/device-provider.cap.ts
49933
50188
  var ProviderStatusSchema = zod.z.object({
49934
50189
  connected: zod.z.boolean(),
@@ -50419,6 +50674,9 @@ var DeviceInfoSchema = zod.z.object({
50419
50674
  * named accordion sections (with optional intra-section order). See
50420
50675
  * `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
50421
50676
  childLayout: zod.z.array(ChildLayoutEntrySchema).readonly().optional(),
50677
+ /** The children a container stands for, most preferred first, by accessory
50678
+ * `childKey`. Provider-declared. See `DeviceMeta.primaryChildPreference`. */
50679
+ primaryChildPreference: zod.z.array(zod.z.string()).readonly().optional(),
50422
50680
  /** Operator-authored per-device display override. See `DeviceMeta.display`. */
50423
50681
  display: DeviceDisplayOverrideSchema.optional()
50424
50682
  });
@@ -50582,6 +50840,9 @@ var DeviceMetaSchema = zod.z.object({
50582
50840
  * accordion sections (with optional intra-section order). See
50583
50841
  * `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
50584
50842
  childLayout: zod.z.array(ChildLayoutEntrySchema).readonly().optional(),
50843
+ /** The children a container stands for, most preferred first, by accessory
50844
+ * `childKey`. Provider-declared. See `DeviceMeta.primaryChildPreference`. */
50845
+ primaryChildPreference: zod.z.array(zod.z.string()).readonly().optional(),
50585
50846
  /** Semantic role string (`DeviceRole`) — propagated from the spawn pre-seed.
50586
50847
  * Optional: only present for accessory children that carry a known role. */
50587
50848
  role: zod.z.string().nullable().optional(),
@@ -50909,6 +51170,17 @@ var deviceManagerCapability = {
50909
51170
  kind: "mutation",
50910
51171
  auth: "admin"
50911
51172
  }),
51173
+ /** Set (or replace) a container's provider-declared primary-child
51174
+ * preference: accessory `childKey`s, most preferred first. Mirrors
51175
+ * `setChildLayout`; the operator's `primaryChildEntityId` still wins.
51176
+ * Persisted, projected, and preserved across re-register/restore. Idempotent. */
51177
+ setPrimaryChildPreference: require_sleep.method(zod.z.object({
51178
+ deviceId: zod.z.number(),
51179
+ primaryChildPreference: zod.z.array(zod.z.string()).readonly()
51180
+ }), zod.z.void(), {
51181
+ kind: "mutation",
51182
+ auth: "admin"
51183
+ }),
50912
51184
  /** Set (or clear) the per-device display override on the meta row. Mirrors
50913
51185
  * `setChildLayout` persistence; `null` clears the override entirely. The
50914
51186
  * override unit(s) are normalized (`normalizeUnit`) at write so the render
@@ -51238,6 +51510,15 @@ var deviceManagerCapability = {
51238
51510
  */
51239
51511
  deviceIds: zod.z.array(zod.z.number()).optional()
51240
51512
  }), zod.z.array(DeviceInfoSchema), { role: "viewer" }),
51513
+ /**
51514
+ * The device → value picker's one query: filter by text, capability and
51515
+ * location / integration / type, with faceted counts, cursor pagination,
51516
+ * the live reading of each matching value, suggestions by the context
51517
+ * device's location, and `ids` resolution for already-picked values.
51518
+ * See `device-search.ts`. Not in `DEVICE_ENUMERATION_METHODS`: a
51519
+ * device-scoped token is refused rather than shown the whole fleet.
51520
+ */
51521
+ search: require_sleep.method(DeviceSearchInputSchema, DeviceSearchResultSchema, { role: "viewer" }),
51241
51522
  /** Get a single device by numeric deviceId. */
51242
51523
  getDevice: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), DeviceInfoSchema.nullable()),
51243
51524
  /** List children of a parent device (by parent numeric id). */
@@ -56514,13 +56795,11 @@ var HeroConfirmSchema = zod.z.enum([
56514
56795
  "press"
56515
56796
  ]);
56516
56797
  var HeroActionSchema = zod.z.object({
56517
- /** Unique within the model; the `gated` list and the specs name it. */
56518
56798
  id: zod.z.string(),
56519
56799
  label: HeroTextSchema,
56520
56800
  icon: IconKeySchema,
56521
56801
  call: HeroCallSchema,
56522
56802
  emphasis: zod.z.enum(["primary", "normal"]),
56523
- /** Ask before running it. */
56524
56803
  confirm: HeroConfirmSchema.nullable()
56525
56804
  });
56526
56805
  var HeroControlSchema = zod.z.discriminatedUnion("kind", [
@@ -56569,8 +56848,23 @@ var HeroPillSchema = zod.z.object({
56569
56848
  text: HeroTextSchema,
56570
56849
  tone: HeroToneSchema
56571
56850
  });
56851
+ /**
56852
+ * Rows whose action and slider controls belong ON the scene (the curtain's buttons, the
56853
+ * lock's key, the player's transport) and not in a row under it. The model says it, so
56854
+ * every client draws the same placement; a control of another kind stays in a row.
56855
+ */
56856
+ var HERO_SCENE_ROW_IDS = new Set([
56857
+ "cover",
56858
+ "valve",
56859
+ "lock",
56860
+ "vacuum",
56861
+ "playback",
56862
+ "brightness"
56863
+ ]);
56572
56864
  var HeroRowSchema = zod.z.object({
56573
56865
  id: HeroRowIdSchema,
56866
+ /** `scene`: the row's action and slider controls are drawn on the scene. Absent: an ordinary row. */
56867
+ placement: zod.z.enum(["row", "scene"]).optional(),
56574
56868
  /** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
56575
56869
  label: HeroTextSchema.optional(),
56576
56870
  /** A group header drawn above the row when it differs from the previous row's ("System"). */
@@ -56601,9 +56895,18 @@ var HeroBadgeSchema = zod.z.object({
56601
56895
  value: zod.z.number().nullable(),
56602
56896
  label: HeroTextSchema
56603
56897
  });
56604
- var HeroRemoteSlotSchema = zod.z.object({
56605
- /** Saved commands; `null` = not known yet (the button still shows). */
56606
- commands: zod.z.number().int().nullable() });
56898
+ /** The id of the action a row recognises as "open the device's remote". */
56899
+ var REMOTE_OPEN_ACTION_ID = "remote.open";
56900
+ var HeroRemoteSlotSchema = zod.z.object({
56901
+ /** Saved commands; `null` = not known yet (the button still shows). */
56902
+ commands: zod.z.number().int().nullable(),
56903
+ /**
56904
+ * The control a list row draws as the "open the remote" icon. Recognised by its id
56905
+ * ({@link REMOTE_OPEN_ACTION_ID}); it changes no state, so a client opens the remote
56906
+ * instead of running `call`. Absent on a model from an older server.
56907
+ */
56908
+ open: HeroActionSchema.optional()
56909
+ });
56607
56910
  var HeroConsumableItemSchema = zod.z.object({
56608
56911
  key: zod.z.string(),
56609
56912
  label: zod.z.string(),
@@ -56774,6 +57077,8 @@ var HeroModelSchema = zod.z.object({
56774
57077
  * the FIRST row that has any (a later row's control is never promoted). When
56775
57078
  * the model lists that part in `gated`, the row has no inline control: the
56776
57079
  * projection never falls through to another control the caller could use.
57080
+ * - a climate or thermostat row's primary is its `climate.mode` control (no power
57081
+ * toggle: "off" is a mode); when the model gates it the rule above applies as before;
56777
57082
  * - a timed run, when the model carries the slot, sits beside that primary:
56778
57083
  * Run while idle, Stop while armed. Gating the slot hides the control.
56779
57084
  * - the status line is the head (what plays, else the state) plus at most
@@ -56781,6 +57086,13 @@ var HeroModelSchema = zod.z.object({
56781
57086
  * time left on an armed timed run;
56782
57087
  * - the trailing fact is the first of power, battery, consumables.
56783
57088
  *
57089
+ * - `extras` are the further inline controls of the types that carry more than one
57090
+ * ({@link ROW_EXTRAS_BY_TYPE}): climate setpoint, a robot's return to base,
57091
+ * a player's volume and remote. Each is a control the model already has, named by id,
57092
+ * in that order and at most {@link ROW_EXTRAS_MAX}; one the model lacks, or lists in
57093
+ * `gated`, is absent, and the one `primary` already is never repeats. Empty = the
57094
+ * row of an older server: `primary` alone.
57095
+ *
56784
57096
  * `projectDeviceRow` is pure and computes nothing: it selects from a
56785
57097
  * {@link HeroModel}. A row that needed a value the hero lacks would mean the
56786
57098
  * model is missing it, so the fix goes in the model.
@@ -56812,6 +57124,12 @@ var HeroRowModelSchema = zod.z.object({
56812
57124
  * while armed. `null` when there is no slot, or the caller may not act.
56813
57125
  */
56814
57126
  timedRun: HeroRowTimedRunSchema.nullable(),
57127
+ /**
57128
+ * The further inline controls after `primary`, in order (see the header). The remote
57129
+ * is an `action` with id `remote.open`: the client opens the remote, it does not run
57130
+ * the call. Absent or empty = `primary` alone.
57131
+ */
57132
+ extras: zod.z.array(HeroControlSchema).max(2).optional(),
56815
57133
  trailing: HeroFactSchema.nullable()
56816
57134
  });
56817
57135
  /** The trailing fact, in order of preference. */
@@ -56827,7 +57145,20 @@ function trailingOf(facts) {
56827
57145
  }
56828
57146
  return null;
56829
57147
  }
57148
+ /**
57149
+ * A type whose primary is a named control, not its power: a climate row is the mode
57150
+ * (which carries "off") and the setpoint, with no power toggle.
57151
+ */
57152
+ var ROW_PRIMARY_BY_TYPE = {
57153
+ [require_composed_stable_id.DeviceType.Climate]: "climate.mode",
57154
+ [require_composed_stable_id.DeviceType.Thermostat]: "climate.mode"
57155
+ };
56830
57156
  function primaryOf(model) {
57157
+ const named = ROW_PRIMARY_BY_TYPE[model.type];
57158
+ if (named !== void 0) {
57159
+ const found = extraOf(model, named);
57160
+ if (found !== null) return found;
57161
+ }
56831
57162
  const power = model.ownPower;
56832
57163
  if (power !== null) {
56833
57164
  if (model.gated.includes("own-power")) return null;
@@ -56847,6 +57178,43 @@ function primaryOf(model) {
56847
57178
  }
56848
57179
  return null;
56849
57180
  }
57181
+ /**
57182
+ * The extras of a type, by control id, in the order they are drawn. The ids are the
57183
+ * model's own: a `remote.open` is read from the model's remote slot, every other
57184
+ * from the rows. A type not listed has no extras.
57185
+ */
57186
+ var ROW_EXTRAS_BY_TYPE = {
57187
+ [require_composed_stable_id.DeviceType.Climate]: ["climate.target"],
57188
+ [require_composed_stable_id.DeviceType.Thermostat]: ["climate.target"],
57189
+ [require_composed_stable_id.DeviceType.Vacuum]: ["vacuum.base"],
57190
+ [require_composed_stable_id.DeviceType.LawnMower]: ["mower.dock"],
57191
+ [require_composed_stable_id.DeviceType.MediaPlayer]: ["volume.level", REMOTE_OPEN_ACTION_ID]
57192
+ };
57193
+ var controlId = (c) => c.kind === "action" ? c.action.id : c.id;
57194
+ function extraOf(model, id) {
57195
+ if (id === "remote.open") {
57196
+ const open = model.remote?.open;
57197
+ if (open === void 0 || model.gated.includes("remote")) return null;
57198
+ return {
57199
+ kind: "action",
57200
+ action: open
57201
+ };
57202
+ }
57203
+ for (const row of model.rows) {
57204
+ if (model.gated.includes(row.id)) continue;
57205
+ const found = row.controls.find((c) => controlId(c) === id);
57206
+ if (found !== void 0) return found;
57207
+ }
57208
+ return null;
57209
+ }
57210
+ function extrasOf(model, primary) {
57211
+ const ids = ROW_EXTRAS_BY_TYPE[model.type] ?? [];
57212
+ const taken = primary === null ? null : controlId(primary);
57213
+ return ids.filter((id) => id !== taken).flatMap((id) => {
57214
+ const found = extraOf(model, id);
57215
+ return found === null ? [] : [found];
57216
+ }).slice(0, 2);
57217
+ }
56850
57218
  function statusLineOf(model, trailing) {
56851
57219
  const head = model.rows.find((r) => r.id === "now-playing")?.status ?? null ?? model.title;
56852
57220
  const rest = model.facts.filter((f) => f !== trailing).map((f) => f.text).slice(0, 3);
@@ -56875,6 +57243,7 @@ function timedRunOf(model) {
56875
57243
  }
56876
57244
  function projectDeviceRow(model) {
56877
57245
  const trailing = trailingOf(model.facts);
57246
+ const primary = primaryOf(model);
56878
57247
  return {
56879
57248
  deviceId: model.deviceId,
56880
57249
  name: model.name,
@@ -56884,8 +57253,9 @@ function projectDeviceRow(model) {
56884
57253
  look: model.look,
56885
57254
  scene: model.scene,
56886
57255
  statusLine: statusLineOf(model, trailing),
56887
- primary: primaryOf(model),
57256
+ primary,
56888
57257
  timedRun: timedRunOf(model),
57258
+ extras: extrasOf(model, primary),
56889
57259
  trailing
56890
57260
  };
56891
57261
  }
@@ -59931,10 +60301,22 @@ var HUB_MDNS_TXT_KEYS = {
59931
60301
  nodeId: "nodeId",
59932
60302
  version: "version",
59933
60303
  role: "role",
59934
- url: "url"
60304
+ url: "url",
60305
+ /** The hub's announced identity (`hub-<16 hex>`), see {@link isHubId}. */
60306
+ hubId: "hubId"
59935
60307
  };
59936
60308
  var HUB_MDNS_ROLE = "hub";
59937
60309
  /**
60310
+ * A hub's ANNOUNCED identity: random, generated once on the hub and persisted, never derived
60311
+ * from anything an outsider can see. Two hubs on one LAN are told apart by it, and a paired
60312
+ * agent records it so it can find ITS hub again over mDNS (and refuse another). It is not the
60313
+ * mesh node id (`hub`), which stays the same on every hub.
60314
+ */
60315
+ var HUB_ID_PATTERN = /^hub-[0-9a-f]{16}$/;
60316
+ function isHubId(value) {
60317
+ return typeof value === "string" && HUB_ID_PATTERN.test(value);
60318
+ }
60319
+ /**
59938
60320
  * How a hub finds agents to pair (D857): every agent publishes ONE mDNS service for its API
59939
60321
  * port, paired or not. The TXT record carries only public facts. Finding an agent grants
59940
60322
  * nothing: pairing still needs the six-digit code confirmed on both screens.
@@ -72232,7 +72614,15 @@ var NcRuleTargetSchema = zod.z.object({
72232
72614
  * - `schedule` — deliver to this target only inside these windows. A target
72233
72615
  * outside its window gets no outbox row and the skip is logged; the other
72234
72616
  * targets of the same fire still deliver.
72235
- * - `priority` — this target's canonical ordinal (1..5).
72617
+ * - `priority` — this target's canonical ordinal (1..5). An editor offers the
72618
+ * kind's DECLARED levels (`caps.levels`), each with its own ordinal.
72619
+ * - `attachment` — which of the pictures the rule produced this target
72620
+ * receives: `none`, `image`, `clip` (video) or `gif`. It narrows, never adds:
72621
+ * the rule's media policy decides what exists (#487, operator 2026-11-10).
72622
+ * - `actions: false` — this target gets no action buttons.
72623
+ *
72624
+ * The same settings apply to EVERY delivery a rule makes — an event, a
72625
+ * summary, a timelapse, a calendar digest (D1032).
72236
72626
  *
72237
72627
  * The notifier's own declared knobs (D938 `deliveryParams`: sound, critical,
72238
72628
  * volume…) stay where they already live per target: the rule target's
@@ -72244,13 +72634,23 @@ var NcRuleTargetSchema = zod.z.object({
72244
72634
  * (D1030).
72245
72635
  */
72246
72636
  var NC_TEMPLATE_TITLE_MAX_CHARS = 500;
72637
+ /** Which picture kind one target receives (#487). */
72638
+ var NcTargetAttachmentSchema = zod.z.enum([
72639
+ "none",
72640
+ "image",
72641
+ "clip",
72642
+ "gif"
72643
+ ]);
72247
72644
  var NcTargetOverrideSchema = zod.z.object({
72248
72645
  template: zod.z.object({
72249
72646
  title: zod.z.string().max(500).optional(),
72250
72647
  body: zod.z.string().max(2e3).optional()
72251
72648
  }).optional(),
72252
72649
  schedule: NcScheduleSchema.optional(),
72253
- priority: zod.z.number().int().min(1).max(5).optional()
72650
+ priority: zod.z.number().int().min(1).max(5).optional(),
72651
+ attachment: NcTargetAttachmentSchema.optional(),
72652
+ /** `false` = no buttons for this target; `true` is the same as absent. */
72653
+ actions: zod.z.boolean().optional()
72254
72654
  });
72255
72655
  /** Per-target settings keyed by target id (#487). */
72256
72656
  var NcTargetOverridesSchema = zod.z.record(zod.z.string(), NcTargetOverrideSchema);
@@ -78752,18 +79152,18 @@ var powerSourceCapability = {
78752
79152
  mode: "singleton",
78753
79153
  deviceTypes: POWER_SOURCE_DEVICE_TYPES,
78754
79154
  methods: {
78755
- getStatus: require_sleep.systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }),
79155
+ getStatus: require_sleep.systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "protected" }),
78756
79156
  powerOn: require_sleep.systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
78757
79157
  kind: "mutation",
78758
- auth: "admin"
79158
+ auth: "protected"
78759
79159
  }),
78760
79160
  powerOff: require_sleep.systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
78761
79161
  kind: "mutation",
78762
- auth: "admin"
79162
+ auth: "protected"
78763
79163
  }),
78764
79164
  forceRestart: require_sleep.systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
78765
79165
  kind: "mutation",
78766
- auth: "admin"
79166
+ auth: "protected"
78767
79167
  })
78768
79168
  },
78769
79169
  runtimeState: PowerSourceStateSchema,
@@ -90531,6 +90931,7 @@ var CAPABILITY_NAMES = {
90531
90931
  cameraStreams: "camera-streams",
90532
90932
  carbonMonoxide: "carbon-monoxide",
90533
90933
  climateControl: "climate-control",
90934
+ clusterUpdate: "cluster-update",
90534
90935
  color: "color",
90535
90936
  composer: "composer",
90536
90937
  connectivity: "connectivity",
@@ -90847,6 +91248,10 @@ var CAPABILITY_ROUTER_KEYS = [
90847
91248
  key: "climateControl",
90848
91249
  name: "climate-control"
90849
91250
  },
91251
+ {
91252
+ key: "clusterUpdate",
91253
+ name: "cluster-update"
91254
+ },
90850
91255
  {
90851
91256
  key: "color",
90852
91257
  name: "color"
@@ -91570,6 +91975,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
91570
91975
  cameraStreamsCapability,
91571
91976
  carbonMonoxideCapability,
91572
91977
  climateControlCapability,
91978
+ clusterUpdateCapability,
91573
91979
  colorCapability,
91574
91980
  composerCapability,
91575
91981
  connectivityCapability,
@@ -100557,9 +100963,11 @@ function isBatteryPresenceFault(presence) {
100557
100963
  * priority-in-sync.ts` fails the build when either drifts — the comment that
100558
100964
  * used to ask for this could not.
100559
100965
  *
100560
- * The rule has three halves and the ORDER matters: an operator's explicit pick
100561
- * wins outright; else a declaration on the device type
100562
- * ({@link CONTAINER_PRIMARY_CHILD_RULES}); else role, namesake, then type
100966
+ * The rule has four steps and the ORDER matters: an operator's explicit pick
100967
+ * wins outright; else the container's own declaration, an ordered list of
100968
+ * child keys its provider stamped at create
100969
+ * ({@link ContainerPrimaryChildPreference}); else a declaration on the device
100970
+ * type ({@link CONTAINER_PRIMARY_CHILD_RULES}); else role, namesake, then type
100563
100971
  * priority. The pick is keyed on the child's re-sync-stable `entityId`, not
100564
100972
  * its numeric id, so it survives a re-sync that reallocates ids.
100565
100973
  */
@@ -100572,6 +100980,25 @@ var CONTAINER_PRIMARY_CHILD_RULES = [{
100572
100980
  deviceType: require_composed_stable_id.DeviceType.HeatPump,
100573
100981
  primary: "self"
100574
100982
  }];
100983
+ /** The declaration of a container read from its meta, or undefined when it declared none. */
100984
+ function primaryChildPreferenceOf(container) {
100985
+ const keys = container.primaryChildPreference;
100986
+ if (container.stableId === void 0 || keys === void 0 || keys === null) return void 0;
100987
+ if (keys.length === 0) return void 0;
100988
+ return {
100989
+ parentStableId: container.stableId,
100990
+ childKeys: keys
100991
+ };
100992
+ }
100993
+ /** The first declared child that exists, or undefined when none does. */
100994
+ function applyPrimaryChildPreference(preference, children) {
100995
+ if (preference === void 0) return void 0;
100996
+ for (const key of preference.childKeys) {
100997
+ const expected = `${preference.parentStableId}-${key}`;
100998
+ const match = children.find((child) => child.stableId === expected);
100999
+ if (match !== void 0) return match;
101000
+ }
101001
+ }
100575
101002
  /**
100576
101003
  * The type declaration, before the heuristic. `fall-through` means the
100577
101004
  * heuristic still decides: the type declared nothing, or it named a child
@@ -100679,7 +101106,8 @@ function rank(type) {
100679
101106
  }
100680
101107
  /**
100681
101108
  * The child a container stands for: the operator's pick when it still exists,
100682
- * else the device type's declaration, else the highest-priority type. `null`
101109
+ * else the container's declared preference, else the device type's
101110
+ * declaration, else the highest-priority type. `null`
100683
101111
  * for a childless container, and for a type that stands for itself — a caller
100684
101112
  * must decide what "no child" means for it, rather than being handed a child
100685
101113
  * that is not the device.
@@ -100711,11 +101139,13 @@ function sameName(childName, containerName) {
100711
101139
  const flatten = (v) => v.toLowerCase().replace(/[-_\s]+/g, " ").trim();
100712
101140
  return flatten(childName) === flatten(containerName);
100713
101141
  }
100714
- function resolveContainerPrimaryChild(children, overrideEntityId, containerName, containerType) {
101142
+ function resolveContainerPrimaryChild(children, overrideEntityId, containerName, containerType, preference) {
100715
101143
  if (overrideEntityId !== void 0 && overrideEntityId !== null) {
100716
101144
  const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
100717
101145
  if (picked !== void 0) return picked;
100718
101146
  }
101147
+ const preferred = applyPrimaryChildPreference(preference, children);
101148
+ if (preferred !== void 0) return preferred;
100719
101149
  const declared = applyPrimaryChildRule(CONTAINER_PRIMARY_CHILD_RULES.find((entry) => entry.deviceType === containerType), children);
100720
101150
  if (declared.kind === "none") return null;
100721
101151
  if (declared.kind === "child") return declared.child;
@@ -100768,7 +101198,7 @@ function expandContainer(id, byId, byParent, visited, out) {
100768
101198
  type: c.type,
100769
101199
  ...c.role !== void 0 && c.role !== null ? { role: c.role } : {},
100770
101200
  ...c.name !== void 0 ? { name: c.name } : {}
100771
- })), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name, candidate.type);
101201
+ })), candidate.primaryChildEntityId, candidate.name, candidate.type, primaryChildPreferenceOf(candidate));
100772
101202
  if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
100773
101203
  }
100774
101204
  /**
@@ -103861,7 +104291,10 @@ var powerSourceContribution = contribution("power-source", PowerSourceStateSchem
103861
104291
  /** The remote cap has no status: the model's input carries how many commands it holds. */
103862
104292
  var remoteContribution = {
103863
104293
  cap: "remote",
103864
- contribute: (_slice, ctx) => ctx.remoteCommands === 0 ? {} : { remote: { commands: ctx.remoteCommands } }
104294
+ contribute: (_slice, ctx) => ctx.remoteCommands === 0 ? {} : { remote: {
104295
+ commands: ctx.remoteCommands,
104296
+ open: action(REMOTE_OPEN_ACTION_ID, require_sleep.t("Remote", "Telecomando"), "gamepad-2", "remote", "open")
104297
+ } }
103865
104298
  };
103866
104299
  var ATTENTION_STATUSES = [
103867
104300
  "low",
@@ -105303,7 +105736,10 @@ function buildHeroModel(input) {
105303
105736
  };
105304
105737
  const allRows = fragments.flatMap((f) => f.rows ?? []);
105305
105738
  const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
105306
- return allRows.filter((r) => r.id === id);
105739
+ return allRows.filter((r) => r.id === id).map((r) => HERO_SCENE_ROW_IDS.has(r.id) ? {
105740
+ ...r,
105741
+ placement: "scene"
105742
+ } : r);
105307
105743
  });
105308
105744
  const ownPower = resolveOwnPower(fragments.flatMap((f) => f.ownPower === void 0 ? [] : [f.ownPower]));
105309
105745
  const timedRun = fragments.find((f) => f.timedRun !== void 0)?.timedRun ?? null;
@@ -106707,6 +107143,27 @@ var METHOD_ACCESS_MAP = Object.freeze({
106707
107143
  access: "create",
106708
107144
  role: "viewer"
106709
107145
  },
107146
+ "clusterUpdate.getClusterUpdateJob": {
107147
+ capName: "cluster-update",
107148
+ capScope: "system",
107149
+ addonId: null,
107150
+ access: "view",
107151
+ role: "admin"
107152
+ },
107153
+ "clusterUpdate.previewClusterUpdate": {
107154
+ capName: "cluster-update",
107155
+ capScope: "system",
107156
+ addonId: null,
107157
+ access: "view",
107158
+ role: "admin"
107159
+ },
107160
+ "clusterUpdate.startClusterUpdate": {
107161
+ capName: "cluster-update",
107162
+ capScope: "system",
107163
+ addonId: null,
107164
+ access: "create",
107165
+ role: "admin"
107166
+ },
106710
107167
  "color.getStatus": {
106711
107168
  capName: "color",
106712
107169
  capScope: "device",
@@ -108079,6 +108536,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
108079
108536
  access: "create",
108080
108537
  role: "admin"
108081
108538
  },
108539
+ "deviceManager.search": {
108540
+ capName: "device-manager",
108541
+ capScope: "system",
108542
+ addonId: null,
108543
+ access: "view",
108544
+ role: "viewer"
108545
+ },
108082
108546
  "deviceManager.setAlias": {
108083
108547
  capName: "device-manager",
108084
108548
  capScope: "system",
@@ -108170,6 +108634,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
108170
108634
  access: "create",
108171
108635
  role: "admin"
108172
108636
  },
108637
+ "deviceManager.setPrimaryChildPreference": {
108638
+ capName: "device-manager",
108639
+ capScope: "system",
108640
+ addonId: null,
108641
+ access: "create",
108642
+ role: "admin"
108643
+ },
108173
108644
  "deviceManager.setRole": {
108174
108645
  capName: "device-manager",
108175
108646
  capScope: "system",
@@ -112809,28 +113280,28 @@ var METHOD_ACCESS_MAP = Object.freeze({
112809
113280
  capScope: "device",
112810
113281
  addonId: null,
112811
113282
  access: "create",
112812
- role: "admin"
113283
+ role: "viewer"
112813
113284
  },
112814
113285
  "powerSource.getStatus": {
112815
113286
  capName: "power-source",
112816
113287
  capScope: "device",
112817
113288
  addonId: null,
112818
113289
  access: "view",
112819
- role: "admin"
113290
+ role: "viewer"
112820
113291
  },
112821
113292
  "powerSource.powerOff": {
112822
113293
  capName: "power-source",
112823
113294
  capScope: "device",
112824
113295
  addonId: null,
112825
113296
  access: "create",
112826
- role: "admin"
113297
+ role: "viewer"
112827
113298
  },
112828
113299
  "powerSource.powerOn": {
112829
113300
  capName: "power-source",
112830
113301
  capScope: "device",
112831
113302
  addonId: null,
112832
113303
  access: "create",
112833
- role: "admin"
113304
+ role: "viewer"
112834
113305
  },
112835
113306
  "presence.getStatus": {
112836
113307
  capName: "presence",
@@ -115895,6 +116366,7 @@ var KNOWN_CAP_NAMES = [
115895
116366
  "camera-streams",
115896
116367
  "carbon-monoxide",
115897
116368
  "climate-control",
116369
+ "cluster-update",
115898
116370
  "color",
115899
116371
  "composer",
115900
116372
  "connectivity",
@@ -116194,6 +116666,7 @@ var SYSTEM_CAP_NAMES = [
116194
116666
  "broker",
116195
116667
  "calendar-source",
116196
116668
  "calendars",
116669
+ "cluster-update",
116197
116670
  "composer",
116198
116671
  "core-blocks",
116199
116672
  "custom-model-registry",
@@ -118989,6 +119462,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
118989
119462
  form: "single",
118990
119463
  optional: false
118991
119464
  }],
119465
+ "deviceManager.setPrimaryChildPreference": [{
119466
+ name: "deviceId",
119467
+ form: "single",
119468
+ optional: false
119469
+ }],
118992
119470
  "deviceManager.setRole": [{
118993
119471
  name: "deviceId",
118994
119472
  form: "single",
@@ -121433,6 +121911,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
121433
121911
  "deviceManager.setMetadata",
121434
121912
  "deviceManager.setName",
121435
121913
  "deviceManager.setPrimaryChildEntityId",
121914
+ "deviceManager.setPrimaryChildPreference",
121436
121915
  "deviceManager.setRole",
121437
121916
  "deviceManager.setStreamProfileMap",
121438
121917
  "deviceManager.setType",
@@ -122683,6 +123162,11 @@ function createSystemProxy(api) {
122683
123162
  getPreferences: (input) => dispatch("calendars", "getPreferences", "query", input),
122684
123163
  setCalendarPreference: (input) => dispatch("calendars", "setCalendarPreference", "mutation", input)
122685
123164
  },
123165
+ clusterUpdate: {
123166
+ previewClusterUpdate: (input) => dispatch("clusterUpdate", "previewClusterUpdate", "query", input),
123167
+ startClusterUpdate: (input) => dispatch("clusterUpdate", "startClusterUpdate", "mutation", input),
123168
+ getClusterUpdateJob: (input) => dispatch("clusterUpdate", "getClusterUpdateJob", "query", input)
123169
+ },
122686
123170
  coreBlocks: {
122687
123171
  list: (input) => dispatch("coreBlocks", "list", "query", input),
122688
123172
  get: (input) => dispatch("coreBlocks", "get", "query", input),
@@ -122778,6 +123262,7 @@ function createSystemProxy(api) {
122778
123262
  setLocationZone: (input) => dispatch("deviceManager", "setLocationZone", "mutation", input),
122779
123263
  listPersistedByAddon: (input) => dispatch("deviceManager", "listPersistedByAddon", "query", input),
122780
123264
  listAll: (input) => dispatch("deviceManager", "listAll", "query", input),
123265
+ search: (input) => dispatch("deviceManager", "search", "query", input),
122781
123266
  getChildren: (input) => dispatch("deviceManager", "getChildren", "query", input),
122782
123267
  getChildrenBatch: (input) => dispatch("deviceManager", "getChildrenBatch", "query", input),
122783
123268
  getLinkedDevicesBatch: (input) => dispatch("deviceManager", "getLinkedDevicesBatch", "query", input),
@@ -124146,6 +124631,7 @@ function prepareNotification(caps, n) {
124146
124631
  sound,
124147
124632
  ttl,
124148
124633
  tag,
124634
+ ...n.delivery !== void 0 ? { delivery: n.delivery } : {},
124149
124635
  bodyParts,
124150
124636
  renderedAs
124151
124637
  };
@@ -124283,6 +124769,44 @@ function deliverableFields(caps) {
124283
124769
  };
124284
124770
  return NOTIFICATION_FIELDS.filter((field) => supported[field]);
124285
124771
  }
124772
+ /** The picture kind a produced media type belongs to. */
124773
+ var KIND_OF_MEDIA = {
124774
+ image: "image",
124775
+ video: "clip",
124776
+ gif: "gif"
124777
+ };
124778
+ /**
124779
+ * The picture kinds a target may be set to receive: `none` plus one per media
124780
+ * type the notifier declares (`caps.attachments.mediaTypes`). Empty when the
124781
+ * kind takes no attachment at all — there is nothing to choose.
124782
+ */
124783
+ function attachmentKindsOf(caps) {
124784
+ if (caps.attachments.max <= 0) return [];
124785
+ const kinds = caps.attachments.mediaTypes.flatMap((type) => {
124786
+ const kind = KIND_OF_MEDIA[type];
124787
+ return kind === void 0 ? [] : [kind];
124788
+ });
124789
+ return kinds.length === 0 ? [] : ["none", ...new Set(kinds)];
124790
+ }
124791
+ /**
124792
+ * Whether a target set to `kind` receives an attachment of `mediaType`.
124793
+ * Absent = every kind the rule produced; an icon or audio part is never
124794
+ * narrowed (it is not a picture of the event).
124795
+ */
124796
+ function targetAttachmentAllows(kind, mediaType) {
124797
+ if (kind === void 0) return true;
124798
+ const own = KIND_OF_MEDIA[mediaType];
124799
+ if (own === void 0) return true;
124800
+ return kind !== "none" && kind === own;
124801
+ }
124802
+ /**
124803
+ * The levels a notifier declares that a rule can pick between: the ones that
124804
+ * map to a canonical ordinal, in ordinal order. The editor labels the choice
124805
+ * with the level's own label (Alexa: normal / high) and stores its ordinal.
124806
+ */
124807
+ function priorityLevelsOf(caps) {
124808
+ return caps.levels.filter((level) => level.ordinal !== null).toSorted((a, b) => (a.ordinal ?? 0) - (b.ordinal ?? 0));
124809
+ }
124286
124810
  /**
124287
124811
  * The union of what the selected targets deliver, with the targets that drop
124288
124812
  * each field. No selection shows every field: a rule that addresses only users
@@ -124314,10 +124838,14 @@ function sanitizeTargetOverride(override, fields) {
124314
124838
  ...body !== void 0 ? { body } : {}
124315
124839
  } : void 0;
124316
124840
  const priority = has("priority") ? override.priority : void 0;
124841
+ const attachment = has("attachments") ? override.attachment : void 0;
124842
+ const noButtons = has("actions") && override.actions === false;
124317
124843
  const next = {
124318
124844
  ...template !== void 0 ? { template } : {},
124319
124845
  ...override.schedule !== void 0 && override.schedule.windows.length > 0 ? { schedule: override.schedule } : {},
124320
- ...priority !== void 0 ? { priority } : {}
124846
+ ...priority !== void 0 ? { priority } : {},
124847
+ ...attachment !== void 0 ? { attachment } : {},
124848
+ ...noButtons ? { actions: false } : {}
124321
124849
  };
124322
124850
  return Object.keys(next).length > 0 ? next : void 0;
124323
124851
  }
@@ -129261,7 +129789,9 @@ var TimelapseRuleInputSchema = zod.z.object({
129261
129789
  /** Classes the notification counts — see {@link ReportClassesField}. */
129262
129790
  reportClasses: ReportClassesField.optional(),
129263
129791
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
129264
- priority: PriorityField.default(3)
129792
+ priority: PriorityField.default(3),
129793
+ /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
129794
+ targetOverrides: NcTargetOverridesSchema.optional()
129265
129795
  });
129266
129796
  /**
129267
129797
  * The caption a rule that never set one gets.
@@ -129301,7 +129831,9 @@ var TimelapseRulePatchSchema = zod.z.object({
129301
129831
  previewText: PreviewTextField.optional(),
129302
129832
  previewMode: PreviewModeField.optional(),
129303
129833
  reportClasses: ReportClassesField.optional(),
129304
- priority: PriorityField.optional()
129834
+ priority: PriorityField.optional(),
129835
+ /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
129836
+ targetOverrides: NcTargetOverridesSchema.optional()
129305
129837
  });
129306
129838
  /** A persisted timelapse rule. */
129307
129839
  var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
@@ -135492,6 +136024,15 @@ exports.ClipWakeSchema = ClipWakeSchema;
135492
136024
  exports.ClusterAddonNodeDeploymentSchema = ClusterAddonNodeDeploymentSchema;
135493
136025
  exports.ClusterAddonStatusEntrySchema = ClusterAddonStatusEntrySchema;
135494
136026
  exports.ClusterModelChoiceSchema = ClusterModelChoiceSchema;
136027
+ exports.ClusterUpdateBlockerSchema = ClusterUpdateBlockerSchema;
136028
+ exports.ClusterUpdateFailureReasonSchema = ClusterUpdateFailureReasonSchema;
136029
+ exports.ClusterUpdateJobSchema = ClusterUpdateJobSchema;
136030
+ exports.ClusterUpdateJobStateSchema = ClusterUpdateJobStateSchema;
136031
+ exports.ClusterUpdateOptionsSchema = ClusterUpdateOptionsSchema;
136032
+ exports.ClusterUpdatePlanSchema = ClusterUpdatePlanSchema;
136033
+ exports.ClusterUpdateStepKindSchema = ClusterUpdateStepKindSchema;
136034
+ exports.ClusterUpdateStepSchema = ClusterUpdateStepSchema;
136035
+ exports.ClusterUpdateStepStatusSchema = ClusterUpdateStepStatusSchema;
135495
136036
  exports.CollectionColumnSchema = CollectionColumnSchema;
135496
136037
  exports.CollectionIndexSchema = CollectionIndexSchema;
135497
136038
  exports.ColorStatusSchema = ColorStatusSchema;
@@ -135676,6 +136217,8 @@ exports.DEVICE_RUNS_MAX_PAGE = DEVICE_RUNS_MAX_PAGE;
135676
136217
  exports.DEVICE_SAN_CREDENTIAL_PREFIX = DEVICE_SAN_CREDENTIAL_PREFIX;
135677
136218
  exports.DEVICE_SAN_USER_PREFIX = DEVICE_SAN_USER_PREFIX;
135678
136219
  exports.DEVICE_SCOPED_CAPS = require_sleep.DEVICE_SCOPED_CAPS;
136220
+ exports.DEVICE_SEARCH_DEFAULT_LIMIT = DEVICE_SEARCH_DEFAULT_LIMIT;
136221
+ exports.DEVICE_SEARCH_MAX_LIMIT = DEVICE_SEARCH_MAX_LIMIT;
135679
136222
  exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS = require_sleep.DEVICE_SETTINGS_CONTRIBUTION_METHODS;
135680
136223
  exports.DEVICE_SIGNATURE_MESSAGE_VERSION = DEVICE_SIGNATURE_MESSAGE_VERSION;
135681
136224
  exports.DEVICE_STATE_READERS = DEVICE_STATE_READERS;
@@ -135777,6 +136320,14 @@ exports.DeviceRunSchema = DeviceRunSchema;
135777
136320
  exports.DeviceRunSourceSchema = DeviceRunSourceSchema;
135778
136321
  exports.DeviceRunStateSchema = DeviceRunStateSchema;
135779
136322
  exports.DeviceRuntimeState = DeviceRuntimeState;
136323
+ exports.DeviceSearchFacetIntegrationSchema = DeviceSearchFacetIntegrationSchema;
136324
+ exports.DeviceSearchFacetValueSchema = DeviceSearchFacetValueSchema;
136325
+ exports.DeviceSearchFacetsSchema = DeviceSearchFacetsSchema;
136326
+ exports.DeviceSearchFiltersSchema = DeviceSearchFiltersSchema;
136327
+ exports.DeviceSearchInputSchema = DeviceSearchInputSchema;
136328
+ exports.DeviceSearchItemSchema = DeviceSearchItemSchema;
136329
+ exports.DeviceSearchRequiresSchema = DeviceSearchRequiresSchema;
136330
+ exports.DeviceSearchResultSchema = DeviceSearchResultSchema;
135780
136331
  exports.DeviceSelectorSchema = DeviceSelectorSchema;
135781
136332
  exports.DeviceSignaturePurposeSchema = DeviceSignaturePurposeSchema;
135782
136333
  exports.DeviceStatusSchema = DeviceStatusSchema;
@@ -135789,6 +136340,7 @@ exports.DeviceTemplateValueSchema = DeviceTemplateValueSchema;
135789
136340
  exports.DeviceTombstoneSchema = DeviceTombstoneSchema;
135790
136341
  exports.DeviceTransitionSchema = require_sleep.DeviceTransitionSchema;
135791
136342
  exports.DeviceType = require_composed_stable_id.DeviceType;
136343
+ exports.DeviceValueOptionSchema = DeviceValueOptionSchema;
135792
136344
  exports.DiagnosticIdSchema = DiagnosticIdSchema;
135793
136345
  exports.DiagnosticWindowPatchSchema = DiagnosticWindowPatchSchema;
135794
136346
  exports.DiagnosticWindowSchema = DiagnosticWindowSchema;
@@ -136033,6 +136585,7 @@ exports.HISTORY_UNIT_LABELS = require_sleep.HISTORY_UNIT_LABELS;
136033
136585
  exports.HOURS_PER_DAY = HOURS_PER_DAY;
136034
136586
  exports.HOUR_MS = require_implemented_methods.HOUR_MS;
136035
136587
  exports.HUB_ADDRESS_ROLES = HUB_ADDRESS_ROLES;
136588
+ exports.HUB_ID_PATTERN = HUB_ID_PATTERN;
136036
136589
  exports.HUB_MDNS_QUERY_NAME = HUB_MDNS_QUERY_NAME;
136037
136590
  exports.HUB_MDNS_ROLE = HUB_MDNS_ROLE;
136038
136591
  exports.HUB_MDNS_SERVICE_TYPE = HUB_MDNS_SERVICE_TYPE;
@@ -136609,6 +137162,7 @@ exports.NcSystemEventDeliveryModeSchema = NcSystemEventDeliveryModeSchema;
136609
137162
  exports.NcSystemEventDeliverySchema = NcSystemEventDeliverySchema;
136610
137163
  exports.NcSystemEventDeliveryToggleSchema = NcSystemEventDeliveryToggleSchema;
136611
137164
  exports.NcSystemEventKindSchema = NcSystemEventKindSchema;
137165
+ exports.NcTargetAttachmentSchema = NcTargetAttachmentSchema;
136612
137166
  exports.NcTargetOverrideSchema = NcTargetOverrideSchema;
136613
137167
  exports.NcTargetOverridesSchema = NcTargetOverridesSchema;
136614
137168
  exports.NcTaxonomyEntrySchema = NcTaxonomyEntrySchema;
@@ -136900,6 +137454,7 @@ exports.REMOTE_GROUP_FRAMES = REMOTE_GROUP_FRAMES;
136900
137454
  exports.REMOTE_KNOWN_ROLES = REMOTE_KNOWN_ROLES;
136901
137455
  exports.REMOTE_MAX_REPEAT = REMOTE_MAX_REPEAT;
136902
137456
  exports.REMOTE_MEDIA_COMMANDS = REMOTE_MEDIA_COMMANDS;
137457
+ exports.REMOTE_OPEN_ACTION_ID = REMOTE_OPEN_ACTION_ID;
136903
137458
  exports.REMOTE_REFUSAL_REASONS = REMOTE_REFUSAL_REASONS;
136904
137459
  exports.REMOTE_ROLE_VOCABULARY = REMOTE_ROLE_VOCABULARY;
136905
137460
  exports.REMOTE_SOURCE_KINDS = REMOTE_SOURCE_KINDS;
@@ -137278,6 +137833,7 @@ exports.StaleDataReportSchema = StaleDataReportSchema;
137278
137833
  exports.StaleDevicePinSchema = StaleDevicePinSchema;
137279
137834
  exports.StaleKindFindingSchema = StaleKindFindingSchema;
137280
137835
  exports.StaleSettingsKeyFindingSchema = StaleSettingsKeyFindingSchema;
137836
+ exports.StartClusterUpdateResultSchema = StartClusterUpdateResultSchema;
137281
137837
  exports.StartEmbeddedInputSchema = StartEmbeddedInputSchema;
137282
137838
  exports.StartEnrollmentOutputSchema = StartEnrollmentOutputSchema;
137283
137839
  exports.StationaryObjectSchema = StationaryObjectSchema;
@@ -137634,6 +138190,7 @@ exports.applyModeDelaysEdits = applyModeDelaysEdits;
137634
138190
  exports.applyModeDeviceListEdit = applyModeDeviceListEdit;
137635
138191
  exports.applyModelBoundSettings = applyModelBoundSettings;
137636
138192
  exports.applyNonBlockingEdit = applyNonBlockingEdit;
138193
+ exports.applyPrimaryChildPreference = applyPrimaryChildPreference;
137637
138194
  exports.applyPrimaryChildRule = applyPrimaryChildRule;
137638
138195
  exports.applySecureOnArmEdit = applySecureOnArmEdit;
137639
138196
  exports.arithmeticDraft = arithmeticDraft;
@@ -137651,6 +138208,7 @@ exports.assertTimelapseCadences = assertTimelapseCadences;
137651
138208
  exports.assertTransactScope = require_sleep.assertTransactScope;
137652
138209
  exports.assertValidDeclaration = require_sleep.assertValidDeclaration;
137653
138210
  exports.assignNodeColorId = require_node_color.assignNodeColorId;
138211
+ exports.attachmentKindsOf = attachmentKindsOf;
137654
138212
  exports.audioAnalysisCapability = audioAnalysisCapability;
137655
138213
  exports.audioAnalyzerCapability = audioAnalyzerCapability;
137656
138214
  exports.audioChunkBytesPerSample = require_sleep.audioChunkBytesPerSample;
@@ -137770,6 +138328,7 @@ exports.cloneStatefulExpressionMemory = require_implemented_methods.cloneStatefu
137770
138328
  exports.clusterModelSettingKey = clusterModelSettingKey;
137771
138329
  exports.clusterStepSettingFieldsFor = clusterStepSettingFieldsFor;
137772
138330
  exports.clusterStepSettingKey = clusterStepSettingKey;
138331
+ exports.clusterUpdateCapability = clusterUpdateCapability;
137773
138332
  exports.codecIsAccepted = codecIsAccepted;
137774
138333
  exports.collectDeviceTemplates = collectDeviceTemplates;
137775
138334
  exports.collectHydratedFieldEntries = require_sleep.collectHydratedFieldEntries;
@@ -138204,6 +138763,7 @@ exports.isFirstLevelMacroClass = isFirstLevelMacroClass;
138204
138763
  exports.isForwardInputRef = require_implemented_methods.isForwardInputRef;
138205
138764
  exports.isHeldBackTemplateVar = isHeldBackTemplateVar;
138206
138765
  exports.isHistoryHelper = require_implemented_methods.isHistoryHelper;
138766
+ exports.isHubId = isHubId;
138207
138767
  exports.isIconKey = isIconKey;
138208
138768
  exports.isInstanceEnabled = require_sleep.isInstanceEnabled;
138209
138769
  exports.isInternalActionId = isInternalActionId;
@@ -138514,7 +139074,9 @@ exports.presenceCapability = presenceCapability;
138514
139074
  exports.presetById = presetById;
138515
139075
  exports.pressureSensorCapability = pressureSensorCapability;
138516
139076
  exports.primaryCapForRole = primaryCapForRole;
139077
+ exports.primaryChildPreferenceOf = primaryChildPreferenceOf;
138517
139078
  exports.principalMayReachAddon = principalMayReachAddon;
139079
+ exports.priorityLevelsOf = priorityLevelsOf;
138518
139080
  exports.privacyMaskCapability = privacyMaskCapability;
138519
139081
  exports.probeToTestResult = probeToTestResult;
138520
139082
  exports.problemsBlockSave = problemsBlockSave;
@@ -138857,6 +139419,7 @@ exports.systemEventSummarySplitOf = systemEventSummarySplitOf;
138857
139419
  exports.systemFamilyOfKind = systemFamilyOfKind;
138858
139420
  exports.systemRuleKindOf = systemRuleKindOf;
138859
139421
  exports.tamperCapability = tamperCapability;
139422
+ exports.targetAttachmentAllows = targetAttachmentAllows;
138860
139423
  exports.targetBody = targetBody;
138861
139424
  exports.targetFeature = targetFeature;
138862
139425
  exports.targetOfRecord = targetOfRecord;