@camstack/system 1.2.453 → 1.2.455

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 (97) hide show
  1. package/dist/{agent-https-DL2cFOQv.js → agent-https-CCvlRQKV.js} +2 -2
  2. package/dist/{agent-https-XAZFJjOS.mjs → agent-https-CLWrOO3o.mjs} +2 -2
  3. package/dist/auth/auth-audit-log.d.ts +1 -1
  4. package/dist/auth/auth-manager.d.ts +7 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alert-episode-policy.d.ts +39 -0
  10. package/dist/builtins/alerts/alerts.addon.d.ts +25 -38
  11. package/dist/builtins/alerts/alerts.addon.js +178 -423
  12. package/dist/builtins/alerts/alerts.addon.mjs +178 -423
  13. package/dist/builtins/alerts/emit-alert-policy.d.ts +3 -16
  14. package/dist/builtins/alerts/runner-alert.d.ts +0 -13
  15. package/dist/builtins/autotrack/index.js +1 -1
  16. package/dist/builtins/autotrack/index.mjs +1 -1
  17. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  18. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  19. package/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/dist/builtins/camera-grid/index.js +1 -1
  22. package/dist/builtins/camera-grid/index.mjs +1 -1
  23. package/dist/builtins/composer/composer.addon.js +2 -2
  24. package/dist/builtins/composer/composer.addon.mjs +2 -2
  25. package/dist/builtins/console-logging/index.js +1 -1
  26. package/dist/builtins/console-logging/index.mjs +1 -1
  27. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  28. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  29. package/dist/builtins/device-history/device-history.addon.js +1 -1
  30. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  31. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  32. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  33. package/dist/builtins/hub-forwarder/index.js +1 -1
  34. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  35. package/dist/builtins/keychain/index.js +4 -4
  36. package/dist/builtins/keychain/index.mjs +4 -4
  37. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  38. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  39. package/dist/builtins/local-auth/local-auth.addon.js +14 -4
  40. package/dist/builtins/local-auth/local-auth.addon.mjs +14 -4
  41. package/dist/builtins/local-network/local-network.addon.js +2 -2
  42. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  43. package/dist/builtins/loki-logging/index.js +1 -1
  44. package/dist/builtins/loki-logging/index.mjs +1 -1
  45. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  46. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  47. package/dist/builtins/platform-probe/index.js +1 -1
  48. package/dist/builtins/platform-probe/index.mjs +1 -1
  49. package/dist/builtins/record-entries/index.js +22 -2
  50. package/dist/builtins/record-entries/index.mjs +22 -2
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  53. package/dist/builtins/snapshot/index.js +1 -1
  54. package/dist/builtins/snapshot/index.mjs +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  56. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/index.js +1 -1
  58. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  59. package/dist/builtins/sqlite-storage/records/records-engine.d.ts +13 -0
  60. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  62. package/dist/builtins/storage-orchestrator/location-class-paths.d.ts +13 -0
  63. package/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +6 -1
  64. package/dist/builtins/storage-orchestrator/location-repointer.d.ts +97 -0
  65. package/dist/builtins/storage-orchestrator/location-store.d.ts +13 -2
  66. package/dist/builtins/storage-orchestrator/record-kinds.d.ts +5 -0
  67. package/dist/builtins/storage-orchestrator/storage-location-band-monitor.d.ts +38 -4
  68. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +8 -2
  69. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +486 -143
  70. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +486 -143
  71. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +26 -1
  72. package/dist/builtins/system-config/system-config.addon.js +3 -3
  73. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  74. package/dist/builtins/winston-logging/index.js +1 -1
  75. package/dist/builtins/winston-logging/index.mjs +1 -1
  76. package/dist/{composition-sources-DwEvAg5Z.js → composition-sources-BxUkLNSo.js} +1 -1
  77. package/dist/{composition-sources-jYNpYEhS.mjs → composition-sources-CSzD5_qX.mjs} +1 -1
  78. package/dist/{constants-DGBB3tNi.mjs → constants-DOlYt1t1.mjs} +1 -1
  79. package/dist/{constants-B3fDUnJt.js → constants-DruwCkfp.js} +1 -1
  80. package/dist/{device-ca-njpTMpJC.js → device-ca-QPBgfqVY.js} +1 -1
  81. package/dist/{device-ca-Dpkxg7px.mjs → device-ca-uFbTyY_o.mjs} +1 -1
  82. package/dist/{dist-B9C2v4SG.mjs → dist-BpSENkRJ.mjs} +550 -240
  83. package/dist/{dist-DyjNaeIj.js → dist-DjQ8C-ku.js} +579 -239
  84. package/dist/file-host-worker.js +1 -1
  85. package/dist/file-host-worker.mjs +1 -1
  86. package/dist/{hub-mdns-ciao-DpdFaLz-.js → hub-mdns-ciao-Bkrvgnma.js} +2 -2
  87. package/dist/{hub-mdns-ciao-B4wHDMvk.mjs → hub-mdns-ciao-DlgkFJVY.mjs} +2 -2
  88. package/dist/index.js +7 -7
  89. package/dist/index.mjs +7 -7
  90. package/dist/{phase6-declare-gate-BlTDMI3t.js → phase6-declare-gate-DrmTtz7F.js} +1 -1
  91. package/dist/{phase6-declare-gate-CNxKbsvm.mjs → phase6-declare-gate-JQUqgQgq.mjs} +1 -1
  92. package/dist/{restore-archive-BeGP9IYs.js → restore-archive-4OP0EYg6.js} +1 -1
  93. package/dist/{restore-archive-D7HwsszI.mjs → restore-archive-YFSJRtKy.mjs} +1 -1
  94. package/dist/{wal-maintenance-i3GRvmQW.js → wal-maintenance-Bl0ZKjVR.js} +0 -0
  95. package/dist/{wal-maintenance-HEmw2Fik.mjs → wal-maintenance-TyuOEVy1.mjs} +0 -0
  96. package/package.json +1 -1
  97. package/dist/builtins/alerts/critical-push.d.ts +0 -90
@@ -1,6 +1,6 @@
1
1
  let zod = require("zod");
2
2
  require("node:crypto");
3
- //#region ../types/dist/event-category-BvOFi6PY.mjs
3
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -79,9 +79,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
79
79
  /**
80
80
  * The node's one-shot runner boot check (D877): planned runners against the
81
81
  * process service, `degraded` when any is failed, refused or missing. The
82
- * alert centre turns it into one alert and a direct critical push.
82
+ * alert centre turns it into one critical alert.
83
83
  */
84
84
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
85
+ /**
86
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
87
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
88
+ * centre sends no notification of its own: Notification Center turns this
89
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
90
+ * system-event kinds, and reconciles from the alerts store because a bus
91
+ * event may be dropped (D8, D11).
92
+ */
93
+ EventCategory["AlertEpisode"] = "alert.episode";
85
94
  EventCategory["AddonError"] = "addon.error";
