@camstack/types 1.2.591 → 1.2.593

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.
@@ -7985,7 +7985,7 @@ var MODEL_FORMATS = [
7985
7985
  //#region src/generated/cap-vocabulary.ts
7986
7986
  /**
7987
7987
  * THE cap vocabulary (D920), projected from the declarations of every
7988
- * `*.cap.ts` (D1050): 213 caps (111 device, 102 system).
7988
+ * `*.cap.ts` (D1050): 214 caps (112 device, 102 system).
7989
7989
  * Device caps in their declared picker order, then system caps by name.
7990
7990
  */
7991
7991
  var CAP_VOCABULARY = {
@@ -8052,6 +8052,10 @@ var CAP_VOCABULARY = {
8052
8052
  it: "Commuta {device}"
8053
8053
  },
8054
8054
  icon: "toggle-right",
8055
+ sideEffects: [{
8056
+ field: "on",
8057
+ negate: true
8058
+ }],
8055
8059
  offeredWhen: {
8056
8060
  method: "getOptions",
8057
8061
  field: "supportsSetState"
@@ -9166,7 +9170,15 @@ var CAP_VOCABULARY = {
9166
9170
  effect: {
9167
9171
  field: "state",
9168
9172
  value: "locked"
9169
- }
9173
+ },
9174
+ hold: { effects: [{
9175
+ field: "state",
9176
+ value: "locking",
9177
+ when: {
9178
+ field: "state",
9179
+ notIn: ["locked"]
9180
+ }
9181
+ }] }
9170
9182
  },
9171
9183
  {
9172
9184
  id: "lock.unlock",
@@ -9195,7 +9207,15 @@ var CAP_VOCABULARY = {
9195
9207
  effect: {
9196
9208
  field: "state",
9197
9209
  value: "unlocked"
9198
- }
9210
+ },
9211
+ hold: { effects: [{
9212
+ field: "state",
9213
+ value: "unlocking",
9214
+ when: {
9215
+ field: "state",
9216
+ notIn: ["unlocked"]
9217
+ }
9218
+ }] }
9199
9219
  },
9200
9220
  {
9201
9221
  id: "lock.open",
@@ -9509,6 +9529,14 @@ var CAP_VOCABULARY = {
9509
9529
  step: .5,
9510
9530
  unit: "°C"
9511
9531
  }
9532
+ }],
9533
+ effect: {
9534
+ field: "targetLow",
9535
+ fromArg: "targetLow"
9536
+ },
9537
+ sideEffects: [{
9538
+ field: "targetHigh",
9539
+ fromArg: "targetHigh"
9512
9540
  }]
9513
9541
  },
9514
9542
  {
@@ -9565,7 +9593,11 @@ var CAP_VOCABULARY = {
9565
9593
  from: "status",
9566
9594
  field: "availableFanModes"
9567
9595
  }
9568
- }]
9596
+ }],
9597
+ effect: {
9598
+ field: "fanMode",
9599
+ fromArg: "fanMode"
9600
+ }
9569
9601
  },
9570
9602
  {
9571
9603
  id: "climate.preset",
@@ -9590,7 +9622,11 @@ var CAP_VOCABULARY = {
9590
9622
  from: "status",
9591
9623
  field: "availablePresets"
9592
9624
  }
9593
- }]
9625
+ }],
9626
+ effect: {
9627
+ field: "preset",
9628
+ fromArg: "preset"
9629
+ }
9594
9630
  },
9595
9631
  {
9596
9632
  id: "climate.swingVerticalOn",
@@ -9823,7 +9859,15 @@ var CAP_VOCABULARY = {
9823
9859
  effect: {
9824
9860
  field: "speed",
9825
9861
  value: 100
9826
- }
9862
+ },
9863
+ sideEffects: [{
9864
+ field: "preset",
9865
+ value: "",
9866
+ when: {
9867
+ field: "preset",
9868
+ notIn: [""]
9869
+ }
9870
+ }]
9827
9871
  },
9828
9872
  {
9829
9873
  id: "fan.speed",
@@ -9854,7 +9898,15 @@ var CAP_VOCABULARY = {
9854
9898
  effect: {
9855
9899
  field: "speed",
9856
9900
  fromArg: "speed"
9857
- }
9901
+ },
9902
+ sideEffects: [{
9903
+ field: "preset",
9904
+ value: "",
9905
+ when: {
9906
+ field: "preset",
9907
+ notIn: [""]
9908
+ }
9909
+ }]
9858
9910
  },
