@camstack/server 1.2.897 → 1.2.899

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 (114) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/cap-router-runtime.js +1 -0
  3. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  4. package/dist/api/trpc/generated-cap-routers.js +1894 -1870
  5. package/dist/core/addon/hub-addon-api.js +1 -0
  6. package/dist/core/moleculer/moleculer.service.js +1 -0
  7. package/package.json +11 -10
  8. package/system/dist/addon-runner.js +207 -13
  9. package/system/dist/addon-runner.mjs +207 -13
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  15. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  16. package/system/dist/builtins/autotrack/index.js +1 -1
  17. package/system/dist/builtins/autotrack/index.mjs +1 -1
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  19. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  20. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  21. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  22. package/system/dist/builtins/camera-grid/index.js +1 -1
  23. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  24. package/system/dist/builtins/composer/composer.addon.js +14 -11
  25. package/system/dist/builtins/composer/composer.addon.mjs +11 -8
  26. package/system/dist/builtins/console-logging/index.js +1 -1
  27. package/system/dist/builtins/console-logging/index.mjs +1 -1
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.js +170 -14
  29. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +169 -13
  30. package/system/dist/builtins/core-blocks/migrations/automation-confirmed-view.d.ts +23 -0
  31. package/system/dist/builtins/core-blocks/migrations/index.d.ts +1 -0
  32. package/system/dist/builtins/core-blocks/migrations/pump-cycle-split.d.ts +1 -0
  33. package/system/dist/builtins/device-history/device-history.addon.js +10 -9
  34. package/system/dist/builtins/device-history/device-history.addon.mjs +10 -9
  35. package/system/dist/builtins/device-manager/command-holds-wiring.d.ts +22 -0
  36. package/system/dist/builtins/device-manager/command-holds.d.ts +77 -0
  37. package/system/dist/builtins/device-manager/device-manager.addon.d.ts +3 -0
  38. package/system/dist/builtins/device-manager/device-manager.addon.js +1078 -41
  39. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1062 -42
  40. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +42 -9
  41. package/system/dist/builtins/device-manager/state-refresh-scheduler.d.ts +92 -0
  42. package/system/dist/builtins/device-manager/state-refresh-wiring.d.ts +23 -0
  43. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  44. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  45. package/system/dist/builtins/keychain/index.js +4 -4
  46. package/system/dist/builtins/keychain/index.mjs +4 -4
  47. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  49. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  50. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  51. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  52. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  53. package/system/dist/builtins/loki-logging/index.js +1 -1
  54. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  55. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  57. package/system/dist/builtins/platform-probe/index.js +1 -1
  58. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  59. package/system/dist/builtins/record-entries/index.js +1 -1
  60. package/system/dist/builtins/record-entries/index.mjs +1 -1
  61. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  63. package/system/dist/builtins/shared/device-state-changed.d.ts +8 -0
  64. package/system/dist/builtins/snapshot/index.js +1 -1
  65. package/system/dist/builtins/snapshot/index.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  69. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  70. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  71. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  72. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  73. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  74. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  75. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  76. package/system/dist/builtins/winston-logging/index.js +1 -1
  77. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  78. package/system/dist/{capture-engine-Bjgs__i9.mjs → capture-engine-BcD6iCZM.mjs} +37 -2
  79. package/system/dist/{capture-engine-D1rjl2dW.js → capture-engine-LHKTf-nM.js} +48 -1
  80. package/system/dist/{composition-sources-B727nlA0.mjs → composition-sources-C3ARJk2g.mjs} +2 -21
  81. package/system/dist/{composition-sources-CF2-u58e.js → composition-sources-DNUDbuXy.js} +1 -32
  82. package/system/dist/{constants-DaR1SUh7.js → constants-dL8fl9aI.js} +1 -1
  83. package/system/dist/{constants-BF309c_I.mjs → constants-er38mZOb.mjs} +1 -1
  84. package/system/dist/{device-ca-DT1hYtdW.mjs → device-ca-Ccz5olgH.mjs} +1 -1
  85. package/system/dist/{device-ca-BqcX5_f2.js → device-ca-KWa6uJRU.js} +1 -1
  86. package/system/dist/{dist-DorY_sjS.mjs → dist-DBanWvHF.mjs} +819 -54
  87. package/system/dist/{dist-BoEy9sm9.js → dist-DEAjZE_-.js} +848 -53
  88. package/system/dist/file-host-worker.js +1 -1
  89. package/system/dist/file-host-worker.mjs +1 -1
  90. package/system/dist/{hub-identity-CZ0nE3GK.mjs → hub-identity-CVv79TVO.mjs} +1 -1
  91. package/system/dist/{hub-identity-DH1rxUMD.js → hub-identity-Dy8ZSUuq.js} +1 -1
  92. package/system/dist/{hub-mdns-ciao-N0nL34fx.js → hub-mdns-ciao-C_XjO7YI.js} +2 -2
  93. package/system/dist/{hub-mdns-ciao-7HK57Vtx.mjs → hub-mdns-ciao-DtmIyWDL.mjs} +2 -2
  94. package/system/dist/index.js +96 -17
  95. package/system/dist/index.mjs +92 -19
  96. package/system/dist/kernel/cap-router-builder.d.ts +7 -0
  97. package/system/dist/kernel/command-follow-up.d.ts +33 -0
  98. package/system/dist/kernel/command-hold-overrides.d.ts +42 -0
  99. package/system/dist/kernel/command-observation.d.ts +3 -0
  100. package/system/dist/kernel/index.d.ts +3 -0
  101. package/system/dist/kernel/moleculer/child-cap-descriptors.d.ts +5 -0
  102. package/system/dist/kernel/moleculer/device-cap-proxy.d.ts +3 -1
  103. package/system/dist/kernel/state-refresh-policies.d.ts +53 -0
  104. package/system/dist/kernel/transport/child-cap-protocol.d.ts +11 -1
  105. package/system/dist/kernel/transport/local-child-registry.d.ts +14 -0
  106. package/system/dist/{legacy-integration-rows-door-CdAQlIvv.mjs → legacy-integration-rows-door-BL8T4lya.mjs} +1 -1
  107. package/system/dist/{legacy-integration-rows-door-BTfeULYt.js → legacy-integration-rows-door-DPInWtE6.js} +1 -1
  108. package/system/dist/{rename-composition-block-B1x-yK5U.js → rename-composition-block-BxzETYOf.js} +1 -1
  109. package/system/dist/{rename-composition-block-CIQjxBUa.mjs → rename-composition-block-Dgo-9-Ts.mjs} +1 -1
  110. package/system/dist/{restore-archive-Bj_gYmE9.mjs → restore-archive-BUtuNTe1.mjs} +82 -82
  111. package/system/dist/{restore-archive-B086o8pL.js → restore-archive-Zvx9sHZP.js} +1 -1
  112. package/system/dist/{wal-maintenance-MVIyxmu7.js → wal-maintenance-DS2IKwtK.js} +0 -0
  113. package/system/dist/{wal-maintenance-Dgfmi-Ao.mjs → wal-maintenance-cASt_sYy.mjs} +0 -0
  114. package/system/package.json +1 -1
@@ -1298,7 +1298,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1298
1298
  */
1299
1299
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1300
1300
  //#endregion