86
95
  EventCategory["AddonPageReady"] = "addon.page-ready";
87
96
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -736,7 +745,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
736
745
  return EventCategory;
737
746
  }({});
738
747
  //#endregion
739
- //#region ../types/dist/sleep-BegKjwUu.mjs
748
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
740
749
  /**
741
750
  * The audio chunk plane's byte format, and the ONE expansion from a coded
742
751
  * window to float samples (D455).
@@ -3248,6 +3257,12 @@ function normalizeAddonInitResult(result) {
3248
3257
  * core proxy and the kernel listener) to keep both off a kernel↔core import.
3249
3258
  */
3250
3259
  var DATAPLANE_SECRET_HEADER = "x-camstack-dataplane-secret";
3260
+ /**
3261
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
3262
+ * and validates them (`share-token.service.ts` builds its enum from this
3263
+ * list); a data plane names the kinds it ACCEPTS in `share`.
3264
+ */
3265
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
3251
3266
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
3252
3267
  var PeerBytesTicketSchema = zod.z.object({
3253
3268
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -10383,6 +10398,235 @@ function scopesAllowDeviceCap(scopes, access) {
10383
10398
  function scopesAllowAddon(scopes, addonId, access) {
10384
10399
  return scopes.some((s) => s.type === "addon" && s.target === addonId && s.access.includes(access));
10385
10400
  }
10401
+ /**
10402
+ * Zod schemas for persisted record types.
10403
+ *
10404
+ * These schemas serve as the single source of truth for types that are
10405
+ * stored in the settings-store backend and retrieved via tRPC. They
10406
+ * replace the manual TypeScript interfaces with schema-derived types,
10407
+ * enabling runtime validation when reading from the backend.
10408
+ *
10409
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
10410
+ * keeps the original name for backward compatibility.
10411
+ */
10412
+ /**
10413
+ * Auth model (v2 — 2026-05-12 caps-only):
10414
+ *
10415
+ * Two principals:
10416
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
10417
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
10418
+ *
10419
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
10420
+ * `super_admin` — collapsed onto the single boolean because every
10421
+ * non-admin caller is governed by the same scope-check rules; the
10422
+ * distinction was only ever used to route role-specific procedures
10423
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
10424
+ * with `isAdmin: false` + an explicit scope list.
10425
+ */
10426
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
10427
+ var MethodAccessSchema = zod.z.enum([
10428
+ "view",
10429
+ "create",
10430
+ "delete"
10431
+ ]);
10432
+ /**
10433
+ * A single scope grant. Three forms — checked in matcher with OR
10434
+ * semantics; the first match decides whether the call passes:
10435
+ *
10436
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
10437
+ * cap with the matching `scope` declaration. New caps inherit grants
10438
+ * automatically — adding a device cap to the codebase makes it
10439
+ * reachable to every user with `category:device [...]` without a
10440
+ * re-grant. Use this for "family viewer" / "operator" tiers.
10441
+ *
10442
+ * - `addon` — every cap that ships inside a given addon id. Niche;
10443
+ * useful when an integration needs to interact with one specific
10444
+ * addon's surface regardless of how many caps it exports.
10445
+ *
10446
+ * - `capability` — the most precise form. Single cap name. Use for
10447
+ * integration tokens where you want to grant `addons.installPackage`
10448
+ * and nothing else.
10449
+ *
10450
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
10451
+ * "give me everything" escape; there is no wildcard scope.
10452
+ */
10453
+ var AllowedProviderSchema = zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]);
10454
+ var AllowedDevicesSchema = zod.z.record(zod.z.string(), zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]));
10455
+ var CapScopeSchema = zod.z.enum(["device", "system"]);
10456
+ /**
10457
+ * DeviceSelector (scope model v3 — 2026-08-12).
10458
+ *
10459
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
10460
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
10461
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
10462
+ * AFTER the grant was minted — no re-grant, no re-login.
10463
+ *
10464
+ * - `all` — every device in the deployment. The broad viewer/operator
10465
+ * lever without a `category` grant (a `category` grant also covers device
10466
+ * caps that carry no deviceId; `all` is specifically the device set).
10467
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
10468
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
10469
+ * is NOT covered until the grant is edited.
10470
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
10471
+ * DYNAMIC. A device that changes type, or a new device of the type,
10472
+ * re-resolves on the next request.
10473
+ * - `locations` — every device whose operator-assigned `location` label is
10474
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
10475
+ * null/unset location matches NO `locations` selector.
10476
+ */
10477
+ var DeviceSelectorSchema = zod.z.discriminatedUnion("kind", [
10478
+ zod.z.object({ kind: zod.z.literal("all") }),
10479
+ zod.z.object({
10480
+ kind: zod.z.literal("ids"),
10481
+ ids: zod.z.array(zod.z.number().int()).min(1)
10482
+ }),
10483
+ zod.z.object({
10484
+ kind: zod.z.literal("types"),
10485
+ types: zod.z.array(zod.z.enum(DeviceType)).min(1)
10486
+ }),
10487
+ zod.z.object({
10488
+ kind: zod.z.literal("locations"),
10489
+ locations: zod.z.array(zod.z.string().min(1)).min(1)
10490
+ })
10491
+ ]);
10492
+ var DeviceTokenScopeSchema = zod.z.object({
10493
+ type: zod.z.literal("device"),
10494
+ /** The device SET this grant covers — resolved against the live fleet. */
10495
+ selector: DeviceSelectorSchema,
10496
+ access: zod.z.array(MethodAccessSchema).min(1),
10497
+ /**
10498
+ * Whether a grant on a PARENT device transparently covers its accessory
10499
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
10500
+ * Direction is parent → children ONLY.
10501
+ *
10502
+ * Absent → the matcher DERIVES it from the access flavour: `view`
10503
+ * inherits (a camera viewer sees the camera's accessories), `create` /
10504
+ * `delete` do NOT (actuating/removing a child is an explicit act the
10505
+ * operator must grant on the child, not inherit from the parent). Set it
10506
+ * explicitly to override that default per grant.
10507
+ */
10508
+ includeLinked: zod.z.boolean().optional()
10509
+ });
10510
+ /**
10511
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
10512
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
10513
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
10514
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
10515
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
10516
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
10517
+ * migration cannot reach a JWT already in a client's hands; parse-time
10518
+ * migration covers both without a flag day. No cast — the raw object is read
10519
+ * through `Reflect.get` (its static type is `unknown`).
10520
+ */
10521
+ function migrateLegacyTokenScope(raw) {
10522
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
10523
+ if (Reflect.get(raw, "type") !== "device") return raw;
10524
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
10525
+ const targets = Reflect.get(raw, "targets");
10526
+ if (!Array.isArray(targets)) return raw;
10527
+ return {
10528
+ type: "device",
10529
+ selector: {
10530
+ kind: "ids",
10531
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
10532
+ },
10533
+ access: Reflect.get(raw, "access")
10534
+ };
10535
+ }
10536
+ var TokenScopeSchema = zod.z.preprocess(migrateLegacyTokenScope, zod.z.discriminatedUnion("type", [
10537
+ zod.z.object({
10538
+ type: zod.z.literal("category"),
10539
+ target: CapScopeSchema,
10540
+ access: zod.z.array(MethodAccessSchema).min(1)
10541
+ }),
10542
+ zod.z.object({
10543
+ type: zod.z.literal("capability"),
10544
+ target: zod.z.string(),
10545
+ access: zod.z.array(MethodAccessSchema).min(1)
10546
+ }),
10547
+ zod.z.object({
10548
+ type: zod.z.literal("addon"),
10549
+ target: zod.z.string(),
10550
+ access: zod.z.array(MethodAccessSchema).min(1)
10551
+ }),
10552
+ DeviceTokenScopeSchema
10553
+ ]));
10554
+ var UserRecordSchema = zod.z.object({
10555
+ id: zod.z.string(),
10556
+ username: zod.z.string(),
10557
+ passwordHash: zod.z.string(),
10558
+ /**
10559
+ * Admin bypass. When true, the middleware skips the scope-access
10560
+ * check entirely. There is no other axis of privilege; the legacy
10561
+ * role enum collapsed onto this boolean in v2.
10562
+ */
10563
+ isAdmin: zod.z.boolean().default(false),
10564
+ allowedProviders: AllowedProviderSchema,
10565
+ allowedDevices: AllowedDevicesSchema,
10566
+ /**
10567
+ * Scopes granted to this user. Admins bypass; their `scopes` is
10568
+ * ignored. Non-admins without scopes are locked out of every
10569
+ * protected call.
10570
+ */
10571
+ scopes: zod.z.array(TokenScopeSchema).default([]),
10572
+ createdAt: zod.z.number(),
10573
+ updatedAt: zod.z.number()
10574
+ });
10575
+ var ApiKeyRecordSchema = zod.z.object({
10576
+ id: zod.z.string(),
10577
+ label: zod.z.string(),
10578
+ isAdmin: zod.z.boolean().default(false),
10579
+ allowedProviders: AllowedProviderSchema,
10580
+ allowedDevices: AllowedDevicesSchema,
10581
+ tokenHash: zod.z.string(),
10582
+ tokenPrefix: zod.z.string(),
10583
+ createdAt: zod.z.number(),
10584
+ lastUsedAt: zod.z.number().optional()
10585
+ });
10586
+ var ScopedTokenSchema = zod.z.object({
10587
+ id: zod.z.string(),
10588
+ userId: zod.z.string(),
10589
+ name: zod.z.string(),
10590
+ tokenHash: zod.z.string(),
10591
+ tokenPrefix: zod.z.string(),
10592
+ scopes: zod.z.array(TokenScopeSchema),
10593
+ expiresAt: zod.z.number().nullish(),
10594
+ lastUsedAt: zod.z.number().nullish(),
10595
+ createdAt: zod.z.number()
10596
+ });
10597
+ /** What a share-view grant lets its holder see. */
10598
+ var ShareViewGrantSchema = zod.z.object({
10599
+ kind: zod.z.enum(SHARE_VIEW_KINDS),
10600
+ deviceIds: zod.z.array(zod.z.number().int().nonnegative()).min(1).max(64),
10601
+ /** Talk-back, opt-in at mint time; absent means off. */
10602
+ talk: zod.z.boolean().optional()
10603
+ });
10604
+ var ShareViewScopeSchema = zod.z.object({
10605
+ type: zod.z.literal("share-view"),
10606
+ grant: ShareViewGrantSchema
10607
+ });
10608
+ var AddonRoutesScopeSchema = zod.z.object({
10609
+ type: zod.z.literal("addon-routes"),
10610
+ access: zod.z.array(MethodAccessSchema).min(1)
10611
+ });
10612
+ var CredentialScopeSchema = zod.z.union([
10613
+ zod.z.literal("*"),
10614
+ ShareViewScopeSchema,
10615
+ AddonRoutesScopeSchema,
10616
+ TokenScopeSchema
10617
+ ]);
10618
+ /**
10619
+ * The claims of a unified token (`auth.mintToken`). It carries no `exp`: its
10620
+ * row (looked up by `jti` on every verify, for revocation) holds the ONE
10621
+ * expiry, so a share link can be extended and a JWT clock can never disagree
10622
+ * with the row.
10623
+ */
10624
+ var CredentialTokenClaimsSchema = zod.z.object({
10625
+ kind: zod.z.literal("credential"),
10626
+ sub: zod.z.string().min(1),
10627
+ jti: zod.z.string().min(16),
10628
+ scopes: zod.z.array(CredentialScopeSchema).min(1)
10629
+ });
10386
10630
  zod.z.enum(["new-session", "step-up"]);