9859
9911
  {
9860
9912
  id: "fan.preset",
@@ -9879,7 +9931,11 @@ var CAP_VOCABULARY = {
9879
9931
  from: "status",
9880
9932
  field: "availablePresets"
9881
9933
  }
9882
- }]
9934
+ }],
9935
+ effect: {
9936
+ field: "preset",
9937
+ fromArg: "preset"
9938
+ }
9883
9939
  },
9884
9940
  {
9885
9941
  id: "fan.forward",
@@ -10424,7 +10480,15 @@ var CAP_VOCABULARY = {
10424
10480
  effect: {
10425
10481
  field: "state",
10426
10482
  value: "disarmed"
10427
- }
10483
+ },
10484
+ hold: { effects: [{
10485
+ field: "state",
10486
+ value: "disarming",
10487
+ when: {
10488
+ field: "state",
10489
+ notIn: ["disarmed"]
10490
+ }
10491
+ }] }
10428
10492
  },
10429
10493
  {
10430
10494
  id: "alarm.arm.home",
@@ -10454,7 +10518,15 @@ var CAP_VOCABULARY = {
10454
10518
  effect: {
10455
10519
  field: "state",
10456
10520
  value: "armed_home"
10457
- }
10521
+ },
10522
+ hold: { effects: [{
10523
+ field: "state",
10524
+ value: "arming",
10525
+ when: {
10526
+ field: "state",
10527
+ notIn: ["armed_home"]
10528
+ }
10529
+ }] }
10458
10530
  },
10459
10531
  {
10460
10532
  id: "alarm.arm.away",
@@ -10484,7 +10556,15 @@ var CAP_VOCABULARY = {
10484
10556
  effect: {
10485
10557
  field: "state",
10486
10558
  value: "armed_away"
10487
- }
10559
+ },
10560
+ hold: { effects: [{
10561
+ field: "state",
10562
+ value: "arming",
10563
+ when: {
10564
+ field: "state",
10565
+ notIn: ["armed_away"]
10566
+ }
10567
+ }] }
10488
10568
  },
10489
10569
  {
10490
10570
  id: "alarm.arm.night",
@@ -10514,7 +10594,15 @@ var CAP_VOCABULARY = {
10514
10594
  effect: {
10515
10595
  field: "state",
10516
10596
  value: "armed_night"
10517
- }
10597
+ },
10598
+ hold: { effects: [{
10599
+ field: "state",
10600
+ value: "arming",
10601
+ when: {
10602
+ field: "state",
10603
+ notIn: ["armed_night"]
10604
+ }
10605
+ }] }
10518
10606
  },
10519
10607
  {
10520
10608
  id: "alarm.arm.vacation",
@@ -10544,7 +10632,15 @@ var CAP_VOCABULARY = {
10544
10632
  effect: {
10545
10633
  field: "state",
10546
10634
  value: "armed_vacation"
10547
- }
10635
+ },
10636
+ hold: { effects: [{
10637
+ field: "state",
10638
+ value: "arming",
10639
+ when: {
10640
+ field: "state",
10641
+ notIn: ["armed_vacation"]
10642
+ }
10643
+ }] }
10548
10644
  },
10549
10645
  {
10550
10646
  id: "alarm.arm.custom_bypass",
@@ -10574,7 +10670,15 @@ var CAP_VOCABULARY = {
10574
10670
  effect: {
10575
10671
  field: "state",
10576
10672
  value: "armed_custom_bypass"
10577
- }
10673
+ },
10674
+ hold: { effects: [{
10675
+ field: "state",
10676
+ value: "arming",
10677
+ when: {
10678
+ field: "state",
10679
+ notIn: ["armed_custom_bypass"]
10680
+ }
10681
+ }] }
10578
10682
  }
10579
10683
  ],
10580
10684
  state: [{
@@ -11716,7 +11820,14 @@ var CAP_VOCABULARY = {
11716
11820
  quantity: "mass"
11717
11821
  },
11718
11822
  optional: true
11719
- }]
11823
+ }],
11824
+ hold: {
11825
+ effects: [{
11826
+ field: "feeding",
11827
+ value: true
11828
+ }],
11829
+ holdMs: 1e4
11830
+ }
11720
11831
  },