1301
- //#region ../types/dist/sleep-BT1bLgPq.mjs
1301
+ //#region ../types/dist/sleep-DO-ayTnk.mjs
1302
1302
  /**
1303
1303
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1304
1304
  * window to float samples (D455).
@@ -6871,6 +6871,10 @@ var CAP_VOCABULARY_BY_NAME = {
6871
6871
  it: "Commuta {device}"
6872
6872
  },
6873
6873
  icon: "toggle-right",
6874
+ sideEffects: [{
6875
+ field: "on",
6876
+ negate: true
6877
+ }],
6874
6878
  offeredWhen: {
6875
6879
  method: "getOptions",
6876
6880
  field: "supportsSetState"
@@ -7985,7 +7989,15 @@ var CAP_VOCABULARY_BY_NAME = {
7985
7989
  effect: {
7986
7990
  field: "state",
7987
7991
  value: "locked"
7988
- }
7992
+ },
7993
+ hold: { effects: [{
7994
+ field: "state",
7995
+ value: "locking",
7996
+ when: {
7997
+ field: "state",
7998
+ notIn: ["locked"]
7999
+ }
8000
+ }] }
7989
8001
  },
7990
8002
  {
7991
8003
  id: "lock.unlock",
@@ -8014,7 +8026,15 @@ var CAP_VOCABULARY_BY_NAME = {
8014
8026
  effect: {
8015
8027
  field: "state",
8016
8028
  value: "unlocked"
8017
- }
8029
+ },
8030
+ hold: { effects: [{
8031
+ field: "state",
8032
+ value: "unlocking",
8033
+ when: {
8034
+ field: "state",
8035
+ notIn: ["unlocked"]
8036
+ }
8037
+ }] }
8018
8038
  },
8019
8039
  {
8020
8040
  id: "lock.open",
@@ -8328,6 +8348,14 @@ var CAP_VOCABULARY_BY_NAME = {
8328
8348
  step: .5,
8329
8349
  unit: "°C"
8330
8350
  }
8351
+ }],
8352
+ effect: {
8353
+ field: "targetLow",
8354
+ fromArg: "targetLow"
8355
+ },
8356
+ sideEffects: [{
8357
+ field: "targetHigh",
8358
+ fromArg: "targetHigh"
8331
8359
  }]
8332
8360
  },
8333
8361
  {
@@ -8384,7 +8412,11 @@ var CAP_VOCABULARY_BY_NAME = {
8384
8412
  from: "status",
8385
8413
  field: "availableFanModes"
8386
8414
  }
8387
- }]
8415
+ }],
8416
+ effect: {
8417
+ field: "fanMode",
8418
+ fromArg: "fanMode"
8419
+ }
8388
8420
  },
8389
8421
  {
8390
8422
  id: "climate.preset",
@@ -8409,7 +8441,11 @@ var CAP_VOCABULARY_BY_NAME = {
8409
8441
  from: "status",
8410
8442
  field: "availablePresets"
8411
8443
  }
8412
- }]
8444
+ }],
8445
+ effect: {
8446
+ field: "preset",
8447
+ fromArg: "preset"
8448
+ }
8413
8449
  },
8414
8450
  {
8415
8451
  id: "climate.swingVerticalOn",
@@ -8642,7 +8678,15 @@ var CAP_VOCABULARY_BY_NAME = {
8642
8678
  effect: {
8643
8679
  field: "speed",
8644
8680
  value: 100
8645
- }
8681
+ },
8682
+ sideEffects: [{
8683
+ field: "preset",
8684
+ value: "",
8685
+ when: {
8686
+ field: "preset",
8687
+ notIn: [""]
8688
+ }
8689
+ }]
8646
8690
  },
8647
8691
  {
8648
8692
  id: "fan.speed",
@@ -8673,7 +8717,15 @@ var CAP_VOCABULARY_BY_NAME = {
8673
8717
  effect: {
8674
8718
  field: "speed",
8675
8719
  fromArg: "speed"
8676
- }
8720
+ },
8721
+ sideEffects: [{
8722
+ field: "preset",
8723
+ value: "",
8724
+ when: {
8725
+ field: "preset",
8726
+ notIn: [""]
8727
+ }
8728
+ }]
8677
8729
  },
8678
8730
  {
8679
8731
  id: "fan.preset",
@@ -8698,7 +8750,11 @@ var CAP_VOCABULARY_BY_NAME = {
8698
8750
  from: "status",
8699
8751
  field: "availablePresets"
8700
8752
  }
8701
- }]
8753
+ }],
8754
+ effect: {
8755
+ field: "preset",
8756
+ fromArg: "preset"
8757
+ }
8702
8758
  },
8703
8759
  {
8704
8760
  id: "fan.forward",
@@ -9243,7 +9299,15 @@ var CAP_VOCABULARY_BY_NAME = {
9243
9299
  effect: {
9244
9300
  field: "state",
9245
9301
  value: "disarmed"
9246
- }
9302
+ },
9303
+ hold: { effects: [{
9304
+ field: "state",
9305
+ value: "disarming",
9306
+ when: {
9307
+ field: "state",
9308
+ notIn: ["disarmed"]
9309
+ }
9310
+ }] }
9247
9311
  },
9248
9312
  {
9249
9313
  id: "alarm.arm.home",
@@ -9273,7 +9337,15 @@ var CAP_VOCABULARY_BY_NAME = {
9273
9337
  effect: {
9274
9338
  field: "state",
9275
9339
  value: "armed_home"
9276
- }
9340
+ },
9341
+ hold: { effects: [{
9342
+ field: "state",
9343
+ value: "arming",
9344
+ when: {
9345
+ field: "state",
9346
+ notIn: ["armed_home"]
9347
+ }
9348
+ }] }
9277
9349
  },
9278
9350
  {
9279
9351
  id: "alarm.arm.away",
@@ -9303,7 +9375,15 @@ var CAP_VOCABULARY_BY_NAME = {
9303
9375
  effect: {
9304
9376
  field: "state",
9305
9377
  value: "armed_away"
9306
- }
9378
+ },
9379
+ hold: { effects: [{
9380
+ field: "state",
9381
+ value: "arming",
9382
+ when: {
9383
+ field: "state",
9384
+ notIn: ["armed_away"]
9385
+ }
9386
+ }] }
9307
9387
  },
9308
9388
  {
9309
9389
  id: "alarm.arm.night",
@@ -9333,7 +9413,15 @@ var CAP_VOCABULARY_BY_NAME = {
9333
9413
  effect: {
9334
9414
  field: "state",
9335
9415
  value: "armed_night"
9336
- }
9416
+ },
9417
+ hold: { effects: [{
9418
+ field: "state",
9419
+ value: "arming",
9420
+ when: {
9421
+ field: "state",
9422
+ notIn: ["armed_night"]
9423
+ }
9424
+ }] }
9337
9425
  },
9338
9426
  {
9339
9427
  id: "alarm.arm.vacation",
@@ -9363,7 +9451,15 @@ var CAP_VOCABULARY_BY_NAME = {
9363
9451
  effect: {
9364
9452
  field: "state",
9365
9453
  value: "armed_vacation"
9366
- }
9454
+ },
9455
+ hold: { effects: [{
9456
+ field: "state",
9457
+ value: "arming",
9458
+ when: {
9459
+ field: "state",
9460
+ notIn: ["armed_vacation"]
9461
+ }
9462
+ }] }
9367
9463
  },
9368
9464
  {
9369
9465
  id: "alarm.arm.custom_bypass",
@@ -9393,7 +9489,15 @@ var CAP_VOCABULARY_BY_NAME = {
9393
9489
  effect: {
9394
9490
  field: "state",
9395
9491
  value: "armed_custom_bypass"
9396
- }
9492
+ },
9493
+ hold: { effects: [{
9494
+ field: "state",
9495
+ value: "arming",
9496
+ when: {
9497
+ field: "state",
9498
+ notIn: ["armed_custom_bypass"]
9499
+ }
9500
+ }] }
9397
9501
  }
9398
9502
  ],
9399
9503
  state: [{
@@ -10535,7 +10639,14 @@ var CAP_VOCABULARY_BY_NAME = {
10535
10639
  quantity: "mass"
10536
10640
  },
10537
10641
  optional: true
10538
- }]
10642
+ }],
10643
+ hold: {
10644
+ effects: [{
10645
+ field: "feeding",
10646
+ value: true
10647
+ }],
10648
+ holdMs: 1e4
10649
+ }
10539
10650
  },
10540
10651
  {
10541
10652
  id: "petFeeder.feedHoppers",
@@ -10579,7 +10690,14 @@ var CAP_VOCABULARY_BY_NAME = {
10579
10690
  quantity: "mass"
10580
10691
  },
10581
10692
  optional: true
10582
- }]
10693
+ }],
10694
+ hold: {
10695
+ effects: [{
10696
+ field: "feeding",
10697
+ value: true
10698
+ }],
10699
+ holdMs: 1e4
10700
+ }
10583
10701
  },
10584
10702
  {
10585
10703
  id: "petFeeder.cancelFeed",
@@ -10670,7 +10788,11 @@ var CAP_VOCABULARY_BY_NAME = {
10670
10788
  it: "Attiva il blocco bambini di {device}"
10671
10789
  },
10672
10790
  icon: "lock",
10673
- args: { on: true }
10791
+ args: { on: true },
10792
+ effect: {
10793
+ field: "childLock",
10794
+ value: true
10795
+ }
10674
10796
  },
10675
10797
  {
10676
10798
  id: "petFeeder.childLockOff",
@@ -10684,7 +10806,11 @@ var CAP_VOCABULARY_BY_NAME = {
10684
10806
  it: "Disattiva il blocco bambini di {device}"
10685
10807
  },
10686
10808
  icon: "lock-open",
10687
- args: { on: false }
10809
+ args: { on: false },
10810
+ effect: {
10811
+ field: "childLock",
10812
+ value: false
10813
+ }
10688
10814
  },
10689
10815
  {
10690
10816
  id: "petFeeder.lightOn",
@@ -10698,7 +10824,11 @@ var CAP_VOCABULARY_BY_NAME = {
10698
10824
  it: "Accendi la spia di {device}"
10699
10825
  },
10700
10826
  icon: "lightbulb",
10701
- args: { on: true }
10827
+ args: { on: true },
10828
+ effect: {
10829
+ field: "indicatorLight",
10830
+ value: true
10831
+ }
10702
10832
  },
10703
10833
  {
10704
10834
  id: "petFeeder.lightOff",
@@ -10712,7 +10842,11 @@ var CAP_VOCABULARY_BY_NAME = {
10712
10842
  it: "Spegni la spia di {device}"
10713
10843
  },
10714
10844
  icon: "lightbulb-off",
10715
- args: { on: false }
10845
+ args: { on: false },
10846
+ effect: {
10847
+ field: "indicatorLight",
10848
+ value: false
10849
+ }
10716
10850
  },
10717
10851
  {
10718
10852
  id: "petFeeder.feedSoundOn",
@@ -10726,7 +10860,11 @@ var CAP_VOCABULARY_BY_NAME = {
10726
10860
  it: "Attiva il suono di erogazione di {device}"
10727
10861
  },
10728
10862
  icon: "volume-2",
10729
- args: { on: true }
10863
+ args: { on: true },
10864
+ effect: {
10865
+ field: "feedSound",
10866
+ value: true
10867
+ }
10730
10868
  },
10731
10869
  {
10732
10870
  id: "petFeeder.feedSoundOff",
@@ -10740,7 +10878,11 @@ var CAP_VOCABULARY_BY_NAME = {
10740
10878
  it: "Disattiva il suono di erogazione di {device}"
10741
10879
  },
10742
10880
  icon: "volume-x",
10743
- args: { on: false }
10881
+ args: { on: false },
10882
+ effect: {
10883
+ field: "feedSound",
10884
+ value: false
10885
+ }
10744
10886
  },
10745
10887
  {
10746
10888
  id: "petFeeder.volume",
@@ -10765,7 +10907,11 @@ var CAP_VOCABULARY_BY_NAME = {
10765
10907
  min: 0,
10766
10908
  step: 1
10767
10909
  }
10768
- }]
10910
+ }],
10911
+ effect: {
10912
+ field: "volume",
10913
+ fromArg: "level"
10914
+ }
10769
10915
  }
10770
10916
  ],
10771
10917
  state: [
@@ -10837,7 +10983,11 @@ var CAP_VOCABULARY_BY_NAME = {
10837
10983
  it: "Avvia la pompa di {device}"
10838
10984
  },
10839
10985
  icon: "play",
10840
- args: { on: true }
10986
+ args: { on: true },
10987
+ effect: {
10988
+ field: "pumpRunning",
10989
+ value: true
10990
+ }
10841
10991
  }, {
10842
10992
  id: "petFountain.pumpOff",
10843
10993
  method: "setPump",
@@ -10850,7 +11000,11 @@ var CAP_VOCABULARY_BY_NAME = {
10850
11000
  it: "Ferma la pompa di {device}"
10851
11001
  },
10852
11002
  icon: "square",
10853
- args: { on: false }
11003
+ args: { on: false },
11004
+ effect: {
11005
+ field: "pumpRunning",
11006
+ value: false
11007
+ }
10854
11008
  }],
10855
11009
  state: [{
10856
11010
  kind: "boolean",
@@ -10902,7 +11056,11 @@ var CAP_VOCABULARY_BY_NAME = {
10902
11056
  it: "Fai lavorare la pompa di {device} a ciclo acceso/spento"
10903
11057
  },
10904
11058
  icon: "timer",
10905
- args: { on: true }
11059
+ args: { on: true },
11060
+ effect: {
11061
+ field: "enabled",
11062
+ value: true
11063
+ }
10906
11064
  },
10907
11065
  {
10908
11066
  id: "pumpCycle.off",
@@ -10916,7 +11074,11 @@ var CAP_VOCABULARY_BY_NAME = {
10916
11074
  it: "Fai lavorare la pompa di {device} in continuo"
10917
11075
  },
10918
11076
  icon: "timer-off",
10919
- args: { on: false }
11077
+ args: { on: false },
11078
+ effect: {
11079
+ field: "enabled",
11080
+ value: false
11081
+ }
10920
11082
  },
10921
11083
  {
10922
11084
  id: "pumpCycle.onMinutes",
@@ -10942,7 +11104,12 @@ var CAP_VOCABULARY_BY_NAME = {
10942
11104
  step: 1,
10943
11105
  unit: "min"
10944
11106
  }
10945
- }]
11107
+ }],
11108
+ effect: {
11109
+ field: "onTime",
11110
+ fromArg: "minutes",
11111
+ scale: 60
11112
+ }
10946
11113
  },
10947
11114
  {
10948
11115
  id: "pumpCycle.offMinutes",
@@ -10968,7 +11135,12 @@ var CAP_VOCABULARY_BY_NAME = {
10968
11135
  step: 1,
10969
11136
  unit: "min"
10970
11137
  }
10971
- }]
11138
+ }],
11139
+ effect: {
11140
+ field: "offTime",
11141
+ fromArg: "minutes",
11142
+ scale: 60
11143
+ }
10972
11144
  }
10973
11145
  ],
10974
11146
  state: [{
@@ -11085,7 +11257,11 @@ var CAP_VOCABULARY_BY_NAME = {
11085
11257
  en: "Play on {device}",
11086
11258
  it: "Avvia la riproduzione su {device}"
11087
11259
  },
11088
- icon: "play"
11260
+ icon: "play",
11261
+ effect: {
11262
+ field: "state",
11263
+ value: "playing"
11264
+ }
11089
11265
  },
11090
11266
  {
11091
11267
  id: "media.pause",
@@ -11098,7 +11274,11 @@ var CAP_VOCABULARY_BY_NAME = {
11098
11274
  en: "Pause {device}",
11099
11275
  it: "Metti in pausa {device}"
11100
11276
  },
11101
- icon: "pause"
11277
+ icon: "pause",
11278
+ effect: {
11279
+ field: "state",
11280
+ value: "paused"
11281
+ }
11102
11282
  },
11103
11283
  {
11104
11284
  id: "media.stop",
@@ -11164,7 +11344,11 @@ var CAP_VOCABULARY_BY_NAME = {
11164
11344
  step: 1,
11165
11345
  unit: "%"
11166
11346
  }
11167
- }]
11347
+ }],
11348
+ effect: {
11349
+ field: "volumeLevel",
11350
+ fromArg: "volumeLevel"
11351
+ }
11168
11352
  },
11169
11353
  {
11170
11354
  id: "media.mute",
@@ -11178,7 +11362,11 @@ var CAP_VOCABULARY_BY_NAME = {
11178
11362
  it: "Silenzia {device}"
11179
11363
  },
11180
11364
  icon: "volume-x",
11181
- args: { muted: true }
11365
+ args: { muted: true },
11366
+ effect: {
11367
+ field: "isMuted",
11368
+ value: true
11369
+ }
11182
11370
  },
11183
11371
  {
11184
11372
  id: "media.unmute",
@@ -11192,7 +11380,11 @@ var CAP_VOCABULARY_BY_NAME = {
11192
11380
  it: "Riattiva l’audio di {device}"
11193
11381
  },
11194
11382
  icon: "volume-2",
11195
- args: { muted: false }
11383
+ args: { muted: false },
11384
+ effect: {
11385
+ field: "isMuted",
11386
+ value: false
11387
+ }
11196
11388
  },
11197
11389
  {
11198
11390
  id: "media.shuffleOn",
@@ -11206,7 +11398,11 @@ var CAP_VOCABULARY_BY_NAME = {
11206
11398
  it: "Attiva la riproduzione casuale su {device}"
11207
11399
  },
11208
11400
  icon: "shuffle",
11209
- args: { shuffle: true }
11401
+ args: { shuffle: true },
11402
+ effect: {
11403
+ field: "shuffle",
11404
+ value: true
11405
+ }
11210
11406
  },
11211
11407
  {
11212
11408
  id: "media.shuffleOff",
@@ -11220,7 +11416,11 @@ var CAP_VOCABULARY_BY_NAME = {
11220
11416
  it: "Disattiva la riproduzione casuale su {device}"
11221
11417
  },
11222
11418
  icon: "shuffle",
11223
- args: { shuffle: false }
11419
+ args: { shuffle: false },
11420
+ effect: {
11421
+ field: "shuffle",
11422
+ value: false
11423
+ }
11224
11424
  },
11225
11425
  {
11226
11426
  id: "media.repeat",
@@ -11266,7 +11466,11 @@ var CAP_VOCABULARY_BY_NAME = {
11266
11466
  }
11267
11467
  ]
11268
11468
  }
11269
- }]
11469
+ }],
11470
+ effect: {
11471
+ field: "repeat",
11472
+ fromArg: "repeat"
11473
+ }
11270
11474
  },
11271
11475
  {
11272
11476
  id: "media.source",
@@ -11291,7 +11495,11 @@ var CAP_VOCABULARY_BY_NAME = {
11291
11495
  from: "status",
11292
11496
  field: "availableSources"
11293
11497
  }
11294
- }]
11498
+ }],
11499
+ effect: {
11500
+ field: "source",
11501
+ fromArg: "source"
11502
+ }
11295
11503
  },
11296
11504
  {
11297
11505
  id: "media.seek",
@@ -11831,7 +12039,14 @@ var CAP_VOCABULARY_BY_NAME = {
11831
12039
  en: "Run {device}",
11832
12040
  it: "Esegui {device}"
11833
12041
  },
11834
- icon: "scroll-text"
12042
+ icon: "scroll-text",
12043
+ hold: {
12044
+ effects: [{
12045
+ field: "isRunning",
12046
+ value: true
12047
+ }],
12048
+ holdMs: 1e4
12049
+ }
11835
12050
  }, {
11836
12051
  id: "script.stop",
11837
12052
  method: "stop",
@@ -11843,7 +12058,11 @@ var CAP_VOCABULARY_BY_NAME = {
11843
12058
  en: "Stop {device}",
11844
12059
  it: "Ferma {device}"
11845
12060
  },
11846
- icon: "square"
12061
+ icon: "square",
12062
+ effect: {
12063
+ field: "isRunning",
12064
+ value: false
12065
+ }
11847
12066
  }],
11848
12067
  state: [{
11849
12068
  kind: "boolean",
@@ -11881,7 +12100,11 @@ var CAP_VOCABULARY_BY_NAME = {
11881
12100
  en: "Enable {device}",
11882
12101
  it: "Abilita {device}"
11883
12102
  },
11884
- icon: "toggle-right"
12103
+ icon: "toggle-right",
12104
+ effect: {
12105
+ field: "enabled",
12106
+ value: true
12107
+ }
11885
12108
  },
11886
12109
  {
11887
12110
  id: "haAutomation.disable",
@@ -11894,7 +12117,11 @@ var CAP_VOCABULARY_BY_NAME = {
11894
12117
  en: "Disable {device}",
11895
12118
  it: "Disabilita {device}"
11896
12119
  },
11897
- icon: "toggle-left"
12120
+ icon: "toggle-left",
12121
+ effect: {
12122
+ field: "enabled",
12123
+ value: false
12124
+ }
11898
12125
  },
11899
12126
  {
11900
12127
  id: "haAutomation.trigger",
@@ -13496,6 +13723,17 @@ var CAP_VOCABULARY_BY_NAME = {
13496
13723
  },
13497
13724
  notOperatorFacing: { resync: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action" }
13498
13725
  },
13726
+ "device-state-refresh": {
13727
+ scope: "device",
13728
+ noun: {
13729
+ en: "State refresh",
13730
+ it: "Aggiornamento dello stato"
13731
+ },
13732
+ notOperatorFacing: {
13733
+ refresh: "the core schedules state refreshes itself; an operator never asks for one",
13734
+ resubscribe: "the core schedules state refreshes itself; an operator never asks for one"
13735
+ }
13736
+ },
13499
13737
  "recording": {
13500
13738
  scope: "device",
13501
13739
  noun: {
@@ -16267,7 +16505,12 @@ function actionEffect(actionId, args) {
16267
16505
  value: effect.value
16268
16506
  };
16269
16507
  const raw = args?.[effect.fromArg];
16270
- if (typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean") return {
16508
+ if (typeof raw === "number") return {
16509
+ cap: found.cap,
16510
+ field: effect.field,
16511
+ value: raw * (effect.scale ?? 1)
16512
+ };
16513
+ if (typeof raw === "string" || typeof raw === "boolean") return {
16271
16514
  cap: found.cap,
16272
16515
  field: effect.field,
16273
16516
  value: raw
@@ -16794,6 +17037,7 @@ var CAP_NAMES = Object.freeze([
16794
17037
  "device-removal-hook",
16795
17038
  "device-runs",
16796
17039
  "device-state",
17040
+ "device-state-refresh",
16797
17041
  "device-status",
16798
17042
  "device-transitions",
16799
17043
  "dishwasher",
@@ -19295,7 +19539,10 @@ function buildAuditedFields() {
19295
19539
  set.add(field);
19296
19540
  byCap.set(cap, set);
19297
19541
  };
19298
- for (const { cap, action } of allVocabActions()) if (action.effect !== void 0) add(cap, action.effect.field);
19542
+ for (const { cap, action } of allVocabActions()) {
19543
+ if (action.effect !== void 0) add(cap, action.effect.field);
19544
+ for (const side of action.sideEffects ?? []) add(cap, side.field);
19545
+ }
19299
19546
  for (const [cap, entry] of Object.entries(CAP_VOCABULARY_BY_NAME)) {
19300
19547
  if (entry.scope !== "device") continue;
19301
19548
  for (const trigger of entry.state ?? []) if (trigger.kind === "boolean" || trigger.kind === "enum") add(cap, trigger.field);
@@ -19325,6 +19572,113 @@ function auditedFields(cap) {
19325
19572
  fieldsByCap ??= buildAuditedFields();
19326
19573
  return fieldsByCap.get(cap) ?? NO_FIELDS;
19327
19574
  }
19575
+ /** Does `slice` meet `when`? A field the slice lacks is in no list. */
19576
+ function effectConditionHolds(when, slice) {
19577
+ if (when === void 0) return true;
19578
+ const raw = slice?.[when.field];
19579
+ const value = typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean" ? raw : void 0;
19580
+ if ("in" in when) return value !== void 0 && when.in.includes(value);
19581
+ return value === void 0 || !when.notIn.includes(value);
19582
+ }
19583
+ /** The step of the number open arg `key`, when the action offers one. */
19584
+ function stepOf(openArgs, key) {
19585
+ const offer = openArgs?.find((a) => a.key === key)?.offer;
19586
+ return offer?.kind === "number" && offer.step !== void 0 && offer.step > 0 ? offer.step : void 0;
19587
+ }
19588
+ /**
19589
+ * One side effect resolved against the args and the slice the command acts
19590
+ * on: `null` when the arg carrying its value is missing, or a `negate` names a
19591
+ * field the slice holds no boolean in. `openArgs` lends a copied number its
19592
+ * step as the tolerance.
19593
+ */
19594
+ function resolveSideEffect(side, args, shown, openArgs) {
19595
+ if ("value" in side) return {
19596
+ field: side.field,
19597
+ value: side.value
19598
+ };
19599
+ if ("negate" in side) {
19600
+ const raw = shown?.[side.field];
19601
+ return typeof raw === "boolean" ? {
19602
+ field: side.field,
19603
+ value: !raw
19604
+ } : null;
19605
+ }
19606
+ const raw = args?.[side.fromArg];
19607
+ if (typeof raw === "string" || typeof raw === "boolean") return {
19608
+ field: side.field,
19609
+ value: raw
19610
+ };
19611
+ if (typeof raw === "number") {
19612
+ const scale = side.scale ?? 1;
19613
+ const step = stepOf(openArgs, side.fromArg);
19614
+ return step === void 0 ? {
19615
+ field: side.field,
19616
+ value: raw * scale
19617
+ } : {
19618
+ field: side.field,
19619
+ value: raw * scale,
19620
+ tolerance: step * scale
19621
+ };
19622
+ }
19623
+ return null;
19624
+ }
19625
+ /**
19626
+ * The hold limit the vocabulary declares for `cap.method(args)` (its action's
19627
+ * `hold.holdMs`), or `undefined` for the default.
19628
+ */
19629
+ function commandHoldMs(cap, method, args) {
19630
+ return holdFor(cap, method, args)?.holdMs;
19631
+ }
19632
+ /**
19633
+ * The hold the vocabulary declares for `cap.method(args)`: the matched
19634
+ * action's, or — when several actions share the method and the args cannot
19635
+ * tell them apart (`petFeeder.feed` / `feedHoppers`) — the one they all
19636
+ * declare alike. Different holds on such actions resolve to none.
19637
+ */
19638
+ function holdFor(cap, method, args) {
19639
+ const actionId = vocabActionIdFor(cap, method, args);
19640
+ if (actionId !== void 0) return findVocabAction(actionId)?.action.hold;
19641
+ const holds = allVocabActions().filter(({ cap: c, action }) => c === cap && action.method === method).map(({ action }) => action.hold);
19642
+ const first = holds[0];
19643
+ if (first === void 0) return void 0;
19644
+ const key = JSON.stringify(first);
19645
+ return holds.every((h) => JSON.stringify(h) === key) ? first : void 0;
19646
+ }
19647
+ /**
19648
+ * EVERY state the command `cap.method(args)` leads to (D1061): its `effect`
19649
+ * first, then each side effect whose condition holds on `current` (the cap's
19650
+ * slice the device reported when the command arrived). Empty when it leads to
19651
+ * none. One field is named once — the first entry for it wins. A `negate`
19652
+ * side effect flips what `shown` (the slice the person saw, held values
19653
+ * included) holds, so a second toggle before the first is confirmed undoes it.
19654
+ * An action that declares `hold.effects` is held as THOSE instead (a lock
19655
+ * holds `locking`, not `locked`).
19656
+ */
19657
+ function commandEffects(cap, method, args, current, shown = current) {
19658
+ const out = [];
19659
+ const hold = holdFor(cap, method, args);
19660
+ if (hold?.effects !== void 0) {
19661
+ for (const entry of hold.effects) {
19662
+ if (!effectConditionHolds(entry.when, current)) continue;
19663
+ const resolved = resolveSideEffect(entry, args, shown);
19664
+ if (resolved !== null && !out.some((e) => e.field === resolved.field)) out.push(resolved);
19665
+ }
19666
+ return out;
19667
+ }
19668
+ const actionId = vocabActionIdFor(cap, method, args);
19669
+ if (actionId === void 0) return [];
19670
+ const action = findVocabAction(actionId)?.action;
19671
+ if (action?.effect !== void 0) {
19672
+ const primary = resolveSideEffect(action.effect, args, shown, action.openArgs);
19673
+ if (primary !== null) out.push(primary);
19674
+ }
19675
+ for (const side of action?.sideEffects ?? []) {
19676
+ if (!effectConditionHolds(side.when, current)) continue;
19677
+ const resolved = resolveSideEffect(side, args, shown, action?.openArgs);
19678
+ if (resolved !== null && !out.some((e) => e.field === resolved.field)) out.push(resolved);
19679
+ }
19680
+ return out;
19681
+ }
19328
19682
  /**
19329
19683
  * Type-safe JSON parsing helpers.
19330
19684
  *
@@ -53854,7 +54208,7 @@ ${hasTime ? ` /** Read the site into memory. A failed read keeps the previous v
53854
54208
  ` : ""} // ── the condition mirror (D49): memory only at fire time ──
53855
54209
  async function refreshMirror(): Promise<void> {
53856
54210
  const report = await mirror.refresh({
53857
- fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
54211
+ fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true }),
53858
54212
  fetchStableIds: async () => {
53859
54213
  const all = await ctx.api.deviceManager.listAll.query({})
53860
54214
  return stableIdMapOf(all)
@@ -53868,7 +54222,7 @@ ${hasTime ? ` /** Read the site into memory. A failed read keeps the previous v
53868
54222
 
53869
54223
  function mirrorFetchers() {
53870
54224
  return {
53871
- fetchSlice: (deviceId: number, cap: string) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
54225
+ fetchSlice: (deviceId: number, cap: string) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true }),
53872
54226
  fetchStableIds: async () => {
53873
54227
  const all = await ctx.api.deviceManager.listAll.query({})
53874
54228
  return stableIdMapOf(all)
@@ -53937,7 +54291,7 @@ ${hasTime ? ` // a time-is leaf changes sides at a boundary with no device ev
53937
54291
  cap: string,
53938
54292
  ): Promise<{ readonly ok: true; readonly slice: unknown } | { readonly ok: false }> {
53939
54293
  try {
53940
- const slice = await ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap })
54294
+ const slice = await ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true })
53941
54295
  return { ok: true, slice }
53942
54296
  } catch (err: unknown) {
53943
54297
  ctx.logger.debug('device state read failed — the leaf keeps what it knew', {
@@ -54324,8 +54678,10 @@ ${hasTime ? " await refreshSite()\n" : ""} await refreshMirror()
54324
54678
  const deviceId = data['deviceId']
54325
54679
  const capName = data['capName']
54326
54680
  if (typeof deviceId === 'number' && typeof capName === 'string') {
54327
- mirror.apply(deviceId, capName, data['slice'])
54328
- guardMirror.apply(deviceId, capName, data['slice'])
54681
+ // what the device reported: a held command is never a condition (D1061)
54682
+ const slice = data['confirmed'] ?? data['slice']
54683
+ mirror.apply(deviceId, capName, slice)
54684
+ guardMirror.apply(deviceId, capName, slice)
54329
54685
  feedHolds()
54330
54686
  evaluateStateTree()
54331
54687
  }
@@ -56920,6 +57276,14 @@ var alarmPanelCapability = {
56920
57276
  field: "state",
56921
57277
  value: "disarmed"
56922
57278
  },
57279
+ hold: { effects: [{
57280
+ field: "state",
57281
+ value: "disarming",
57282
+ when: {
57283
+ field: "state",
57284
+ notIn: ["disarmed"]
57285
+ }
57286
+ }] },
56923
57287
  openArgs: [{
56924
57288
  key: "code",
56925
57289
  label: t("PIN code", "Codice PIN"),
@@ -56950,6 +57314,14 @@ var alarmPanelCapability = {
56950
57314
  field: "state",
56951
57315
  value: "armed_home"
56952
57316
  },
57317
+ hold: { effects: [{
57318
+ field: "state",
57319
+ value: "arming",
57320
+ when: {
57321
+ field: "state",
57322
+ notIn: ["armed_home"]
57323
+ }
57324
+ }] },
56953
57325
  args: { mode: "home" },
56954
57326
  openArgs: [{
56955
57327
  key: "code",
@@ -56970,6 +57342,14 @@ var alarmPanelCapability = {
56970
57342
  field: "state",
56971
57343
  value: "armed_away"
56972
57344
  },
57345
+ hold: { effects: [{
57346
+ field: "state",
57347
+ value: "arming",
57348
+ when: {
57349
+ field: "state",
57350
+ notIn: ["armed_away"]
57351
+ }
57352
+ }] },
56973
57353
  args: { mode: "away" },
56974
57354
  openArgs: [{
56975
57355
  key: "code",
@@ -56990,6 +57370,14 @@ var alarmPanelCapability = {
56990
57370
  field: "state",
56991
57371
  value: "armed_night"
56992
57372
  },
57373
+ hold: { effects: [{
57374
+ field: "state",
57375
+ value: "arming",
57376
+ when: {
57377
+ field: "state",
57378
+ notIn: ["armed_night"]
57379
+ }
57380
+ }] },
56993
57381
  args: { mode: "night" },
56994
57382
  openArgs: [{
56995
57383
  key: "code",
@@ -57010,6 +57398,14 @@ var alarmPanelCapability = {
57010
57398
  field: "state",
57011
57399
  value: "armed_vacation"
57012
57400
  },
57401
+ hold: { effects: [{
57402
+ field: "state",
57403
+ value: "arming",
57404
+ when: {
57405
+ field: "state",
57406
+ notIn: ["armed_vacation"]
57407
+ }
57408
+ }] },
57013
57409
  args: { mode: "vacation" },
57014
57410
  openArgs: [{
57015
57411
  key: "code",
@@ -57030,6 +57426,14 @@ var alarmPanelCapability = {
57030
57426
  field: "state",
57031
57427
  value: "armed_custom_bypass"
57032
57428
  },
57429
+ hold: { effects: [{
57430
+ field: "state",
57431
+ value: "arming",
57432
+ when: {
57433
+ field: "state",
57434
+ notIn: ["armed_custom_bypass"]
57435
+ }
57436
+ }] },
57033
57437
  args: { mode: "custom_bypass" },
57034
57438
  openArgs: [{
57035
57439
  key: "code",
@@ -57859,6 +58263,10 @@ var automationControlCapability = {
57859
58263
  auth: "admin",
57860
58264
  actions: [{
57861
58265
  id: "haAutomation.enable",
58266
+ effect: {
58267
+ field: "enabled",
58268
+ value: true
58269
+ },
57862
58270
  label: t("Enable automation", "Abilita l’automazione"),
57863
58271
  phrase: t("Enable {device}", "Abilita {device}"),
57864
58272
  icon: "toggle-right"
@@ -57869,6 +58277,10 @@ var automationControlCapability = {
57869
58277
  auth: "admin",
57870
58278
  actions: [{
57871
58279
  id: "haAutomation.disable",
58280
+ effect: {
58281
+ field: "enabled",
58282
+ value: false
58283
+ },
57872
58284
  label: t("Disable automation", "Disabilita l’automazione"),
57873
58285
  phrase: t("Disable {device}", "Disabilita {device}"),
57874
58286
  icon: "toggle-left"
@@ -61322,6 +61734,14 @@ var climateControlCapability = {
61322
61734
  label: t("Set temperature range", "Imposta l’intervallo di temperatura"),
61323
61735
  phrase: t("Keep {device} between {targetLow} and {targetHigh}", "Mantieni {device} tra {targetLow} e {targetHigh}"),
61324
61736
  icon: "thermometer",
61737
+ effect: {
61738
+ field: "targetLow",
61739
+ fromArg: "targetLow"
61740
+ },
61741
+ sideEffects: [{
61742
+ field: "targetHigh",
61743
+ fromArg: "targetHigh"
61744
+ }],
61325
61745
  openArgs: [{
61326
61746
  key: "targetLow",
61327
61747
  label: t("Lowest", "Minima"),
@@ -61380,6 +61800,10 @@ var climateControlCapability = {
61380
61800
  label: t("Set fan mode", "Imposta la ventilazione"),
61381
61801
  phrase: t("Set the fan of {device} to {fanMode}", "Imposta la ventilazione di {device} su {fanMode}"),
61382
61802
  icon: "fan",
61803
+ effect: {
61804
+ field: "fanMode",
61805
+ fromArg: "fanMode"
61806
+ },
61383
61807
  openArgs: [{
61384
61808
  key: "fanMode",
61385
61809
  label: t("Fan mode", "Ventilazione"),
@@ -61402,6 +61826,10 @@ var climateControlCapability = {
61402
61826
  label: t("Set preset", "Imposta il preset"),
61403
61827
  phrase: t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
61404
61828
  icon: "list",
61829
+ effect: {
61830
+ field: "preset",
61831
+ fromArg: "preset"
61832
+ },
61405
61833
  openArgs: [{
61406
61834
  key: "preset",
61407
61835
  label: t("Preset", "Preset"),
@@ -63645,6 +64073,10 @@ var mediaPlayerCapability = {
63645
64073
  auth: "protected",
63646
64074
  actions: [{
63647
64075
  id: "media.play",
64076
+ effect: {
64077
+ field: "state",
64078
+ value: "playing"
64079
+ },
63648
64080
  label: t("Play", "Riproduci"),
63649
64081
  phrase: t("Play on {device}", "Avvia la riproduzione su {device}"),
63650
64082
  icon: "play"
@@ -63655,6 +64087,10 @@ var mediaPlayerCapability = {
63655
64087
  auth: "protected",
63656
64088
  actions: [{
63657
64089
  id: "media.pause",
64090
+ effect: {
64091
+ field: "state",
64092
+ value: "paused"
64093
+ },
63658
64094
  label: t("Pause media", "Metti in pausa"),
63659
64095
  phrase: t("Pause {device}", "Metti in pausa {device}"),
63660
64096
  icon: "pause"
@@ -63698,6 +64134,10 @@ var mediaPlayerCapability = {
63698
64134
  auth: "protected",
63699
64135
  actions: [{
63700
64136
  id: "media.volume",
64137
+ effect: {
64138
+ field: "volumeLevel",
64139
+ fromArg: "volumeLevel"
64140
+ },
63701
64141
  label: t("Set volume", "Imposta il volume"),
63702
64142
  phrase: t("Set the volume of {device} to {volumeLevel}", "Imposta il volume di {device} al {volumeLevel}"),
63703
64143
  icon: "volume-2",
@@ -63722,12 +64162,20 @@ var mediaPlayerCapability = {
63722
64162
  auth: "protected",
63723
64163
  actions: [{
63724
64164
  id: "media.mute",
64165
+ effect: {
64166
+ field: "isMuted",
64167
+ value: true
64168
+ },
63725
64169
  label: t("Mute", "Silenzia"),
63726
64170
  phrase: t("Mute {device}", "Silenzia {device}"),
63727
64171
  icon: "volume-x",
63728
64172
  args: { muted: true }
63729
64173
  }, {
63730
64174
  id: "media.unmute",
64175
+ effect: {
64176
+ field: "isMuted",
64177
+ value: false
64178
+ },
63731
64179
  label: t("Unmute", "Riattiva l’audio"),
63732
64180
  phrase: t("Unmute {device}", "Riattiva l’audio di {device}"),
63733
64181
  icon: "volume-2",
@@ -63742,12 +64190,20 @@ var mediaPlayerCapability = {
63742
64190
  auth: "protected",
63743
64191
  actions: [{
63744
64192
  id: "media.shuffleOn",
64193
+ effect: {
64194
+ field: "shuffle",
64195
+ value: true
64196
+ },
63745
64197
  label: t("Shuffle on", "Riproduzione casuale attiva"),
63746
64198
  phrase: t("Turn on shuffle on {device}", "Attiva la riproduzione casuale su {device}"),
63747
64199
  icon: "shuffle",
63748
64200
  args: { shuffle: true }
63749
64201
  }, {
63750
64202
  id: "media.shuffleOff",
64203
+ effect: {
64204
+ field: "shuffle",
64205
+ value: false
64206
+ },
63751
64207
  label: t("Shuffle off", "Riproduzione casuale spenta"),
63752
64208
  phrase: t("Turn off shuffle on {device}", "Disattiva la riproduzione casuale su {device}"),
63753
64209
  icon: "shuffle",
@@ -63762,6 +64218,10 @@ var mediaPlayerCapability = {
63762
64218
  auth: "protected",
63763
64219
  actions: [{
63764
64220
  id: "media.repeat",
64221
+ effect: {
64222
+ field: "repeat",
64223
+ fromArg: "repeat"
64224
+ },
63765
64225
  label: t("Set repeat", "Imposta la ripetizione"),
63766
64226
  phrase: t("Set repeat on {device} to {repeat}", "Imposta la ripetizione di {device} su {repeat}"),
63767
64227
  icon: "repeat",
@@ -63796,6 +64256,10 @@ var mediaPlayerCapability = {
63796
64256
  auth: "protected",
63797
64257
  actions: [{
63798
64258
  id: "media.source",
64259
+ effect: {
64260
+ field: "source",
64261
+ fromArg: "source"
64262
+ },
63799
64263
  label: t("Select source", "Scegli la sorgente"),
63800
64264
  phrase: t("Switch {device} to {source}", "Passa {device} alla sorgente {source}"),
63801
64265
  icon: "cast",
@@ -74392,7 +74856,9 @@ var deviceStateCapability = {
74392
74856
  */