10387
10631
  /** The languages the hub's app landing pages are written in (D858). */
10388
10632
  var AppPageLangSchema = zod.z.enum(["en", "it"]);
@@ -11267,7 +11511,14 @@ var AlertSeveritySchema = zod.z.enum([
11267
11511
  ]);
11268
11512
  var AlertActionSchema = zod.z.object({
11269
11513
  label: zod.z.string(),
11270
- href: zod.z.string().optional()
11514
+ href: zod.z.string().optional(),
11515
+ /**
11516
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
11517
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
11518
+ * start) — the browser must leave the SPA with a full navigation, because
11519
+ * the SPA has no such route and would bounce to the home page.
11520
+ */
11521
+ navigation: zod.z.enum(["app", "server"]).optional()
11271
11522
  });
11272
11523
  var AlertStatusSchema = zod.z.enum([
11273
11524
  "active",
@@ -44526,6 +44777,9 @@ var NcSystemEventKindSchema = zod.z.enum([
44526
44777
  "server-updated",
44527
44778
  "export-completed",
44528
44779
  "backup-completed",
44780
+ "alert-critical",
44781
+ "alert-error",
44782
+ "alert-critical-resolved",
44529
44783
  "camera-online",
44530
44784
  "camera-offline",
44531
44785
  "camera-disabled",
@@ -46793,202 +47047,6 @@ var notificationRulesCapability = {
46793
47047
  }
46794
47048
  };
46795
47049
  /**
46796
- * Zod schemas for persisted record types.
46797
- *
46798
- * These schemas serve as the single source of truth for types that are
46799
- * stored in the settings-store backend and retrieved via tRPC. They
46800
- * replace the manual TypeScript interfaces with schema-derived types,
46801
- * enabling runtime validation when reading from the backend.
46802
- *
46803
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
46804
- * keeps the original name for backward compatibility.
46805
- */
46806
- /**
46807
- * Auth model (v2 — 2026-05-12 caps-only):
46808
- *
46809
- * Two principals:
46810
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
46811
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
46812
- *
46813
- * No role enum. There used to be `viewer / agent / scoped` and earlier
46814
- * `super_admin` — collapsed onto the single boolean because every
46815
- * non-admin caller is governed by the same scope-check rules; the
46816
- * distinction was only ever used to route role-specific procedures
46817
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
46818
- * with `isAdmin: false` + an explicit scope list.
46819
- */
46820
- /** Per-method access flavour. Materialised on every cap method via codegen. */
46821
- var MethodAccessSchema = zod.z.enum([
46822
- "view",
46823
- "create",
46824
- "delete"
46825
- ]);
46826
- /**
46827
- * A single scope grant. Three forms — checked in matcher with OR
46828
- * semantics; the first match decides whether the call passes:
46829
- *
46830
- * - `category` — broadest. `target: 'device' | 'system'` selects every
46831
- * cap with the matching `scope` declaration. New caps inherit grants
46832
- * automatically — adding a device cap to the codebase makes it
46833
- * reachable to every user with `category:device [...]` without a
46834
- * re-grant. Use this for "family viewer" / "operator" tiers.
46835
- *
46836
- * - `addon` — every cap that ships inside a given addon id. Niche;
46837
- * useful when an integration needs to interact with one specific
46838
- * addon's surface regardless of how many caps it exports.
46839
- *
46840
- * - `capability` — the most precise form. Single cap name. Use for
46841
- * integration tokens where you want to grant `addons.installPackage`
46842
- * and nothing else.
46843
- *
46844
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
46845
- * "give me everything" escape; there is no wildcard scope.
46846
- */
46847
- var AllowedProviderSchema = zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]);
46848
- var AllowedDevicesSchema = zod.z.record(zod.z.string(), zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]));
46849
- var CapScopeSchema = zod.z.enum(["device", "system"]);
46850
- /**
46851
- * DeviceSelector (scope model v3 — 2026-08-12).
46852
- *
46853
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
46854
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
46855
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
46856
- * AFTER the grant was minted — no re-grant, no re-login.
46857
- *
46858
- * - `all` — every device in the deployment. The broad viewer/operator
46859
- * lever without a `category` grant (a `category` grant also covers device
46860
- * caps that carry no deviceId; `all` is specifically the device set).
46861
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
46862
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
46863
- * is NOT covered until the grant is edited.
46864
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
46865
- * DYNAMIC. A device that changes type, or a new device of the type,
46866
- * re-resolves on the next request.
46867
- * - `locations` — every device whose operator-assigned `location` label is
46868
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
46869
- * null/unset location matches NO `locations` selector.
46870
- */
46871
- var DeviceSelectorSchema = zod.z.discriminatedUnion("kind", [
46872
- zod.z.object({ kind: zod.z.literal("all") }),
46873
- zod.z.object({
46874
- kind: zod.z.literal("ids"),
46875
- ids: zod.z.array(zod.z.number().int()).min(1)
46876
- }),
46877
- zod.z.object({
46878
- kind: zod.z.literal("types"),
46879
- types: zod.z.array(zod.z.enum(DeviceType)).min(1)
46880
- }),
46881
- zod.z.object({
46882
- kind: zod.z.literal("locations"),
46883
- locations: zod.z.array(zod.z.string().min(1)).min(1)
46884
- })
46885
- ]);
46886
- var DeviceTokenScopeSchema = zod.z.object({
46887
- type: zod.z.literal("device"),
46888
- /** The device SET this grant covers — resolved against the live fleet. */
46889
- selector: DeviceSelectorSchema,
46890
- access: zod.z.array(MethodAccessSchema).min(1),
46891
- /**
46892
- * Whether a grant on a PARENT device transparently covers its accessory
46893
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
46894
- * Direction is parent → children ONLY.
46895
- *
46896
- * Absent → the matcher DERIVES it from the access flavour: `view`
46897
- * inherits (a camera viewer sees the camera's accessories), `create` /
46898
- * `delete` do NOT (actuating/removing a child is an explicit act the
46899
- * operator must grant on the child, not inherit from the parent). Set it
46900
- * explicitly to override that default per grant.
46901
- */
46902
- includeLinked: zod.z.boolean().optional()
46903
- });
46904
- /**
46905
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
46906
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
46907
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
46908
- * EVERY parse path — stored records AND the JWT-carried scope arrays
46909
- * normalised at the request boundary ({@link normalizeTokenScopes} in
46910
- * `device-selector.ts`). Chosen over a one-time DB migration because a
46911
- * migration cannot reach a JWT already in a client's hands; parse-time
46912
- * migration covers both without a flag day. No cast — the raw object is read
46913
- * through `Reflect.get` (its static type is `unknown`).
46914
- */
46915
- function migrateLegacyTokenScope(raw) {
46916
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
46917
- if (Reflect.get(raw, "type") !== "device") return raw;
46918
- if (Reflect.get(raw, "selector") !== void 0) return raw;
46919
- const targets = Reflect.get(raw, "targets");
46920
- if (!Array.isArray(targets)) return raw;
46921
- return {
46922
- type: "device",
46923
- selector: {
46924
- kind: "ids",
46925
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
46926
- },
46927
- access: Reflect.get(raw, "access")
46928
- };
46929
- }
46930
- var TokenScopeSchema = zod.z.preprocess(migrateLegacyTokenScope, zod.z.discriminatedUnion("type", [
46931
- zod.z.object({
46932
- type: zod.z.literal("category"),
46933
- target: CapScopeSchema,
46934
- access: zod.z.array(MethodAccessSchema).min(1)
46935
- }),
46936
- zod.z.object({
46937
- type: zod.z.literal("capability"),
46938
- target: zod.z.string(),
46939
- access: zod.z.array(MethodAccessSchema).min(1)
46940
- }),
46941
- zod.z.object({
46942
- type: zod.z.literal("addon"),
46943
- target: zod.z.string(),
46944
- access: zod.z.array(MethodAccessSchema).min(1)
46945
- }),
46946
- DeviceTokenScopeSchema
46947
- ]));
46948
- var UserRecordSchema = zod.z.object({
46949
- id: zod.z.string(),
46950
- username: zod.z.string(),
46951
- passwordHash: zod.z.string(),
46952
- /**
46953
- * Admin bypass. When true, the middleware skips the scope-access
46954
- * check entirely. There is no other axis of privilege; the legacy
46955
- * role enum collapsed onto this boolean in v2.
46956
- */
46957
- isAdmin: zod.z.boolean().default(false),
46958
- allowedProviders: AllowedProviderSchema,
46959
- allowedDevices: AllowedDevicesSchema,
46960
- /**
46961
- * Scopes granted to this user. Admins bypass; their `scopes` is
46962
- * ignored. Non-admins without scopes are locked out of every
46963
- * protected call.
46964
- */
46965
- scopes: zod.z.array(TokenScopeSchema).default([]),
46966
- createdAt: zod.z.number(),
46967
- updatedAt: zod.z.number()
46968
- });
46969
- var ApiKeyRecordSchema = zod.z.object({
46970
- id: zod.z.string(),
46971
- label: zod.z.string(),
46972
- isAdmin: zod.z.boolean().default(false),
46973
- allowedProviders: AllowedProviderSchema,
46974
- allowedDevices: AllowedDevicesSchema,
46975
- tokenHash: zod.z.string(),
46976
- tokenPrefix: zod.z.string(),
46977
- createdAt: zod.z.number(),
46978
- lastUsedAt: zod.z.number().optional()
46979
- });
46980
- var ScopedTokenSchema = zod.z.object({
46981
- id: zod.z.string(),
46982
- userId: zod.z.string(),
46983
- name: zod.z.string(),
46984
- tokenHash: zod.z.string(),
46985
- tokenPrefix: zod.z.string(),
46986
- scopes: zod.z.array(TokenScopeSchema),
46987
- expiresAt: zod.z.number().nullish(),
46988
- lastUsedAt: zod.z.number().nullish(),
46989
- createdAt: zod.z.number()
46990
- });
46991
- /**
46992
47050
  * `oauth-integration` — a collection cap by which an addon declares
46993
47051
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
46994
47052
  * Each provider returns a static descriptor; the core enumerates them
@@ -55883,6 +55941,18 @@ var storageMigrationCapability = {
55883
55941
  */