11721
11832
  {
11722
11833
  id: "petFeeder.feedHoppers",
@@ -11760,7 +11871,14 @@ var CAP_VOCABULARY = {
11760
11871
  quantity: "mass"
11761
11872
  },
11762
11873
  optional: true
11763
- }]
11874
+ }],
11875
+ hold: {
11876
+ effects: [{
11877
+ field: "feeding",
11878
+ value: true
11879
+ }],
11880
+ holdMs: 1e4
11881
+ }
11764
11882
  },
11765
11883
  {
11766
11884
  id: "petFeeder.cancelFeed",
@@ -11851,7 +11969,11 @@ var CAP_VOCABULARY = {
11851
11969
  it: "Attiva il blocco bambini di {device}"
11852
11970
  },
11853
11971
  icon: "lock",
11854
- args: { on: true }
11972
+ args: { on: true },
11973
+ effect: {
11974
+ field: "childLock",
11975
+ value: true
11976
+ }
11855
11977
  },
11856
11978
  {
11857
11979
  id: "petFeeder.childLockOff",
@@ -11865,7 +11987,11 @@ var CAP_VOCABULARY = {
11865
11987
  it: "Disattiva il blocco bambini di {device}"
11866
11988
  },
11867
11989
  icon: "lock-open",
11868
- args: { on: false }
11990
+ args: { on: false },
11991
+ effect: {
11992
+ field: "childLock",
11993
+ value: false
11994
+ }
11869
11995
  },
11870
11996
  {
11871
11997
  id: "petFeeder.lightOn",
@@ -11879,7 +12005,11 @@ var CAP_VOCABULARY = {
11879
12005
  it: "Accendi la spia di {device}"
11880
12006
  },
11881
12007
  icon: "lightbulb",
11882
- args: { on: true }
12008
+ args: { on: true },
12009
+ effect: {
12010
+ field: "indicatorLight",
12011
+ value: true
12012
+ }
11883
12013
  },
11884
12014
  {
11885
12015
  id: "petFeeder.lightOff",
@@ -11893,7 +12023,11 @@ var CAP_VOCABULARY = {
11893
12023
  it: "Spegni la spia di {device}"
11894
12024
  },
11895
12025
  icon: "lightbulb-off",
11896
- args: { on: false }
12026
+ args: { on: false },
12027
+ effect: {
12028
+ field: "indicatorLight",
12029
+ value: false
12030
+ }
11897
12031
  },
11898
12032
  {
11899
12033
  id: "petFeeder.feedSoundOn",
@@ -11907,7 +12041,11 @@ var CAP_VOCABULARY = {
11907
12041
  it: "Attiva il suono di erogazione di {device}"
11908
12042
  },
11909
12043
  icon: "volume-2",
11910
- args: { on: true }
12044
+ args: { on: true },
12045
+ effect: {
12046
+ field: "feedSound",
12047
+ value: true
12048
+ }
11911
12049
  },
11912
12050
  {
11913
12051
  id: "petFeeder.feedSoundOff",
@@ -11921,7 +12059,11 @@ var CAP_VOCABULARY = {
11921
12059
  it: "Disattiva il suono di erogazione di {device}"
11922
12060
  },
11923
12061
  icon: "volume-x",
11924
- args: { on: false }
12062
+ args: { on: false },
12063
+ effect: {
12064
+ field: "feedSound",
12065
+ value: false
12066
+ }
11925
12067
  },
11926
12068
  {
11927
12069
  id: "petFeeder.volume",
@@ -11946,7 +12088,11 @@ var CAP_VOCABULARY = {
11946
12088
  min: 0,
11947
12089
  step: 1
11948
12090
  }
11949
- }]
12091
+ }],
12092
+ effect: {
12093
+ field: "volume",
12094
+ fromArg: "level"
12095
+ }
11950
12096
  }
11951
12097
  ],
