@camstack/addon-export-alexa 1.2.172 → 1.2.174

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.
@@ -34,7 +34,7 @@ let node_path = require("node:path");
34
34
  node_path = __toESM(node_path, 1);
35
35
  require("node:child_process");
36
36
  require("node:zlib");
37
- //#region ../types/dist/event-category-CT-hz5Rb.mjs
37
+ //#region ../types/dist/event-category-DmZDPDf_.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -661,7 +661,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
661
661
  * (a track was promoted to a stationary-registry entry) or departs (the
662
662
  * object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
663
663
  * the dedicated "Stationary" section — never the live event feed. Payload:
664
- * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
664
+ * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
665
665
  */
666
666
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
667
667
  /**
@@ -799,6 +799,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
799
799
  */
800
800
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
801
801
  /**
802
+ * An action run started or ended. Emitted by the `actions` surface.
803
+ * Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
804
+ */
805
+ EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
806
+ /**
802
807
  * Progress update from a running model conversion job.
803
808
  * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
804
809
  * Emitted by `addon-model-studio` on the converting node.
@@ -5477,7 +5482,7 @@ var ZodIssueCode = {
5477
5482
  var ZodFirstPartyTypeKind;
5478
5483
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5479
5484
  //#endregion
5480
- //#region ../types/dist/sleep--jXS9hWo.mjs
5485
+ //#region ../types/dist/sleep-DJws6ho7.mjs
5481
5486
  /**
5482
5487
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5483
5488
  * window to float samples (D455).
@@ -8548,6 +8553,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
8548
8553
  /** Every capability name, so addon code can check a name without the schema graph. */
8549
8554
  var CAP_NAMES = Object.freeze([
8550
8555
  "accessories",
8556
+ "action-source",
8557
+ "actions",
8551
8558
  "addon-pages",
8552
8559
  "addon-pages-source",
8553
8560
  "addon-routes",
@@ -8631,6 +8638,7 @@ var CAP_NAMES = Object.freeze([
8631
8638
  "image-settings",
8632
8639
  "integrations",
8633
8640
  "intercom",
8641
+ "ir-transmitter",
8634
8642
  "keychain",
8635
8643
  "keychain-admin",
8636
8644
  "lawn-mower-control",
@@ -8689,6 +8697,7 @@ var CAP_NAMES = Object.freeze([
8689
8697
  "recording-onboard",
8690
8698
  "recording-signal",
8691
8699
  "records",
8700
+ "remote",
8692
8701
  "running-state",
8693
8702
  "scene-monitor",
8694
8703
  "script-runner",
@@ -8712,6 +8721,7 @@ var CAP_NAMES = Object.freeze([
8712
8721
  "system",
8713
8722
  "tamper",
8714
8723
  "temperature-sensor",
8724
+ "template",
8715
8725
  "terminal-session",
8716
8726
  "toast",
8717
8727
  "training",
@@ -8736,11 +8746,11 @@ var CAP_NAMES = Object.freeze([
8736
8746
  Object.freeze({
8737
8747
  "air-quality-sensor": [
8738
8748
  {
8739
- "path": "co2Ppm",
8749
+ "path": "co2",
8740
8750
  "valueType": "number"
8741
8751
  },
8742
8752
  {
8743
- "path": "vocPpb",
8753
+ "path": "voc",
8744
8754
  "valueType": "number"
8745
8755
  },
8746
8756
  {
@@ -8790,7 +8800,7 @@ Object.freeze({
8790
8800
  }
8791
8801
  ],
8792
8802
  "ambient-light-sensor": [{
8793
- "path": "lux",
8803
+ "path": "illuminance",
8794
8804
  "valueType": "number"
8795
8805
  }],
8796
8806
  "audio-metrics": [
@@ -8851,7 +8861,7 @@ Object.freeze({
8851
8861
  ],
8852
8862
  "battery": [
8853
8863
  {
8854
- "path": "percentage",
8864
+ "path": "level",
8855
8865
  "valueType": "number"
8856
8866
  },
8857
8867
  {
@@ -8873,7 +8883,7 @@ Object.freeze({
8873
8883
  "valueType": "number"
8874
8884
  },
8875
8885
  {
8876
- "path": "volts",
8886
+ "path": "voltage",
8877
8887
  "valueType": "number"
8878
8888
  },
8879
8889
  {
@@ -8894,7 +8904,7 @@ Object.freeze({
8894
8904
  "valueType": "boolean"
8895
8905
  }],
8896
8906
  "brightness": [{
8897
- "path": "percentage",
8907
+ "path": "level",
8898
8908
  "valueType": "number"
8899
8909
  }],
8900
8910
  "broker": [{
@@ -9095,7 +9105,7 @@ Object.freeze({
9095
9105
  "valueType": "number"
9096
9106
  },
9097
9107
  {
9098
- "path": "mireds",
9108
+ "path": "colorTemperature",
9099
9109
  "valueType": "number"
9100
9110
  }
9101
9111
  ],
@@ -9274,15 +9284,15 @@ Object.freeze({
9274
9284
  "valueType": "string"
9275
9285
  },
9276
9286
  {
9277
- "path": "remainingSeconds",
9287
+ "path": "remaining",
9278
9288
  "valueType": "number"
9279
9289
  },
9280
9290
  {
9281
- "path": "delayedStartSeconds",
9291
+ "path": "delayedStart",
9282
9292
  "valueType": "number"
9283
9293
  },
9284
9294
  {
9285
- "path": "progressPercent",
9295
+ "path": "progress",
9286
9296
  "valueType": "number"
9287
9297
  },
9288
9298
  {
@@ -9396,7 +9406,7 @@ Object.freeze({
9396
9406
  ],
9397
9407
  "fan-control": [
9398
9408
  {
9399
- "path": "percentage",
9409
+ "path": "speed",
9400
9410
  "valueType": "number"
9401
9411
  },
9402
9412
  {
@@ -9496,7 +9506,7 @@ Object.freeze({
9496
9506
  }
9497
9507
  ],
9498
9508
  "humidity-sensor": [{
9499
- "path": "percent",
9509
+ "path": "humidity",
9500
9510
  "valueType": "number"
9501
9511
  }],
9502
9512
  "image": [{
@@ -9606,7 +9616,7 @@ Object.freeze({
9606
9616
  "valueType": "number"
9607
9617
  },
9608
9618
  {
9609
- "path": "progressPercent",
9619
+ "path": "progress",
9610
9620
  "valueType": "number"
9611
9621
  },
9612
9622
  {
@@ -9652,6 +9662,11 @@ Object.freeze({
9652
9662
  "standby"
9653
9663
  ]
9654
9664
  },
9665
+ {
9666
+ "path": "stateSource",
9667
+ "valueType": "enum",
9668
+ "enumValues": ["reported", "assumed"]
9669
+ },
9655
9670
  {
9656
9671
  "path": "volumeLevel",
9657
9672
  "valueType": "number"
@@ -9685,11 +9700,11 @@ Object.freeze({
9685
9700
  "valueType": "string"
9686
9701
  },
9687
9702
  {
9688
- "path": "positionMs",
9703
+ "path": "position",
9689
9704
  "valueType": "number"
9690
9705
  },
9691
9706
  {
9692
- "path": "durationMs",
9707
+ "path": "duration",
9693
9708
  "valueType": "number"
9694
9709
  },
9695
9710
  {
@@ -9791,11 +9806,11 @@ Object.freeze({
9791
9806
  ]
9792
9807
  },
9793
9808
  {
9794
- "path": "signalPercent",
9809
+ "path": "signal",
9795
9810
  "valueType": "number"
9796
9811
  },
9797
9812
  {
9798
- "path": "rssiDbm",
9813
+ "path": "rssi",
9799
9814
  "valueType": "number"
9800
9815
  },
9801
9816
  {
@@ -9850,6 +9865,18 @@ Object.freeze({
9850
9865
  "path": "foodLevel",
9851
9866
  "valueType": "number"
9852
9867
  },
9868
+ {
9869
+ "path": "bowlFood",
9870
+ "valueType": "number"
9871
+ },
9872
+ {
9873
+ "path": "eating",
9874
+ "valueType": "boolean"
9875
+ },
9876
+ {
9877
+ "path": "supportsMarkRefilled",
9878
+ "valueType": "boolean"
9879
+ },
9853
9880
  {
9854
9881
  "path": "food1",
9855
9882
  "valueType": "number"
@@ -9866,6 +9893,11 @@ Object.freeze({
9866
9893
  "path": "batteryPower",
9867
9894
  "valueType": "number"
9868
9895
  },
9896
+ {
9897
+ "path": "powerSource",
9898
+ "valueType": "enum",
9899
+ "enumValues": ["mains", "battery"]
9900
+ },
9869
9901
  {
9870
9902
  "path": "desiccantLeftDays",
9871
9903
  "valueType": "number"
@@ -9910,27 +9942,39 @@ Object.freeze({
9910
9942
  {
9911
9943
  "path": "volume",
9912
9944
  "valueType": "number"
9945
+ },
9946
+ {
9947
+ "path": "lastFeedGrams",
9948
+ "valueType": "number"
9949
+ },
9950
+ {
9951
+ "path": "lastFeedHopper1",
9952
+ "valueType": "number"
9953
+ },
9954
+ {
9955
+ "path": "lastFeedHopper2",
9956
+ "valueType": "number"
9913
9957
  }
9914
9958
  ],
9915
9959
  "power-meter": [
9916
9960
  {
9917
- "path": "watts",
9961
+ "path": "power",
9918
9962
  "valueType": "number"
9919
9963
  },
9920
9964
  {
9921
- "path": "kwhTotal",
9965
+ "path": "energy",
9922
9966
  "valueType": "number"
9923
9967
  },
9924
9968
  {
9925
- "path": "volts",
9969
+ "path": "voltage",
9926
9970
  "valueType": "number"
9927
9971
  },
9928
9972
  {
9929
- "path": "amps",
9973
+ "path": "current",
9930
9974
  "valueType": "number"
9931
9975
  },
9932
9976
  {
9933
- "path": "va",
9977
+ "path": "apparentPower",
9934
9978
  "valueType": "number"
9935
9979
  },
9936
9980
  {
@@ -9958,14 +10002,10 @@ Object.freeze({
9958
10002
  {
9959
10003
  "path": "gps.accuracyMeters",
9960
10004
  "valueType": "number"
9961
- },
9962
- {
9963
- "path": "batteryPercent",
9964
- "valueType": "number"
9965
10005
  }
9966
10006
  ],
9967
10007
  "pressure-sensor": [{
9968
- "path": "hpa",
10008
+ "path": "pressure",
9969
10009
  "valueType": "number"
9970
10010
  }],
9971
10011
  "privacy-mask": [{
@@ -10279,7 +10319,7 @@ Object.freeze({
10279
10319
  "valueType": "boolean"
10280
10320
  }],
10281
10321
  "temperature-sensor": [{
10282
- "path": "celsius",
10322
+ "path": "temperature",
10283
10323
  "valueType": "number"
10284
10324
  }],
10285
10325
  "update": [
@@ -10327,7 +10367,7 @@ Object.freeze({
10327
10367
  "valueType": "string"
10328
10368
  },
10329
10369
  {
10330
- "path": "progressPercent",
10370
+ "path": "progress",
10331
10371
  "valueType": "number"
10332
10372
  },
10333
10373
  {
@@ -10453,7 +10493,7 @@ object({
10453
10493
  params: record(string(), union([string(), number()])).optional()
10454
10494
  });
10455
10495
  //#endregion
10456
- //#region ../types/dist/err-msg-DIorGYeC.mjs
10496
+ //#region ../types/dist/err-msg-BCdlR2Li.mjs
10457
10497
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10458
10498
  DeviceType["Camera"] = "camera";
10459
10499
  DeviceType["Hub"] = "hub";
@@ -10799,6 +10839,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10799
10839
  /** Fallback when the notifier service name doesn't match a known
10800
10840
  * pattern. */
10801
10841
  DeviceRole["GenericNotifier"] = "generic-notifier";
10842
+ /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
10843
+ * cap. A `DeviceType.Generic` device. */
10844
+ DeviceRole["IrTransmitter"] = "ir-transmitter";
10802
10845
  return DeviceRole;
10803
10846
  }({});
10804
10847
  /**
@@ -10812,7 +10855,7 @@ function errMsg(err) {
10812
10855
  return String(err);
10813
10856
  }
10814
10857
  //#endregion
10815
- //#region ../types/dist/composition-Bb8iwHEJ.mjs
10858
+ //#region ../types/dist/composition-bIBW5_13.mjs
10816
10859
  /**
10817
10860
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10818
10861
  *
@@ -15619,6 +15662,14 @@ var AutomationConditionLeafSchema = object({
15619
15662
  array(union([string(), number()]))
15620
15663
  ])
15621
15664
  });
15665
+ var AutomationConditionStationaryPresentSchema = object({
15666
+ kind: literal("stationary-present"),
15667
+ deviceId: number().int().nonnegative(),
15668
+ /** Class names; a macro class matches every raw class that maps to it. */
15669
+ classes: array(string().min(1)).min(1).optional(),
15670
+ /** The parked object must be in at least one of these zones. */
15671
+ zones: array(string().min(1)).min(1).optional()
15672
+ });
15622
15673
  /**
15623
15674
  * The expression leaf, declared as a plain object rather than an intersection
15624
15675
  * with {@link ExpressionSourceSchema}: a discriminated union has to be able to
@@ -15652,7 +15703,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
15652
15703
  child: AutomationConditionSchema
15653
15704
  }),
15654
15705
  AutomationConditionLeafSchema,
15655
- AutomationConditionExpressionSchema
15706
+ AutomationConditionExpressionSchema,
15707
+ AutomationConditionStationaryPresentSchema
15656
15708
  ]));
15657
15709
  /**
15658
15710
  * What starts a run.
@@ -15693,7 +15745,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15693
15745
  kind: literal("schedule"),
15694
15746
  cron: string().min(1).max(120)
15695
15747
  }),
15696
- object({ kind: literal("manual") })
15748
+ object({ kind: literal("manual") }),
15749
+ object({
15750
+ kind: literal("detection"),
15751
+ /** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
15752
+ * matches every raw class that maps to it; any other name matches
15753
+ * exactly. */
15754
+ classes: array(string().min(1)).min(1),
15755
+ deviceIds: array(number().int().nonnegative()).min(1),
15756
+ /** The track must have visited at least one of these zones. */
15757
+ zones: array(string().min(1)).min(1).optional(),
15758
+ /** Best-so-far confidence the track must reach. */
15759
+ minScore: number().min(0).max(1).optional()
15760
+ }),
15761
+ object({
15762
+ kind: literal("stationary"),
15763
+ deviceIds: array(number().int().nonnegative()).min(1),
15764
+ /** Class names; a macro class matches like the detection trigger. */
15765
+ classes: array(string().min(1)).min(1).optional(),
15766
+ /** The parked object must be in at least one of these zones. */
15767
+ zones: array(string().min(1)).min(1).optional(),
15768
+ /** `appeared`: it became parked. `departed`: the registry retired it.
15769
+ * The vocabulary of `PipelineAnalyticsStationaryChanged`. */
15770
+ phase: _enum(["appeared", "departed"])
15771
+ }),
15772
+ object({
15773
+ kind: literal("interval"),
15774
+ minutes: number().int().min(1).max(1440)
15775
+ })
15697
15776
  ]);
15698
15777
  /**
15699
15778
  * One action step.
@@ -15713,28 +15792,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15713
15792
  * is called. The runner still receives a number and is untouched; the
15714
15793
  * resolution is the recipe's job, not the runner's.
15715
15794
  */
15795
+ var AutomationWaitStepSchema = object({
15796
+ kind: literal("wait"),
15797
+ seconds: number().min(0).max(300)
15798
+ });
15799
+ var AutomationCapStepSchema = object({
15800
+ kind: literal("cap"),
15801
+ /**
15802
+ * One device, several same-family devices (locks / climate family / …),
15803
+ * or `{ $var }` for the device that triggered the run. An array is
15804
+ * fan-out at codegen — each id gets the same cap.method call.
15805
+ */
15806
+ deviceId: union([
15807
+ number().int(),
15808
+ array(number().int()).min(1),
15809
+ object({ $var: string().min(1) })
15810
+ ]),
15811
+ cap: string().min(1),
15812
+ method: string().min(1),
15813
+ /** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
15814
+ * SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
15815
+ * the expression leaf. */
15816
+ args: record(string(), unknown()).optional()
15817
+ });
15818
+ /**
15819
+ * The steps an internal Action may contain: cap and wait, and nothing that can
15820
+ * call back into an Action — so an Action can never reach itself (no cycles).
15821
+ */
15822
+ var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
15716
15823
  var AutomationActionSchema = discriminatedUnion("kind", [
15824
+ AutomationWaitStepSchema,
15825
+ AutomationCapStepSchema,
15717
15826
  object({
15718
- kind: literal("wait"),
15719
- seconds: number().min(0).max(300)
15720
- }),
15721
- object({
15722
- kind: literal("cap"),
15723
- /**
15724
- * One device, several same-family devices (locks / climate family / …),
15725
- * or `{ $var }` for the device that triggered the run. An array is
15726
- * fan-out at codegen — each id gets the same cap.method call.
15727
- */
15728
- deviceId: union([
15729
- number().int(),
15730
- array(number().int()).min(1),
15731
- object({ $var: string().min(1) })
15732
- ]),
15733
- cap: string().min(1),
15734
- method: string().min(1),
15735
- /** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
15736
- * evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
15737
- args: record(string(), unknown()).optional()
15827
+ kind: literal("action"),
15828
+ /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
15829
+ actionId: string().min(1),
15830
+ /** Values for the action's declared variables; the others take their default. */
15831
+ variables: record(string(), union([
15832
+ string(),
15833
+ number(),
15834
+ boolean()
15835
+ ])).optional()
15738
15836
  }),
15739
15837
  object({
15740
15838
  kind: literal("code"),
@@ -15743,10 +15841,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
15743
15841
  code: string().min(1).max(2e4)
15744
15842
  })
15745
15843
  ]);
15844
+ /**
15845
+ * How a trigger that arrives while the automation is busy (or cooling down) is
15846
+ * handled. One of the automation's execution modes, never a property of its
15847
+ * actions. Absent means `single`.
15848
+ *
15849
+ * - `single` — drop the trigger while a run is in progress (traced + logged).
15850
+ * - `restart` — abort the run in progress (at its next step boundary), start fresh.
15851
+ * - `queued` — queue up to `max` triggers, drop the rest (traced).
15852
+ * - `parallel` — up to `max` runs at once, drop the rest (traced).
15853
+ * - `cooldown` — `single`, and no new run until `minutes` after the last run
15854
+ * STARTED; persisted across a restart. A manual trigger bypasses only this
15855
+ * wait, never the single/queued limits.
15856
+ */
15857
+ var AutomationRunModeSchema = discriminatedUnion("mode", [
15858
+ object({ mode: literal("single") }),
15859
+ object({ mode: literal("restart") }),
15860
+ object({
15861
+ mode: literal("queued"),
15862
+ max: number().int().min(1).max(10)
15863
+ }),
15864
+ object({
15865
+ mode: literal("parallel"),
15866
+ max: number().int().min(1).max(10)
15867
+ }),
15868
+ object({
15869
+ mode: literal("cooldown"),
15870
+ minutes: number().int().min(1).max(1440)
15871
+ })
15872
+ ]);
15746
15873
  var AutomationRecipeSchema = object({
15747
15874
  triggers: array(AutomationTriggerSchema),
15748
15875
  conditions: AutomationConditionSchema.optional(),
15749
- actions: array(AutomationActionSchema)
15876
+ actions: array(AutomationActionSchema),
15877
+ runMode: AutomationRunModeSchema.optional(),
15878
+ /** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
15879
+ keepTraces: number().int().min(1).max(100).optional()
15880
+ });
15881
+ new Set([
15882
+ {
15883
+ id: "person",
15884
+ name: "Person"
15885
+ },
15886
+ {
15887
+ id: "vehicle",
15888
+ name: "Vehicle"
15889
+ },
15890
+ {
15891
+ id: "animal",
15892
+ name: "Animal"
15893
+ },
15894
+ {
15895
+ id: "package",
15896
+ name: "Package"
15897
+ }
15898
+ ].map((l) => l.id));
15899
+ var COCO_TO_MACRO = {
15900
+ mapping: {
15901
+ person: "person",
15902
+ bicycle: "vehicle",
15903
+ car: "vehicle",
15904
+ motorcycle: "vehicle",
15905
+ airplane: "vehicle",
15906
+ bus: "vehicle",
15907
+ train: "vehicle",
15908
+ truck: "vehicle",
15909
+ boat: "vehicle",
15910
+ bird: "animal",
15911
+ cat: "animal",
15912
+ dog: "animal",
15913
+ horse: "animal",
15914
+ sheep: "animal",
15915
+ cow: "animal",
15916
+ elephant: "animal",
15917
+ bear: "animal",
15918
+ zebra: "animal",
15919
+ giraffe: "animal",
15920
+ suitcase: "package",
15921
+ backpack: "package",
15922
+ handbag: "package"
15923
+ },
15924
+ preserveOriginal: false
15925
+ };
15926
+ new Set(Object.values(COCO_TO_MACRO.mapping));
15927
+ /**
15928
+ * Run traces — what an automation (or, later, an Action run) DID, node by node,
15929
+ * so the editor can paint every block green or red with its reason.
15930
+ *
15931
+ * A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
15932
+ * every condition node (containers and leaves, including the ones a
15933
+ * short-circuit never reached), the run-mode verdict and every action step —
15934
+ * each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
15935
+ * for an Action run). Skipped
15936
+ * evaluations are traced too, and identical consecutive skips collapse into a
15937
+ * repeat count so a trigger that fails every 5 minutes cannot flush real runs.
15938
+ *
15939
+ * {@link AutomationStepTraceSchema} is deliberately free of automation
15940
+ * vocabulary so an Action run records the same step shape.
15941
+ */
15942
+ /** A value a trace may show: JSON primitives and short lists, nothing deeper. */
15943
+ var TraceValueSchema = union([
15944
+ string(),
15945
+ number(),
15946
+ boolean(),
15947
+ _null(),
15948
+ array(union([string(), number()]))
15949
+ ]);
15950
+ var AutomationRunOutcomeSchema = _enum([
15951
+ "ran",
15952
+ "skipped-trigger",
15953
+ "skipped-conditions",
15954
+ "skipped-cooldown",
15955
+ "skipped-overlap",
15956
+ "failed",
15957
+ "aborted"
15958
+ ]);
15959
+ /** `not-evaluated` = a short-circuit never reached the node. */
15960
+ var TraceNodeOutcomeSchema = _enum([
15961
+ "pass",
15962
+ "fail",
15963
+ "not-evaluated"
15964
+ ]);
15965
+ var AutomationTriggerTraceSchema = object({
15966
+ kind: string().min(1),
15967
+ outcome: _enum(["pass", "fail"]),
15968
+ /** Why an event was rejected ("class person not in [dog]") or what fired. */
15969
+ reason: string(),
15970
+ /** deviceId, className, trackId, score … — only what the trigger exposes. */
15971
+ vars: record(string(), TraceValueSchema)
15972
+ });
15973
+ var AutomationConditionTraceNodeSchema = object({
15974
+ /** `conditions` for the root, `conditions.<i>` for its i-th child, … */
15975
+ path: string().min(1),
15976
+ kind: _enum([
15977
+ "all",
15978
+ "any",
15979
+ "not",
15980
+ "condition",
15981
+ "expression",
15982
+ "stationary-present"
15983
+ ]),
15984
+ outcome: TraceNodeOutcomeSchema,
15985
+ reason: string(),
15986
+ deviceId: number().int().optional(),
15987
+ cap: string().optional(),
15988
+ fieldPath: string().optional(),
15989
+ operator: string().optional(),
15990
+ expected: TraceValueSchema.optional(),
15991
+ /** What the mirror held; `null` when it held nothing (unknown). */
15992
+ observed: TraceValueSchema.optional()
15993
+ });
15994
+ var AutomationRunVerdictSchema = object({
15995
+ mode: AutomationRunModeSchema,
15996
+ decision: _enum([
15997
+ "run",
15998
+ "queued",
15999
+ "restart",
16000
+ "drop",
16001
+ "cooldown",
16002
+ "bypass"
16003
+ ]),
16004
+ reason: string()
16005
+ });
16006
+ /** One executed (or not-run) step — shared by automations and Action runs. */
16007
+ var AutomationStepTraceSchema = object({
16008
+ /** `actions.<i>` */
16009
+ path: string().min(1),
16010
+ kind: string().min(1),
16011
+ cap: string().optional(),
16012
+ method: string().optional(),
16013
+ deviceId: number().int().optional(),
16014
+ startedAt: number().optional(),
16015
+ endedAt: number().optional(),
16016
+ outcome: _enum([
16017
+ "ok",
16018
+ "error",
16019
+ "not-run"
16020
+ ]),
16021
+ message: string().optional()
16022
+ });
16023
+ var AutomationRunTraceSchema = object({
16024
+ runId: string().min(1),
16025
+ startedAt: number(),
16026
+ endedAt: number(),
16027
+ trigger: AutomationTriggerTraceSchema,
16028
+ conditions: array(AutomationConditionTraceNodeSchema),
16029
+ verdict: AutomationRunVerdictSchema.optional(),
16030
+ steps: array(AutomationStepTraceSchema),
16031
+ outcome: AutomationRunOutcomeSchema,
16032
+ /** How many identical consecutive skips this trace stands for (>= 1). */
16033
+ repeat: number().int().min(1),
16034
+ /** When the latest of those repeats happened. */
16035
+ lastAt: number()
16036
+ });
16037
+ /**
16038
+ * What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
16039
+ * `action:<actionId>`): the cooldown stamp and the trace ring.
16040
+ */
16041
+ var AutomationStateDocSchema = object({
16042
+ version: literal(1),
16043
+ lastRunStartedAt: number().nullable(),
16044
+ traces: array(AutomationRunTraceSchema)
16045
+ });
16046
+ /**
16047
+ * Actions — named, runnable things an operator (or an automation) can start,
16048
+ * declared as LIST ENTRIES, never as devices.
16049
+ *
16050
+ * An entry is either **internal** (a short list of cap/wait steps kept in the
16051
+ * hub's `actions` record kind) or declared by an addon through the
16052
+ * `action-source` collection (a Home Assistant script, a scene …). The one
16053
+ * surface the UI and automations talk to is the `actions` cap; it keeps no
16054
+ * catalog of its own (D3) — every `list` asks the providers live.
16055
+ *
16056
+ * This file is the data half: the entry schema, the variables an entry may
16057
+ * declare, and the pure resolution of the values a run was given. It holds no
16058
+ * runtime.
16059
+ */
16060
+ /** What a variable's value is. `select` takes one of `options`. */
16061
+ var ActionVariableTypeSchema = _enum([
16062
+ "string",
16063
+ "number",
16064
+ "boolean",
16065
+ "select"
16066
+ ]);
16067
+ var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
16068
+ var ActionVariableValueSchema = union([
16069
+ string(),
16070
+ number(),
16071
+ boolean()
16072
+ ]);
16073
+ /**
16074
+ * One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
16075
+ * value) or `{{vars.name}}` (inside a string) in their args.
16076
+ */
16077
+ var ActionVariableSchema = object({
16078
+ name: string().regex(ACTION_VARIABLE_NAME_RE),
16079
+ label: string().min(1).max(120).optional(),
16080
+ type: ActionVariableTypeSchema,
16081
+ required: boolean().optional(),
16082
+ default: ActionVariableValueSchema.optional(),
16083
+ /** The allowed values of a `select`. */
16084
+ options: array(string().min(1)).min(1).optional()
16085
+ }).superRefine((v, ctx) => {
16086
+ if (v.type === "select" && v.options === void 0) ctx.addIssue({
16087
+ code: "custom",
16088
+ message: "a select variable needs options",
16089
+ path: ["options"]
16090
+ });
16091
+ if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
16092
+ code: "custom",
16093
+ message: variableValueError(v, v.default) ?? "invalid default",
16094
+ path: ["default"]
16095
+ });
16096
+ });
16097
+ /** Why `value` is not a legal value for the variable, or null when it is. */
16098
+ function variableValueError(variable, value) {
16099
+ switch (variable.type) {
16100
+ case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
16101
+ case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
16102
+ case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
16103
+ case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
16104
+ }
16105
+ }
16106
+ var ActionSourceKindSchema = _enum(["internal", "addon"]);
16107
+ function isInternalActionId(actionId) {
16108
+ return actionId.startsWith("internal:") && actionId.length > 9;
16109
+ }
16110
+ /** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
16111
+ function addonIdOfActionId(actionId) {
16112
+ if (isInternalActionId(actionId)) return null;
16113
+ const at = actionId.indexOf(":");
16114
+ return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
16115
+ }
16116
+ var ActionStatusSchema = object({
16117
+ isRunning: boolean(),
16118
+ /** Ms epoch the latest run STARTED; null when it never ran. */
16119
+ lastRunAt: number().nullable(),
16120
+ /** The latest run's failure; null on success or when it never ran. */
16121
+ lastError: string().nullable()
16122
+ });
16123
+ var ActionEntrySchema = object({
16124
+ /** `internal:<uuid>` or `<addonId>:<localId>`. */
16125
+ id: string().min(3),
16126
+ name: string().min(1).max(120),
16127
+ /** The addon that declared it; `core-blocks` for an internal one. */
16128
+ addonId: string().min(1),
16129
+ source: ActionSourceKindSchema,
16130
+ /** An addon-declared entry is edited where it was declared. */
16131
+ readOnly: boolean(),
16132
+ /** Internal only: cap and wait steps. No action-in-action, so no cycles. */
16133
+ steps: array(ActionStepSchema).min(1).max(50).optional(),
16134
+ variables: array(ActionVariableSchema).max(20).optional(),
16135
+ status: ActionStatusSchema
16136
+ }).superRefine((entry, ctx) => {
16137
+ if (entry.source === "internal") {
16138
+ if (!isInternalActionId(entry.id)) ctx.addIssue({
16139
+ code: "custom",
16140
+ message: "an internal action id is internal:<uuid>",
16141
+ path: ["id"]
16142
+ });
16143
+ return;
16144
+ }
16145
+ if (entry.steps !== void 0) ctx.addIssue({
16146
+ code: "custom",
16147
+ message: "only an internal action carries steps",
16148
+ path: ["steps"]
16149
+ });
16150
+ if (!entry.readOnly) ctx.addIssue({
16151
+ code: "custom",
16152
+ message: "an addon action is read-only here",
16153
+ path: ["readOnly"]
16154
+ });
16155
+ if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
16156
+ code: "custom",
16157
+ message: "an addon action id is <addonId>:<localId>",
16158
+ path: ["id"]
16159
+ });
16160
+ });
16161
+ /** What an operator writes for an internal action. */
16162
+ var ActionInputSchema = object({
16163
+ name: string().min(1).max(120),
16164
+ steps: array(ActionStepSchema).min(1).max(50),
16165
+ variables: array(ActionVariableSchema).max(20).optional()
16166
+ });
16167
+ /** Who started a run. Absent = the operator pressed it. */
16168
+ var ActionRunOriginSchema = object({
16169
+ /** The automation block whose step started it. */
16170
+ blockId: string().min(1).optional() });
16171
+ /** `started` = the caller did not ask to wait. */
16172
+ var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
16173
+ var ActionRunResultSchema = object({
16174
+ runId: string().min(1),
16175
+ outcome: ActionRunOutcomeSchema,
16176
+ /** Why it did not run, or what failed. */
16177
+ message: string().optional()
16178
+ });
16179
+ _enum([
16180
+ "not-found",
16181
+ "read-only",
16182
+ "invalid-variables",
16183
+ "invalid-steps",
16184
+ "not-linked",
16185
+ "busy"
16186
+ ]);
16187
+ object({
16188
+ actionId: string(),
16189
+ runId: string(),
16190
+ isRunning: boolean(),
16191
+ /** Set when the run ended. */
16192
+ outcome: AutomationRunOutcomeSchema.optional(),
16193
+ lastRunAt: number().nullable(),
16194
+ lastError: string().nullable()
15750
16195
  });
15751
16196
  /**
15752
16197
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
@@ -16126,9 +16571,21 @@ var AlertSeveritySchema = _enum([
16126
16571
  "error",
16127
16572
  "critical"
16128
16573
  ]);
16574
+ /**
16575
+ * An action that RUNS something instead of going somewhere: the admin UI calls
16576
+ * the addon's custom action (`addons.custom`) with exactly these fields. The
16577
+ * producer owns the meaning; the UI knows nothing about the addon or the kind.
16578
+ */
16579
+ var AlertActionInvokeSchema = object({
16580
+ addonId: string().min(1),
16581
+ action: string().min(1),
16582
+ input: record(string(), unknown()).optional()
16583
+ });
16584
+ /** An action has `href` (a link) OR `invoke` (a button that runs a custom action). */
16129
16585
  var AlertActionSchema = object({
16130
16586
  label: string(),
16131
16587
  href: string().optional(),
16588
+ invoke: AlertActionInvokeSchema.optional(),
16132
16589
  /**
16133
16590
  * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
16134
16591
  * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
@@ -18346,7 +18803,7 @@ var CompositionEventPlanSchema = object({
18346
18803
  stateField: string(),
18347
18804
  fieldKey: string()
18348
18805
  });
18349
- /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
18806
+ /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
18350
18807
  var CompositionProblemSchema = object({
18351
18808
  code: _enum([
18352
18809
  "reserved-variant",
@@ -18628,12 +19085,13 @@ var CHANGED = {
18628
19085
  expr: "now"
18629
19086
  };
18630
19087
  function numeric(input) {
19088
+ const { alsoFrom, ...base } = input;
18631
19089
  return {
18632
- ...input,
19090
+ ...base,
18633
19091
  family: "numeric",
18634
19092
  deviceType: DeviceType.Sensor,
18635
19093
  memberDeviceType: DeviceType.Sensor,
18636
- memberDeviceTypes: [DeviceType.Sensor],
19094
+ memberDeviceTypes: [DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
18637
19095
  activeWhen: void 0,
18638
19096
  commandCaps: [],
18639
19097
  baseUnit: baseUnitOf(input.quantity),
@@ -18641,9 +19099,10 @@ function numeric(input) {
18641
19099
  accept: [{
18642
19100
  cap: input.outputCap,
18643
19101
  fieldPath: input.outputField
18644
- }]
19102
+ }, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
18645
19103
  };
18646
19104
  }
19105
+ var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
18647
19106
  function binary(input) {
18648
19107
  return {
18649
19108
  ...input,
@@ -18665,29 +19124,43 @@ var GROUP_TEMPLATES = [
18665
19124
  summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18666
19125
  role: DeviceRole.TemperatureSensor,
18667
19126
  outputCap: "temperature-sensor",
18668
- outputField: "celsius",
19127
+ outputField: "temperature",
18669
19128
  quantity: "temperature",
18670
19129
  defaultAggregate: "mean",
18671
19130
  empty: "null",
18672
- companions: [NOW$2]
19131
+ companions: [NOW$2],
19132
+ alsoFrom: {
19133
+ deviceTypes: CLIMATE_DEVICES,
19134
+ accept: {
19135
+ cap: "climate-control",
19136
+ fieldPath: "currentTemp"
19137
+ }
19138
+ }
18673
19139
  }),
18674
19140
  numeric({
18675
19141
  id: "humidity",
18676
19142
  summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18677
19143
  role: DeviceRole.HumiditySensor,
18678
19144
  outputCap: "humidity-sensor",
18679
- outputField: "percent",
19145
+ outputField: "humidity",
18680
19146
  quantity: "humidity",
18681
19147
  defaultAggregate: "mean",
18682
19148
  empty: "null",
18683
- companions: [NOW$2]
19149
+ companions: [NOW$2],
19150
+ alsoFrom: {
19151
+ deviceTypes: CLIMATE_DEVICES,
19152
+ accept: {
19153
+ cap: "climate-control",
19154
+ fieldPath: "currentHumidity"
19155
+ }
19156
+ }
18684
19157
  }),
18685
19158
  numeric({
18686
19159
  id: "pressure",
18687
19160
  summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18688
19161
  role: DeviceRole.PressureSensor,
18689
19162
  outputCap: "pressure-sensor",
18690
- outputField: "hpa",
19163
+ outputField: "pressure",
18691
19164
  quantity: "pressure",
18692
19165
  defaultAggregate: "mean",
18693
19166
  empty: "null",
@@ -18698,7 +19171,7 @@ var GROUP_TEMPLATES = [
18698
19171
  summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18699
19172
  role: DeviceRole.AmbientLightSensor,
18700
19173
  outputCap: "ambient-light-sensor",
18701
- outputField: "lux",
19174
+ outputField: "illuminance",
18702
19175
  quantity: "illuminance",
18703
19176
  defaultAggregate: "mean",
18704
19177
  empty: "null",
@@ -18709,7 +19182,7 @@ var GROUP_TEMPLATES = [
18709
19182
  summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18710
19183
  role: DeviceRole.PowerSensor,
18711
19184
  outputCap: "power-meter",
18712
- outputField: "watts",
19185
+ outputField: "power",
18713
19186
  quantity: "power",
18714
19187
  defaultAggregate: "sum",
18715
19188
  empty: "omit",
@@ -18720,7 +19193,7 @@ var GROUP_TEMPLATES = [
18720
19193
  summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18721
19194
  role: DeviceRole.EnergySensor,
18722
19195
  outputCap: "power-meter",
18723
- outputField: "kwhTotal",
19196
+ outputField: "energy",
18724
19197
  quantity: "energy",
18725
19198
  defaultAggregate: "sum",
18726
19199
  empty: "omit",
@@ -18731,7 +19204,7 @@ var GROUP_TEMPLATES = [
18731
19204
  summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18732
19205
  role: DeviceRole.BatterySensor,
18733
19206
  outputCap: "battery",
18734
- outputField: "percentage",
19207
+ outputField: "level",
18735
19208
  quantity: "percentage",
18736
19209
  defaultAggregate: "mean",
18737
19210
  empty: "null",
@@ -19309,7 +19782,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
19309
19782
  kind: "mutation",
19310
19783
  auth: "admin",
19311
19784
  access: "view"
19312
- });
19785
+ }), method(object({
19786
+ blockId: string().min(1),
19787
+ trace: AutomationRunTraceSchema.optional(),
19788
+ runStartedAt: number().optional(),
19789
+ keepTraces: number().int().min(1).max(100).optional()
19790
+ }), _void(), {
19791
+ kind: "mutation",
19792
+ auth: "admin"
19793
+ }), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
19794
+ traces: array(AutomationRunTraceSchema),
19795
+ lastError: string().nullable()
19796
+ }), { auth: "admin" });
19313
19797
  /**
19314
19798
  * `custom-model-registry` — collection cap exposing operator-registered
19315
19799
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -42912,6 +43396,17 @@ var LlmProfileSchema = object({
42912
43396
  * field in its editor only when its descriptor lists it in `profileFields`. */
42913
43397
  topK: number().int().positive().optional(),
42914
43398
  maxTokens: number().int().positive().optional(),
43399
+ /** How hard the model "thinks" before it answers. Omitted = the model's own
43400
+ * default. `off` matters for structured output: a thinking model can spend
43401
+ * the whole completion on reasoning and return an empty `content`. Carried
43402
+ * only by the wires that have it — a kind offers the field in its editor
43403
+ * only when its descriptor lists it in `profileFields`. */
43404
+ reasoningEffort: _enum([
43405
+ "off",
43406
+ "low",
43407
+ "medium",
43408
+ "high"
43409
+ ]).optional(),
42915
43410
  /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
42916
43411
  contextLength: number().int().positive().optional(),
42917
43412
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
@@ -42950,6 +43445,7 @@ var LlmProfileFieldSchema = _enum([
42950
43445
  "topP",
42951
43446
  "topK",
42952
43447
  "maxTokens",
43448
+ "reasoningEffort",
42953
43449
  "contextLength",
42954
43450
  "systemPrompt",
42955
43451
  "timeoutMs",
@@ -44200,6 +44696,43 @@ var NotificationActionSchema = object({
44200
44696
  */
44201
44697
  mode: _enum(["navigate", "background"]).optional()
44202
44698
  });
44699
+ /** A delivery parameter value: what a notifier declared it takes. */
44700
+ var DeliveryParamValueSchema = union([
44701
+ string(),
44702
+ number(),
44703
+ boolean()
44704
+ ]);
44705
+ /**
44706
+ * One extra delivery parameter a notifier KIND declares (D938). A rule that
44707
+ * addresses a target of that kind may set it; a kind that declares nothing is
44708
+ * never handed one. The admin UI derives its control from this descriptor —
44709
+ * no editor knows a service by name.
44710
+ *
44711
+ * Optional fields are `.optional()`, never `.default()` (a Zod default does not
44712
+ * run on the addon cap path).
44713
+ */
44714
+ var DeliveryParamSchema = object({
44715
+ key: string().min(1),
44716
+ label: string(),
44717
+ /** i18n key of the label, resolved by the declaring addon's namespace. */
44718
+ labelKey: string().optional(),
44719
+ type: _enum([
44720
+ "enum",
44721
+ "number",
44722
+ "boolean",
44723
+ "string"
44724
+ ]),
44725
+ /** `enum` only: the closed set of accepted values. */
44726
+ options: array(object({
44727
+ value: string(),
44728
+ label: string()
44729
+ })).optional(),
44730
+ /** `number` only. */
44731
+ min: number().optional(),
44732
+ max: number().optional(),
44733
+ /** What the notifier does when the rule sets nothing; shown as the placeholder. */
44734
+ default: DeliveryParamValueSchema.optional()
44735
+ });
44203
44736
  /**
44204
44737
  * The canonical notification. `body` is the only hard field (Apprise model).
44205
44738
  * `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
@@ -44222,7 +44755,13 @@ var NotificationSchema = object({
44222
44755
  tag: string().optional(),
44223
44756
  deviceId: number().optional(),
44224
44757
  eventId: string().optional(),
44225
- metadata: record(string(), unknown()).optional()
44758
+ metadata: record(string(), unknown()).optional(),
44759
+ /**
44760
+ * Values for the parameters the target's kind DECLARES in
44761
+ * {@link TargetKindSchema} `deliveryParams`. Already validated against the
44762
+ * declaration by the sender; a notifier reads only the keys it declared.
44763
+ */
44764
+ delivery: record(string(), DeliveryParamValueSchema).optional()
44226
44765
  });
44227
44766
  /** One declared native severity/priority level for a kind. */
44228
44767
  var TargetKindLevelSchema = object({
@@ -44328,6 +44867,11 @@ var TargetKindSchema = object({
44328
44867
  */
44329
44868
  destinationKeys: array(string()).optional(),
44330
44869
  supportsDiscovery: boolean(),
44870
+ /**
44871
+ * Extra delivery parameters a rule may set for a target of this kind (D938).
44872
+ * Absent = none; the rule editor then offers nothing.
44873
+ */
44874
+ deliveryParams: array(DeliveryParamSchema).optional(),
44331
44875
  caps: TargetKindCapsSchema
44332
44876
  });
44333
44877
  /**
@@ -44427,51 +44971,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
44427
44971
  kind: "mutation",
44428
44972
  auth: "admin"
44429
44973
  });
44430
- new Set([
44431
- {
44432
- id: "person",
44433
- name: "Person"
44434
- },
44435
- {
44436
- id: "vehicle",
44437
- name: "Vehicle"
44438
- },
44439
- {
44440
- id: "animal",
44441
- name: "Animal"
44442
- },
44443
- {
44444
- id: "package",
44445
- name: "Package"
44446
- }
44447
- ].map((l) => l.id));
44448
- var COCO_TO_MACRO = {
44449
- mapping: {
44450
- person: "person",
44451
- bicycle: "vehicle",
44452
- car: "vehicle",
44453
- motorcycle: "vehicle",
44454
- airplane: "vehicle",
44455
- bus: "vehicle",
44456
- train: "vehicle",
44457
- truck: "vehicle",
44458
- boat: "vehicle",
44459
- bird: "animal",
44460
- cat: "animal",
44461
- dog: "animal",
44462
- horse: "animal",
44463
- sheep: "animal",
44464
- cow: "animal",
44465
- elephant: "animal",
44466
- bear: "animal",
44467
- zebra: "animal",
44468
- giraffe: "animal",
44469
- suitcase: "package",
44470
- backpack: "package",
44471
- handbag: "package"
44472
- },
44473
- preserveOriginal: false
44474
- };
44475
44974
  var AUDIO_MACRO_LABELS = [
44476
44975
  {
44477
44976
  id: "speech",
@@ -56559,7 +57058,9 @@ var ManifestShapeSchema = object({
56559
57058
  icon: string().optional()
56560
57059
  }).optional(),
56561
57060
  protected: boolean().optional(),
56562
- removable: boolean().optional()
57061
+ removable: boolean().optional(),
57062
+ /** Declared Integrations-page block (mirror of `AddonDeclaration.integrationSection`). */
57063
+ integrationSection: _enum(["system", "providers"]).optional()
56563
57064
  });
56564
57065
  var AddonProcessSchema = object({
56565
57066
  pid: number().optional(),
@@ -56924,9 +57425,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
56924
57425
  }), LogStreamEntrySchema, { kind: "subscription" });
56925
57426
  object({
56926
57427
  /** Carbon dioxide concentration in ppm. */
56927
- co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
57428
+ co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
56928
57429
  /** Total volatile organic compounds in ppb. */
56929
- vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57430
+ voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
56930
57431
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
56931
57432
  pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
56932
57433
  /** Particulate matter ≤ 10 μm in µg/m³. */
@@ -56939,7 +57440,7 @@ object({
56939
57440
  DeviceType.Sensor;
56940
57441
  object({
56941
57442
  /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
56942
- lux: number().min(0).nullable().meta(readingMeta("illuminance", {
57443
+ illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
56943
57444
  precision: 0,
56944
57445
  label: "Illuminance"
56945
57446
  })),
@@ -57036,6 +57537,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
57036
57537
  * would produce more than `maxPoints` samples. */
57037
57538
  sampleEveryMs: number().int().positive().optional()
57038
57539
  }), AudioMetricsHistorySchema);
57540
+ method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
57541
+ actionId: string().min(1),
57542
+ variables: record(string(), ActionVariableValueSchema).optional()
57543
+ }), _void(), {
57544
+ kind: "mutation",
57545
+ auth: "admin"
57546
+ }), method(object({ actionId: string().min(1) }), _void(), {
57547
+ kind: "mutation",
57548
+ auth: "admin"
57549
+ });
57550
+ /**
57551
+ * actions — the ONE surface for runnable actions, for the UI and for
57552
+ * automations. Provided by the core-blocks builtin on the hub.
57553
+ *
57554
+ * An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
57555
+ * steps, kept in the hub's `actions` record kind) or declared by an addon over
57556
+ * `action-source`. `list` asks every `action-source` provider LIVE and overlays
57557
+ * the run status from the hub's `runs` ledger; there is no catalog here to
57558
+ * drift (D3).
57559
+ *
57560
+ * **Permissions follow the camera, as linked devices do.** An action is linked
57561
+ * to cameras by the operator (`setLinks`, D356: nothing links itself). A
57562
+ * non-admin may `get` / `run` an action only through a camera they may see that
57563
+ * links it: they name the camera (`deviceId`, a top-level field so the scope
57564
+ * gate sees it) and the provider refuses an action that camera does not link.
57565
+ * An admin, and an in-process caller (an automation block), may run any action.
57566
+ * Every refusal is typed (`[not-linked] …`) and logged.
57567
+ *
57568
+ * A second `run` of an action that is already running is REFUSED — traced and
57569
+ * logged — never queued.
57570
+ */
57571
+ var ActionIdInput = object({ actionId: string().min(1) });
57572
+ var ActionLinksSchema = object({
57573
+ deviceId: number().int().nonnegative(),
57574
+ actionIds: array(string().min(1)).max(100)
57575
+ });
57576
+ method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
57577
+ actionId: string().min(1),
57578
+ deviceId: number().int().nonnegative().optional()
57579
+ }), object({ action: ActionEntrySchema.nullable() }), {
57580
+ role: "viewer",
57581
+ auth: "protected",
57582
+ kind: "query",
57583
+ caller: "required"
57584
+ }), method(object({
57585
+ actionId: string().min(1),
57586
+ variables: record(string(), ActionVariableValueSchema).optional(),
57587
+ wait: boolean().optional(),
57588
+ origin: ActionRunOriginSchema.optional(),
57589
+ deviceId: number().int().nonnegative().optional()
57590
+ }), ActionRunResultSchema, {
57591
+ role: "viewer",
57592
+ auth: "protected",
57593
+ kind: "mutation",
57594
+ caller: "required"
57595
+ }), method(ActionIdInput, _void(), {
57596
+ kind: "mutation",
57597
+ auth: "admin"
57598
+ }), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
57599
+ kind: "mutation",
57600
+ auth: "admin"
57601
+ }), method(object({
57602
+ actionId: string().min(1),
57603
+ action: ActionInputSchema.partial()
57604
+ }), object({ action: ActionEntrySchema }), {
57605
+ kind: "mutation",
57606
+ auth: "admin"
57607
+ }), method(ActionIdInput, _void(), {
57608
+ kind: "mutation",
57609
+ auth: "admin"
57610
+ }), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
57611
+ role: "viewer",
57612
+ auth: "protected",
57613
+ kind: "query"
57614
+ }), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
57615
+ kind: "mutation",
57616
+ auth: "admin"
57617
+ });
57039
57618
  object({
57040
57619
  /** Whether the automation is currently enabled. Disabled automations
57041
57620
  * ignore their trigger block — manual `trigger` still works. */
@@ -57089,7 +57668,7 @@ var BatteryStatusSchema = object({
57089
57668
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
57090
57669
  * declines to band a non-finite reading, which is the correct shape.
57091
57670
  */
57092
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57671
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57093
57672
  /**
57094
57673
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
57095
57674
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -57099,7 +57678,7 @@ var BatteryStatusSchema = object({
57099
57678
  * `'unknown'` is the absence of an answer: the provider has not read the
57100
57679
  * power fields yet, or the firmware reported neither. Before it existed,
57101
57680
  * two unreadable fields produced `'none'`, and a camera nobody had reached
57102
- * was drawn "on battery alone" — the same D315 defect `percentage` closed
57681
+ * was drawn "on battery alone" — the same D315 defect `level` closed
57103
57682
  * by going nullable. Consumers SKIP it (no charger state published, no
57104
57683
  * glyph, no HomeKit ChargingState) rather than coerce it either way.
57105
57684
  */
@@ -57123,7 +57702,7 @@ var BatteryStatusSchema = object({
57123
57702
  * that only report charge. A second reading on this cap, not a second
57124
57703
  * `numeric-sensor` on the same device.
57125
57704
  */
57126
- volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57705
+ voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57127
57706
  /**
57128
57707
  * Ms epoch of the last time the device PROVED it was reachable — a
57129
57708
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -57157,7 +57736,7 @@ var BatteryStatusSchema = object({
57157
57736
  /**
57158
57737
  * True when the source is a BINARY low-battery indicator (HA
57159
57738
  * `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
57160
- * charge level — `percentage` is then a coarse stand-in (100 = normal,
57739
+ * charge level — `level` is then a coarse stand-in (100 = normal,
57161
57740
  * sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
57162
57741
  * misleading exact percentage. Absent/false → genuine 0–100 % reading.
57163
57742
  */
@@ -57188,33 +57767,395 @@ DeviceType.Sensor;
57188
57767
  * controls to this single-method surface.
57189
57768
  *
57190
57769
  * The cap is intentionally minimal: a single `setBrightness({deviceId,
57191
- * percentage})` mutation plus the auto-injected `getStatus`. Drivers
57770
+ * level})` mutation plus the auto-injected `getStatus`. Drivers
57192
57771
  * that expose richer controls (color temperature, scenes, schedules)
57193
57772
  * should surface those via the device's `getSettingsUISchema()`
57194
57773
  * instead of bloating this cap.
57195
57774
  */
57196
57775
  var BrightnessStatusSchema = object({
57197
57776
  /** Current level as 0..100 inclusive. Firmware-reported. */
57198
- percentage: number().min(0).max(100).meta(readingMeta("percentage")),
57777
+ level: number().min(0).max(100).meta(readingMeta("percentage")),
57199
57778
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
57200
57779
  lastChangedAt: number()
57201
57780
  });
57202
57781
  DeviceType.Light, method(object({
57203
57782
  deviceId: number().int().nonnegative(),
57204
- percentage: number().min(0).max(100)
57783
+ level: number().min(0).max(100)
57205
57784
  }), _void(), {
57206
57785
  kind: "mutation",
57207
57786
  auth: "protected"
57208
57787
  }), object({
57209
57788
  deviceId: number(),
57210
- percentage: number().min(0).max(100),
57789
+ level: number().min(0).max(100),
57211
57790
  lastChangedAt: number()
57212
57791
  });
57792
+ /**
57793
+ * The role vocabulary of a remote (D963): what a button MEANS, independent of
57794
+ * how it is wired. A layout template places buttons by role; a device binds a
57795
+ * role to an action; an exporter asks for a role by name. Roles are shared so
57796
+ * one layout fits every appliance and one voice command fits every binding.
57797
+ *
57798
+ * A role outside this list is `custom:<key>` — the operator's own button (a
57799
+ * SmartIR source, a channel preset). The key is a lowercase slug.
57800
+ */
57801
+ var REMOTE_KNOWN_ROLES = [
57802
+ "power",
57803
+ "power_on",
57804
+ "power_off",
57805
+ "volume_up",
57806
+ "volume_down",
57807
+ "mute",
57808
+ "channel_up",
57809
+ "channel_down",
57810
+ "up",
57811
+ "down",
57812
+ "left",
57813
+ "right",
57814
+ "ok",
57815
+ "back",
57816
+ "home",
57817
+ "menu",
57818
+ "info",
57819
+ "guide",
57820
+ "exit",
57821
+ "input",
57822
+ "play",
57823
+ "pause",
57824
+ "play_pause",
57825
+ "stop",
57826
+ "next",
57827
+ "previous",
57828
+ "fast_forward",
57829
+ "rewind",
57830
+ "digit_0",
57831
+ "digit_1",
57832
+ "digit_2",
57833
+ "digit_3",
57834
+ "digit_4",
57835
+ "digit_5",
57836
+ "digit_6",
57837
+ "digit_7",
57838
+ "digit_8",
57839
+ "digit_9"
57840
+ ];
57841
+ var CUSTOM_KEY_RE = /^[a-z0-9][a-z0-9_]{0,47}$/;
57842
+ var KNOWN_ROLES = new Set(REMOTE_KNOWN_ROLES);
57843
+ function isRemoteKnownRole(value) {
57844
+ return KNOWN_ROLES.has(value);
57845
+ }
57846
+ function isRemoteCustomKey(key) {
57847
+ return CUSTOM_KEY_RE.test(key);
57848
+ }
57849
+ /** The key of a `custom:<key>` role, or null for any other string. */
57850
+ function customKeyOfRole(role) {
57851
+ if (!role.startsWith("custom:")) return null;
57852
+ const key = role.slice(7);
57853
+ return isRemoteCustomKey(key) ? key : null;
57854
+ }
57855
+ function isRemoteRole(value) {
57856
+ return isRemoteKnownRole(value) || customKeyOfRole(value) !== null;
57857
+ }
57858
+ var RemoteRoleSchema = string().refine(isRemoteRole, { message: "a role is one of the known roles or custom:<key> (lowercase letters, digits, _)" });
57859
+ var RemoteBindingSchema = object({ action: AutomationCapStepSchema.extend({ deviceId: number().int().nonnegative() }) });
57860
+ var RemoteCustomButtonSchema = object({
57861
+ /** The slug after `custom:` in the role. */
57862
+ key: string().refine(isRemoteCustomKey, { message: "a lowercase slug" }),
57863
+ /** What the operator calls it, and what a voice command may name. */
57864
+ name: string().min(1).max(60)
57865
+ });
57866
+ var RemotePowerModeSchema = _enum(["toggle", "discrete"]);
57867
+ var RemoteConfigSchema = object({
57868
+ layoutTemplateId: string().min(1).nullable(),
57869
+ /**
57870
+ * The transmitter device new bindings and an import send through. A binding
57871
+ * names its own device, so one command may override it.
57872
+ */
57873
+ defaultTransmitterId: number().int().nonnegative().nullable().default(null),
57874
+ /** Keyed by role. A role with no entry falls back to the native cap. */
57875
+ bindings: record(string(), RemoteBindingSchema),
57876
+ customButtons: array(RemoteCustomButtonSchema).max(100),
57877
+ power: object({ mode: RemotePowerModeSchema })
57878
+ }).superRefine((config, ctx) => {
57879
+ const roles = Object.keys(config.bindings);
57880
+ if (roles.length > 200) ctx.addIssue({
57881
+ code: "custom",
57882
+ message: "too many bindings",
57883
+ path: ["bindings"]
57884
+ });
57885
+ for (const role of roles) if (!isRemoteRole(role)) ctx.addIssue({
57886
+ code: "custom",
57887
+ message: `"${role}" is not a role`,
57888
+ path: ["bindings", role]
57889
+ });
57890
+ const keys = /* @__PURE__ */ new Set();
57891
+ config.customButtons.forEach((button, index) => {
57892
+ if (keys.has(button.key)) ctx.addIssue({
57893
+ code: "custom",
57894
+ message: `custom button "${button.key}" is listed twice`,
57895
+ path: [
57896
+ "customButtons",
57897
+ index,
57898
+ "key"
57899
+ ]
57900
+ });
57901
+ keys.add(button.key);
57902
+ });
57903
+ for (const role of roles) {
57904
+ const key = customKeyOfRole(role);
57905
+ if (key !== null && !keys.has(key)) ctx.addIssue({
57906
+ code: "custom",
57907
+ message: `${role} is bound but has no entry in customButtons`,
57908
+ path: ["bindings", role]
57909
+ });
57910
+ }
57911
+ });
57912
+ object({
57913
+ power: object({
57914
+ state: _enum(["on", "off"]),
57915
+ at: number()
57916
+ }).nullable(),
57917
+ muted: object({
57918
+ value: boolean(),
57919
+ at: number()
57920
+ }).nullable()
57921
+ });
57922
+ var RemoteLayoutButtonSchema = object({
57923
+ id: string().min(1).max(40),
57924
+ /** 0-based grid position. */
57925
+ row: number().int().min(0).max(24),
57926
+ col: number().int().min(0).max(24),
57927
+ rowSpan: number().int().min(1).max(24),
57928
+ colSpan: number().int().min(1).max(24),
57929
+ icon: string().min(1).max(60).optional(),
57930
+ label: string().min(1).max(40).optional(),
57931
+ role: RemoteRoleSchema
57932
+ });
57933
+ object({
57934
+ columns: number().int().min(1).max(24),
57935
+ rows: number().int().min(1).max(24),
57936
+ buttons: array(RemoteLayoutButtonSchema).max(200)
57937
+ }).superRefine((grid, ctx) => {
57938
+ const ids = /* @__PURE__ */ new Set();
57939
+ const taken = /* @__PURE__ */ new Map();
57940
+ grid.buttons.forEach((button, index) => {
57941
+ if (ids.has(button.id)) ctx.addIssue({
57942
+ code: "custom",
57943
+ message: `button id "${button.id}" is used twice`,
57944
+ path: [
57945
+ "buttons",
57946
+ index,
57947
+ "id"
57948
+ ]
57949
+ });
57950
+ ids.add(button.id);
57951
+ if (button.row + button.rowSpan > grid.rows || button.col + button.colSpan > grid.columns) {
57952
+ ctx.addIssue({
57953
+ code: "custom",
57954
+ message: `button "${button.id}" leaves the grid`,
57955
+ path: ["buttons", index]
57956
+ });
57957
+ return;
57958
+ }
57959
+ for (let r = button.row; r < button.row + button.rowSpan; r += 1) for (let c = button.col; c < button.col + button.colSpan; c += 1) {
57960
+ const cell = `${r}:${c}`;
57961
+ const other = taken.get(cell);
57962
+ if (other !== void 0) {
57963
+ ctx.addIssue({
57964
+ code: "custom",
57965
+ message: `buttons "${other}" and "${button.id}" overlap`,
57966
+ path: ["buttons", index]
57967
+ });
57968
+ return;
57969
+ }
57970
+ taken.set(cell, button.id);
57971
+ }
57972
+ });
57973
+ });
57974
+ var RemoteBoundCommandSchema = object({
57975
+ role: RemoteRoleSchema,
57976
+ /** The operator's name for a custom button; absent for a known role. */
57977
+ label: string().optional(),
57978
+ custom: boolean()
57979
+ });
57980
+ var RemoteCommandListSchema = object({
57981
+ layoutTemplateId: string().nullable(),
57982
+ power: object({ mode: RemotePowerModeSchema }),
57983
+ /** Only the roles that are BOUND — the ones a press can reach. */
57984
+ commands: array(RemoteBoundCommandSchema)
57985
+ });
57986
+ var RemoteRefusalReasonSchema = _enum([
57987
+ "no-remote",
57988
+ "unbound-role",
57989
+ "action-failed"
57990
+ ]);
57991
+ var RemoteSendResultSchema = discriminatedUnion("status", [
57992
+ object({
57993
+ status: literal("sent"),
57994
+ /** How many times the action ran. */
57995
+ sends: number().int().min(1)
57996
+ }),
57997
+ object({
57998
+ status: literal("skipped"),
57999
+ reason: literal("already-in-state")
58000
+ }),
58001
+ object({
58002
+ status: literal("refused"),
58003
+ reason: RemoteRefusalReasonSchema,
58004
+ detail: string().optional()
58005
+ })
58006
+ ]);
58007
+ var RemoteMediaCommandSchema = _enum([
58008
+ "play",
58009
+ "pause",
58010
+ "stop",
58011
+ "next",
58012
+ "previous",
58013
+ "setMute",
58014
+ "selectSource"
58015
+ ]);
58016
+ /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
58017
+ var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
58018
+ var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status: literal("saved") }), object({
58019
+ status: literal("refused"),
58020
+ reason: _enum(["unknown-template", "not-a-media-player"]),
58021
+ detail: string()
58022
+ })]);
58023
+ var deviceInput = object({ deviceId: number().int().nonnegative() });
58024
+ DeviceType.MediaPlayer;
58025
+ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
58026
+ kind: "mutation",
58027
+ auth: "admin"
58028
+ }), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
58029
+ role: RemoteRoleSchema,
58030
+ /** Sends in a row (volume steps). */
58031
+ repeat: number().int().min(1).max(50).default(1)
58032
+ }), RemoteSendResultSchema, {
58033
+ kind: "mutation",
58034
+ auth: "protected"
58035
+ }), method(deviceInput.extend({
58036
+ command: RemoteMediaCommandSchema,
58037
+ muted: boolean().optional(),
58038
+ source: string().optional(),
58039
+ repeat: number().int().min(1).max(50).default(1)
58040
+ }), RemoteMediaCommandResultSchema, {
58041
+ kind: "mutation",
58042
+ auth: "protected"
58043
+ });
58044
+ var TemplateKindSchema = _enum(["remote"]);
58045
+ /**
58046
+ * template — the generic store of reusable, named operator data (D963). A
58047
+ * record is `{ id, kind, name, payload }`; the kinds (today only `remote`, the
58048
+ * button grid of a remote) and the schema each payload must satisfy are
58049
+ * declared by the system in `template-kinds.ts`. Nothing here is specific to a
58050
+ * kind: the engine validates a payload against its kind's schema and, on a
58051
+ * delete, asks the kind's owner whether anything still points at the record.
58052
+ *
58053
+ * Every refusal is a typed result — a UI says "unknown kind" or names the
58054
+ * devices that still use a template, without parsing text.
58055
+ */
58056
+ var TemplateRecordSchema = object({
58057
+ id: string().min(1),
58058
+ kind: TemplateKindSchema,
58059
+ name: string().min(1).max(120),
58060
+ /** Shaped by the kind; `checkTemplatePayload(kind, payload)` reads it. */
58061
+ payload: unknown(),
58062
+ createdAt: number(),
58063
+ updatedAt: number()
58064
+ });
58065
+ var TemplateWriteResultSchema = discriminatedUnion("status", [object({
58066
+ status: literal("saved"),
58067
+ template: TemplateRecordSchema
58068
+ }), object({
58069
+ status: literal("refused"),
58070
+ reason: _enum(["invalid-payload", "not-found"]),
58071
+ detail: string()
58072
+ })]);
58073
+ /** A device still pointing at a template. */
58074
+ var TemplateUserSchema = object({
58075
+ deviceId: number().int().nonnegative(),
58076
+ name: string()
58077
+ });
58078
+ var TemplateDeleteResultSchema = discriminatedUnion("status", [
58079
+ object({ status: literal("deleted") }),
58080
+ object({ status: literal("not-found") }),
58081
+ object({
58082
+ status: literal("in-use"),
58083
+ devices: array(TemplateUserSchema).min(1)
58084
+ })
58085
+ ]);
58086
+ method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSchema), { auth: "protected" }), method(object({ id: string().min(1) }), TemplateRecordSchema.nullable(), { auth: "protected" }), method(object({
58087
+ kind: TemplateKindSchema,
58088
+ name: string().min(1).max(120),
58089
+ payload: unknown()
58090
+ }), TemplateWriteResultSchema, {
58091
+ kind: "mutation",
58092
+ auth: "admin"
58093
+ }), method(object({
58094
+ id: string().min(1),
58095
+ name: string().min(1).max(120).optional(),
58096
+ payload: unknown().optional()
58097
+ }), TemplateWriteResultSchema, {
58098
+ kind: "mutation",
58099
+ auth: "admin"
58100
+ }), method(object({ id: string().min(1) }), TemplateDeleteResultSchema, {
58101
+ kind: "mutation",
58102
+ auth: "admin"
58103
+ });
57213
58104
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
57214
58105
  kind: "mutation",
57215
58106
  auth: "protected"
57216
58107
  });
57217
58108
  /**
58109
+ * A pulse train in signed microseconds: mark (+) first, then space (-), strictly
58110
+ * alternating, no zeros, 2..1024 entries.
58111
+ */
58112
+ var IrTimingsSchema = array(number().int()).min(2).max(1024).superRefine((timings, ctx) => {
58113
+ timings.forEach((value, index) => {
58114
+ const expectMark = index % 2 === 0;
58115
+ if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
58116
+ code: "custom",
58117
+ message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
58118
+ path: [index]
58119
+ });
58120
+ });
58121
+ });
58122
+ /** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
58123
+ var TransmitSettingsSchema = object({
58124
+ carrierHz: number().int().positive().optional(),
58125
+ dutyCyclePercent: number().int().min(1).max(100).optional(),
58126
+ repeat: number().int().min(0).max(20).optional(),
58127
+ repeatDelayMs: number().int().min(0).optional()
58128
+ });
58129
+ /** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
58130
+ var TransmitSettingKeySchema = _enum([
58131
+ "carrierHz",
58132
+ "dutyCyclePercent",
58133
+ "repeat",
58134
+ "repeatDelayMs"
58135
+ ]);
58136
+ var IrMediumSchema = _enum(["ir", "rf"]);
58137
+ var IrSendResultSchema = object({
58138
+ ok: literal(true),
58139
+ /** Settings the transmitter could not apply; the train was still sent. */
58140
+ ignoredSettings: array(string())
58141
+ });
58142
+ var IrTransmitterInfoSchema = object({
58143
+ media: array(IrMediumSchema),
58144
+ settable: array(TransmitSettingKeySchema),
58145
+ maxTimings: number().int().positive()
58146
+ });
58147
+ DeviceType.Generic, method(object({
58148
+ deviceId: number().int().nonnegative(),
58149
+ timings: IrTimingsSchema,
58150
+ settings: TransmitSettingsSchema.optional()
58151
+ }), IrSendResultSchema, {
58152
+ kind: "mutation",
58153
+ auth: "protected"
58154
+ }), method(object({ deviceId: number().int().nonnegative() }), IrTransmitterInfoSchema, {
58155
+ kind: "query",
58156
+ auth: "protected"
58157
+ });
58158
+ /**
57218
58159
  * `calendar-source` — collection cap exposing per-provider calendars and
57219
58160
  * their events. Every addon that contributes calendars (Home Assistant,
57220
58161
  * a future Google Calendar addon, …) registers a provider here. The hub
@@ -57708,11 +58649,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
57708
58649
  }),
57709
58650
  object({
57710
58651
  mode: literal("mired"),
57711
- mireds: number().int().min(50).max(1e3)
58652
+ colorTemperature: number().int().min(50).max(1e3)
57712
58653
  })
57713
58654
  ]);
57714
58655
  object({
57715
- /** Active color mode — which of `rgb` / `hsv` / `mireds` reflects
58656
+ /** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
57716
58657
  * the bulb's current state. */
57717
58658
  mode: _enum([
57718
58659
  "rgb",
@@ -57724,7 +58665,7 @@ object({
57724
58665
  /** Populated when `mode === 'hsv'`. */
57725
58666
  hsv: HsvTripletSchema.optional(),
57726
58667
  /** Populated when `mode === 'mired'`. */
57727
- mireds: number().int().optional().meta(readingMeta("colour-temperature")),
58668
+ colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
57728
58669
  /** Ms epoch of the last operator-driven change. */
57729
58670
  lastChangedAt: number()
57730
58671
  });
@@ -57743,7 +58684,7 @@ DeviceType.Light, method(object({
57743
58684
  ]),
57744
58685
  rgb: RgbTripletSchema.optional(),
57745
58686
  hsv: HsvTripletSchema.optional(),
57746
- mireds: number().int().optional(),
58687
+ colorTemperature: number().int().optional(),
57747
58688
  lastChangedAt: number()
57748
58689
  });
57749
58690
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
@@ -58181,11 +59122,11 @@ object({
58181
59122
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
58182
59123
  availablePrograms: array(string()),
58183
59124
  /** Seconds remaining on the active cycle, or null when not running / not known. */
58184
- remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59125
+ remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
58185
59126
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
58186
- delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59127
+ delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
58187
59128
  /** Cycle completion 0..100, or null when not applicable. */
58188
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59129
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58189
59130
  /** True when the door is reported open; null when the door state is not known. */
58190
59131
  doorOpen: boolean().nullable(),
58191
59132
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -58803,7 +59744,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
58803
59744
  object({
58804
59745
  /** Active speed as 0..100 inclusive. Null when the device has no
58805
59746
  * speed surface (single-speed fan). */
58806
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59747
+ speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58807
59748
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
58808
59749
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
58809
59750
  percentageStep: number().positive().optional().meta(readingMeta("percentage")),
@@ -58823,7 +59764,7 @@ object({
58823
59764
  });
58824
59765
  DeviceType.Fan, method(object({
58825
59766
  deviceId: number().int().nonnegative(),
58826
- percentage: number().min(0).max(100)
59767
+ speed: number().min(0).max(100)
58827
59768
  }), _void(), {
58828
59769
  kind: "mutation",
58829
59770
  auth: "protected"
@@ -59014,7 +59955,7 @@ DeviceType.Humidifier, method(object({
59014
59955
  */
59015
59956
  var HumiditySensorStatusSchema = object({
59016
59957
  /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
59017
- percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
59958
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
59018
59959
  precision: 0,
59019
59960
  label: "Humidity"
59020
59961
  })),
@@ -59457,7 +60398,7 @@ object({
59457
60398
  batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59458
60399
  /** 0..100 mowing-completion percentage of the current task, or null when no
59459
60400
  * task is active / progress is unavailable. */
59460
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60401
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59461
60402
  /** Current device/event code (dynamic — mostly status, sometimes an error),
59462
60403
  * or null when unknown. */
59463
60404
  currentCode: number().nullable().meta(readingMeta("none")),
@@ -59929,9 +60870,35 @@ var MediaInfoSchema = object({
59929
60870
  /** Optional cover-art / thumbnail URL. */
59930
60871
  imageUrl: string().optional()
59931
60872
  });
60873
+ /**
60874
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
60875
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
60876
+ * tracks what it last SENT; it moves only after a send was accepted, and a
60877
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
60878
+ * guess, never as a reading.
60879
+ */
60880
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
60881
+ /** The fields of a media-player status a driver can only guess. */
60882
+ var MediaPlayerAssumedFieldSchema = _enum([
60883
+ "state",
60884
+ "volumeLevel",
60885
+ "isMuted",
60886
+ "source"
60887
+ ]);
59932
60888
  object({
59933
60889
  /** Playback lifecycle state. */
59934
60890
  state: MediaPlayerStateSchema,
60891
+ /**
60892
+ * Whether the state fields are readings or the driver's own bookkeeping.
60893
+ * A slice written before this field existed parses as `reported`.
60894
+ */
60895
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
60896
+ /**
60897
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
60898
+ * this is not empty; a field not listed here is a reading even then (power
60899
+ * from a running-state source, mute guessed from the last send).
60900
+ */
60901
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
59935
60902
  /** Volume as 0..100 inclusive. Null when the device has no volume
59936
60903
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
59937
60904
  volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
@@ -59947,10 +60914,10 @@ object({
59947
60914
  currentMedia: MediaInfoSchema.nullable(),
59948
60915
  /** Current playback position in ms. Null when not seekable or
59949
60916
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
59950
- positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
60917
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59951
60918
  /** Total duration of the current media in ms. Null when unknown
59952
60919
  * (live stream) or nothing is playing. */
59953
- durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
60920
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59954
60921
  /** Shuffle toggle. Null when no shuffle surface.
59955
60922
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
59956
60923
  shuffle: boolean().nullable(),
@@ -59977,7 +60944,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
59977
60944
  auth: "protected"
59978
60945
  }), method(object({
59979
60946
  deviceId: number().int().nonnegative(),
59980
- positionMs: number().int().nonnegative()
60947
+ position: number().int().nonnegative()
59981
60948
  }), _void(), {
59982
60949
  kind: "mutation",
59983
60950
  auth: "protected"
@@ -60650,9 +61617,9 @@ var NetworkLinkStatusSchema = object({
60650
61617
  * one whose reading has not landed must not be drawn at 0 %. Consumers
60651
61618
  * SKIP a null rather than coerce it.
60652
61619
  */
60653
- signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61620
+ signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60654
61621
  /** Raw received signal strength in dBm, when the firmware reports one. */
60655
- rssiDbm: number().optional().meta(readingMeta("signal-level")),
61622
+ rssi: number().optional().meta(readingMeta("signal-level")),
60656
61623
  /** Network name of a wireless link, when the firmware reports it. */
60657
61624
  ssid: string().optional(),
60658
61625
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
@@ -61313,10 +62280,20 @@ var PetFeederDeviceStatusSchema = _enum([
61313
62280
  ]);
61314
62281
  var gramsPortion = number().int().min(4).max(200);
61315
62282
  object({
61316
- /** Food currently in the bowl (grams). Null when the device has not
61317
- * reported a reading yet. On dual-hopper models this is the combined
61318
- * bowl reading; per-hopper levels live in `food1`/`food2`. */
62283
+ /** Food in the TANK (hopper), as the feeder's own sensor reports it
62284
+ * (`state.food`). A coarse level code, not grams — `0` is empty. The
62285
+ * amount in the bowl is `bowlFood`. On dual-hopper models this is the
62286
+ * combined reading; per-hopper levels live in `food1`/`food2`. Null when
62287
+ * the device has not reported yet. */
61319
62288
  foodLevel: number().nullable().meta(readingMeta("none")),
62289
+ /** Food in the BOWL as the feeder reports it (`state.bowl`), in the
62290
+ * feeder's own units. Null when the model reports none. */
62291
+ bowlFood: number().nullable().meta(readingMeta("none")),
62292
+ /** True while the pet is eating (`state.eating`). */
62293
+ eating: boolean(),
62294
+ /** Whether `markFoodReplenished` does anything on this model. When false
62295
+ * the client must not offer it. */
62296
+ supportsMarkRefilled: boolean(),
61320
62297
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
61321
62298
  * single-hopper models. */
61322
62299
  food1: number().nullable().meta(readingMeta("none")),
@@ -61324,12 +62301,17 @@ object({
61324
62301
  * single-hopper models. */
61325
62302
  food2: number().nullable().meta(readingMeta("none")),
61326
62303
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
61327
- * (`device_class: problem`, on = low). True when the bowl is empty /
61328
- * below the feeder's low threshold. */
62304
+ * (`device_class: problem`, on = low). True when the tank reports empty,
62305
+ * or, on a dual-hopper model, when EITHER hopper is empty. */
61329
62306
  lowFood: boolean(),
61330
- /** Battery charge 0..100 (%). Null on mains-powered models or when the
61331
- * device has no battery reading. */
62307
+ /** Battery charge 0..100 (%). On a feeder running on `mains` this is the
62308
+ * BACKUP battery's charge, not the power source. Null when the device has
62309
+ * no battery reading. */
61332
62310
  batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
62311
+ /** What the feeder is powered from right now: `mains` (plugged in, the
62312
+ * battery is only a backup) or `battery`. Null when the device does not
62313
+ * report it. */
62314
+ powerSource: _enum(["mains", "battery"]).nullable(),
61333
62315
  /**
61334
62316
  * Desiccant life remaining, stored in seconds (duration base, D944).
61335
62317
  * Providers convert from the days the feeder reports. Null when the
@@ -61357,6 +62339,14 @@ object({
61357
62339
  feedSound: boolean(),
61358
62340
  /** Speaker / prompt volume level (device-scaled integer). */
61359
62341
  volume: number().meta(readingMeta("none")),
62342
+ /** Portion (grams) of the last manual feed sent from a single-hopper
62343
+ * stepper — the default the next manual feed starts from. Persisted per
62344
+ * device by the provider; null until a manual feed has been sent. */
62345
+ lastFeedGrams: gramsPortion.nullable(),
62346
+ /** Hopper-1 portion of the last manual feed (dual-hopper); null until sent. */
62347
+ lastFeedHopper1: gramsPortion.nullable(),
62348
+ /** Hopper-2 portion of the last manual feed (dual-hopper); null until sent. */
62349
+ lastFeedHopper2: gramsPortion.nullable(),
61360
62350
  /** Ms epoch when the slice was last refreshed from the cloud. */
61361
62351
  lastFetchedAt: number()
61362
62352
  });
@@ -61792,16 +62782,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
61792
62782
  auth: "admin"
61793
62783
  });
61794
62784
  object({
61795
- /** Instantaneous power draw in watts. */
61796
- watts: number().optional().meta(readingMeta("power", { label: "Power" })),
62785
+ /** Instantaneous power draw (watts). */
62786
+ power: number().optional().meta(readingMeta("power", { label: "Power" })),
61797
62787
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
61798
- kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
61799
- /** Voltage in volts. */
61800
- volts: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
62788
+ energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
62789
+ /** Voltage (volts). */
62790
+ voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
61801
62791
  /** Current in amperes. */
61802
- amps: number().optional().meta(readingMeta("current", { label: "Current" })),
62792
+ current: number().optional().meta(readingMeta("current", { label: "Current" })),
61803
62793
  /** Apparent power in volt-amperes. */
61804
- va: number().optional().meta(readingMeta("apparent-power")),
62794
+ apparentPower: number().optional().meta(readingMeta("apparent-power")),
61805
62795
  /** Power factor (0..1) if reported. */
61806
62796
  powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
61807
62797
  /** Ms epoch when the slice was last updated. */
@@ -61856,16 +62846,13 @@ var PresenceStatusSchema = object({
61856
62846
  location: string().nullable(),
61857
62847
  /** GPS coordinates when available. Null otherwise. */
61858
62848
  gps: GpsLocationSchema.nullable(),
61859
- /** Optional battery level of the tracking device (0..100). Null
61860
- * when not reported. */
61861
- batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61862
62849
  /** Ms epoch when the slice was last updated. */
61863
62850
  lastChangedAt: number()
61864
62851
  });
61865
62852
  DeviceType.Presence;
61866
62853
  object({
61867
62854
  /** Current pressure in hPa. `null` when the sample was refused (D393). */
61868
- hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
62855
+ pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
61869
62856
  /** Ms epoch when the slice was last updated. */
61870
62857
  lastFetchedAt: number()
61871
62858
  });
@@ -64887,7 +65874,7 @@ DeviceType.Sensor;
64887
65874
  */
64888
65875
  var TemperatureSensorStatusSchema = object({
64889
65876
  /** Current temperature in Celsius. `null` when the sample was refused (D393). */
64890
- celsius: number().nullable().meta(readingMeta("temperature", {
65877
+ temperature: number().nullable().meta(readingMeta("temperature", {
64891
65878
  precision: 1,
64892
65879
  label: "Temperature"
64893
65880
  })),
@@ -65151,7 +66138,7 @@ object({
65151
66138
  /** Speed tokens the hardware accepts — drives the UI selector. */
65152
66139
  availableFanSpeeds: array(string()),
65153
66140
  /** 0..100 cleaning-completion percentage of the current task, or null. */
65154
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
66141
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
65155
66142
  /** Current error code (0 / null = no error). */
65156
66143
  errorCode: number().nullable().meta(readingMeta("none")),
65157
66144
  /** Human label for {@link errorCode}, or null when none / undecodable. */
@@ -66020,9 +67007,17 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
66020
67007
  kind: "mutation",
66021
67008
  auth: "admin"
66022
67009
  });
67010
+ discriminatedUnion("kind", [object({
67011
+ kind: literal("raw"),
67012
+ timings: array(number().int()),
67013
+ settings: TransmitSettingsSchema.optional()
67014
+ }), object({
67015
+ kind: literal("pronto"),
67016
+ code: string()
67017
+ })]);
66023
67018
  DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
66024
67019
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
66025
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
67020
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
66026
67021
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
66027
67022
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
66028
67023
  new Set(CAP_NAMES);
@@ -66092,6 +67087,104 @@ Object.freeze({
66092
67087
  access: "create",
66093
67088
  role: "admin"
66094
67089
  },
67090
+ "actions.create": {
67091
+ capName: "actions",
67092
+ capScope: "system",
67093
+ addonId: null,
67094
+ access: "create",
67095
+ role: "admin"
67096
+ },
67097
+ "actions.delete": {
67098
+ capName: "actions",
67099
+ capScope: "system",
67100
+ addonId: null,
67101
+ access: "delete",
67102
+ role: "admin"
67103
+ },
67104
+ "actions.get": {
67105
+ capName: "actions",
67106
+ capScope: "system",
67107
+ addonId: null,
67108
+ access: "view",
67109
+ role: "viewer"
67110
+ },
67111
+ "actions.getLinks": {
67112
+ capName: "actions",
67113
+ capScope: "system",
67114
+ addonId: null,
67115
+ access: "view",
67116
+ role: "admin"
67117
+ },
67118
+ "actions.getTraces": {
67119
+ capName: "actions",
67120
+ capScope: "system",
67121
+ addonId: null,
67122
+ access: "view",
67123
+ role: "admin"
67124
+ },
67125
+ "actions.list": {
67126
+ capName: "actions",
67127
+ capScope: "system",
67128
+ addonId: null,
67129
+ access: "view",
67130
+ role: "admin"
67131
+ },
67132
+ "actions.listForCamera": {
67133
+ capName: "actions",
67134
+ capScope: "system",
67135
+ addonId: null,
67136
+ access: "view",
67137
+ role: "viewer"
67138
+ },
67139
+ "actions.run": {
67140
+ capName: "actions",
67141
+ capScope: "system",
67142
+ addonId: null,
67143
+ access: "create",
67144
+ role: "viewer"
67145
+ },
67146
+ "actions.setLinks": {
67147
+ capName: "actions",
67148
+ capScope: "system",
67149
+ addonId: null,
67150
+ access: "create",
67151
+ role: "admin"
67152
+ },
67153
+ "actions.stop": {
67154
+ capName: "actions",
67155
+ capScope: "system",
67156
+ addonId: null,
67157
+ access: "create",
67158
+ role: "admin"
67159
+ },
67160
+ "actions.update": {
67161
+ capName: "actions",
67162
+ capScope: "system",
67163
+ addonId: null,
67164
+ access: "create",
67165
+ role: "admin"
67166
+ },
67167
+ "actionSource.listActions": {
67168
+ capName: "action-source",
67169
+ capScope: "system",
67170
+ addonId: null,
67171
+ access: "view",
67172
+ role: "admin"
67173
+ },
67174
+ "actionSource.runAction": {
67175
+ capName: "action-source",
67176
+ capScope: "system",
67177
+ addonId: null,
67178
+ access: "create",
67179
+ role: "admin"
67180
+ },
67181
+ "actionSource.stopAction": {
67182
+ capName: "action-source",
67183
+ capScope: "system",
67184
+ addonId: null,
67185
+ access: "create",
67186
+ role: "admin"
67187
+ },
66095
67188
  "addonPages.listPages": {
66096
67189
  capName: "addon-pages",
66097
67190
  capScope: "system",
@@ -67373,6 +68466,13 @@ Object.freeze({
67373
68466
  access: "view",
67374
68467
  role: "admin"
67375
68468
  },
68469
+ "coreBlocks.getAutomationRunState": {
68470
+ capName: "core-blocks",
68471
+ capScope: "system",
68472
+ addonId: null,
68473
+ access: "view",
68474
+ role: "admin"
68475
+ },
67376
68476
  "coreBlocks.getBlockSettings": {
67377
68477
  capName: "core-blocks",
67378
68478
  capScope: "system",
@@ -67394,6 +68494,13 @@ Object.freeze({
67394
68494
  access: "view",
67395
68495
  role: "admin"
67396
68496
  },
68497
+ "coreBlocks.getTraces": {
68498
+ capName: "core-blocks",
68499
+ capScope: "system",
68500
+ addonId: null,
68501
+ access: "view",
68502
+ role: "admin"
68503
+ },
67397
68504
  "coreBlocks.getTypeDefs": {
67398
68505
  capName: "core-blocks",
67399
68506
  capScope: "system",
@@ -67429,6 +68536,13 @@ Object.freeze({
67429
68536
  access: "create",
67430
68537
  role: "admin"
67431
68538
  },
68539
+ "coreBlocks.reportAutomationRun": {
68540
+ capName: "core-blocks",
68541
+ capScope: "system",
68542
+ addonId: null,
68543
+ access: "create",
68544
+ role: "admin"
68545
+ },
67432
68546
  "coreBlocks.restart": {
67433
68547
  capName: "core-blocks",
67434
68548
  capScope: "system",
@@ -69508,6 +70622,20 @@ Object.freeze({
69508
70622
  access: "create",
69509
70623
  role: "viewer"
69510
70624
  },
70625
+ "irTransmitter.getInfo": {
70626
+ capName: "ir-transmitter",
70627
+ capScope: "device",
70628
+ addonId: null,
70629
+ access: "view",
70630
+ role: "viewer"
70631
+ },
70632
+ "irTransmitter.send": {
70633
+ capName: "ir-transmitter",
70634
+ capScope: "device",
70635
+ addonId: null,
70636
+ access: "create",
70637
+ role: "viewer"
70638
+ },
69511
70639
  "keychain.delete": {
69512
70640
  capName: "keychain",
69513
70641
  capScope: "system",
@@ -73631,6 +74759,41 @@ Object.freeze({
73631
74759
  access: "create",
73632
74760
  role: "admin"
73633
74761
  },
74762
+ "remote.getConfig": {
74763
+ capName: "remote",
74764
+ capScope: "system",
74765
+ addonId: null,
74766
+ access: "view",
74767
+ role: "admin"
74768
+ },
74769
+ "remote.listCommands": {
74770
+ capName: "remote",
74771
+ capScope: "system",
74772
+ addonId: null,
74773
+ access: "view",
74774
+ role: "admin"
74775
+ },
74776
+ "remote.sendCommand": {
74777
+ capName: "remote",
74778
+ capScope: "system",
74779
+ addonId: null,
74780
+ access: "create",
74781
+ role: "admin"
74782
+ },
74783
+ "remote.sendMediaCommand": {
74784
+ capName: "remote",
74785
+ capScope: "system",
74786
+ addonId: null,
74787
+ access: "create",
74788
+ role: "admin"
74789
+ },
74790
+ "remote.setConfig": {
74791
+ capName: "remote",
74792
+ capScope: "system",
74793
+ addonId: null,
74794
+ access: "create",
74795
+ role: "admin"
74796
+ },
73634
74797
  "runningState.getStatus": {
73635
74798
  capName: "running-state",
73636
74799
  capScope: "device",
@@ -74821,6 +75984,41 @@ Object.freeze({
74821
75984
  access: "view",
74822
75985
  role: "viewer"
74823
75986
  },
75987
+ "template.create": {
75988
+ capName: "template",
75989
+ capScope: "system",
75990
+ addonId: null,
75991
+ access: "create",
75992
+ role: "admin"
75993
+ },
75994
+ "template.delete": {
75995
+ capName: "template",
75996
+ capScope: "system",
75997
+ addonId: null,
75998
+ access: "delete",
75999
+ role: "admin"
76000
+ },
76001
+ "template.get": {
76002
+ capName: "template",
76003
+ capScope: "system",
76004
+ addonId: null,
76005
+ access: "view",
76006
+ role: "admin"
76007
+ },
76008
+ "template.list": {
76009
+ capName: "template",
76010
+ capScope: "system",
76011
+ addonId: null,
76012
+ access: "view",
76013
+ role: "admin"
76014
+ },
76015
+ "template.update": {
76016
+ capName: "template",
76017
+ capScope: "system",
76018
+ addonId: null,
76019
+ access: "create",
76020
+ role: "admin"
76021
+ },
74824
76022
  "terminalSession.adoptLegacyMonitor": {
74825
76023
  capName: "terminal-session",
74826
76024
  capScope: "system",
@@ -76002,7 +77200,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76002
77200
  label: t("Full brightness", "Luminosità massima"),
76003
77201
  phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
76004
77202
  icon: "sun",
76005
- args: { percentage: 100 }
77203
+ args: { level: 100 }
76006
77204
  },
76007
77205
  {
76008
77206
  id: "brightness.half",
@@ -76010,7 +77208,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76010
77208
  label: t("Half brightness", "Luminosità a metà"),
76011
77209
  phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
76012
77210
  icon: "sun-dim",
76013
- args: { percentage: 50 }
77211
+ args: { level: 50 }
76014
77212
  },
76015
77213
  {
76016
77214
  id: "brightness.off",
@@ -76018,16 +77216,16 @@ var ACTUATOR_CAP_VOCABULARY = {
76018
77216
  label: t("Brightness off", "Luminosità a zero"),
76019
77217
  phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
76020
77218
  icon: "lightbulb-off",
76021
- args: { percentage: 0 }
77219
+ args: { level: 0 }
76022
77220
  },
76023
77221
  {
76024
77222
  id: "brightness.set",
76025
77223
  method: "setBrightness",
76026
77224
  label: t("Set brightness", "Imposta la luminosità"),
76027
- phrase: t("Set the brightness of {device} to {percentage}", "Imposta la luminosità di {device} a {percentage}"),
77225
+ phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
76028
77226
  icon: "sun-medium",
76029
77227
  openArgs: [{
76030
- key: "percentage",
77228
+ key: "level",
76031
77229
  label: PERCENT,
76032
77230
  offer: {
76033
77231
  kind: "number",
@@ -76041,13 +77239,13 @@ var ACTUATOR_CAP_VOCABULARY = {
76041
77239
  ],
76042
77240
  state: [{
76043
77241
  kind: "numeric",
76044
- field: "percentage",
77242
+ field: "level",
76045
77243
  quantity: t("the brightness", "la luminosità"),
76046
77244
  label: t("Brightness", "Luminosità"),
76047
77245
  unit: "%",
76048
77246
  icon: "sun"
76049
77247
  }],
76050
- events: { onBrightnessChanged: { notOperatorFacing: "the `percentage` state trigger reads the same change" } }
77248
+ events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
76051
77249
  },
76052
77250
  color: {
76053
77251
  scope: "device",
@@ -76061,7 +77259,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76061
77259
  icon: "sun",
76062
77260
  args: { color: {
76063
77261
  mode: "mired",
76064
- mireds: 370
77262
+ colorTemperature: 370
76065
77263
  } }
76066
77264
  },
76067
77265
  {
@@ -76072,7 +77270,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76072
77270
  icon: "snowflake",
76073
77271
  args: { color: {
76074
77272
  mode: "mired",
76075
- mireds: 200
77273
+ colorTemperature: 200
76076
77274
  } }
76077
77275
  },
76078
77276
  {
@@ -76686,7 +77884,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76686
77884
  label: t("Fan off", "Ventilatore spento"),
76687
77885
  phrase: t("Stop {device}", "Ferma {device}"),
76688
77886
  icon: "power-off",
76689
- args: { percentage: 0 }
77887
+ args: { speed: 0 }
76690
77888
  },
76691
77889
  {
76692
77890
  id: "fan.full",
@@ -76694,16 +77892,16 @@ var ACTUATOR_CAP_VOCABULARY = {
76694
77892
  label: t("Fan full", "Ventilatore al massimo"),
76695
77893
  phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
76696
77894
  icon: "fan",
76697
- args: { percentage: 100 }
77895
+ args: { speed: 100 }
76698
77896
  },
76699
77897
  {
76700
77898
  id: "fan.speed",
76701
77899
  method: "setPercentage",
76702
77900
  label: t("Set speed", "Imposta la velocità"),
76703
- phrase: t("Set the speed of {device} to {percentage}", "Imposta la velocità di {device} al {percentage}"),
77901
+ phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
76704
77902
  icon: "fan",
76705
77903
  openArgs: [{
76706
- key: "percentage",
77904
+ key: "speed",
76707
77905
  label: t("Speed", "Velocità"),
76708
77906
  offer: {
76709
77907
  kind: "number",
@@ -76765,7 +77963,7 @@ var ACTUATOR_CAP_VOCABULARY = {
76765
77963
  ],
76766
77964
  state: [{
76767
77965
  kind: "numeric",
76768
- field: "percentage",
77966
+ field: "speed",
76769
77967
  quantity: t("the speed", "la velocità"),
76770
77968
  label: t("Speed", "Velocità"),
76771
77969
  unit: "%",
@@ -77131,6 +78329,11 @@ var ACTUATOR_CAP_VOCABULARY = {
77131
78329
  icon: "circle-dot"
77132
78330
  }]
77133
78331
  },
78332
+ "ir-transmitter": {
78333
+ scope: "device",
78334
+ noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
78335
+ notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
78336
+ },
77134
78337
  control: {
77135
78338
  scope: "device",
77136
78339
  noun: t("Control", "Controllo"),
@@ -77563,7 +78766,7 @@ var APPLIANCE_CAP_VOCABULARY = {
77563
78766
  },
77564
78767
  {
77565
78768
  kind: "numeric",
77566
- field: "progressPercent",
78769
+ field: "progress",
77567
78770
  quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
77568
78771
  label: t("Progress", "Avanzamento"),
77569
78772
  unit: "%",
@@ -77921,10 +79124,10 @@ var APPLIANCE_CAP_VOCABULARY = {
77921
79124
  id: "media.seek",
77922
79125
  method: "seek",
77923
79126
  label: t("Seek", "Vai al punto"),
77924
- phrase: t("Move {device} to {positionMs}", "Porta {device} al punto {positionMs}"),
79127
+ phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
77925
79128
  icon: "fast-forward",
77926
79129
  openArgs: [{
77927
- key: "positionMs",
79130
+ key: "position",
77928
79131
  label: t("Position", "Posizione"),
77929
79132
  offer: {
77930
79133
  kind: "number",
@@ -78973,7 +80176,7 @@ var SENSOR_CAP_VOCABULARY = {
78973
80176
  state: [
78974
80177
  {
78975
80178
  kind: "numeric",
78976
- field: "co2Ppm",
80179
+ field: "co2",
78977
80180
  quantity: t("the CO₂", "la CO₂"),
78978
80181
  label: t("CO₂", "CO₂"),
78979
80182
  unit: "ppm",
@@ -78981,7 +80184,7 @@ var SENSOR_CAP_VOCABULARY = {
78981
80184
  },
78982
80185
  {
78983
80186
  kind: "numeric",
78984
- field: "vocPpb",
80187
+ field: "voc",
78985
80188
  quantity: t("the VOC level", "il livello di COV"),
78986
80189
  label: t("VOC", "COV"),
78987
80190
  unit: "ppb",
@@ -79017,7 +80220,7 @@ var SENSOR_CAP_VOCABULARY = {
79017
80220
  noun: t("Light level", "Luminosità ambiente"),
79018
80221
  state: [{
79019
80222
  kind: "numeric",
79020
- field: "lux",
80223
+ field: "illuminance",
79021
80224
  quantity: t("the light level", "la luminosità"),
79022
80225
  label: t("Illuminance", "Illuminamento"),
79023
80226
  unit: "lx",
@@ -79220,7 +80423,7 @@ var SENSOR_CAP_VOCABULARY = {
79220
80423
  noun: t("Humidity", "Umidità"),
79221
80424
  state: [{
79222
80425
  kind: "numeric",
79223
- field: "percent",
80426
+ field: "humidity",
79224
80427
  quantity: t("the humidity", "l’umidità"),
79225
80428
  label: t("Humidity", "Umidità"),
79226
80429
  unit: "%",
@@ -79268,7 +80471,7 @@ var SENSOR_CAP_VOCABULARY = {
79268
80471
  state: [
79269
80472
  {
79270
80473
  kind: "numeric",
79271
- field: "watts",
80474
+ field: "power",
79272
80475
  quantity: t("the power draw", "il consumo"),
79273
80476
  label: t("Power", "Potenza"),
79274
80477
  unit: "W",
@@ -79276,7 +80479,7 @@ var SENSOR_CAP_VOCABULARY = {
79276
80479
  },
79277
80480
  {
79278
80481
  kind: "numeric",
79279
- field: "kwhTotal",
80482
+ field: "energy",
79280
80483
  quantity: t("the energy used", "l’energia consumata"),
79281
80484
  label: t("Energy", "Energia"),
79282
80485
  unit: "kWh",
@@ -79284,7 +80487,7 @@ var SENSOR_CAP_VOCABULARY = {
79284
80487
  },
79285
80488
  {
79286
80489
  kind: "numeric",
79287
- field: "volts",
80490
+ field: "voltage",
79288
80491
  quantity: t("the voltage", "la tensione"),
79289
80492
  label: t("Voltage", "Tensione"),
79290
80493
  unit: "V",
@@ -79292,7 +80495,7 @@ var SENSOR_CAP_VOCABULARY = {
79292
80495
  },
79293
80496
  {
79294
80497
  kind: "numeric",
79295
- field: "amps",
80498
+ field: "current",
79296
80499
  quantity: t("the current", "la corrente"),
79297
80500
  label: t("Current", "Corrente"),
79298
80501
  unit: "A",
@@ -79309,13 +80512,6 @@ var SENSOR_CAP_VOCABULARY = {
79309
80512
  label: t("Where", "Posizione"),
79310
80513
  phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
79311
80514
  icon: "map-pin"
79312
- }, {
79313
- kind: "numeric",
79314
- field: "batteryPercent",
79315
- quantity: t("the phone battery", "la batteria del telefono"),
79316
- label: t("Battery", "Batteria"),
79317
- unit: "%",
79318
- icon: "battery"
79319
80515
  }]
79320
80516
  },
79321
80517
  "pressure-sensor": {
@@ -79323,7 +80519,7 @@ var SENSOR_CAP_VOCABULARY = {
79323
80519
  noun: t("Pressure", "Pressione"),
79324
80520
  state: [{
79325
80521
  kind: "numeric",
79326
- field: "hpa",
80522
+ field: "pressure",
79327
80523
  quantity: t("the pressure", "la pressione"),
79328
80524
  label: t("Pressure", "Pressione"),
79329
80525
  unit: "hPa",
@@ -79359,7 +80555,7 @@ var SENSOR_CAP_VOCABULARY = {
79359
80555
  noun: t("Temperature", "Temperatura"),
79360
80556
  state: [{
79361
80557
  kind: "numeric",
79362
- field: "celsius",
80558
+ field: "temperature",
79363
80559
  quantity: t("the temperature", "la temperatura"),
79364
80560
  label: t("Temperature", "Temperatura"),
79365
80561
  unit: "°C",
@@ -79430,7 +80626,7 @@ var SENSOR_CAP_VOCABULARY = {
79430
80626
  state: [
79431
80627
  {
79432
80628
  kind: "numeric",
79433
- field: "percentage",
80629
+ field: "level",
79434
80630
  quantity: t("the battery level", "il livello della batteria"),
79435
80631
  label: t("Battery", "Batteria"),
79436
80632
  unit: "%",
@@ -79472,7 +80668,7 @@ var SENSOR_CAP_VOCABULARY = {
79472
80668
  icon: "battery-charging"
79473
80669
  }
79474
80670
  ],
79475
- events: { onStatusChanged: { notOperatorFacing: "the percentage / sleeping / charging state triggers each read one field of this change" } },
80671
+ events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
79476
80672
  extraEvents: [{
79477
80673
  category: EventCategory.DeviceAwake,
79478
80674
  label: t("Woke up", "Risvegliato"),
@@ -79490,7 +80686,7 @@ var SENSOR_CAP_VOCABULARY = {
79490
80686
  noun: t("Network link", "Collegamento di rete"),
79491
80687
  state: [{
79492
80688
  kind: "numeric",
79493
- field: "signalPercent",
80689
+ field: "signal",
79494
80690
  quantity: t("the signal strength", "l’intensità del segnale"),
79495
80691
  label: t("Signal", "Segnale"),
79496
80692
  unit: "%",
@@ -79583,6 +80779,8 @@ var ML = "model and training machinery — no device action";
79583
80779
  var INTERNAL = "internal plumbing between addons — never operator-facing";
79584
80780
  /** Every system-scoped cap, with why it is not a device's vocabulary. */
79585
80781
  var SYSTEM_CAP_VOCABULARY = {
80782
+ "action-source": system(INTERNAL),
80783
+ actions: system("declared actions — run from the Actions page and from the cameras that link them"),
79586
80784
  "addon-pages": system(UI_PLUMBING),
79587
80785
  "addon-pages-source": system(UI_PLUMBING),
79588
80786
  "addon-routes": system(UI_PLUMBING),
@@ -79652,6 +80850,7 @@ var SYSTEM_CAP_VOCABULARY = {
79652
80850
  "recording-archive": system(STORAGE),
79653
80851
  "recording-export": system("recording exports — requested from the timeline, not an automation step"),
79654
80852
  records: system(INTERNAL),
80853
+ remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
79655
80854
  "server-management": system(CLUSTER),
79656
80855
  "settings-store": system(INTERNAL),
79657
80856
  "smtp-provider": system(INTERNAL),
@@ -79664,6 +80863,7 @@ var SYSTEM_CAP_VOCABULARY = {
79664
80863
  "storage-provider": system(STORAGE),
79665
80864
  "stream-broker": system(PIPELINE),
79666
80865
  system: system(CLUSTER),
80866
+ template: system("operator-authored templates — edited in their own editor, never actuated"),
79667
80867
  "terminal-session": system(CLUSTER),
79668
80868
  toast: system(UI_PLUMBING),
79669
80869
  training: system(ML),
@@ -79804,6 +81004,31 @@ Object.freeze({
79804
81004
  form: "single",
79805
81005
  optional: false
79806
81006
  }],
81007
+ "actions.get": [{
81008
+ name: "deviceId",
81009
+ form: "single",
81010
+ optional: true
81011
+ }],
81012
+ "actions.getLinks": [{
81013
+ name: "deviceId",
81014
+ form: "single",
81015
+ optional: false
81016
+ }],
81017
+ "actions.listForCamera": [{
81018
+ name: "deviceId",
81019
+ form: "single",
81020
+ optional: false
81021
+ }],
81022
+ "actions.run": [{
81023
+ name: "deviceId",
81024
+ form: "single",
81025
+ optional: true
81026
+ }],
81027
+ "actions.setLinks": [{
81028
+ name: "deviceId",
81029
+ form: "single",
81030
+ optional: false
81031
+ }],
79807
81032
  "addonSettings.getDeviceSettings": [{
79808
81033
  name: "deviceId",
79809
81034
  form: "single",
@@ -80855,6 +82080,16 @@ Object.freeze({
80855
82080
  form: "single",
80856
82081
  optional: false
80857
82082
  }],
82083
+ "irTransmitter.getInfo": [{
82084
+ name: "deviceId",
82085
+ form: "single",
82086
+ optional: false
82087
+ }],
82088
+ "irTransmitter.send": [{
82089
+ name: "deviceId",
82090
+ form: "single",
82091
+ optional: false
82092
+ }],
80858
82093
  "keychain.deleteDeviceScope": [{
80859
82094
  name: "deviceId",
80860
82095
  form: "single",
@@ -82080,6 +83315,31 @@ Object.freeze({
82080
83315
  form: "single",
82081
83316
  optional: true
82082
83317
  }],
83318
+ "remote.getConfig": [{
83319
+ name: "deviceId",
83320
+ form: "single",
83321
+ optional: false
83322
+ }],
83323
+ "remote.listCommands": [{
83324
+ name: "deviceId",
83325
+ form: "single",
83326
+ optional: false
83327
+ }],
83328
+ "remote.sendCommand": [{
83329
+ name: "deviceId",
83330
+ form: "single",
83331
+ optional: false
83332
+ }],
83333
+ "remote.sendMediaCommand": [{
83334
+ name: "deviceId",
83335
+ form: "single",
83336
+ optional: false
83337
+ }],
83338
+ "remote.setConfig": [{
83339
+ name: "deviceId",
83340
+ form: "single",
83341
+ optional: false
83342
+ }],
82083
83343
  "runningState.getStatus": [{
82084
83344
  name: "deviceId",
82085
83345
  form: "single",
@@ -83986,8 +85246,17 @@ function resolveGrantDeviceIds(scopes, fleet, access) {
83986
85246
  }
83987
85247
  return out;
83988
85248
  }
85249
+ String.raw`(?<=^|["'(\s>,\[{])`;
83989
85250
  var MB = 1024 * 1024;
83990
85251
  1024 * MB, 3072 * MB;
85252
+ object({
85253
+ manufacturer: string().optional(),
85254
+ supportedModels: array(string()).optional(),
85255
+ supportedController: string().optional(),
85256
+ commandsEncoding: string(),
85257
+ delay: number().nonnegative().optional(),
85258
+ commands: record(string(), unknown())
85259
+ });
83991
85260
  //#endregion
83992
85261
  //#region src/custom-actions.ts
83993
85262
  /**
@@ -84234,6 +85503,148 @@ async function profileForCamStream(input) {
84234
85503
  }
84235
85504
  }
84236
85505
  //#endregion
85506
+ //#region src/egress/alexa-source-profile.ts
85507
+ async function resolveAlexaSourceProfile(input) {
85508
+ const { api, deviceId, exposedEntry } = input;
85509
+ const log = input.logger;
85510
+ const pinnedProfile = (() => {
85511
+ const pref = exposedEntry?.settings?.streamPreference;
85512
+ if (pref === "low" || pref === "mid" || pref === "high") return pref;
85513
+ })();
85514
+ const allowTranscode = exposedEntry?.settings?.allowTranscode !== false;
85515
+ const scored = pinnedProfile === void 0 ? await api.cameraStreams.pickStream.query({
85516
+ deviceId,
85517
+ requirements: {
85518
+ acceptCodecs: ["h264"],
85519
+ minHeight: 480,
85520
+ maxHeight: ALEXA_MAX_LINES,
85521
+ excludeDerived: true,
85522
+ allowTranscode
85523
+ },
85524
+ preferences: { targetHeight: 720 }
85525
+ }).catch((err) => {
85526
+ log.warn("alexa rtc-session: pickStream threw — falling back to the high slot", {
85527
+ tags: { deviceId },
85528
+ meta: { error: err instanceof Error ? err.message : String(err) }
85529
+ });
85530
+ return null;
85531
+ }) : null;
85532
+ const scoredProfile = scored === null ? null : await profileForCamStream({
85533
+ api,
85534
+ deviceId,
85535
+ camStreamId: scored.camStreamId,
85536
+ logger: log
85537
+ });
85538
+ const sourceProfile = pinnedProfile ?? scoredProfile ?? "high";
85539
+ if (pinnedProfile === void 0) log.info("alexa rtc-session: source scored against the Echo requirements", {
85540
+ tags: { deviceId },
85541
+ meta: {
85542
+ chosen: sourceProfile,
85543
+ scored: scored === null ? "none-eligible" : scored.reason,
85544
+ camStreamId: scored?.camStreamId ?? null,
85545
+ slot: scoredProfile ?? (scored === null ? null : "no-slot"),
85546
+ height: scored?.resolution?.height ?? null,
85547
+ transcodes: scored?.transcodes ?? null,
85548
+ allowTranscode
85549
+ }
85550
+ });
85551
+ return sourceProfile;
85552
+ }
85553
+ var AlexaEgressPrewarm = class {
85554
+ deps;
85555
+ holds = /* @__PURE__ */ new Map();
85556
+ holdMs;
85557
+ disposed = false;
85558
+ constructor(deps) {
85559
+ this.deps = deps;
85560
+ this.holdMs = deps.holdMs ?? 3e4;
85561
+ }
85562
+ /** A doorbell press for `deviceId`. Never throws. */
85563
+ async onPress(deviceId) {
85564
+ const { api, logger } = this.deps;
85565
+ if (this.disposed) return;
85566
+ if (this.holds.has(deviceId)) {
85567
+ logger.debug("alexa egress prewarm: a hold is already pending, press ignored", { tags: { deviceId } });
85568
+ return;
85569
+ }
85570
+ if (this.deps.hasLiveSession(deviceId)) {
85571
+ logger.info("alexa egress prewarm: an Alexa session is already live, nothing to warm", { tags: { deviceId } });
85572
+ return;
85573
+ }
85574
+ const hold = {
85575
+ pipelineKey: null,
85576
+ timer: null
85577
+ };
85578
+ this.holds.set(deviceId, hold);
85579
+ const sessionId = `prewarm-${deviceId}-${Date.now()}`;
85580
+ try {
85581
+ const sourceProfile = await resolveAlexaSourceProfile({
85582
+ api,
85583
+ deviceId,
85584
+ exposedEntry: this.deps.listExposed().find((e) => e.deviceId === deviceId),
85585
+ logger
85586
+ });
85587
+ const acquired = await acquireAlexaEgress({
85588
+ api,
85589
+ deviceId,
85590
+ sourceProfile,
85591
+ sessionId,
85592
+ logger
85593
+ });
85594
+ hold.pipelineKey = acquired.pipelineKey;
85595
+ if (this.disposed || this.holds.get(deviceId) !== hold) {
85596
+ await this.release(deviceId, hold, "disposed before the hold was armed");
85597
+ return;
85598
+ }
85599
+ hold.timer = setTimeout(() => {
85600
+ this.release(deviceId, hold, "no session arrived");
85601
+ }, this.holdMs);
85602
+ hold.timer.unref?.();
85603
+ logger.info("alexa egress prewarm: transcode held for the coming session", {
85604
+ tags: { deviceId },
85605
+ meta: {
85606
+ pipelineKey: acquired.pipelineKey,
85607
+ sourceProfile,
85608
+ holdMs: this.holdMs
85609
+ }
85610
+ });
85611
+ } catch (err) {
85612
+ this.holds.delete(deviceId);
85613
+ logger.warn("alexa egress prewarm: acquire failed, the session will start the transcode", {
85614
+ tags: { deviceId },
85615
+ meta: { error: err instanceof Error ? err.message : String(err) }
85616
+ });
85617
+ }
85618
+ }
85619
+ /** Release every pending hold (addon shutdown). */
85620
+ async dispose() {
85621
+ this.disposed = true;
85622
+ const pending = [...this.holds.entries()];
85623
+ await Promise.all(pending.map(([deviceId, hold]) => this.release(deviceId, hold, "shutdown")));
85624
+ }
85625
+ async release(deviceId, hold, reason) {
85626
+ if (hold.timer) clearTimeout(hold.timer);
85627
+ hold.timer = null;
85628
+ if (this.holds.get(deviceId) === hold) this.holds.delete(deviceId);
85629
+ const pipelineKey = hold.pipelineKey;
85630
+ hold.pipelineKey = null;
85631
+ if (pipelineKey === null) return;
85632
+ await releaseAlexaEgress({
85633
+ api: this.deps.api,
85634
+ deviceId,
85635
+ pipelineKey,
85636
+ logger: this.deps.logger
85637
+ });
85638
+ this.deps.logger.info("alexa egress prewarm: hold released", {
85639
+ tags: { deviceId },
85640
+ meta: {
85641
+ pipelineKey,
85642
+ reason
85643
+ }
85644
+ });
85645
+ }
85646
+ };
85647
+ //#endregion
84237
85648
  //#region src/handlers/endpoint-id.ts
84238
85649
  /** The classes a camera publishes a detection sensor for (R1). */
84239
85650
  var DETECTION_SENSOR_CLASSES = [
@@ -84510,47 +85921,12 @@ async function handleInitiateSessionWithOffer(header, endpointRaw, payloadRaw, d
84510
85921
  if (sdpOffer.length === 0) return errorEnvelope(header, "INVALID_DIRECTIVE", "offer.value is empty");
84511
85922
  const api = deps.ctx.api;
84512
85923
  const exposedEntry = deps.listExposed().find((e) => e.deviceId === deviceId);
84513
- const pinnedProfile = (() => {
84514
- const pref = exposedEntry?.settings?.streamPreference;
84515
- if (pref === "low" || pref === "mid" || pref === "high") return pref;
84516
- })();
84517
- const allowTranscode = exposedEntry?.settings?.allowTranscode !== false;
84518
- const scored = pinnedProfile === void 0 ? await api.cameraStreams.pickStream.query({
84519
- deviceId,
84520
- requirements: {
84521
- acceptCodecs: ["h264"],
84522
- minHeight: 480,
84523
- maxHeight: ALEXA_MAX_LINES,
84524
- excludeDerived: true,
84525
- allowTranscode
84526
- },
84527
- preferences: { targetHeight: 720 }
84528
- }).catch((err) => {
84529
- log.warn("alexa rtc-session: pickStream threw — falling back to the high slot", {
84530
- tags: { deviceId },
84531
- meta: { error: err instanceof Error ? err.message : String(err) }
84532
- });
84533
- return null;
84534
- }) : null;
84535
- const scoredProfile = scored === null ? null : await profileForCamStream({
85924
+ const sourceProfile = await resolveAlexaSourceProfile({
84536
85925
  api,
84537
85926
  deviceId,
84538
- camStreamId: scored.camStreamId,
85927
+ exposedEntry,
84539
85928
  logger: log
84540
85929
  });
84541
- const sourceProfile = pinnedProfile ?? scoredProfile ?? "high";
84542
- if (pinnedProfile === void 0) log.info("alexa rtc-session: source scored against the Echo requirements", {
84543
- tags: { deviceId },
84544
- meta: {
84545
- chosen: sourceProfile,
84546
- scored: scored === null ? "none-eligible" : scored.reason,
84547
- camStreamId: scored?.camStreamId ?? null,
84548
- slot: scoredProfile ?? (scored === null ? null : "no-slot"),
84549
- height: scored?.resolution?.height ?? null,
84550
- transcodes: scored?.transcodes ?? null,
84551
- allowTranscode
84552
- }
84553
- });
84554
85930
  let derivedTarget;
84555
85931
  /**
84556
85932
  * The primitive's release handle, when this session acquired one. Recorded so
@@ -85707,13 +87083,13 @@ var temperatureAdapter = {
85707
87083
  category: "TEMPERATURE_SENSOR"
85708
87084
  }),
85709
87085
  properties: (_cap, slice) => {
85710
- const p = TemperatureSensorStatusSchema.pick({ celsius: true }).safeParse(slice);
85711
- if (!p.success || p.data.celsius === null) return [];
87086
+ const p = TemperatureSensorStatusSchema.pick({ temperature: true }).safeParse(slice);
87087
+ if (!p.success || p.data.temperature === null) return [];
85712
87088
  return [{
85713
87089
  namespace: "Alexa.TemperatureSensor",
85714
87090
  name: "temperature",
85715
87091
  value: {
85716
- value: Math.round(p.data.celsius * 10) / 10,
87092
+ value: Math.round(p.data.temperature * 10) / 10,
85717
87093
  scale: "CELSIUS"
85718
87094
  }
85719
87095
  }];
@@ -86458,12 +87834,12 @@ var humidityAdapter = {
86458
87834
  category: "TEMPERATURE_SENSOR"
86459
87835
  }),
86460
87836
  properties: (_cap, slice) => {
86461
- const p = HumiditySensorStatusSchema.pick({ percent: true }).safeParse(slice);
86462
- if (!p.success || p.data.percent === null) return [];
87837
+ const p = HumiditySensorStatusSchema.pick({ humidity: true }).safeParse(slice);
87838
+ if (!p.success || p.data.humidity === null) return [];
86463
87839
  return [{
86464
87840
  namespace: "Alexa.HumiditySensor",
86465
87841
  name: "relativeHumidity",
86466
- value: { value: Math.max(0, Math.min(100, p.data.percent)) }
87842
+ value: { value: Math.max(0, Math.min(100, p.data.humidity)) }
86467
87843
  }];
86468
87844
  },
86469
87845
  directives: [],
@@ -86637,7 +88013,7 @@ async function handleSetBrightness(header, endpointRaw, payloadRaw, deps, _calle
86637
88013
  try {
86638
88014
  await api.brightness.setBrightness.mutate({
86639
88015
  deviceId: targetDeviceId,
86640
- percentage
88016
+ level: percentage
86641
88017
  });
86642
88018
  } catch (err) {
86643
88019
  const message = err instanceof Error ? err.message : String(err);
@@ -86781,11 +88157,11 @@ var GENERIC_ADAPTERS = [
86781
88157
  },
86782
88158
  properties: (capName, slice) => {
86783
88159
  if (capName === "brightness") {
86784
- const p = BrightnessStatusSchema.pick({ percentage: true }).safeParse(slice);
88160
+ const p = BrightnessStatusSchema.pick({ level: true }).safeParse(slice);
86785
88161
  return p.success ? [{
86786
88162
  namespace: "Alexa.BrightnessController",
86787
88163
  name: "brightness",
86788
- value: Math.max(0, Math.min(100, Math.round(p.data.percentage)))
88164
+ value: Math.max(0, Math.min(100, Math.round(p.data.level)))
86789
88165
  }] : [];
86790
88166
  }
86791
88167
  const p = SwitchStatusSchema.pick({ on: true }).safeParse(slice);
@@ -89835,7 +91211,7 @@ async function collectChildProperties(api, childDeviceId, properties, timeOfSamp
89835
91211
  timeOfSample,
89836
91212
  uncertaintyInMilliseconds: 0
89837
91213
  });
89838
- const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "percentage");
91214
+ const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "level");
89839
91215
  if (level !== null) properties.push({
89840
91216
  namespace: "Alexa.BrightnessController",
89841
91217
  name: "brightness",
@@ -91363,6 +92739,7 @@ var LwaEventGateway = class {
91363
92739
  return;
91364
92740
  }
91365
92741
  if (!this.hasProactiveCredentials()) return;
92742
+ this.deps.onExposedDoorbellPress?.(parentDeviceId);
91366
92743
  for (const account of linked) {
91367
92744
  if (!this.mayPush(account.userId, parentDeviceId, "doorbell press")) continue;
91368
92745
  if (!this.findToken(account.userId)) {
@@ -93718,7 +95095,7 @@ function indexByDrivingDevice(exported) {
93718
95095
  }
93719
95096
  var EnabledSchema = object({ enabled: boolean() });
93720
95097
  var OnSchema = object({ on: boolean() });
93721
- var PercentageSchema = object({ percentage: number() });
95098
+ var PercentageSchema = object({ level: number() });
93722
95099
  var OnlineSchema = object({ online: boolean() });
93723
95100
  function power(on) {
93724
95101
  return {
@@ -93799,7 +95176,7 @@ function stateReportsFor(change, exported) {
93799
95176
  case "brightness": {
93800
95177
  const parsed = PercentageSchema.safeParse(change.slice);
93801
95178
  if (!parsed.success) break;
93802
- const value = Math.max(0, Math.min(100, Math.round(parsed.data.percentage)));
95179
+ const value = Math.max(0, Math.min(100, Math.round(parsed.data.level)));
93803
95180
  for (const e of of("child")) reports.push({
93804
95181
  ...e,
93805
95182
  interfaceName: "Alexa.BrightnessController",
@@ -94526,6 +95903,7 @@ var ExportAlexaAddon = class extends BaseAddon {
94526
95903
  "tokens[userId].brokerCredential"
94527
95904
  ];
94528
95905
  lwaGateway = null;
95906
+ egressPrewarm = null;
94529
95907
  syncEngine = null;
94530
95908
  /** S1 (D767): the linking user's live grants. Built in `onInitialize`, the
94531
95909
  * first point `ctx` exists. */
@@ -94692,10 +96070,19 @@ var ExportAlexaAddon = class extends BaseAddon {
94692
96070
  }
94693
96071
  }));
94694
96072
  const oauthIntegrationProvider = { getDescriptor: async () => buildAlexaOauthIntegration(this.config.publicHubUrl) };
96073
+ this.egressPrewarm = new AlexaEgressPrewarm({
96074
+ api: this.ctx.api,
96075
+ logger: this.ctx.logger,
96076
+ listExposed: () => this.config.exposed,
96077
+ hasLiveSession: (deviceId) => heldEgressHandles().some((h) => h.deviceId === deviceId)
96078
+ });
94695
96079
  this.lwaGateway = new LwaEventGateway({
94696
96080
  ctx: this.ctx,
94697
96081
  logger: this.ctx.logger,
94698
96082
  listExposed: () => this.config.exposed,
96083
+ onExposedDoorbellPress: (deviceId) => {
96084
+ this.egressPrewarm?.onPress(deviceId);
96085
+ },
94699
96086
  listLinkedAccounts: () => this.config.linkedAccounts,
94700
96087
  listTokens: () => this.config.tokens,
94701
96088
  upsertToken: (input) => this.upsertToken(input),
@@ -94849,6 +96236,10 @@ var ExportAlexaAddon = class extends BaseAddon {
94849
96236
  this.stateReconciler = null;
94850
96237
  this.stateReporter?.stop();
94851
96238
  this.stateReporter = null;
96239
+ if (this.egressPrewarm) {
96240
+ await this.egressPrewarm.dispose();
96241
+ this.egressPrewarm = null;
96242
+ }
94852
96243
  if (this.lwaGateway) {
94853
96244
  this.lwaGateway.stop();
94854
96245
  this.lwaGateway = null;