@camstack/server 1.2.942 → 1.2.944

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 (158) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/closure-pins.json +350 -0
  3. package/dist/api/core/auth-sessions.procedures.js +18 -0
  4. package/dist/api/core/auth.router.js +19 -6
  5. package/dist/api/server-upload.js +17 -1
  6. package/dist/api/trpc/generated-cap-routers.js +83 -0
  7. package/dist/auth/native-return.js +9 -3
  8. package/dist/auth/sso-routes.js +5 -1
  9. package/dist/core/addon/instance-lifecycle.js +4 -1
  10. package/dist/core/auth/handoff-code.service.js +35 -1
  11. package/dist/server-root/index.js +313 -70
  12. package/package.json +22 -26
  13. package/system/dist/{action-index-B1fgpQBt.mjs → action-index-DpYmsOKh.mjs} +1 -1
  14. package/system/dist/{action-index-B_cLRwXJ.js → action-index-Dz9rd1qa.js} +1 -1
  15. package/system/dist/{addon-settings.cap-CZ4MC7ha.mjs → addon-settings.cap-CHpmuaQG.mjs} +1 -1
  16. package/system/dist/{addon-settings.cap-DrLdMFIe.js → addon-settings.cap-nZVHPo3X.js} +1 -1
  17. package/system/dist/{alert-episode-Be--PngO.mjs → alert-episode-D-1VUUkZ.mjs} +1 -1
  18. package/system/dist/{alert-episode-Bqktmt-i.js → alert-episode-DaQ3prSe.js} +1 -1
  19. package/system/dist/{base-addon-CRsXtYFG.js → base-addon-BG7p06Hb.js} +136 -15
  20. package/system/dist/{base-addon-BcS6r1cT.mjs → base-addon-BcVoYZbC.mjs} +136 -15
  21. package/system/dist/{base-device-DAdWzDOl.js → base-device-DeSNiwZ4.js} +4 -4
  22. package/system/dist/{base-device-DJXF5eDN.mjs → base-device-w_MD0Bf4.mjs} +4 -4
  23. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  24. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  25. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  26. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  27. package/system/dist/builtins/alerts/alerts.addon.js +3 -3
  28. package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
  29. package/system/dist/builtins/autotrack/index.js +1 -1
  30. package/system/dist/builtins/autotrack/index.mjs +1 -1
  31. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  32. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  33. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  34. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  35. package/system/dist/builtins/camera-grid/index.js +3 -3
  36. package/system/dist/builtins/camera-grid/index.mjs +3 -3
  37. package/system/dist/builtins/composer/composer.addon.js +7 -7
  38. package/system/dist/builtins/composer/composer.addon.mjs +7 -7
  39. package/system/dist/builtins/console-logging/index.js +1 -1
  40. package/system/dist/builtins/console-logging/index.mjs +1 -1
  41. package/system/dist/builtins/core-blocks/actions-store.d.ts +2 -0
  42. package/system/dist/builtins/core-blocks/block-supervisor.d.ts +16 -4
  43. package/system/dist/builtins/core-blocks/core-block-store.d.ts +2 -0
  44. package/system/dist/builtins/core-blocks/core-blocks.addon.js +1018 -323
  45. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +986 -291
  46. package/system/dist/builtins/core-blocks/migrations/index.d.ts +5 -2
  47. package/system/dist/builtins/core-blocks/migrations/tag-ids.d.ts +42 -0
  48. package/system/dist/builtins/core-blocks/migrations/tags-as-records.d.ts +47 -0
  49. package/system/dist/builtins/core-blocks/record-kinds.d.ts +12 -1
  50. package/system/dist/builtins/core-blocks/runs-api.d.ts +3 -1
  51. package/system/dist/builtins/core-blocks/runs-ledger.d.ts +3 -1
  52. package/system/dist/builtins/core-blocks/scheduler/scheduler-store.d.ts +2 -0
  53. package/system/dist/builtins/core-blocks/tags-service.d.ts +52 -27
  54. package/system/dist/builtins/core-blocks/tags-wiring.d.ts +2 -0
  55. package/system/dist/builtins/core-notifier/core-notifier.addon.js +76 -67
  56. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +76 -67
  57. package/system/dist/builtins/device-history/device-history.addon.js +4 -4
  58. package/system/dist/builtins/device-history/device-history.addon.mjs +4 -4
  59. package/system/dist/builtins/device-manager/device-config-secrets.d.ts +14 -0
  60. package/system/dist/builtins/device-manager/device-manager.addon.js +1655 -764
  61. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1641 -750
  62. package/system/dist/builtins/device-manager/device-meta-actions.d.ts +13 -136
  63. package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
  64. package/system/dist/builtins/device-manager/device-provider-context.d.ts +9 -0
  65. package/system/dist/builtins/device-manager/device-row-store.d.ts +21 -4
  66. package/system/dist/builtins/device-manager/device-search.d.ts +6 -0
  67. package/system/dist/builtins/device-manager/location-alignment.d.ts +9 -2
  68. package/system/dist/builtins/device-manager/migrate-device.d.ts +7 -2
  69. package/system/dist/builtins/device-manager/migrate-hardware-state.d.ts +132 -1
  70. package/system/dist/builtins/device-manager/migrations/device-tag-ids.d.ts +25 -0
  71. package/system/dist/builtins/device-manager/migrations/index.d.ts +16 -0
  72. package/system/dist/builtins/device-manager/migrations/orphan-children.d.ts +33 -0
  73. package/system/dist/builtins/device-manager/migrations/ports.d.ts +17 -0
  74. package/system/dist/builtins/device-manager/migrations/rooms-as-records.d.ts +52 -0
  75. package/system/dist/builtins/device-manager/record-kinds.d.ts +3 -1
  76. package/system/dist/builtins/device-manager/removal-cleanup.d.ts +7 -0
  77. package/system/dist/builtins/device-manager/room-actions.d.ts +27 -0
  78. package/system/dist/builtins/device-manager/room-store.d.ts +19 -0
  79. package/system/dist/builtins/device-manager/tag-names.d.ts +32 -0
  80. package/system/dist/builtins/device-manager/wireable-enum-catalog.d.ts +18 -0
  81. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  82. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  83. package/system/dist/builtins/keychain/index.js +2 -2
  84. package/system/dist/builtins/keychain/index.mjs +2 -2
  85. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  86. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  87. package/system/dist/builtins/local-auth/local-auth.addon.js +1 -1
  88. package/system/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  89. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  90. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  91. package/system/dist/builtins/loki-logging/index.js +2 -2
  92. package/system/dist/builtins/loki-logging/index.mjs +2 -2
  93. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  94. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  95. package/system/dist/builtins/platform-probe/index.js +1 -1
  96. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  97. package/system/dist/builtins/record-entries/index.js +1 -1
  98. package/system/dist/builtins/record-entries/index.mjs +1 -1
  99. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  100. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  101. package/system/dist/builtins/snapshot/index.js +1 -1
  102. package/system/dist/builtins/snapshot/index.mjs +1 -1
  103. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  104. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  105. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  106. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  107. package/system/dist/builtins/sqlite-storage/migrations/migration-engine.d.ts +3 -1
  108. package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +1 -0
  109. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +15 -10
  110. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +15 -10
  111. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  112. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  113. package/system/dist/builtins/system-config/system-config.addon.js +1 -1
  114. package/system/dist/builtins/system-config/system-config.addon.mjs +1 -1
  115. package/system/dist/builtins/winston-logging/index.js +2 -2
  116. package/system/dist/builtins/winston-logging/index.mjs +2 -2
  117. package/system/dist/{command-catalog-C29hVOOg.js → command-catalog-CI0tu1Nt.js} +1 -1
  118. package/system/dist/{command-catalog-xAeqxbZk.mjs → command-catalog-zwlIA3T5.mjs} +1 -1
  119. package/system/dist/{composition-sources-C327LGFn.mjs → composition-sources-CXxXfh1z.mjs} +1 -1
  120. package/system/dist/{composition-sources-Do5qM6EB.js → composition-sources-DNgSItK-.js} +1 -1
  121. package/system/dist/{core-blocks.cap-CdTGUKtr.js → core-blocks.cap-BHEok4VO.js} +125 -373
  122. package/system/dist/{core-blocks.cap-DLkEfV5b.mjs → core-blocks.cap-CPgZRcpj.mjs} +109 -327
  123. package/system/dist/{device-manager.cap-DJs8izI6.js → device-manager.cap-B9qVf7ag.js} +163 -22
  124. package/system/dist/{device-manager.cap-eYrj1Ezp.mjs → device-manager.cap-CV4KGp3e.mjs} +134 -17
  125. package/system/dist/{error.cap-CU1FB6uE.mjs → error.cap-B8l7L8e4.mjs} +7 -1
  126. package/system/dist/{error.cap-BuKbL3Ac.js → error.cap-BqlvgBJd.js} +7 -1
  127. package/system/dist/file-host-worker.js +1 -1
  128. package/system/dist/file-host-worker.mjs +1 -1
  129. package/system/dist/index.js +7 -7
  130. package/system/dist/index.mjs +6 -6
  131. package/system/dist/{legacy-integration-rows-door-CdqYAj-o.js → legacy-integration-rows-door-BK8eoGlF.js} +1 -1
  132. package/system/dist/{legacy-integration-rows-door-LSgpClpX.mjs → legacy-integration-rows-door-CwzC5XNk.mjs} +1 -1
  133. package/system/dist/{migration-DGAc6ywR.mjs → migration-BvbfW9g-.mjs} +6 -0
  134. package/system/dist/{migration-BOQlFZCN.js → migration-CHPdAdNh.js} +6 -0
  135. package/system/dist/{prefix-walk-BFnw8NBu.js → named-entity-store-DFwLij9c.js} +244 -90
  136. package/system/dist/{prefix-walk-Mtij0NNT.mjs → named-entity-store-DOnyyFFf.mjs} +195 -89
  137. package/system/dist/{notification-rules.cap-BUIuYPlQ.mjs → notification-rules.cap-ClvK6QT1.mjs} +10 -5
  138. package/system/dist/{notification-rules.cap-BJKUjizS.js → notification-rules.cap-uSLoe2pA.js} +10 -5
  139. package/system/dist/{notification-targets-DMW7xgR2.js → notification-targets-ChqpBbtR.js} +2 -2
  140. package/system/dist/{notification-targets-4bGYH5J7.mjs → notification-targets-DUA6-F2t.mjs} +2 -2
  141. package/system/dist/{device-row-store-CTocYKqC.mjs → record-kinds-BD2xv4Pd.mjs} +222 -93
  142. package/system/dist/{device-row-store-C0P2H18h.js → record-kinds-BV8Gcpsx.js} +246 -93
  143. package/system/dist/records/named-entity-store.d.ts +60 -0
  144. package/system/dist/{rename-composition-block-Cdh-dRmY.mjs → rename-composition-block-C3QQ9UUE.mjs} +134 -33
  145. package/system/dist/{rename-composition-block-D9Uc1AF7.js → rename-composition-block-Cx3X8QSm.js} +134 -33
  146. package/system/dist/{retention-source.cap-C6Hy0hlM.js → retention-source.cap-A-TMhU5O.js} +1 -1
  147. package/system/dist/{retention-source.cap-550kkyp5.mjs → retention-source.cap-Ct07pM30.mjs} +1 -1
  148. package/system/dist/{storage-admin.cap-Ci4QbL6P.mjs → storage-admin.cap-C54s9_B9.mjs} +8 -2
  149. package/system/dist/{storage-admin.cap-DqW1ol4j.js → storage-admin.cap-DSPHi7ut.js} +8 -2
  150. package/system/dist/{stream-catalog.cap-CjEQFknc.js → stream-catalog.cap-7WPsugOy.js} +1 -1
  151. package/system/dist/{stream-catalog.cap-DVniDdRD.mjs → stream-catalog.cap-CzwRDaqT.mjs} +1 -1
  152. package/system/dist/{tag-BxLazvVb.js → tag-BLraBqvp.js} +12 -0
  153. package/system/dist/{tag-uZBAq6ox.mjs → tag-DU8pm9Bi.mjs} +7 -1
  154. package/system/dist/time-window-B6UhCArd.js +679 -0
  155. package/system/dist/time-window-BnUBULgu.mjs +578 -0
  156. package/system/dist/{wal-maintenance-BgYiAy5b.js → wal-maintenance-CkPfVApC.js} +0 -0
  157. package/system/dist/{wal-maintenance-Bey5ChBb.mjs → wal-maintenance-u84_1sVl.mjs} +0 -0
  158. package/system/package.json +1 -1