11952
12098
  state: [
@@ -12018,7 +12164,11 @@ var CAP_VOCABULARY = {
12018
12164
  it: "Avvia la pompa di {device}"
12019
12165
  },
12020
12166
  icon: "play",
12021
- args: { on: true }
12167
+ args: { on: true },
12168
+ effect: {
12169
+ field: "pumpRunning",
12170
+ value: true
12171
+ }
12022
12172
  }, {
12023
12173
  id: "petFountain.pumpOff",
12024
12174
  method: "setPump",
@@ -12031,7 +12181,11 @@ var CAP_VOCABULARY = {
12031
12181
  it: "Ferma la pompa di {device}"
12032
12182
  },
12033
12183
  icon: "square",
12034
- args: { on: false }
12184
+ args: { on: false },
12185
+ effect: {
12186
+ field: "pumpRunning",
12187
+ value: false
12188
+ }
12035
12189
  }],
12036
12190
  state: [{
12037
12191
  kind: "boolean",
@@ -12083,7 +12237,11 @@ var CAP_VOCABULARY = {
12083
12237
  it: "Fai lavorare la pompa di {device} a ciclo acceso/spento"
12084
12238
  },
12085
12239
  icon: "timer",
12086
- args: { on: true }
12240
+ args: { on: true },
12241
+ effect: {
12242
+ field: "enabled",
12243
+ value: true
12244
+ }
12087
12245
  },
12088
12246
  {
12089
12247
  id: "pumpCycle.off",
@@ -12097,7 +12255,11 @@ var CAP_VOCABULARY = {
12097
12255
  it: "Fai lavorare la pompa di {device} in continuo"
12098
12256
  },
12099
12257
  icon: "timer-off",
12100
- args: { on: false }
12258
+ args: { on: false },
12259
+ effect: {
12260
+ field: "enabled",
12261
+ value: false
12262
+ }
12101
12263
  },
12102
12264
  {
12103
12265
  id: "pumpCycle.onMinutes",
@@ -12123,7 +12285,12 @@ var CAP_VOCABULARY = {
12123
12285
  step: 1,
12124
12286
  unit: "min"
12125
12287
  }
12126
- }]
12288
+ }],
12289
+ effect: {
12290
+ field: "onTime",
12291
+ fromArg: "minutes",
12292
+ scale: 60
12293
+ }
12127
12294
  },
12128
12295
  {
12129
12296
  id: "pumpCycle.offMinutes",
@@ -12149,7 +12316,12 @@ var CAP_VOCABULARY = {
12149
12316
  step: 1,
12150
12317
  unit: "min"
12151
12318
  }
12152
- }]
12319
+ }],
12320
+ effect: {
12321
+ field: "offTime",
12322
+ fromArg: "minutes",
12323
+ scale: 60
12324
+ }
12153
12325
  }
12154
12326
  ],
12155
12327
  state: [{
@@ -12266,7 +12438,11 @@ var CAP_VOCABULARY = {
12266
12438
  en: "Play on {device}",
12267
12439
  it: "Avvia la riproduzione su {device}"
12268
12440
  },
12269
- icon: "play"
12441
+ icon: "play",
12442
+ effect: {
12443
+ field: "state",
12444
+ value: "playing"
12445
+ }
12270
12446
  },
12271
12447
  {
12272
12448
  id: "media.pause",
@@ -12279,7 +12455,11 @@ var CAP_VOCABULARY = {
12279
12455
  en: "Pause {device}",
12280
12456
  it: "Metti in pausa {device}"
12281
12457
  },
12282
- icon: "pause"
12458
+ icon: "pause",
12459
+ effect: {
12460
+ field: "state",
12461
+ value: "paused"
12462
+ }
12283
12463
  },
12284
12464
  {
12285
12465
  id: "media.stop",
@@ -12345,7 +12525,11 @@ var CAP_VOCABULARY = {
12345
12525
  step: 1,
12346
12526
  unit: "%"
12347
12527
  }
12348
- }]
12528
+ }],
12529
+ effect: {
12530
+ field: "volumeLevel",
12531
+ fromArg: "volumeLevel"
12532
+ }
12349
12533
  },
12350
12534
  {
12351
12535
  id: "media.mute",
@@ -12359,7 +12543,11 @@ var CAP_VOCABULARY = {
12359
12543
  it: "Silenzia {device}"
12360
12544
  },
12361
12545
  icon: "volume-x",
12362
- args: { muted: true }
12546
+ args: { muted: true },
12547
+ effect: {
12548
+ field: "isMuted",
12549
+ value: true
12550
+ }
12363
12551
  },