55884
55942
  movers: method(zod.z.object({}), zod.z.array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }),
55885
55943
  /**
55944
+ * May a mover that touches these locations run NOW? One claim per physical
55945
+ * root is owned by the storage orchestrator: a single-location repoint holds
55946
+ * it while it carries its subtree, and a mover (`relocateMedia`,
55947
+ * `relocateFootage`, a migration move) asks here AFTER registering its job and
55948
+ * cancels itself on `clear: false`. The repoint, in turn, refuses while a
55949
+ * registered mover touches its root. Asked, never polled (D3).
55950
+ */
55951
+ moverClearance: method(zod.z.object({ locationIds: zod.z.array(zod.z.string()).readonly() }), zod.z.object({
55952
+ clear: zod.z.boolean(),
55953
+ repointLocationId: zod.z.string().optional()
55954
+ }), { auth: "admin" }),
55955
+ /**
55886
55956
  * What each class's SOURCE still holds, from the archive — never from the
55887
55957
  * resident index (D295). Only classes with something left (or something
55888
55958
  * unknown) are listed, so an empty list means there is nothing to drain and
@@ -61103,6 +61173,11 @@ onStatusChanged: { data: zod.z.object({
61103
61173
  *
61104
61174
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
61105
61175
  * provider refreshes the slice on an interval and eagerly after commands.
61176
+ *
61177
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
61178
+ * nullable: `null` means "not known right now" (the appliance has not said,
61179
+ * the link is down, or the description does not carry it) and is never
61180
+ * rendered or exported as `false` / `0`. `availability` says why.
61106
61181
  */