@@ -2,9 +2,9 @@ const require_streaming_shared = require("./streaming-shared-DQwFZOSi.js");
2
2
  const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
3
3
  const require_device_identifiers = require("./device-identifiers-BQg9EQi1.js");
4
4
  const require_quantity = require("./quantity-lY1KiTSZ.js");
5
- const require_tag = require("./tag-BxLazvVb.js");
5
+ const require_tag = require("./tag-BLraBqvp.js");
6
6
  const require_device_type = require("./device-type-Cnc0NiSX.js");
7
- const require_addon_settings_cap = require("./addon-settings.cap-DrLdMFIe.js");
7
+ const require_addon_settings_cap = require("./addon-settings.cap-nZVHPo3X.js");
8
8
  const require_source_info = require("./source-info-DtWf4k2j.js");
9
9
  const require_device_provider_cap = require("./device-provider.cap-CNlYBQ5D.js");
10
10
  let zod = require("zod");
@@ -812,17 +812,6 @@ var SiteZoneSchema = /* @__PURE__ */ zod.z.object({
812
812
  * the ones that most want grouping. */
813
813
  locationKeys: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string())
814
814
  });
815
- /**
816
- * The join key for a zone label: trimmed, lower-cased.
817
- *
818
- * Deliberately a separate export from `locationIconKey` even though the
819
- * derivation is identical — they key different maps, and a future change to one
820
- * must not silently re-key the other. Their agreement is a fact about today,
821
- * not a dependency.
822
- */
823
- function siteZoneKey(label) {
824
- return label.trim().toLowerCase();
825
- }
826
815
  //#endregion