12364
12552
  {
12365
12553
  id: "media.unmute",
@@ -12373,7 +12561,11 @@ var CAP_VOCABULARY = {
12373
12561
  it: "Riattiva l’audio di {device}"
12374
12562
  },
12375
12563
  icon: "volume-2",
12376
- args: { muted: false }
12564
+ args: { muted: false },
12565
+ effect: {
12566
+ field: "isMuted",
12567
+ value: false
12568
+ }
12377
12569
  },
12378
12570
  {
12379
12571
  id: "media.shuffleOn",
@@ -12387,7 +12579,11 @@ var CAP_VOCABULARY = {
12387
12579
  it: "Attiva la riproduzione casuale su {device}"
12388
12580
  },
12389
12581
  icon: "shuffle",
12390
- args: { shuffle: true }
12582
+ args: { shuffle: true },
12583
+ effect: {
12584
+ field: "shuffle",
12585
+ value: true
12586
+ }
12391
12587
  },
12392
12588
  {
12393
12589
  id: "media.shuffleOff",
@@ -12401,7 +12597,11 @@ var CAP_VOCABULARY = {
12401
12597
  it: "Disattiva la riproduzione casuale su {device}"
12402
12598
  },
12403
12599
  icon: "shuffle",
12404
- args: { shuffle: false }
12600
+ args: { shuffle: false },
12601
+ effect: {
12602
+ field: "shuffle",
12603
+ value: false
12604
+ }
12405
12605
  },
12406
12606
  {
12407
12607
  id: "media.repeat",
@@ -12447,7 +12647,11 @@ var CAP_VOCABULARY = {
12447
12647
  }
12448
12648
  ]
12449
12649
  }
12450
- }]
12650
+ }],
12651
+ effect: {
12652
+ field: "repeat",
12653
+ fromArg: "repeat"
12654
+ }
12451
12655
  },
12452
12656
  {
12453
12657
  id: "media.source",
@@ -12472,7 +12676,11 @@ var CAP_VOCABULARY = {
12472
12676
  from: "status",
12473
12677
  field: "availableSources"
12474
12678
  }
12475
- }]
12679
+ }],
12680
+ effect: {
12681
+ field: "source",
12682
+ fromArg: "source"
12683
+ }
12476
12684
  },
12477
12685
  {
12478
12686
  id: "media.seek",
@@ -13012,7 +13220,14 @@ var CAP_VOCABULARY = {
13012
13220
  en: "Run {device}",
13013
13221
  it: "Esegui {device}"
13014
13222
  },
13015
- icon: "scroll-text"
13223
+ icon: "scroll-text",
13224
+ hold: {
13225
+ effects: [{
13226
+ field: "isRunning",
13227
+ value: true
13228
+ }],
13229
+ holdMs: 1e4
13230
+ }
13016
13231
  }, {
13017
13232
  id: "script.stop",
13018
13233
  method: "stop",
@@ -13024,7 +13239,11 @@ var CAP_VOCABULARY = {
13024
13239
  en: "Stop {device}",
13025
13240
  it: "Ferma {device}"
13026
13241
  },
13027
- icon: "square"
13242
+ icon: "square",
13243
+ effect: {
13244
+ field: "isRunning",
13245
+ value: false
13246
+ }
13028
13247
  }],