74393
74857
  getCapSlice: method(zod.z.object({
74394
74858
  deviceId: zod.z.number(),
74395
- capName: zod.z.string()
74859
+ capName: zod.z.string(),
74860
+ /** The slice the device CONFIRMED, without a held command (D1061) — history and automations. */
74861
+ confirmed: zod.z.boolean().optional()
74396
74862
  }), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
74397
74863
  /**
74398
74864
  * Whole-system snapshot — every device's full state in one
@@ -74401,7 +74867,9 @@ var deviceStateCapability = {
74401
74867
  * `sm.getDeviceById(id).state.<cap>.value` is sync. Empty inner
74402
74868
  * record for devices that haven't emitted any slice yet.
74403
74869
  */
74404
- getAllSnapshots: method(zod.z.object({}), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.unknown())))),
74870
+ getAllSnapshots: method(zod.z.object({
74871
+ /** The slices the devices CONFIRMED, without held commands (D1061). */
74872
+ confirmed: zod.z.boolean().optional() }), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.unknown())))),
74405
74873
  /**
74406
74874
  * Canonical cross-layer WRITE for one cap-keyed slice. Used by
74407
74875
  * everyone who needs to publish runtime state for a device:
@@ -74510,6 +74978,110 @@ onChanged: event(zod.z.object({
74510
74978
  vocabulary: { notOperatorFacing: "the runtime-state mirror every trigger already reads through" }
74511
74979
  };
74512
74980
  /**
74981
+ * Server-driven device state refresh (D1062): the core decides WHEN a device is
74982
+ * re-read, the integration only knows HOW.
74983
+ *
74984
+ * A provider states its policy where it registers the device's
74985
+ * `device-state-refresh` cap (`ctx.registerNativeCap(cap, provider, {
74986
+ * stateRefresh })`). It reaches the hub by the road the command-hold options
74987
+ * take (D1061): written directly in-process, carried on a forked child's cap
74988
+ * descriptors otherwise. Plain data, wire-safe.
74989
+ */
74990
+ /** Why the core asks for a refresh. */
74991
+ var StateRefreshReasonSchema = zod.z.enum([
74992
+ "schedule",
74993
+ "command",
74994
+ "burst"
74995
+ ]);
74996
+ /**
74997
+ * What arrives without asking: `none` (everything is read), `partial` (some
74998
+ * fields arrive by push, the rest is read on the schedule), `full` (everything
74999
+ * arrives by push — never read on a schedule).
75000
+ */
75001
+ var StateRefreshPushSchema = zod.z.enum([
75002
+ "none",
75003
+ "partial",
75004
+ "full"
75005
+ ]);
75006
+ zod.z.object({
75007
+ /**
75008
+ * The integration instance the device belongs to. Devices of one instance
75009
+ * share one schedule group: a batching provider is asked once for all of
75010
+ * them, and the heartbeat is judged across them.
75011
+ */
75012
+ integrationId: zod.z.string().min(1),
75013
+ /** The fastest interval the integration can afford for its devices. The core polls at it by default. */
75014
+ minIntervalMs: zod.z.number().int().min(1e3),
75015
+ /**
75016
+ * The operator's per-integration setting, when there is one. It can only SLOW
75017
+ * the cadence: the core polls at `max(minIntervalMs, intervalMs)`.
75018
+ */
75019
+ intervalMs: zod.z.number().int().positive().optional(),
75020
+ /** One `refresh` call can read every device of the integration at once. */
75021
+ batch: zod.z.boolean(),
75022
+ push: StateRefreshPushSchema,
75023
+ /** Longest silence a push integration may keep before the core re-reads it and asks it to resubscribe. */
75024
+ heartbeatMs: zod.z.number().int().positive().optional(),
75025
+ /**
75026
+ * Bumped by the provider each time its push subscription reconnected on its
75027
+ * own. A change makes the core re-read every device of the integration
75028
+ * (pushes lost while it was down; events may be dropped, D8).
75029
+ */
75030
+ connectionEpoch: zod.z.number().int().nonnegative().optional()
75031
+ });
75032
+ /** The cadence the core runs a policy at: the declared minimum, slowed (never sped up) by the setting. */
75033
+ function effectiveRefreshIntervalMs(policy) {
75034
+ const setting = policy.intervalMs ?? 0;
75035
+ return Math.max(policy.minIntervalMs, setting);
75036
+ }
75037
+ /** The burst after a command on a read (non-push) device: offsets from the command, in ms. */
75038
+ var COMMAND_BURST_OFFSETS_MS = [3e3, 1e4];
75039
+ /** How long the core waits for a push device to confirm a command before reading it once. */
75040
+ var PUSH_CONFIRM_WINDOW_MS = 2500;
75041
+ /**
75042
+ * device-state-refresh — the HOW of a device's state refresh, called by the
75043
+ * core, which owns the WHEN (D1062).
75044
+ *
75045
+ * The provider registers it per device with its policy
75046
+ * (`registerNativeCap(cap, provider, { stateRefresh })`). The hub's scheduler
75047
+ * calls `refresh` on the schedule, after a command and in the burst that
75048
+ * follows it, and `resubscribe` when a push integration fell silent. The
75049
+ * provider re-reads and writes the slices it already writes; nothing is
75050
+ * returned but completion.
75051
+ */
75052
+ var DeviceStateRefreshInputSchema = zod.z.object({
75053
+ /** The device the call is routed by (one of `deviceIds`). */
75054
+ deviceId: zod.z.number().int().nonnegative(),
75055
+ /** Every device to re-read: one, or the integration's whole set when the provider batches. */
75056
+ deviceIds: zod.z.array(zod.z.number().int().nonnegative()).min(1),
75057
+ reason: StateRefreshReasonSchema
75058
+ });
75059
+ var DeviceStateResubscribeInputSchema = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
75060
+ var DeviceStateRefreshResultSchema = zod.z.object({ ok: zod.z.literal(true) });
75061
+ var NOT_OPERATOR_FACING = "the core schedules state refreshes itself; an operator never asks for one";
75062
+ var deviceStateRefreshCapability = {
75063
+ name: "device-state-refresh",
75064
+ scope: "device",
75065
+ deviceNative: true,
75066
+ mode: "singleton",
75067
+ methods: {
75068
+ refresh: method(DeviceStateRefreshInputSchema, DeviceStateRefreshResultSchema, {
75069
+ kind: "mutation",
75070
+ auth: "admin",
75071
+ notOperatorFacing: NOT_OPERATOR_FACING
75072
+ }),
75073
+ resubscribe: method(DeviceStateResubscribeInputSchema, DeviceStateRefreshResultSchema, {
75074
+ kind: "mutation",
75075
+ auth: "admin",
75076
+ notOperatorFacing: NOT_OPERATOR_FACING
75077
+ })
75078
+ },
75079
+ vocabulary: {
75080
+ noun: t("State refresh", "Aggiornamento dello stato"),
75081
+ order: 3247
75082
+ }
75083
+ };
75084
+ /**
74513
75085
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
74514
75086
  * for every device, regardless of provider — the kernel needs a uniform
74515
75087
  * cap-keyed slice for the basic device flags every consumer expects to
@@ -77067,7 +77639,15 @@ var fanControlCapability = {
77067
77639
  field: "speed",
77068
77640
  value: 100
77069
77641
  },
77070
- args: { speed: 100 }
77642
+ args: { speed: 100 },
77643
+ sideEffects: [{
77644
+ field: "preset",
77645
+ value: "",
77646
+ when: {
77647
+ field: "preset",
77648
+ notIn: [""]
77649
+ }
77650
+ }]
77071
77651
  },
77072
77652
  {
77073
77653
  id: "fan.speed",
@@ -77078,6 +77658,14 @@ var fanControlCapability = {
77078
77658
  field: "speed",
77079
77659
  fromArg: "speed"
77080
77660
  },
77661
+ sideEffects: [{
77662
+ field: "preset",
77663
+ value: "",
77664
+ when: {
77665
+ field: "preset",
77666
+ notIn: [""]
77667
+ }
77668
+ }],
77081
77669
  openArgs: [{
77082
77670
  key: "speed",
77083
77671
  label: t("Speed", "Velocità"),
@@ -77103,6 +77691,10 @@ var fanControlCapability = {
77103
77691
  label: t("Set preset", "Imposta il preset"),
77104
77692
  phrase: t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
77105
77693
  icon: "list",
77694
+ effect: {
77695
+ field: "preset",
77696
+ fromArg: "preset"
77697
+ },
77106
77698
  openArgs: [{
77107
77699
  key: "preset",
77108
77700
  label: t("Preset", "Preset"),
@@ -83565,6 +84157,14 @@ var lockControlCapability = {
83565
84157
  field: "state",
83566
84158
  value: "locked"
83567
84159
  },
84160
+ hold: { effects: [{
84161
+ field: "state",
84162
+ value: "locking",
84163
+ when: {
84164
+ field: "state",
84165
+ notIn: ["locked"]
84166
+ }
84167
+ }] },
83568
84168
  openArgs: [{
83569
84169
  key: "code",
83570
84170
  label: t("PIN code", "Codice PIN"),
@@ -83598,6 +84198,14 @@ var lockControlCapability = {
83598
84198
  field: "state",
83599
84199
  value: "unlocked"
83600
84200
  },
84201
+ hold: { effects: [{
84202
+ field: "state",
84203
+ value: "unlocking",
84204
+ when: {
84205
+ field: "state",
84206
+ notIn: ["unlocked"]
84207
+ }
84208
+ }] },
83601
84209
  openArgs: [{
83602
84210
  key: "code",
83603
84211
  label: t("PIN code", "Codice PIN"),
@@ -97415,6 +98023,14 @@ var osdManagerCapability = {
97415
98023
  vocabulary: { notOperatorFacing: NOT_A_DEVICE.PIPELINE }
97416
98024
  };
97417
98025
  /**
98026
+ * Hold limits a cap's vocabulary may declare on an action (D1061).
98027
+ *
98028
+ * A one-shot command (feed, run a script) has no lasting state to confirm; it
98029
+ * holds its in-progress flag just long enough that a second tap, before the
98030
+ * device reports, is seen as "already running" and refused.
98031
+ */
98032
+ var ONE_SHOT_HOLD_MS = 1e4;
98033
+ /**
97418
98034
  * Feeder connectivity / power status — mirrors the HA petkit device-status
97419
98035
  * enum: `normal` (online, mains), `offline` (not reaching PetKit cloud),
97420
98036
  * `on_batteries` (running on battery backup). `null` until first reported.
@@ -97532,6 +98148,13 @@ var petFeederCapability = {
97532
98148
  label: t("Feed", "Dai da mangiare"),
97533
98149
  phrase: t("Dispense {grams} from {device}", "Eroga {grams} da {device}"),
97534
98150
  icon: "paw-print",
98151
+ hold: {
98152
+ effects: [{
98153
+ field: "feeding",
98154
+ value: true
98155
+ }],
98156
+ holdMs: ONE_SHOT_HOLD_MS
98157
+ },
97535
98158
  openArgs: [{
97536
98159
  key: "grams",
97537
98160
  label: t("Grams", "Grammi"),
@@ -97550,6 +98173,13 @@ var petFeederCapability = {
97550
98173
  label: t("Feed from both hoppers", "Eroga da entrambi i serbatoi"),
97551
98174
  phrase: t("Dispense {hopper1} and {hopper2} from {device}", "Eroga {hopper1} e {hopper2} da {device}"),
97552
98175
  icon: "paw-print",
98176
+ hold: {
98177
+ effects: [{
98178
+ field: "feeding",
98179
+ value: true
98180
+ }],
98181
+ holdMs: ONE_SHOT_HOLD_MS
98182
+ },
97553
98183
  openArgs: [{
97554
98184
  key: "hopper1",
97555
98185
  label: t("Hopper 1", "Serbatoio 1"),
@@ -97655,12 +98285,20 @@ var petFeederCapability = {
97655
98285
  auth: "protected",
97656
98286
  actions: [{
97657
98287
  id: "petFeeder.childLockOn",
98288
+ effect: {
98289
+ field: "childLock",
98290
+ value: true
98291
+ },
97658
98292
  label: t("Child lock on", "Blocco bambini attivo"),
97659
98293
  phrase: t("Turn on the child lock of {device}", "Attiva il blocco bambini di {device}"),
97660
98294
  icon: "lock",
97661
98295
  args: { on: true }
97662
98296
  }, {
97663
98297
  id: "petFeeder.childLockOff",
98298
+ effect: {
98299
+ field: "childLock",
98300
+ value: false
98301
+ },
97664
98302
  label: t("Child lock off", "Blocco bambini spento"),
97665
98303
  phrase: t("Turn off the child lock of {device}", "Disattiva il blocco bambini di {device}"),
97666
98304
  icon: "lock-open",
@@ -97676,12 +98314,20 @@ var petFeederCapability = {
97676
98314
  auth: "protected",
97677
98315
  actions: [{
97678
98316
  id: "petFeeder.lightOn",
98317
+ effect: {
98318
+ field: "indicatorLight",
98319
+ value: true
98320
+ },
97679
98321
  label: t("Indicator light on", "Spia accesa"),
97680
98322
  phrase: t("Turn on the indicator light of {device}", "Accendi la spia di {device}"),
97681
98323
  icon: "lightbulb",
97682
98324
  args: { on: true }
97683
98325
  }, {
97684
98326
  id: "petFeeder.lightOff",
98327
+ effect: {
98328
+ field: "indicatorLight",
98329
+ value: false
98330
+ },
97685
98331
  label: t("Indicator light off", "Spia spenta"),
97686
98332
  phrase: t("Turn off the indicator light of {device}", "Spegni la spia di {device}"),
97687
98333
  icon: "lightbulb-off",
@@ -97697,12 +98343,20 @@ var petFeederCapability = {
97697
98343
  auth: "protected",
97698
98344
  actions: [{
97699
98345
  id: "petFeeder.feedSoundOn",
98346
+ effect: {
98347
+ field: "feedSound",
98348
+ value: true
98349
+ },
97700
98350
  label: t("Feeding sound on", "Suono di erogazione attivo"),
97701
98351
  phrase: t("Turn on the feeding sound of {device}", "Attiva il suono di erogazione di {device}"),
97702
98352
  icon: "volume-2",
97703
98353
  args: { on: true }
97704
98354
  }, {
97705
98355
  id: "petFeeder.feedSoundOff",
98356
+ effect: {
98357
+ field: "feedSound",
98358
+ value: false
98359
+ },
97706
98360
  label: t("Feeding sound off", "Suono di erogazione spento"),
97707
98361
  phrase: t("Turn off the feeding sound of {device}", "Disattiva il suono di erogazione di {device}"),
97708
98362
  icon: "volume-x",
@@ -97718,6 +98372,10 @@ var petFeederCapability = {
97718
98372
  auth: "protected",
97719
98373
  actions: [{
97720
98374
  id: "petFeeder.volume",
98375
+ effect: {
98376
+ field: "volume",
98377
+ fromArg: "level"
98378
+ },
97721
98379
  label: t("Set volume", "Imposta il volume"),
97722
98380
  phrase: t("Set the volume of {device} to {level}", "Imposta il volume di {device} a {level}"),
97723
98381
  icon: "volume-2",
@@ -97884,12 +98542,20 @@ setPump: method(zod.z.object({
97884
98542
  auth: "protected",
97885
98543
  actions: [{
97886
98544
  id: "petFountain.pumpOn",
98545
+ effect: {
98546
+ field: "pumpRunning",
98547
+ value: true
98548
+ },
97887
98549
  label: t("Pump on", "Pompa accesa"),
97888
98550
  phrase: t("Start the pump of {device}", "Avvia la pompa di {device}"),
97889
98551
  icon: "play",
97890
98552
  args: { on: true }
97891
98553
  }, {
97892
98554
  id: "petFountain.pumpOff",
98555
+ effect: {
98556
+ field: "pumpRunning",
98557
+ value: false
98558
+ },
97893
98559
  label: t("Pump off", "Pompa spenta"),
97894
98560
  phrase: t("Stop the pump of {device}", "Ferma la pompa di {device}"),
97895
98561
  icon: "square",
@@ -101349,12 +102015,20 @@ var pumpCycleCapability = {
101349
102015
  auth: "protected",
101350
102016
  actions: [{
101351
102017
  id: "pumpCycle.on",
102018
+ effect: {
102019
+ field: "enabled",
102020
+ value: true
102021
+ },
101352
102022
  label: t("Pump cycle on", "Ciclo pompa attivo"),
101353
102023
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
101354
102024
  icon: "timer",
101355
102025
  args: { on: true }
101356
102026
  }, {
101357
102027
  id: "pumpCycle.off",
102028
+ effect: {
102029
+ field: "enabled",
102030
+ value: false
102031
+ },
101358
102032
  label: t("Pump cycle off", "Ciclo pompa spento"),
101359
102033
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
101360
102034
  icon: "timer-off",
@@ -101373,6 +102047,11 @@ var pumpCycleCapability = {
101373
102047
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
101374
102048
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
101375
102049
  icon: "timer",
102050
+ effect: {
102051
+ field: "onTime",
102052
+ fromArg: "minutes",
102053
+ scale: 60
102054
+ },
101376
102055
  openArgs: [{
101377
102056
  key: "minutes",
101378
102057
  label: t("Minutes", "Minuti"),
@@ -101397,6 +102076,11 @@ var pumpCycleCapability = {
101397
102076
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
101398
102077
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
101399
102078
  icon: "timer-off",
102079
+ effect: {
102080
+ field: "offTime",
102081
+ fromArg: "minutes",
102082
+ scale: 60
102083
+ },
101400
102084
  openArgs: [{
101401
102085
  key: "minutes",
101402
102086
  label: t("Minutes", "Minuti"),
@@ -105711,7 +106395,14 @@ var scriptRunnerCapability = {
105711
106395
  id: "script.run",
105712
106396
  label: t("Run script", "Esegui lo script"),
105713
106397
  phrase: t("Run {device}", "Esegui {device}"),
105714
- icon: "scroll-text"
106398
+ icon: "scroll-text",
106399
+ hold: {
106400
+ effects: [{
106401
+ field: "isRunning",
106402
+ value: true
106403
+ }],
106404
+ holdMs: ONE_SHOT_HOLD_MS
106405
+ }
105715
106406
  }]
105716
106407
  }),
105717
106408
  /** Cancel a running script. Provider rejects when the script
@@ -105721,6 +106412,10 @@ var scriptRunnerCapability = {
105721
106412
  auth: "admin",
105722
106413
  actions: [{
105723
106414
  id: "script.stop",
106415
+ effect: {
106416
+ field: "isRunning",
106417
+ value: false
106418
+ },
105724
106419
  label: t("Stop script", "Ferma lo script"),
105725
106420
  phrase: t("Stop {device}", "Ferma {device}"),
105726
106421
  icon: "square"
@@ -108098,6 +108793,10 @@ var switchCapability = {
108098
108793
  auth: "protected",
108099
108794
  actions: [{
108100
108795
  id: "switch.toggle",
108796
+ sideEffects: [{
108797
+ field: "on",
108798
+ negate: true
108799
+ }],
108101
108800
  label: t("Toggle", "Commuta"),
108102
108801
  phrase: t("Toggle {device}", "Commuta {device}"),
108103
108802
  icon: "toggle-right",
@@ -114278,6 +114977,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
114278
114977
  deviceRemovalHookCapability,
114279
114978
  deviceRunsCapability,
114280
114979
  deviceStateCapability,
114980
+ deviceStateRefreshCapability,
114281
114981
  deviceStatusCapability,
114282
114982
  deviceTransitionsCapability,
114283
114983
  dishwasherCapability,
@@ -125641,6 +126341,20 @@ var METHOD_ACCESS_MAP = Object.freeze({
125641
126341
  access: "create",
125642
126342
  role: "admin"
125643
126343
  },
126344
+ "deviceStateRefresh.refresh": {
126345
+ capName: "device-state-refresh",
126346
+ capScope: "device",
126347
+ addonId: null,
126348
+ access: "create",
126349
+ role: "admin"
126350
+ },
126351
+ "deviceStateRefresh.resubscribe": {
126352
+ capName: "device-state-refresh",
126353
+ capScope: "device",
126354
+ addonId: null,
126355
+ access: "create",
126356
+ role: "admin"
126357
+ },
125644
126358
  "deviceStatus.getStatus": {
125645
126359
  capName: "device-status",
125646
126360
  capScope: "device",
@@ -134477,6 +135191,20 @@ Object.freeze({
134477
135191
  form: "single",
134478
135192
  optional: false
134479
135193
  }],
135194
+ "deviceStateRefresh.refresh": [{
135195
+ name: "deviceId",
135196
+ form: "single",
135197
+ optional: false
135198
+ }, {
135199
+ name: "deviceIds",
135200
+ form: "array",
135201
+ optional: false
135202
+ }],
135203
+ "deviceStateRefresh.resubscribe": [{
135204
+ name: "deviceId",
135205
+ form: "single",
135206
+ optional: false
135207
+ }],
134480
135208
  "deviceStatus.getStatus": [{
134481
135209
  name: "deviceId",
134482
135210
  form: "single",
@@ -139269,6 +139997,43 @@ function searchRank(rawQuery, fields) {
139269
139997
  const keywords = (fields.keywords ?? []).map(normalizeSearchText).filter((keyword) => keyword.length > 0);
139270
139998
  return matchRank(label, keywords, (fields.identifiers ?? []).map(normalizeSearchText).filter((identifier) => identifier.length > 0), query) ?? fuzzyMatchRank(label, query) ?? bestFuzzy(keywords, query);
139271
139999
  }
140000
+ /**
140001
+ * How long a command is held when nothing says otherwise. Equal to the
140002
+ * transition correlator's match window (D1022), so a hold that reverts and a
140003
+ * command recorded `unconfirmed` are the same event.
140004
+ */
140005
+ var DEFAULT_COMMAND_HOLD_MS = 3e4;
140006
+ /** The longest hold a provider may ask for: a value the device never confirms is not shown for long. */
140007
+ var MAX_COMMAND_HOLD_MS = 12e4;
140008
+ function clampHoldMs(ms) {
140009
+ if (ms === void 0 || !Number.isFinite(ms)) return DEFAULT_COMMAND_HOLD_MS;
140010
+ return Math.min(MAX_COMMAND_HOLD_MS, Math.max(1, Math.round(ms)));
140011
+ }
140012
+ function resolveList(list, args, current, shown, into) {
140013
+ for (const entry of list) {
140014
+ if (!effectConditionHolds(entry.when, current)) continue;
140015
+ const resolved = resolveSideEffect(entry, args, shown);
140016
+ if (resolved !== null && !into.some((e) => e.field === resolved.field)) into.push(resolved);
140017
+ }
140018
+ }
140019
+ /**
140020
+ * What to hold for `cap.method(args)` given the cap's slice when it arrived
140021
+ * (`current`, as the device reported it; `shown`, with the held values over
140022
+ * it — what a `negate` flips) and the provider's option for the method.
140023
+ * `null` = hold nothing (`never`, or a command that leads to no state).
140024
+ */
140025
+ function resolveCommandHold(cap, method, args, current, option, shown = current) {
140026
+ if (option?.hold === "never") return null;
140027
+ const effects = [];
140028
+ if (option?.effects !== void 0) resolveList(option.effects, args, current, shown, effects);
140029
+ else effects.push(...commandEffects(cap, method, args, current, shown));
140030
+ if (option?.extraEffects !== void 0) resolveList(option.extraEffects, args, current, shown, effects);
140031
+ if (effects.length === 0) return null;
140032
+ return {
140033
+ effects,
140034
+ holdMs: clampHoldMs(option?.holdMs ?? commandHoldMs(cap, method, args))
140035
+ };
140036
+ }
139272
140037
  //#endregion