827
816
  //#region ../types/dist/esm/device/device-identity-candidates.mjs
828
817
  /**
@@ -989,6 +978,48 @@ var IdentityLinkDecisionSchema = /* @__PURE__ */ zod.z.discriminatedUnion("ok",
989
978
  message: /* @__PURE__ */ zod.z.string()
990
979
  })]);
991
980
  //#endregion
981
+ //#region ../types/dist/esm/entities/entities.mjs
982
+ var RoomNameSchema = /* @__PURE__ */ zod.z.string().trim().min(1).max(80);
983
+ var RoomBodySchema = /* @__PURE__ */ zod.z.object({
984
+ name: RoomNameSchema,
985
+ icon: /* @__PURE__ */ require_tag.IconKeySchema.optional(),
986
+ description: /* @__PURE__ */ zod.z.string().optional(),
987
+ /** The id of the site zone this room belongs to (`zones` record). */
988
+ zoneId: /* @__PURE__ */ zod.z.string().min(1).optional(),
989
+ colour: /* @__PURE__ */ require_tag.TagColorIdSchema.optional(),
990
+ order: /* @__PURE__ */ zod.z.number().optional()
991
+ });
992
+ var RoomSchema = /* @__PURE__ */ RoomBodySchema.extend({ id: /* @__PURE__ */ zod.z.string().min(1) });
993
+ /** A zone record: name and icon; its rooms are the rooms whose `zoneId` names it. */
994
+ var ZoneBodySchema = /* @__PURE__ */ zod.z.object({
995
+ name: RoomNameSchema,
996
+ icon: /* @__PURE__ */ require_tag.IconKeySchema.optional()
997
+ });
998
+ var TagBodySchema = /* @__PURE__ */ zod.z.object({
999
+ name: require_tag.TagNameSchema,
1000
+ colour: /* @__PURE__ */ require_tag.TagColorIdSchema.optional(),
1001
+ icon: /* @__PURE__ */ require_tag.IconKeySchema.optional(),
1002
+ description: /* @__PURE__ */ zod.z.string().optional(),
1003
+ order: /* @__PURE__ */ zod.z.number().optional()
1004
+ });
1005
+ var TagRecordSchema = /* @__PURE__ */ TagBodySchema.extend({ id: /* @__PURE__ */ zod.z.string().min(1) });
1006
+ /** The partial an `update*` call carries: a field left out is kept, `null` clears it. */
1007
+ var RoomPatchSchema = /* @__PURE__ */ zod.z.object({
1008
+ name: /* @__PURE__ */ RoomNameSchema.optional(),
1009
+ icon: /* @__PURE__ */ require_tag.IconKeySchema.nullable().optional(),
1010
+ description: /* @__PURE__ */ zod.z.string().nullable().optional(),
1011
+ zoneId: /* @__PURE__ */ zod.z.string().min(1).nullable().optional(),
1012
+ colour: /* @__PURE__ */ require_tag.TagColorIdSchema.nullable().optional(),
1013
+ order: /* @__PURE__ */ zod.z.number().nullable().optional()
1014
+ });
1015
+ var TagPatchSchema = /* @__PURE__ */ zod.z.object({
1016
+ name: /* @__PURE__ */ require_tag.TagNameSchema.optional(),
1017
+ colour: /* @__PURE__ */ require_tag.TagColorIdSchema.nullable().optional(),
1018
+ icon: /* @__PURE__ */ require_tag.IconKeySchema.nullable().optional(),
1019
+ description: /* @__PURE__ */ zod.z.string().nullable().optional(),
1020
+ order: /* @__PURE__ */ zod.z.number().nullable().optional()
1021
+ });
1022
+ //#endregion
992
1023
  //#region ../types/dist/esm/capabilities/device-search.mjs