61107
61182
  var DishwasherStateSchema = zod.z.enum([
61108
61183
  "idle",
@@ -61112,43 +61187,155 @@ var DishwasherStateSchema = zod.z.enum([
61112
61187
  "error",
61113
61188
  "unavailable"
61114
61189
  ]);
61190
+ /**
61191
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
61192
+ * view for compact surfaces; this is what the appliance said.
61193
+ */
61194
+ var DishwasherOperationStateSchema = zod.z.enum([
61195
+ "Inactive",
61196
+ "Ready",
61197
+ "DelayedStart",
61198
+ "Run",
61199
+ "Pause",
61200
+ "ActionRequired",
61201
+ "Finished",
61202
+ "Error",
61203
+ "Aborting"
61204
+ ]);
61205
+ /**
61206
+ * Why fields may be `null`:
61207
+ * - `available` — the link is up and the description is loaded;
61208
+ * - `offline` — the local link is down (values are unknown, not last-known);
61209
+ * - `description-missing` — the link is up but the appliance's description could not
61210
+ * be loaded, so its values cannot be decoded.
61211
+ */
61212
+ var DishwasherAvailabilitySchema = zod.z.enum([
61213
+ "available",
61214
+ "offline",
61215
+ "description-missing"
61216
+ ]);
61115
61217
  var DishwasherConsumableLevelSchema = zod.z.enum([
61116
61218
  "ok",
61117
61219
  "low",
61118
61220
  "empty"
61119
61221
  ]);
61120
61222
  var DishwasherStatusSchema = zod.z.object({
61223
+ availability: DishwasherAvailabilitySchema,
61224
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
61121
61225
  state: DishwasherStateSchema,
61122
- /** Active program id/name, or null when none selected / unknown. */
61226
+ /** The appliance's operation state as reported; null when not known. */
61227
+ operationState: DishwasherOperationStateSchema.nullable(),
61228
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
61123
61229
  program: zod.z.string().nullable(),
61124
- /** Program tokens the hardware accepts — drives the UI selector. */
61230
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
61231
+ selectedProgram: zod.z.string().nullable(),
61232
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
61125
61233
  availablePrograms: zod.z.array(zod.z.string()),
61126
- /** Minutes remaining on the active cycle, or null when not running. */
61127
- remainingMinutes: zod.z.number().int().nonnegative().nullable(),
61234
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
61235
+ remainingSeconds: zod.z.number().int().nonnegative().nullable(),
61236
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
61237
+ delayedStartSeconds: zod.z.number().int().nonnegative().nullable(),
61128
61238
  /** Cycle completion 0..100, or null when not applicable. */
61129
61239
  progressPercent: zod.z.number().min(0).max(100).nullable(),
61130
- /** True when the door is reported open. */
61131
- doorOpen: zod.z.boolean(),
61132
- /** True when remote start is allowed (door closed, power on, etc.). */
61133
- remoteStartAllowed: zod.z.boolean(),
61134
- /** Main power / switched-on state. */
61135
- powerOn: zod.z.boolean(),
61240
+ /** True when the door is reported open; null when the door state is not known. */
61241
+ doorOpen: zod.z.boolean().nullable(),
61242
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
61243
+ doorLocked: zod.z.boolean().nullable(),
61244
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
61245
+ remoteStartAllowed: zod.z.boolean().nullable(),
61246
+ /** True when the appliance accepts remote control now; null when not known. */
61247
+ remoteControlActive: zod.z.boolean().nullable(),
61248
+ /** True while somebody operates the appliance at its panel; null when not reported. */
61249
+ localControlActive: zod.z.boolean().nullable(),
61250
+ /** Main power / switched-on state; null when not known. */
61251
+ powerOn: zod.z.boolean().nullable(),
61252
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
61253
+ powerState: zod.z.string().nullable(),
61136
61254
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
61137
61255
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
61138
- halfLoad: zod.z.boolean(),
61139
- hygienePlus: zod.z.boolean(),
61256
+ /** Option states: null when the appliance does not expose the option or has not said. */
61257
+ halfLoad: zod.z.boolean().nullable(),
61258
+ hygienePlus: zod.z.boolean().nullable(),
61140
61259
  /** Extra dry option when the appliance exposes it. */
61141
- extraDry: zod.z.boolean(),
61260
+ extraDry: zod.z.boolean().nullable(),
61142
61261
  /** Intensive zone (lower basket) when the appliance exposes it. */
61143
- intensiveZone: zod.z.boolean(),
61262
+ intensiveZone: zod.z.boolean().nullable(),
61144
61263
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
61145
- varioSpeedPlus: zod.z.boolean(),
61146
- /** Child lock (controls disabled on the appliance). */
61147
- childLock: zod.z.boolean(),
61264
+ varioSpeedPlus: zod.z.boolean().nullable(),
61265
+ /** Child lock (controls disabled on the appliance); null when not known. */
61266
+ childLock: zod.z.boolean().nullable(),
61267
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
61268
+ activeEvents: zod.z.array(zod.z.string()),
61269
+ /** Numeric error code when the appliance reports one; null otherwise. */
61148
61270
  errorCode: zod.z.number().nullable(),
61271
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
61149
61272
  errorLabel: zod.z.string().nullable(),
61273
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
61150
61274
  lastFetchedAt: zod.z.number()
61151
61275
  });
61276
+ var DeviceIdSchema = zod.z.number().int().nonnegative();
61277
+ /** A value a program option or setting can take. */
61278
+ var DishwasherValueSchema = zod.z.union([
61279
+ zod.z.boolean(),
61280
+ zod.z.string(),
61281
+ zod.z.number()
61282
+ ]);
61283
+ var DishwasherAccessSchema = zod.z.enum([
61284
+ "none",
61285
+ "read",
61286
+ "readWrite",
61287
+ "writeOnly",
61288
+ "readStatic"
61289
+ ]);
61290
+ /**
61291
+ * One option or setting the appliance declares, with the constraints its description
61292
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
61293
+ */
61294
+ var DishwasherOptionDescriptorSchema = zod.z.object({
61295
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
61296
+ key: zod.z.string(),
61297
+ /** Last segment of the key, for display. */
61298
+ name: zod.z.string(),
61299
+ type: zod.z.enum([
61300
+ "boolean",
61301
+ "number",
61302
+ "enum",
61303
+ "string"
61304
+ ]),
61305
+ access: DishwasherAccessSchema,
61306
+ /** The appliance reports this entity as currently available. */
61307
+ available: zod.z.boolean(),
61308
+ /** Unit the description declares for a number; null when it declares none. */
61309
+ unit: zod.z.string().nullable(),
61310
+ min: zod.z.number().nullable(),
61311
+ max: zod.z.number().nullable(),
61312
+ step: zod.z.number().nullable(),
61313
+ /** Allowed members of an enum; null for other types. */
61314
+ enumValues: zod.z.array(zod.z.string()).nullable(),
61315
+ defaultValue: DishwasherValueSchema.nullable()
61316
+ });
61317
+ var DishwasherProgramSchema = zod.z.object({
61318
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
61319
+ key: zod.z.string(),
61320
+ name: zod.z.string(),
61321
+ /** The appliance currently offers this program. */
61322
+ available: zod.z.boolean(),
61323
+ /** The options this program lists, with the program-level access / availability / default. */
61324
+ options: zod.z.array(DishwasherOptionDescriptorSchema)
61325
+ });
61326
+ var DishwasherOptionsSchema = zod.z.object({
61327
+ availability: DishwasherAvailabilitySchema,
61328
+ /** What the appliance can be told to do, from the commands its description declares. */
61329
+ supportsStart: zod.z.boolean(),
61330
+ supportsPause: zod.z.boolean(),
61331
+ supportsResume: zod.z.boolean(),
61332
+ supportsStop: zod.z.boolean(),
61333
+ supportsPower: zod.z.boolean(),
61334
+ /** Every program the description lists, with its options. */
61335
+ programs: zod.z.array(DishwasherProgramSchema),
61336
+ /** Every option and setting entity the description lists (programs reference these by key). */
61337
+ options: zod.z.array(DishwasherOptionDescriptorSchema)
61338
+ });
61152
61339
  var dishwasherCapability = {
61153
61340
  name: "dishwasher",
61154
61341
  scope: "device",
@@ -61156,86 +61343,102 @@ var dishwasherCapability = {
61156
61343
  mode: "singleton",
61157
61344
  deviceTypes: [DeviceType.Dishwasher],
61158
61345
  methods: {
61159
- start: method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
61346
+ /**
61347
+ * Start a program. Without `program` the selected one starts. `options` are
61348
+ * option feature keys; each is checked against the program's constraints.
61349
+ */
61350
+ start: method(zod.z.object({
61351
+ deviceId: DeviceIdSchema,
61352
+ program: zod.z.string().min(1).optional(),
61353
+ options: zod.z.record(zod.z.string(), DishwasherValueSchema).optional()
61354
+ }), zod.z.void(), {
61160
61355
  kind: "mutation",
61161
61356
  auth: "protected"
61162
61357
  }),
61163
- pause: method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
61358
+ pause: method(zod.z.object({ deviceId: DeviceIdSchema }), zod.z.void(), {
61164
61359
  kind: "mutation",
61165
61360
  auth: "protected"
61166
61361
  }),
61167
- stop: method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
61362
+ resume: method(zod.z.object({ deviceId: DeviceIdSchema }), zod.z.void(), {
61168
61363
  kind: "mutation",
61169
61364
  auth: "protected"
61170
61365
  }),
61366
+ stop: method(zod.z.object({ deviceId: DeviceIdSchema }), zod.z.void(), {
61367
+ kind: "mutation",
61368
+ auth: "protected"
61369
+ }),
61370
+ /** Select (not start) a program; refused when the appliance does not offer it. */
61171
61371
  setProgram: method(zod.z.object({
61172
- deviceId: zod.z.number().int().nonnegative(),
61372
+ deviceId: DeviceIdSchema,
61173
61373
  program: zod.z.string().min(1)
61174
61374
  }), zod.z.void(), {
61175
61375
  kind: "mutation",
61176
61376
  auth: "protected"
61177
61377
  }),
61178
61378
  setPower: method(zod.z.object({
61179
- deviceId: zod.z.number().int().nonnegative(),
61379
+ deviceId: DeviceIdSchema,
61180
61380
  on: zod.z.boolean()
61181
61381
  }), zod.z.void(), {
61182
61382
  kind: "mutation",
61183
61383
  auth: "protected"
61184
61384
  }),
61185
61385
  setHalfLoad: method(zod.z.object({
61186
- deviceId: zod.z.number().int().nonnegative(),
61386
+ deviceId: DeviceIdSchema,
61187
61387
  on: zod.z.boolean()
61188
61388
  }), zod.z.void(), {
61189
61389
  kind: "mutation",
61190
61390
  auth: "protected"
61191
61391
  }),
61192
61392
  setHygienePlus: method(zod.z.object({
61193
- deviceId: zod.z.number().int().nonnegative(),
61393
+ deviceId: DeviceIdSchema,
61194
61394
  on: zod.z.boolean()
61195
61395
  }), zod.z.void(), {
61196
61396
  kind: "mutation",
61197
61397
  auth: "protected"
61198
61398
  }),
61199
61399
  setExtraDry: method(zod.z.object({
61200
- deviceId: zod.z.number().int().nonnegative(),
61400
+ deviceId: DeviceIdSchema,
61201
61401
  on: zod.z.boolean()
61202
61402
  }), zod.z.void(), {
61203
61403
  kind: "mutation",
61204
61404
  auth: "protected"
61205
61405
  }),
61206
61406
  setIntensiveZone: method(zod.z.object({
61207
- deviceId: zod.z.number().int().nonnegative(),
61407
+ deviceId: DeviceIdSchema,
61208
61408
  on: zod.z.boolean()
61209
61409
  }), zod.z.void(), {
61210
61410
  kind: "mutation",
61211
61411
  auth: "protected"
61212
61412
  }),
61213
61413
  setVarioSpeedPlus: method(zod.z.object({
61214
- deviceId: zod.z.number().int().nonnegative(),
61414
+ deviceId: DeviceIdSchema,
61215
61415
  on: zod.z.boolean()
61216
61416
  }), zod.z.void(), {
61217
61417
  kind: "mutation",
61218
61418
  auth: "protected"
61219
61419
  }),
61220
61420
  setChildLock: method(zod.z.object({
61221
- deviceId: zod.z.number().int().nonnegative(),
61421
+ deviceId: DeviceIdSchema,
61222
61422
  on: zod.z.boolean()
61223
61423
  }), zod.z.void(), {
61224
61424
  kind: "mutation",
61225
61425
  auth: "protected"
61226
61426
  }),
61427
+ /**
61428
+ * Write any option or setting by feature key. Refused when the description does
61429
+ * not list it, it is not writable or not available now, or the value is outside
61430
+ * its declared range / members.
61431
+ */
61227
61432
  setOption: method(zod.z.object({
61228
- deviceId: zod.z.number().int().nonnegative(),
61433
+ deviceId: DeviceIdSchema,
61229
61434
  key: zod.z.string().min(1),
61230
- value: zod.z.union([
61231
- zod.z.boolean(),
61232
- zod.z.string(),
61233
- zod.z.number()
61234
- ])
61435
+ value: DishwasherValueSchema
61235
61436
  }), zod.z.void(), {
61236
61437
  kind: "mutation",
61237
61438
  auth: "protected"
61238
- })
61439
+ }),
61440
+ /** What this appliance can do, from its own description — the UI is derived from it. */
61441
+ getOptions: method(zod.z.object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
61239
61442
  },
61240
61443
  status: {
61241
61444
  schema: DishwasherStatusSchema,
@@ -77092,6 +77295,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
77092
77295
  addonId: null,
77093
77296
  access: "view"
77094
77297
  },
77298
+ "dishwasher.getOptions": {
77299
+ capName: "dishwasher",
77300
+ capScope: "device",
77301
+ addonId: null,
77302
+ access: "view"
77303
+ },
77095
77304
  "dishwasher.getStatus": {
77096
77305
  capName: "dishwasher",
77097
77306
  capScope: "device",
@@ -77104,6 +77313,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
77104
77313
  addonId: null,
77105
77314
  access: "create"
77106
77315
  },
77316
+ "dishwasher.resume": {
77317
+ capName: "dishwasher",
77318
+ capScope: "device",
77319
+ addonId: null,
77320
+ access: "create"
77321
+ },
77107
77322
  "dishwasher.setChildLock": {
77108
77323
  capName: "dishwasher",
77109
77324
  capScope: "device",
@@ -81604,6 +81819,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
81604
81819
  addonId: null,
81605
81820
  access: "view"
81606
81821
  },
81822
+ "storageMigration.moverClearance": {
81823
+ capName: "storage-migration",
81824
+ capScope: "system",
81825
+ addonId: null,
81826
+ access: "view"
81827
+ },
81607
81828
  "storageMigration.movers": {
81608
81829
  capName: "storage-migration",
81609
81830
  capScope: "system",
@@ -84068,6 +84289,11 @@ Object.freeze({
84068
84289
  form: "single",
84069
84290
  optional: false
84070
84291
  }],
84292
+ "dishwasher.getOptions": [{
84293
+ name: "deviceId",
84294
+ form: "single",
84295
+ optional: false
84296
+ }],
84071
84297
  "dishwasher.getStatus": [{
84072
84298
  name: "deviceId",
84073
84299
  form: "single",
@@ -84078,6 +84304,11 @@ Object.freeze({
84078
84304
  form: "single",
84079
84305
  optional: false
84080
84306
  }],
84307
+ "dishwasher.resume": [{
84308
+ name: "deviceId",
84309
+ form: "single",
84310
+ optional: false
84311
+ }],
84081
84312
  "dishwasher.setChildLock": [{
84082
84313
  name: "deviceId",
84083
84314
  form: "single",
@@ -86754,6 +86985,9 @@ new Map(Object.entries({
86754
86985
  "wrapper-update-available": "system",
86755
86986
  "backup-completed": "system",
86756
86987
  "export-completed": "system",
86988
+ "alert-critical": "system",
86989
+ "alert-error": "system",
86990
+ "alert-critical-resolved": "system",
86757
86991
  "storage-location-low": "system",
86758
86992
  "storage-location-critical": "system",
86759
86993
  "storage-location-ok": "system",
@@ -86878,6 +87112,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
86878
87112
  "storage-location-ok"
86879
87113
  ]
86880
87114
  },
87115
+ {
87116
+ id: "alerts",
87117
+ family: "system",
87118
+ label: "Alerts",
87119
+ kinds: [
87120
+ "alert-critical",
87121
+ "alert-error",
87122
+ "alert-critical-resolved"
87123
+ ]
87124
+ },
86881
87125
  {
86882
87126
  id: "alarm",
86883
87127
  family: "alarm",
@@ -86922,6 +87166,63 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
86922
87166
  return [[descriptor.kind, field]];
86923
87167
  })));
86924
87168
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
87169
+ zod.z.object({
87170
+ phase: zod.z.enum(["raised", "resolved"]),
87171
+ episodeId: zod.z.string().min(1),
87172
+ alertId: zod.z.string().min(1),
87173
+ severity: AlertSeveritySchema,
87174
+ category: zod.z.string(),
87175
+ title: zod.z.string(),
87176
+ message: zod.z.string(),
87177
+ sourceType: zod.z.string().optional(),
87178
+ sourceId: zod.z.string().optional(),
87179
+ nodeId: zod.z.string().optional(),
87180
+ /** The alert's own action link (where the operator acts on it), when it has one. */
87181
+ actionUrl: zod.z.string().optional(),
87182
+ at: zod.z.number()
87183
+ });
87184
+ /** An episode is closed once its alert is completed or dismissed. */
87185
+ function isAlertEpisodeOpen(status) {
87186
+ return status !== "completed" && status !== "dismissed";
87187
+ }
87188
+ /** Only these severities are ever announced. */
87189
+ function isAlertEpisodeSeverity(severity) {
87190
+ return severity === "critical" || severity === "error";
87191
+ }
87192
+ function alertEpisodeId(alert) {
87193
+ const minted = alert.metadata?.["episodeId"];
87194
+ return typeof minted === "string" && minted.length > 0 ? minted : `${alert.id}@${String(alert.createdAt)}`;
87195
+ }
87196
+ /** The node an alert is about, from the places emitters put it. */
87197
+ function alertNodeId(alert) {
87198
+ const direct = alert.metadata?.["nodeId"];
87199
+ if (typeof direct === "string") return direct;
87200
+ const runner = alert.metadata?.["runner"];
87201
+ if (typeof runner === "object" && runner !== null && "nodeId" in runner) {
87202
+ const id = runner.nodeId;
87203
+ if (typeof id === "string") return id;
87204
+ }
87205
+ return alert.source?.type === "node" ? alert.source.id : void 0;
87206
+ }
87207
+ function alertEpisodePayload(alert, phase, at) {
87208
+ const nodeId = alertNodeId(alert);
87209
+ return {
87210
+ phase,
87211
+ episodeId: alertEpisodeId(alert),
87212
+ alertId: alert.id,
87213
+ severity: alert.severity,
87214
+ category: alert.category,
87215
+ title: alert.title,
87216
+ message: alert.message,
87217
+ ...alert.source !== void 0 ? {
87218
+ sourceType: alert.source.type,
87219
+ sourceId: alert.source.id
87220
+ } : {},
87221
+ ...nodeId !== void 0 ? { nodeId } : {},
87222
+ ...alert.action?.href !== void 0 ? { actionUrl: alert.action.href } : {},
87223
+ at
87224
+ };
87225
+ }
86925
87226
  var RULE_BODY_ONLY = ["body"];
86926
87227
  var RULE_TEXT = ["title", "body"];
86927
87228
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -86931,6 +87232,11 @@ var TANK = [
86931
87232
  "device-tank-full",
86932
87233
  "device-tank-normal"
86933
87234
  ];
87235
+ var ALERT_EPISODE = [
87236
+ "alert-critical",
87237
+ "alert-error",
87238
+ "alert-critical-resolved"
87239
+ ];
86934
87240
  var UPDATES = [
86935
87241
  "addon-update-available",
86936
87242
  "server-update-available",
@@ -87123,14 +87429,14 @@ var STATE_SUMMARY_VARS = [
87123
87429
  ([...RULE_TEXT], [...CONSUMABLE]),
87124
87430
  ([...RULE_TEXT], [...TANK]),
87125
87431
  [...RULE_TEXT],
87126
- ([...RULE_TEXT], [...UPDATES]),
87127
- ([...RULE_TEXT], [...UPDATES]),
87128
- [...RULE_TEXT],
87432
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
87433
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
87129
87434
  [...RULE_TEXT],
87130
87435
  [...RULE_TEXT],
87131
87436
  [...RULE_TEXT],
87132
87437
  [...RULE_TEXT],
87133
87438
  [...RULE_TEXT],
87439
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87134
87440
  [...RULE_TEXT],
87135
87441
  [...RULE_TEXT],
87136
87442
  [...RULE_TEXT],
@@ -87148,7 +87454,11 @@ var STATE_SUMMARY_VARS = [
87148
87454
  [...RULE_TEXT],
87149
87455
  [...RULE_TEXT],
87150
87456
  [...RULE_TEXT],
87151
- [...RULE_TEXT],
87457
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87458
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87459
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87460
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87461
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
87152
87462
  [...RULE_TEXT],
87153
87463
  [...RULE_TEXT],
87154
87464
  [...RULE_TEXT],
@@ -88185,6 +88495,12 @@ Object.defineProperty(exports, "CoreBlockSchema", {
88185
88495
  return CoreBlockSchema;
88186
88496
  }
88187
88497
  });
88498
+ Object.defineProperty(exports, "CredentialTokenClaimsSchema", {
88499
+ enumerable: true,
88500
+ get: function() {
88501
+ return CredentialTokenClaimsSchema;
88502
+ }
88503
+ });
88188
88504
  Object.defineProperty(exports, "DATABASE_SNAPSHOT_PARTIAL_SUFFIX", {
88189
88505
  enumerable: true,
88190
88506
  get: function() {
@@ -88665,6 +88981,18 @@ Object.defineProperty(exports, "addonWidgetsCapability", {
88665
88981
  return addonWidgetsCapability;
88666
88982
  }
88667
88983
  });
88984
+ Object.defineProperty(exports, "alertEpisodeId", {
88985
+ enumerable: true,
88986
+ get: function() {
88987
+ return alertEpisodeId;
88988
+ }
88989
+ });
88990
+ Object.defineProperty(exports, "alertEpisodePayload", {
88991
+ enumerable: true,
88992
+ get: function() {
88993
+ return alertEpisodePayload;
88994
+ }
88995
+ });
88668
88996
  Object.defineProperty(exports, "alertsCapability", {
88669
88997
  enumerable: true,
88670
88998
  get: function() {
@@ -89151,6 +89479,18 @@ Object.defineProperty(exports, "interpolate", {
89151
89479
  return interpolate;
89152
89480
  }
89153
89481
  });
89482
+ Object.defineProperty(exports, "isAlertEpisodeOpen", {
89483
+ enumerable: true,
89484
+ get: function() {
89485
+ return isAlertEpisodeOpen;
89486
+ }
89487
+ });
89488
+ Object.defineProperty(exports, "isAlertEpisodeSeverity", {
89489
+ enumerable: true,
89490
+ get: function() {
89491
+ return isAlertEpisodeSeverity;
89492
+ }
89493
+ });
89154
89494
  Object.defineProperty(exports, "isAppLinkBase", {
89155
89495
  enumerable: true,
89156
89496
  get: function() {