139273
140038
  Object.defineProperty(exports, "ACTION_RUN_MAX_MS", {
139274
140039
  enumerable: true,
@@ -139420,6 +140185,12 @@ Object.defineProperty(exports, "CATALOG_LANGS", {
139420
140185
  return CATALOG_LANGS;
139421
140186
  }
139422
140187
  });
140188
+ Object.defineProperty(exports, "COMMAND_BURST_OFFSETS_MS", {
140189
+ enumerable: true,
140190
+ get: function() {
140191
+ return COMMAND_BURST_OFFSETS_MS;
140192
+ }
140193
+ });
139423
140194
  Object.defineProperty(exports, "COMPOSED_DEVICE_STABLE_ID_PREFIX", {
139424
140195
  enumerable: true,
139425
140196
  get: function() {
@@ -140008,6 +140779,12 @@ Object.defineProperty(exports, "NoCallerError", {
140008
140779
  return NoCallerError;
140009
140780
  }
140010
140781
  });
140782
+ Object.defineProperty(exports, "ONE_SHOT_HOLD_MS", {
140783
+ enumerable: true,
140784
+ get: function() {
140785
+ return ONE_SHOT_HOLD_MS;
140786
+ }
140787
+ });
140011
140788
  Object.defineProperty(exports, "PET_FOUNTAIN_WATER_KEY", {
140012
140789
  enumerable: true,
140013
140790
  get: function() {
@@ -140026,6 +140803,12 @@ Object.defineProperty(exports, "PROPOSAL_MIN_SPAN_MS", {
140026
140803
  return PROPOSAL_MIN_SPAN_MS;
140027
140804
  }
140028
140805
  });
140806
+ Object.defineProperty(exports, "PUSH_CONFIRM_WINDOW_MS", {
140807
+ enumerable: true,
140808
+ get: function() {
140809
+ return PUSH_CONFIRM_WINDOW_MS;
140810
+ }
140811
+ });
140029
140812
  Object.defineProperty(exports, "PackageRequiresSchema", {
140030
140813
  enumerable: true,
140031
140814
  get: function() {
@@ -141034,6 +141817,12 @@ Object.defineProperty(exports, "disarmRoseMemory", {
141034
141817
  return disarmRoseMemory;
141035
141818
  }
141036
141819
  });
141820
+ Object.defineProperty(exports, "effectiveRefreshIntervalMs", {
141821
+ enumerable: true,
141822
+ get: function() {
141823
+ return effectiveRefreshIntervalMs;
141824
+ }
141825
+ });
141037
141826
  Object.defineProperty(exports, "emitDownForOwnedCaps", {
141038
141827
  enumerable: true,
141039
141828
  get: function() {
@@ -142078,6 +142867,12 @@ Object.defineProperty(exports, "resolveCapMount", {
142078
142867
  return resolveCapMount;
142079
142868
  }
142080
142869
  });
142870
+ Object.defineProperty(exports, "resolveCommandHold", {
142871
+ enumerable: true,
142872
+ get: function() {
142873
+ return resolveCommandHold;
142874
+ }
142875
+ });
142081
142876
  Object.defineProperty(exports, "resolveCoreBlockEntry", {
142082
142877
  enumerable: true,
142083
142878
  get: function() {