993
1024
  var DeviceSearchRequiresSchema = /* @__PURE__ */ zod.z.object({
994
1025
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
@@ -1201,8 +1232,12 @@ var DeviceInfoSchema = /* @__PURE__ */ zod.z.object({
1201
1232
  alias: /* @__PURE__ */ DeviceAliasSchema.optional(),
1202
1233
  /** Operator-organisational location label. `null` when unset. */
1203
1234
  location: /* @__PURE__ */ zod.z.string().nullable(),
1235
+ /** The room id (D1089); `location` is its current name, DERIVED and read-only. */
1236
+ locationId: /* @__PURE__ */ zod.z.string().nullable().optional(),
1204
1237
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1205
1238
  tags: /* @__PURE__ */ require_tag.TagsFieldSchema.optional(),
1239
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1240
+ tagIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
1206
1241
  /** Soft-disabled flag. */
1207
1242
  disabled: /* @__PURE__ */ zod.z.boolean(),
1208
1243
  parentDeviceId: /* @__PURE__ */ zod.z.number().nullable(),
@@ -1373,8 +1408,12 @@ var SavedDeviceRowSchema = /* @__PURE__ */ zod.z.object({
1373
1408
  name: /* @__PURE__ */ zod.z.string(),
1374
1409
  /** Operator-organisational location label. `null` when unset. */
1375
1410
  location: /* @__PURE__ */ zod.z.string().nullable(),
1411
+ /** The room id (D1089); `location` is its current name, DERIVED and read-only. */
1412
+ locationId: /* @__PURE__ */ zod.z.string().nullable().optional(),
1376
1413
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1377
1414
  tags: /* @__PURE__ */ require_tag.TagsFieldSchema.optional(),
1415
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1416
+ tagIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
1378
1417
  /** Soft-disabled flag. */
1379
1418
  disabled: /* @__PURE__ */ zod.z.boolean(),
1380
1419
  parentDeviceId: /* @__PURE__ */ zod.z.number().nullable(),
@@ -1397,8 +1436,12 @@ var DeviceMetaSchema = /* @__PURE__ */ zod.z.object({
1397
1436
  * `DeviceMeta.userNamed`. */
1398
1437
  userNamed: /* @__PURE__ */ zod.z.boolean().optional(),
1399
1438
  location: /* @__PURE__ */ zod.z.string().nullable(),
1439
+ /** The room (D1089): `location` is its current name, DERIVED. `null` when unset or unknown. */
1440
+ locationId: /* @__PURE__ */ zod.z.string().nullable().optional(),
1400
1441
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1401
1442
  tags: /* @__PURE__ */ require_tag.TagsFieldSchema.optional(),
1443
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1444
+ tagIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
1402
1445
  disabled: /* @__PURE__ */ zod.z.boolean(),
1403
1446
  parentDeviceId: /* @__PURE__ */ zod.z.number().nullable(),
1404
1447
  metadata: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).nullable().optional(),
@@ -1543,7 +1586,27 @@ var MigrateDeviceResultSchema = /* @__PURE__ */ zod.z.object({
1543
1586
  /** Switches that could NOT be turned off on the source. Empty is the only
1544
1587
  * value meaning the replaced hardware is quiet. */
1545
1588
  sourceStillLive: /* @__PURE__ */ zod.z.array(require_device_identifiers.CameraSwitchIdSchema).readonly(),
1546
- swapped: /* @__PURE__ */ zod.z.boolean()
1589
+ swapped: /* @__PURE__ */ zod.z.boolean(),
1590
+ /** The keychain half of the swap (D339): the secrets the swapped config's
1591
+ * markers name moved with it. Refs only, never values. */
1592
+ secretScopes: /* @__PURE__ */ zod.z.object({
1593
+ exchanged: /* @__PURE__ */ zod.z.boolean(),
1594
+ markersRepointed: /* @__PURE__ */ zod.z.number().int(),
1595
+ refsAtSource: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
1596
+ refsAtTarget: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly()
1597
+ })
1598
+ });
1599
+ /** What `repairMigrationSecrets` found and did: counts and refs, never values. */
1600
+ var MigrationSecretRepairSchema = /* @__PURE__ */ zod.z.object({
1601
+ outcome: /* @__PURE__ */ zod.z.enum([
1602
+ "repaired",
1603
+ "would-repair",
1604
+ "nothing-to-repair"
1605
+ ]),
1606
+ markersRepointedAtA: /* @__PURE__ */ zod.z.number().int(),
1607
+ markersRepointedAtB: /* @__PURE__ */ zod.z.number().int(),
1608
+ refsNowAtA: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
1609
+ refsNowAtB: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly()
1547
1610
  });
1548
1611
  var deviceManagerCapability = {
1549
1612
  name: "device-manager",
@@ -1594,6 +1657,26 @@ var deviceManagerCapability = {
1594
1657
  auth: "admin",
1595
1658
  timeoutMs: 12 * 6e4
1596
1659
  }),
1660
+ /**
1661
+ * Repair a pair a migration left with CROSSED secrets (it ran before the
1662
+ * keychain followed the config, D339): each device's config carries
1663
+ * markers naming the OTHER device's keychain scope, so removing the
1664
+ * leftover device would delete the migrated camera's password. Brings
1665
+ * every such value under the number whose config holds it, through staged
1666
+ * copies (stage, point both configs at the stage, write the end refs,
1667
+ * point at them, delete the stage), so a crash at any step is re-run to the
1668
+ * right end state. A pair crossed on one side only is repaired field by
1669
+ * field. Idempotent; `apply: false` (the default) is a dry run that
1670
+ * reports counts only. Refs only, never values.
1671
+ */
1672
+ repairMigrationSecrets: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1673
+ deviceA: /* @__PURE__ */ zod.z.number().int(),
1674
+ deviceB: /* @__PURE__ */ zod.z.number().int(),
1675
+ apply: /* @__PURE__ */ zod.z.boolean().default(false)
1676
+ }), MigrationSecretRepairSchema, {
1677
+ kind: "mutation",
1678
+ auth: "admin"
1679
+ }),
1597
1680
  /** Register a device in the DB + in-memory registry. Called by DeviceManagerApi.register(). */
1598
1681
  registerDevice: /* @__PURE__ */ require_capability_definition.method(DeviceRegisterPayloadSchema, /* @__PURE__ */ zod.z.void(), { kind: "mutation" }),
1599
1682
  /** Remove a device from the DB + in-memory registry. Called by DeviceManagerApi.remove(). */
@@ -1694,7 +1777,10 @@ var deviceManagerCapability = {
1694
1777
  * clears it. */
1695
1778
  setLocation: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1696
1779
  deviceId: /* @__PURE__ */ zod.z.number(),
1697
- location: /* @__PURE__ */ zod.z.string().nullable()
1780
+ /** The room by TEXT: accepted for one release, resolved through `ensureRoom` (D1089). */
1781
+ location: /* @__PURE__ */ zod.z.string().nullable().optional(),
1782
+ /** The room by id (D1089); wins over `location`. `null` clears it. */
1783
+ locationId: /* @__PURE__ */ zod.z.string().nullable().optional()
1698
1784
  }), /* @__PURE__ */ zod.z.void(), {
1699
1785
  kind: "mutation",
1700
1786
  auth: "admin"
@@ -1705,7 +1791,10 @@ var deviceManagerCapability = {
1705
1791
  * descendants. */
1706
1792
  setTags: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1707
1793
  deviceId: /* @__PURE__ */ zod.z.number(),
1708
- tags: require_tag.TagsFieldSchema
1794
+ /** Tags by TEXT: accepted for one release, resolved through `ensureTag` (D1089). */
1795
+ tags: /* @__PURE__ */ require_tag.TagsFieldSchema.optional(),
1796
+ /** Tags by id (D1089); wins over `tags`. */
1797
+ tagIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).max(20).optional()
1709
1798
  }), /* @__PURE__ */ zod.z.void(), {
1710
1799
  kind: "mutation",
1711
1800
  auth: "admin"
@@ -1866,7 +1955,9 @@ var deviceManagerCapability = {
1866
1955
  deviceId: /* @__PURE__ */ zod.z.number(),
1867
1956
  name: /* @__PURE__ */ zod.z.string().optional(),
1868
1957
  location: /* @__PURE__ */ zod.z.string().nullable().optional(),
1958
+ locationId: /* @__PURE__ */ zod.z.string().nullable().optional(),
1869
1959
  tags: /* @__PURE__ */ require_tag.TagsFieldSchema.optional(),
1960
+ tagIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).max(20).optional(),
1870
1961
  type: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType).optional(),
1871
1962
  integrationId: /* @__PURE__ */ zod.z.string().optional(),
1872
1963
  linkDeviceId: /* @__PURE__ */ zod.z.number().nullable().optional(),
@@ -1967,6 +2058,32 @@ var deviceManagerCapability = {
1967
2058
  kind: "mutation",
1968
2059
  auth: "admin"
1969
2060
  }),
2061
+ /** Create the room named `name`, or return the one that has it (trimmed,
2062
+ * case-insensitive): the "type a new name in the picker" flow is one call
2063
+ * (D1089). A new room gets a random id. */
2064
+ ensureRoom: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ name: RoomNameSchema }), RoomSchema, {
2065
+ kind: "mutation",
2066
+ auth: "admin"
2067
+ }),
2068
+ /** Every room record, sorted by `order` then name. A room with no device is listed. */
2069
+ listRooms: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(RoomSchema), { role: "viewer" }),
2070
+ /** ONE write to ONE record: rename, restyle, describe, move to a zone. A field
2071
+ * left out is kept, `null` clears it. A rename onto the name another room
2072
+ * has is refused (`room-name-taken`); merge by moving devices instead. No
2073
+ * device is rewritten. Unknown id is refused (`room-not-found`). */
2074
+ updateRoom: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
2075
+ id: /* @__PURE__ */ zod.z.string().min(1),
2076
+ patch: RoomPatchSchema
2077
+ }), RoomSchema, {
2078
+ kind: "mutation",
2079
+ auth: "admin"
2080
+ }),
2081
+ /** Delete a room and clear every reference to it in one server operation:
2082
+ * its devices read as having no room. Idempotent. */
2083
+ deleteRoom: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ id: /* @__PURE__ */ zod.z.string().min(1) }), /* @__PURE__ */ zod.z.object({ cleared: /* @__PURE__ */ zod.z.number() }), {
2084
+ kind: "mutation",
2085
+ auth: "admin"
2086
+ }),
1970
2087
  /** Operator-curated location registry. Returns the union of:
1971
2088
  * (1) labels persisted in the registry via `addLocation`, and
1972
2089
  * (2) labels currently in use on at least one device's
@@ -2844,6 +2961,36 @@ Object.defineProperty(exports, "ResyncResultSchema", {
2844
2961
  return ResyncResultSchema;
2845
2962
  }
2846
2963
  });
2964
+ Object.defineProperty(exports, "RoomBodySchema", {
2965
+ enumerable: true,
2966
+ get: function() {
2967
+ return RoomBodySchema;
2968
+ }
2969
+ });
2970
+ Object.defineProperty(exports, "TagBodySchema", {
2971
+ enumerable: true,
2972
+ get: function() {
2973
+ return TagBodySchema;
2974
+ }
2975
+ });
2976
+ Object.defineProperty(exports, "TagPatchSchema", {
2977
+ enumerable: true,
2978
+ get: function() {
2979
+ return TagPatchSchema;
2980
+ }
2981
+ });
2982
+ Object.defineProperty(exports, "TagRecordSchema", {
2983
+ enumerable: true,
2984
+ get: function() {
2985
+ return TagRecordSchema;
2986
+ }
2987
+ });
2988
+ Object.defineProperty(exports, "ZoneBodySchema", {
2989
+ enumerable: true,
2990
+ get: function() {
2991
+ return ZoneBodySchema;
2992
+ }
2993
+ });
2847
2994
  Object.defineProperty(exports, "checkDeviceAlias", {
2848
2995
  enumerable: true,
2849
2996
  get: function() {
@@ -2886,9 +3033,3 @@ Object.defineProperty(exports, "resolveTemplateRef", {
2886
3033
  return resolveTemplateRef;
2887
3034
  }
2888
3035
  });
2889
- Object.defineProperty(exports, "siteZoneKey", {
2890
- enumerable: true,
2891
- get: function() {
2892
- return siteZoneKey;
2893
- }
2894
- });
@@ -2,9 +2,9 @@ import { m as StreamSourceEntrySchema } from "./streaming-shared-B8cXatuU.mjs";
2
2
  import { c as method } from "./capability-definition-C1TLUVJR.mjs";
3
3
  import { d as CameraSwitchIdSchema, n as DeviceIdentifierKeySchema, r as DeviceIdentifiersSchema } from "./device-identifiers-iSuQCKmK.mjs";
4
4
  import { t as ReadingQuantitySchema } from "./quantity-D3g5SxsZ.mjs";
5
- import { i as TagsFieldSchema, u as IconKeySchema } from "./tag-uZBAq6ox.mjs";
5
+ import { a as TagsFieldSchema, d as IconKeySchema, r as TagNameSchema, t as TagColorIdSchema } from "./tag-DU8pm9Bi.mjs";
6
6
  import { n as DeviceRole, r as DeviceType } from "./device-type-TUGqGmaI.mjs";
7
- import { c as LocationDescriptionAssignmentSchema, l as LocationIconAssignmentSchema, n as SettingsSchemaWithValuesSchema } from "./addon-settings.cap-CZ4MC7ha.mjs";
7
+ import { c as LocationDescriptionAssignmentSchema, l as LocationIconAssignmentSchema, n as SettingsSchemaWithValuesSchema } from "./addon-settings.cap-CHpmuaQG.mjs";
8
8
  import { n as SourceInfoSchema } from "./source-info-DGB7SdB_.mjs";
9
9
  import { a as FieldProbeResultSchema, n as DiscoveryCandidateSchema, t as DeviceSummarySchema } from "./device-provider.cap-D8mJllVM.mjs";
10
10
  import { z } from "zod";
@@ -812,17 +812,6 @@ var SiteZoneSchema = /* @__PURE__ */ z.object({
812
812
  * the ones that most want grouping. */
813
813
  locationKeys: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string())
814
814
  });