13029
13248
  state: [{
13030
13249
  kind: "boolean",
@@ -13062,7 +13281,11 @@ var CAP_VOCABULARY = {
13062
13281
  en: "Enable {device}",
13063
13282
  it: "Abilita {device}"
13064
13283
  },
13065
- icon: "toggle-right"
13284
+ icon: "toggle-right",
13285
+ effect: {
13286
+ field: "enabled",
13287
+ value: true
13288
+ }
13066
13289
  },
13067
13290
  {
13068
13291
  id: "haAutomation.disable",
@@ -13075,7 +13298,11 @@ var CAP_VOCABULARY = {
13075
13298
  en: "Disable {device}",
13076
13299
  it: "Disabilita {device}"
13077
13300
  },
13078
- icon: "toggle-left"
13301
+ icon: "toggle-left",
13302
+ effect: {
13303
+ field: "enabled",
13304
+ value: false
13305
+ }
13079
13306
  },
13080
13307
  {
13081
13308
  id: "haAutomation.trigger",
@@ -14677,6 +14904,17 @@ var CAP_VOCABULARY = {
14677
14904
  },
14678
14905
  notOperatorFacing: { resync: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action" }
14679
14906
  },
14907
+ "device-state-refresh": {
14908
+ scope: "device",
14909
+ noun: {
14910
+ en: "State refresh",
14911
+ it: "Aggiornamento dello stato"
14912
+ },
14913
+ notOperatorFacing: {
14914
+ refresh: "the core schedules state refreshes itself; an operator never asks for one",
14915
+ resubscribe: "the core schedules state refreshes itself; an operator never asks for one"
14916
+ }
14917
+ },
14680
14918
  "recording": {
14681
14919
  scope: "device",
14682
14920
  noun: {
@@ -17466,7 +17704,12 @@ function actionEffect(actionId, args) {
17466
17704
  value: effect.value
17467
17705
  };
17468
17706
  const raw = args?.[effect.fromArg];
17469
- if (typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean") return {
17707
+ if (typeof raw === "number") return {
17708
+ cap: found.cap,
17709
+ field: effect.field,
17710
+ value: raw * (effect.scale ?? 1)
17711
+ };
17712
+ if (typeof raw === "string" || typeof raw === "boolean") return {
17470
17713
  cap: found.cap,
17471
17714
  field: effect.field,
17472
17715
  value: raw
@@ -18146,6 +18389,7 @@ var CAP_NAMES = Object.freeze([
18146
18389
  "device-removal-hook",
18147
18390
  "device-runs",
18148
18391
  "device-state",
18392
+ "device-state-refresh",
18149
18393
  "device-status",
18150
18394
  "device-transitions",
18151
18395
  "dishwasher",
@@ -20674,7 +20918,10 @@ function buildAuditedFields() {
20674
20918
  set.add(field);
20675
20919
  byCap.set(cap, set);
20676
20920
  };
20677
- for (const { cap, action } of allVocabActions()) if (action.effect !== void 0) add(cap, action.effect.field);
20921
+ for (const { cap, action } of allVocabActions()) {
20922
+ if (action.effect !== void 0) add(cap, action.effect.field);
20923
+ for (const side of action.sideEffects ?? []) add(cap, side.field);
20924
+ }
20678
20925
  for (const [cap, entry] of Object.entries(CAP_VOCABULARY_BY_NAME)) {
20679
20926
  if (entry.scope !== "device") continue;
20680
20927
  for (const trigger of entry.state ?? []) if (trigger.kind === "boolean" || trigger.kind === "enum") add(cap, trigger.field);
@@ -20704,6 +20951,113 @@ function auditedFields(cap) {
20704
20951
  fieldsByCap ??= buildAuditedFields();
20705
20952
  return fieldsByCap.get(cap) ?? NO_FIELDS;
20706
20953
  }
20954
+ /** Does `slice` meet `when`? A field the slice lacks is in no list. */
20955
+ function effectConditionHolds(when, slice) {
20956
+ if (when === void 0) return true;
20957
+ const raw = slice?.[when.field];
20958
+ const value = typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean" ? raw : void 0;
20959
+ if ("in" in when) return value !== void 0 && when.in.includes(value);
20960
+ return value === void 0 || !when.notIn.includes(value);
20961
+ }
20962
+ /** The step of the number open arg `key`, when the action offers one. */
20963
+ function stepOf(openArgs, key) {
20964
+ const offer = openArgs?.find((a) => a.key === key)?.offer;
20965
+ return offer?.kind === "number" && offer.step !== void 0 && offer.step > 0 ? offer.step : void 0;
20966
+ }
20967
+ /**
20968
+ * One side effect resolved against the args and the slice the command acts
20969
+ * on: `null` when the arg carrying its value is missing, or a `negate` names a
20970
+ * field the slice holds no boolean in. `openArgs` lends a copied number its
20971
+ * step as the tolerance.
20972
+ */
20973
+ function resolveSideEffect(side, args, shown, openArgs) {
20974
+ if ("value" in side) return {
20975
+ field: side.field,
20976
+ value: side.value
20977
+ };
20978
+ if ("negate" in side) {
20979
+ const raw = shown?.[side.field];
20980
+ return typeof raw === "boolean" ? {
20981
+ field: side.field,
20982
+ value: !raw
20983
+ } : null;
20984
+ }
20985
+ const raw = args?.[side.fromArg];
20986
+ if (typeof raw === "string" || typeof raw === "boolean") return {
20987
+ field: side.field,
20988
+ value: raw
20989
+ };
20990
+ if (typeof raw === "number") {
20991
+ const scale = side.scale ?? 1;
20992
+ const step = stepOf(openArgs, side.fromArg);
20993
+ return step === void 0 ? {
20994
+ field: side.field,
20995
+ value: raw * scale
20996
+ } : {
20997
+ field: side.field,
20998
+ value: raw * scale,
20999
+ tolerance: step * scale
21000
+ };
21001
+ }
21002
+ return null;
21003
+ }
21004
+ /**
21005
+ * The hold limit the vocabulary declares for `cap.method(args)` (its action's
21006
+ * `hold.holdMs`), or `undefined` for the default.
21007
+ */
21008
+ function commandHoldMs(cap, method, args) {
21009
+ return holdFor(cap, method, args)?.holdMs;
21010
+ }
21011
+ /**
21012
+ * The hold the vocabulary declares for `cap.method(args)`: the matched
21013
+ * action's, or — when several actions share the method and the args cannot
21014
+ * tell them apart (`petFeeder.feed` / `feedHoppers`) — the one they all
21015
+ * declare alike. Different holds on such actions resolve to none.
21016
+ */
21017
+ function holdFor(cap, method, args) {
21018
+ const actionId = vocabActionIdFor(cap, method, args);
21019
+ if (actionId !== void 0) return findVocabAction(actionId)?.action.hold;
21020
+ const holds = allVocabActions().filter(({ cap: c, action }) => c === cap && action.method === method).map(({ action }) => action.hold);
21021
+ const first = holds[0];
21022
+ if (first === void 0) return void 0;
21023
+ const key = JSON.stringify(first);
21024
+ return holds.every((h) => JSON.stringify(h) === key) ? first : void 0;
21025
+ }
21026
+ /**
21027
+ * EVERY state the command `cap.method(args)` leads to (D1061): its `effect`
21028
+ * first, then each side effect whose condition holds on `current` (the cap's
21029
+ * slice the device reported when the command arrived). Empty when it leads to
21030
+ * none. One field is named once — the first entry for it wins. A `negate`
21031
+ * side effect flips what `shown` (the slice the person saw, held values
21032
+ * included) holds, so a second toggle before the first is confirmed undoes it.
21033
+ * An action that declares `hold.effects` is held as THOSE instead (a lock
21034
+ * holds `locking`, not `locked`).
21035
+ */
21036
+ function commandEffects(cap, method, args, current, shown = current) {
21037
+ const out = [];
21038
+ const hold = holdFor(cap, method, args);
21039
+ if (hold?.effects !== void 0) {
21040
+ for (const entry of hold.effects) {
21041
+ if (!effectConditionHolds(entry.when, current)) continue;
21042
+ const resolved = resolveSideEffect(entry, args, shown);
21043
+ if (resolved !== null && !out.some((e) => e.field === resolved.field)) out.push(resolved);
21044
+ }
21045
+ return out;
21046
+ }
21047
+ const actionId = vocabActionIdFor(cap, method, args);
21048
+ if (actionId === void 0) return [];
21049
+ const action = findVocabAction(actionId)?.action;
21050
+ if (action?.effect !== void 0) {
21051
+ const primary = resolveSideEffect(action.effect, args, shown, action.openArgs);
21052
+ if (primary !== null) out.push(primary);
21053
+ }
21054
+ for (const side of action?.sideEffects ?? []) {
21055
+ if (!effectConditionHolds(side.when, current)) continue;
21056
+ const resolved = resolveSideEffect(side, args, shown, action?.openArgs);
21057
+ if (resolved !== null && !out.some((e) => e.field === resolved.field)) out.push(resolved);
21058
+ }
21059
+ return out;
21060
+ }
20707
21061
  //#endregion
20708
21062
  //#region src/device/device-state-handle.ts
20709
21063
  var DEVICE_STATE_EVENT_CATEGORY = "device.state-changed";
@@ -21184,6 +21538,10 @@ function createDeviceProxy(api, binding, opts) {
21184
21538
  getRun: (input, options) => dispatch("device-runs", "deviceRuns", "getRun", "query", input, void 0, options),
21185
21539
  getCurrentRun: (input, options) => dispatch("device-runs", "deviceRuns", "getCurrentRun", "query", input, void 0, options)
21186
21540
  };
21541
+ const deviceStateRefreshInterface = {
21542
+ refresh: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "refresh", "mutation", input, void 0, options),
21543
+ resubscribe: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "resubscribe", "mutation", input, void 0, options)
21544
+ };
21187
21545
  const deviceStatusInterface = { getStatus: (input, options) => dispatch("device-status", "deviceStatus", "getStatus", "query", input, void 0, options) };
21188
21546
  const deviceTransitionsInterface = {
21189
21547
  listTransitions: (input, options) => dispatch("device-transitions", "deviceTransitions", "listTransitions", "query", input, void 0, options),
@@ -21967,6 +22325,7 @@ function createDeviceProxy(api, binding, opts) {
21967
22325
  ...bound("device-extension") ? { deviceExtension: deviceExtensionInterface } : {},
21968
22326
  ...bound("device-ops") ? { deviceOps: deviceOpsInterface } : {},
21969
22327
  ...bound("device-runs") ? { deviceRuns: deviceRunsInterface } : {},
22328
+ ...bound("device-state-refresh") ? { deviceStateRefresh: deviceStateRefreshInterface } : {},
21970
22329
  ...bound("device-status") ? { deviceStatus: deviceStatusInterface } : {},
21971
22330
  ...bound("device-transitions") ? { deviceTransitions: deviceTransitionsInterface } : {},
21972
22331
  ...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
@@ -22080,7 +22439,7 @@ function createDeviceProxy(api, binding, opts) {
22080
22439
  * can answer "may a rule actuate this?" without importing the schema barrel
22081
22440
  * (~144MB RSS per runner, D28).
22082
22441
  *
22083
- * Coverage: 111 device-scoped capabilities.
22442
+ * Coverage: 112 device-scoped capabilities.
22084
22443
  */
22085
22444
  var DEVICE_SCOPED_CAPS = new Set([
22086
22445
  "accessories",
@@ -22112,6 +22471,7 @@ var DEVICE_SCOPED_CAPS = new Set([
22112
22471
  "device-extension",
22113
22472
  "device-ops",
22114
22473
  "device-runs",
22474
+ "device-state-refresh",
22115
22475
  "device-status",
22116
22476
  "device-transitions",
22117
22477
  "dishwasher",
@@ -23465,6 +23825,18 @@ Object.defineProperty(exports, "commandEffect", {
23465
23825
  return commandEffect;
23466
23826
  }
23467
23827
  });
23828
+ Object.defineProperty(exports, "commandEffects", {
23829
+ enumerable: true,
23830
+ get: function() {
23831
+ return commandEffects;
23832
+ }
23833
+ });
23834
+ Object.defineProperty(exports, "commandHoldMs", {
23835
+ enumerable: true,
23836
+ get: function() {
23837
+ return commandHoldMs;
23838
+ }
23839
+ });
23468
23840
  Object.defineProperty(exports, "commandOrigin", {
23469
23841
  enumerable: true,
23470
23842
  get: function() {
@@ -23609,6 +23981,12 @@ Object.defineProperty(exports, "displayUnitFor", {
23609
23981
  return displayUnitFor;
23610
23982
  }
23611
23983
  });
23984
+ Object.defineProperty(exports, "effectConditionHolds", {
23985
+ enumerable: true,
23986
+ get: function() {
23987
+ return effectConditionHolds;
23988
+ }
23989
+ });
23612
23990
  Object.defineProperty(exports, "emitDownForOwnedCaps", {
23613
23991
  enumerable: true,
23614
23992
  get: function() {
@@ -24113,6 +24491,12 @@ Object.defineProperty(exports, "resolveSecretViewsIn", {
24113
24491
  return resolveSecretViewsIn;
24114
24492
  }
24115
24493
  });
24494
+ Object.defineProperty(exports, "resolveSideEffect", {
24495
+ enumerable: true,
24496
+ get: function() {
24497
+ return resolveSideEffect;
24498
+ }
24499
+ });
24116
24500
  Object.defineProperty(exports, "resolvedValues", {
24117
24501
  enumerable: true,
24118
24502
  get: function() {