815
- /**
816
- * The join key for a zone label: trimmed, lower-cased.
817
- *
818
- * Deliberately a separate export from `locationIconKey` even though the
819
- * derivation is identical — they key different maps, and a future change to one
820
- * must not silently re-key the other. Their agreement is a fact about today,
821
- * not a dependency.
822
- */
823
- function siteZoneKey(label) {
824
- return label.trim().toLowerCase();
825
- }
826
815
  //#endregion
827
816
  //#region ../types/dist/esm/device/device-identity-candidates.mjs
828
817
  /**
@@ -989,6 +978,48 @@ var IdentityLinkDecisionSchema = /* @__PURE__ */ z.discriminatedUnion("ok", [/*
989
978
  message: /* @__PURE__ */ z.string()
990
979
  })]);
991
980
  //#endregion
981
+ //#region ../types/dist/esm/entities/entities.mjs
982
+ var RoomNameSchema = /* @__PURE__ */ z.string().trim().min(1).max(80);
983
+ var RoomBodySchema = /* @__PURE__ */ z.object({
984
+ name: RoomNameSchema,
985
+ icon: /* @__PURE__ */ IconKeySchema.optional(),
986
+ description: /* @__PURE__ */ z.string().optional(),
987
+ /** The id of the site zone this room belongs to (`zones` record). */
988
+ zoneId: /* @__PURE__ */ z.string().min(1).optional(),
989
+ colour: /* @__PURE__ */ TagColorIdSchema.optional(),
990
+ order: /* @__PURE__ */ z.number().optional()
991
+ });
992
+ var RoomSchema = /* @__PURE__ */ RoomBodySchema.extend({ id: /* @__PURE__ */ z.string().min(1) });
993
+ /** A zone record: name and icon; its rooms are the rooms whose `zoneId` names it. */
994
+ var ZoneBodySchema = /* @__PURE__ */ z.object({
995
+ name: RoomNameSchema,
996
+ icon: /* @__PURE__ */ IconKeySchema.optional()
997
+ });
998
+ var TagBodySchema = /* @__PURE__ */ z.object({
999
+ name: TagNameSchema,
1000
+ colour: /* @__PURE__ */ TagColorIdSchema.optional(),
1001
+ icon: /* @__PURE__ */ IconKeySchema.optional(),
1002
+ description: /* @__PURE__ */ z.string().optional(),
1003
+ order: /* @__PURE__ */ z.number().optional()
1004
+ });
1005
+ var TagRecordSchema = /* @__PURE__ */ TagBodySchema.extend({ id: /* @__PURE__ */ z.string().min(1) });
1006
+ /** The partial an `update*` call carries: a field left out is kept, `null` clears it. */
1007
+ var RoomPatchSchema = /* @__PURE__ */ z.object({
1008
+ name: /* @__PURE__ */ RoomNameSchema.optional(),
1009
+ icon: /* @__PURE__ */ IconKeySchema.nullable().optional(),
1010
+ description: /* @__PURE__ */ z.string().nullable().optional(),
1011
+ zoneId: /* @__PURE__ */ z.string().min(1).nullable().optional(),
1012
+ colour: /* @__PURE__ */ TagColorIdSchema.nullable().optional(),
1013
+ order: /* @__PURE__ */ z.number().nullable().optional()
1014
+ });
1015
+ var TagPatchSchema = /* @__PURE__ */ z.object({
1016
+ name: /* @__PURE__ */ TagNameSchema.optional(),
1017
+ colour: /* @__PURE__ */ TagColorIdSchema.nullable().optional(),
1018
+ icon: /* @__PURE__ */ IconKeySchema.nullable().optional(),
1019
+ description: /* @__PURE__ */ z.string().nullable().optional(),
1020
+ order: /* @__PURE__ */ z.number().nullable().optional()
1021
+ });
1022
+ //#endregion
992
1023
  //#region ../types/dist/esm/capabilities/device-search.mjs
993
1024
  var DeviceSearchRequiresSchema = /* @__PURE__ */ z.object({
994
1025
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
@@ -1201,8 +1232,12 @@ var DeviceInfoSchema = /* @__PURE__ */ z.object({
1201
1232
  alias: /* @__PURE__ */ DeviceAliasSchema.optional(),
1202
1233
  /** Operator-organisational location label. `null` when unset. */
1203
1234
  location: /* @__PURE__ */ z.string().nullable(),
1235
+ /** The room id (D1089); `location` is its current name, DERIVED and read-only. */
1236
+ locationId: /* @__PURE__ */ z.string().nullable().optional(),
1204
1237
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1205
1238
  tags: /* @__PURE__ */ TagsFieldSchema.optional(),
1239
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1240
+ tagIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1206
1241
  /** Soft-disabled flag. */
1207
1242
  disabled: /* @__PURE__ */ z.boolean(),
1208
1243
  parentDeviceId: /* @__PURE__ */ z.number().nullable(),
@@ -1373,8 +1408,12 @@ var SavedDeviceRowSchema = /* @__PURE__ */ z.object({
1373
1408
  name: /* @__PURE__ */ z.string(),
1374
1409
  /** Operator-organisational location label. `null` when unset. */
1375
1410
  location: /* @__PURE__ */ z.string().nullable(),
1411
+ /** The room id (D1089); `location` is its current name, DERIVED and read-only. */
1412
+ locationId: /* @__PURE__ */ z.string().nullable().optional(),
1376
1413
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1377
1414
  tags: /* @__PURE__ */ TagsFieldSchema.optional(),
1415
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1416
+ tagIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1378
1417
  /** Soft-disabled flag. */
1379
1418
  disabled: /* @__PURE__ */ z.boolean(),
1380
1419
  parentDeviceId: /* @__PURE__ */ z.number().nullable(),
@@ -1397,8 +1436,12 @@ var DeviceMetaSchema = /* @__PURE__ */ z.object({
1397
1436
  * `DeviceMeta.userNamed`. */
1398
1437
  userNamed: /* @__PURE__ */ z.boolean().optional(),
1399
1438
  location: /* @__PURE__ */ z.string().nullable(),
1439
+ /** The room (D1089): `location` is its current name, DERIVED. `null` when unset or unknown. */
1440
+ locationId: /* @__PURE__ */ z.string().nullable().optional(),
1400
1441
  /** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
1401
1442
  tags: /* @__PURE__ */ TagsFieldSchema.optional(),
1443
+ /** The tag ids (D1089); `tags` is their current names, DERIVED and read-only. */
1444
+ tagIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1402
1445
  disabled: /* @__PURE__ */ z.boolean(),
1403
1446
  parentDeviceId: /* @__PURE__ */ z.number().nullable(),
1404
1447
  metadata: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).nullable().optional(),
@@ -1543,7 +1586,27 @@ var MigrateDeviceResultSchema = /* @__PURE__ */ z.object({
1543
1586
  /** Switches that could NOT be turned off on the source. Empty is the only
1544
1587
  * value meaning the replaced hardware is quiet. */
1545
1588
  sourceStillLive: /* @__PURE__ */ z.array(CameraSwitchIdSchema).readonly(),
1546
- swapped: /* @__PURE__ */ z.boolean()
1589
+ swapped: /* @__PURE__ */ z.boolean(),
1590
+ /** The keychain half of the swap (D339): the secrets the swapped config's
1591
+ * markers name moved with it. Refs only, never values. */
1592
+ secretScopes: /* @__PURE__ */ z.object({
1593
+ exchanged: /* @__PURE__ */ z.boolean(),
1594
+ markersRepointed: /* @__PURE__ */ z.number().int(),
1595
+ refsAtSource: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).readonly(),
1596
+ refsAtTarget: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).readonly()
1597
+ })
1598
+ });
1599
+ /** What `repairMigrationSecrets` found and did: counts and refs, never values. */
1600
+ var MigrationSecretRepairSchema = /* @__PURE__ */ z.object({
1601
+ outcome: /* @__PURE__ */ z.enum([
1602
+ "repaired",
1603
+ "would-repair",
1604
+ "nothing-to-repair"
1605
+ ]),
1606
+ markersRepointedAtA: /* @__PURE__ */ z.number().int(),
1607
+ markersRepointedAtB: /* @__PURE__ */ z.number().int(),
1608
+ refsNowAtA: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).readonly(),
1609
+ refsNowAtB: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).readonly()
1547
1610
  });
1548
1611
  var deviceManagerCapability = {
1549
1612
  name: "device-manager",
@@ -1594,6 +1657,26 @@ var deviceManagerCapability = {
1594
1657
  auth: "admin",
1595
1658
  timeoutMs: 12 * 6e4
1596
1659
  }),
1660
+ /**
1661
+ * Repair a pair a migration left with CROSSED secrets (it ran before the
1662
+ * keychain followed the config, D339): each device's config carries
1663
+ * markers naming the OTHER device's keychain scope, so removing the
1664
+ * leftover device would delete the migrated camera's password. Brings
1665
+ * every such value under the number whose config holds it, through staged
1666
+ * copies (stage, point both configs at the stage, write the end refs,
1667
+ * point at them, delete the stage), so a crash at any step is re-run to the
1668
+ * right end state. A pair crossed on one side only is repaired field by
1669
+ * field. Idempotent; `apply: false` (the default) is a dry run that
1670
+ * reports counts only. Refs only, never values.
1671
+ */
1672
+ repairMigrationSecrets: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
1673
+ deviceA: /* @__PURE__ */ z.number().int(),
1674
+ deviceB: /* @__PURE__ */ z.number().int(),
1675
+ apply: /* @__PURE__ */ z.boolean().default(false)
1676
+ }), MigrationSecretRepairSchema, {
1677
+ kind: "mutation",
1678
+ auth: "admin"
1679
+ }),
1597
1680
  /** Register a device in the DB + in-memory registry. Called by DeviceManagerApi.register(). */
1598
1681
  registerDevice: /* @__PURE__ */ method(DeviceRegisterPayloadSchema, /* @__PURE__ */ z.void(), { kind: "mutation" }),
1599
1682
  /** Remove a device from the DB + in-memory registry. Called by DeviceManagerApi.remove(). */
@@ -1694,7 +1777,10 @@ var deviceManagerCapability = {
1694
1777
  * clears it. */
1695
1778
  setLocation: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
1696
1779
  deviceId: /* @__PURE__ */ z.number(),
1697
- location: /* @__PURE__ */ z.string().nullable()
1780
+ /** The room by TEXT: accepted for one release, resolved through `ensureRoom` (D1089). */
1781
+ location: /* @__PURE__ */ z.string().nullable().optional(),
1782
+ /** The room by id (D1089); wins over `location`. `null` clears it. */
1783
+ locationId: /* @__PURE__ */ z.string().nullable().optional()
1698
1784
  }), /* @__PURE__ */ z.void(), {
1699
1785
  kind: "mutation",
1700
1786
  auth: "admin"
@@ -1705,7 +1791,10 @@ var deviceManagerCapability = {
1705
1791
  * descendants. */
1706
1792
  setTags: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
1707
1793
  deviceId: /* @__PURE__ */ z.number(),
1708
- tags: TagsFieldSchema
1794
+ /** Tags by TEXT: accepted for one release, resolved through `ensureTag` (D1089). */
1795
+ tags: /* @__PURE__ */ TagsFieldSchema.optional(),
1796
+ /** Tags by id (D1089); wins over `tags`. */
1797
+ tagIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(20).optional()
1709
1798
  }), /* @__PURE__ */ z.void(), {
1710
1799
  kind: "mutation",
1711
1800
  auth: "admin"
@@ -1866,7 +1955,9 @@ var deviceManagerCapability = {
1866
1955
  deviceId: /* @__PURE__ */ z.number(),
1867
1956
  name: /* @__PURE__ */ z.string().optional(),
1868
1957
  location: /* @__PURE__ */ z.string().nullable().optional(),
1958
+ locationId: /* @__PURE__ */ z.string().nullable().optional(),
1869
1959
  tags: /* @__PURE__ */ TagsFieldSchema.optional(),
1960
+ tagIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(20).optional(),
1870
1961
  type: /* @__PURE__ */ z.enum(DeviceType).optional(),
1871
1962
  integrationId: /* @__PURE__ */ z.string().optional(),
1872
1963
  linkDeviceId: /* @__PURE__ */ z.number().nullable().optional(),
@@ -1967,6 +2058,32 @@ var deviceManagerCapability = {
1967
2058
  kind: "mutation",
1968
2059
  auth: "admin"
1969
2060
  }),
2061
+ /** Create the room named `name`, or return the one that has it (trimmed,
2062
+ * case-insensitive): the "type a new name in the picker" flow is one call
2063
+ * (D1089). A new room gets a random id. */
2064
+ ensureRoom: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ name: RoomNameSchema }), RoomSchema, {
2065
+ kind: "mutation",
2066
+ auth: "admin"
2067
+ }),
2068
+ /** Every room record, sorted by `order` then name. A room with no device is listed. */
2069
+ listRooms: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), /* @__PURE__ */ z.array(RoomSchema), { role: "viewer" }),
2070
+ /** ONE write to ONE record: rename, restyle, describe, move to a zone. A field
2071
+ * left out is kept, `null` clears it. A rename onto the name another room
2072
+ * has is refused (`room-name-taken`); merge by moving devices instead. No
2073
+ * device is rewritten. Unknown id is refused (`room-not-found`). */
2074
+ updateRoom: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
2075
+ id: /* @__PURE__ */ z.string().min(1),
2076
+ patch: RoomPatchSchema
2077
+ }), RoomSchema, {
2078
+ kind: "mutation",
2079
+ auth: "admin"
2080
+ }),
2081
+ /** Delete a room and clear every reference to it in one server operation:
2082
+ * its devices read as having no room. Idempotent. */
2083
+ deleteRoom: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ id: /* @__PURE__ */ z.string().min(1) }), /* @__PURE__ */ z.object({ cleared: /* @__PURE__ */ z.number() }), {
2084
+ kind: "mutation",
2085
+ auth: "admin"
2086
+ }),
1970
2087
  /** Operator-curated location registry. Returns the union of:
1971
2088
  * (1) labels persisted in the registry via `addLocation`, and
1972
2089
  * (2) labels currently in use on at least one device's
@@ -2766,4 +2883,4 @@ var deviceManagerCapability = {
2766
2883
  vocabulary: { notOperatorFacing: "the device registry itself — rename, move and remove are administration" }
2767
2884
  };
2768
2885
  //#endregion
2769
- export { resolveTemplateRef as _, deviceManagerCapability as a, ResyncResultSchema as b, IdentityLinkBodySchema as c, siteZoneKey as d, DEVICE_TEMPLATE_FILTERS as f, DEVICE_TEMPLATE_VALUES_CAP as g, DEVICE_TEMPLATE_THIS_ALIAS as h, LinkedDevicesSlotValueSchema as i, identityLinkId as l, DEVICE_TEMPLATE_MAX_OUTPUT as m, DeviceTombstoneSchema as n, DiscoveryProposalBodySchema as o, DEVICE_TEMPLATE_MAX_LENGTH as p, LINKED_DEVICES_SLOT as r, IDENTITY_LINK_KINDS as s, DEVICE_TOMBSTONE_RETENTION_MS as t, identityLinkSidesRefusal as u, checkDeviceAlias as v, deviceAdoptionCapability as x, generateDeviceAlias as y };
2886
+ export { generateDeviceAlias as C, checkDeviceAlias as S, deviceAdoptionCapability as T, DEVICE_TEMPLATE_MAX_LENGTH as _, deviceManagerCapability as a, DEVICE_TEMPLATE_VALUES_CAP as b, TagBodySchema as c, ZoneBodySchema as d, IDENTITY_LINK_KINDS as f, DEVICE_TEMPLATE_FILTERS as g, identityLinkSidesRefusal as h, LinkedDevicesSlotValueSchema as i, TagPatchSchema as l, identityLinkId as m, DeviceTombstoneSchema as n, DiscoveryProposalBodySchema as o, IdentityLinkBodySchema as p, LINKED_DEVICES_SLOT as r, RoomBodySchema as s, DEVICE_TOMBSTONE_RETENTION_MS as t, TagRecordSchema as u, DEVICE_TEMPLATE_MAX_OUTPUT as v, ResyncResultSchema as w, resolveTemplateRef as x, DEVICE_TEMPLATE_THIS_ALIAS as y };
@@ -70,7 +70,13 @@ listFaultTypes: /* @__PURE__ */ method(ListFaultTypesInputSchema, FaultTypesSche
70
70
  status: {
71
71
  schema: ErrorStatusSchema,
72
72
  kind: "push",
73
- empty: ERROR_STATUS_COLD
73
+ empty: ERROR_STATUS_COLD,
74
+ fieldEnums: { code: {
75
+ from: "method",
76
+ method: "listFaultTypes",
77
+ listKey: "types",
78
+ valueKey: "code"
79
+ } }
74
80
  },
75
81
  runtimeState: ErrorStatusSchema,
76
82
  /**
@@ -70,7 +70,13 @@ listFaultTypes: /* @__PURE__ */ require_capability_definition.method(ListFaultTy
70
70
  status: {
71
71
  schema: ErrorStatusSchema,
72
72
  kind: "push",
73
- empty: ERROR_STATUS_COLD
73
+ empty: ERROR_STATUS_COLD,
74
+ fieldEnums: { code: {
75
+ from: "method",
76
+ method: "listFaultTypes",
77
+ listKey: "types",
78
+ valueKey: "code"
79
+ } }
74
80
  },
75
81
  runtimeState: ErrorStatusSchema,
76
82
  /**
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-BgYiAy5b.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-CkPfVApC.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-Bey5ChBb.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-u84_1sVl.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,15 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_base_addon = require("./base-addon-CRsXtYFG.js");
3
+ const require_base_addon = require("./base-addon-BG7p06Hb.js");
4
4
  const require_scoped_settings = require("./scoped-settings-CylSSq_8.js");
5
- const require_rename_composition_block = require("./rename-composition-block-D9Uc1AF7.js");
5
+ const require_rename_composition_block = require("./rename-composition-block-Cx3X8QSm.js");
6
6
  const require_camstack_error = require("./camstack-error-DJ-TUAi1.js");
7
7
  const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
8
8
  const require_record_kind = require("./record-kind-DoBfYHCs.js");
9
- const require_wal_maintenance = require("./wal-maintenance-BgYiAy5b.js");
9
+ const require_wal_maintenance = require("./wal-maintenance-CkPfVApC.js");
10
10
  const require_device_certificate = require("./device-certificate-CguVACQO.js");
11
- const require_addon_settings_cap = require("./addon-settings.cap-DrLdMFIe.js");
12
- const require_prefix_walk = require("./prefix-walk-BFnw8NBu.js");
11
+ const require_addon_settings_cap = require("./addon-settings.cap-nZVHPo3X.js");
12
+ const require_named_entity_store = require("./named-entity-store-DFwLij9c.js");
13
13
  const require_network_access_cap = require("./network-access.cap-CTQ2WQoi.js");
14
14
  const require_constants = require("./constants-C860Y6U4.js");
15
15
  const require_addon_id = require("./addon-id-Di0lNJ89.js");
@@ -42,7 +42,7 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
42
42
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
43
43
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
44
44
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
45
- const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-CdqYAj-o.js");
45
+ const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BK8eoGlF.js");
46
46
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
47
47
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
48
48
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
@@ -12625,7 +12625,7 @@ function asBlob(value) {
12625
12625
  * form opens, and the capability preferences once at boot.
12626
12626
  */
12627
12627
  async function loadSystemSettingsPrefix(door, prefix, mayRead = () => true) {
12628
- const listed = await require_prefix_walk.loadPrefixed(door, "system-settings", prefix, () => null);
12628
+ const listed = await require_named_entity_store.loadPrefixed(door, "system-settings", prefix, () => null);
12629
12629
  const result = {};
12630
12630
  for (const suffix of Object.keys(listed).filter(mayRead)) {
12631
12631
  const value = await door.get({
@@ -1,14 +1,14 @@
1
1
  import { i as __require } from "./chunk-CNf5ZN-e.mjs";
2
- import { b as EventCategory$1, i as collectSecretMarkerRefs, p as createEvent$1 } from "./base-addon-BcS6r1cT.mjs";
2
+ import { b as EventCategory$1, i as collectSecretMarkerRefs, p as createEvent$1 } from "./base-addon-BcVoYZbC.mjs";
3
3
  import { Z as errMsg$1 } from "./scoped-settings-DVWUIP7Z.mjs";
4
- import { Un as lifecycleJobSchema, a as isCollectionArrayMethod, c as kebabToCamel$1, d as objectInputDeclaresRequiredDeviceId, dr as compareVersions, f as procedureAuthKey, fr as describeUnmet, i as isArrayOutputSchema, l as looseSchema, m as ALL_CAPABILITY_DEFINITIONS, o as isObjectInput, p as resolveMethodAuth, pr as unmetRequirements, r as extractNestedAddonId, s as isVoidInput, u as objectInputDeclaresAddonId, ur as PackageRequiresSchema } from "./rename-composition-block-Cdh-dRmY.mjs";
4
+ import { Un as lifecycleJobSchema, a as isCollectionArrayMethod, c as kebabToCamel$1, d as objectInputDeclaresRequiredDeviceId, dr as compareVersions, f as procedureAuthKey, fr as describeUnmet, i as isArrayOutputSchema, l as looseSchema, m as ALL_CAPABILITY_DEFINITIONS, o as isObjectInput, p as resolveMethodAuth, pr as unmetRequirements, r as extractNestedAddonId, s as isVoidInput, u as objectInputDeclaresAddonId, ur as PackageRequiresSchema } from "./rename-composition-block-C3QQ9UUE.mjs";
5
5
  import { t as userError } from "./camstack-error-viZYfcj9.mjs";
6
6
  import { a as expandCapMethods, n as DEVICE_STATUS_METHOD, t as DEVICE_SETTINGS_CONTRIBUTION_METHODS, u as resolveCapMount } from "./capability-definition-C1TLUVJR.mjs";
7
7
  import { s as defineRecordKinds } from "./record-kind-ub6NXqfh.mjs";
8
- import { D as RecordsEngine, J as asNumber, X as parseJsonObject, Y as asString$1, Z as parseJsonUnknown, l as SqliteSettingsBackend, q as asJsonObject$1 } from "./wal-maintenance-Bey5ChBb.mjs";
8
+ import { D as RecordsEngine, J as asNumber, X as parseJsonObject, Y as asString$1, Z as parseJsonUnknown, l as SqliteSettingsBackend, q as asJsonObject$1 } from "./wal-maintenance-u84_1sVl.mjs";
9
9
  import { f as AppPageLangSchema } from "./device-certificate-Cddm4Idn.mjs";
10
- import { i as addonSettingsCapability } from "./addon-settings.cap-CZ4MC7ha.mjs";
11
- import { t as loadPrefixed } from "./prefix-walk-Mtij0NNT.mjs";
10
+ import { i as addonSettingsCapability } from "./addon-settings.cap-CHpmuaQG.mjs";
11
+ import { a as loadPrefixed } from "./named-entity-store-DOnyyFFf.mjs";
12
12
  import { a as AGENT_MDNS_TXT_KEYS, i as AGENT_MDNS_SERVICE_TYPE } from "./network-access.cap-Dx5K0I5i.mjs";
13
13
  import { t as RUNTIME_DEFAULTS } from "./constants-DCLpoF4L.mjs";
14
14
  import { t as bareAddonId } from "./addon-id-CVg1_r5E.mjs";
@@ -41,7 +41,7 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
41
41
  import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
42
42
  import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
43
43
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
44
- import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-LSgpClpX.mjs";
44
+ import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-CwzC5XNk.mjs";
45
45
  import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
46
46
  import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
47
47
  import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";