@camstack/types 1.2.385 → 1.2.386

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.
@@ -0,0 +1,230 @@
1
+ /**
2
+ * The ONE permission vocabulary every credential is reduced to (D892).
3
+ *
4
+ * A credential — a login session, an account-link token, a legacy `csa_` /
5
+ * `cst_` / `csv_` token, or the unified token `auth.mintToken` issues — is
6
+ * verified into a principal whose permissions are a `CredentialScope[]`, and
7
+ * nothing else. What KIND of credential it was never decides what it may do:
8
+ *
9
+ * - `'*'` — everything (the admin bypass). Held by an admin's session, a
10
+ * legacy admin token, and a unified token minted with it.
11
+ * - a {@link TokenScope} — the v3 capability grants (`category`,
12
+ * `capability`, `addon`, `device`) the tRPC matcher has always applied.
13
+ * - `share-view` — one fail-closed embed perimeter (`grid-view` /
14
+ * `events-view`) over a few devices. A principal that holds one is
15
+ * RESTRICTED to it: the matcher honours nothing else it holds.
16
+ * - `addon-routes` — may reach any addon's own `authenticated` HTTP routes
17
+ * and data planes (never an `admin` one). A person's session has always
18
+ * had this; an integration token never had it and must hold
19
+ * `addon:<id>` instead.
20
+ *
21
+ * Pure: no I/O. It lives in `@camstack/types` so the hub, the kernel and any
22
+ * addon read the same vocabulary.
23
+ */
24
+ import { z } from 'zod';
25
+ import { MethodAccessSchema, type TokenScope } from '../schemas/auth-records.js';
26
+ /** The admin scope: every permission. */
27
+ export declare const ADMIN_SCOPE = "*";
28
+ /** At most this many devices in one share-view grant (the share-link bound). */
29
+ export declare const SHARE_VIEW_MAX_DEVICES = 64;
30
+ /** What a share-view grant lets its holder see. */
31
+ export declare const ShareViewGrantSchema: z.ZodObject<{
32
+ kind: z.ZodEnum<{
33
+ "events-view": "events-view";
34
+ "grid-view": "grid-view";
35
+ }>;
36
+ deviceIds: z.ZodArray<z.ZodNumber>;
37
+ talk: z.ZodOptional<z.ZodBoolean>;
38
+ }, z.core.$strip>;
39
+ export type ShareViewGrant = z.infer<typeof ShareViewGrantSchema>;
40
+ export declare const ShareViewScopeSchema: z.ZodObject<{
41
+ type: z.ZodLiteral<"share-view">;
42
+ grant: z.ZodObject<{
43
+ kind: z.ZodEnum<{
44
+ "events-view": "events-view";
45
+ "grid-view": "grid-view";
46
+ }>;
47
+ deviceIds: z.ZodArray<z.ZodNumber>;
48
+ talk: z.ZodOptional<z.ZodBoolean>;
49
+ }, z.core.$strip>;
50
+ }, z.core.$strip>;
51
+ export type ShareViewScope = z.infer<typeof ShareViewScopeSchema>;
52
+ export declare const AddonRoutesScopeSchema: z.ZodObject<{
53
+ type: z.ZodLiteral<"addon-routes">;
54
+ access: z.ZodArray<z.ZodEnum<{
55
+ create: "create";
56
+ delete: "delete";
57
+ view: "view";
58
+ }>>;
59
+ }, z.core.$strip>;
60
+ export type AddonRoutesScope = z.infer<typeof AddonRoutesScopeSchema>;
61
+ export declare const CredentialScopeSchema: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodObject<{
62
+ type: z.ZodLiteral<"share-view">;
63
+ grant: z.ZodObject<{
64
+ kind: z.ZodEnum<{
65
+ "events-view": "events-view";
66
+ "grid-view": "grid-view";
67
+ }>;
68
+ deviceIds: z.ZodArray<z.ZodNumber>;
69
+ talk: z.ZodOptional<z.ZodBoolean>;
70
+ }, z.core.$strip>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ type: z.ZodLiteral<"addon-routes">;
73
+ access: z.ZodArray<z.ZodEnum<{
74
+ create: "create";
75
+ delete: "delete";
76
+ view: "view";
77
+ }>>;
78
+ }, z.core.$strip>, z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
79
+ type: z.ZodLiteral<"category">;
80
+ target: z.ZodEnum<{
81
+ device: "device";
82
+ system: "system";
83
+ }>;
84
+ access: z.ZodArray<z.ZodEnum<{
85
+ create: "create";
86
+ delete: "delete";
87
+ view: "view";
88
+ }>>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<"capability">;
91
+ target: z.ZodString;
92
+ access: z.ZodArray<z.ZodEnum<{
93
+ create: "create";
94
+ delete: "delete";
95
+ view: "view";
96
+ }>>;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ type: z.ZodLiteral<"addon">;
99
+ target: z.ZodString;
100
+ access: z.ZodArray<z.ZodEnum<{
101
+ create: "create";
102
+ delete: "delete";
103
+ view: "view";
104
+ }>>;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ type: z.ZodLiteral<"device">;
107
+ selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
108
+ kind: z.ZodLiteral<"all">;
109
+ }, z.core.$strip>, z.ZodObject<{
110
+ kind: z.ZodLiteral<"ids">;
111
+ ids: z.ZodArray<z.ZodNumber>;
112
+ }, z.core.$strip>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"types">;
114
+ types: z.ZodArray<z.ZodEnum<typeof import("../index.js").DeviceType>>;
115
+ }, z.core.$strip>, z.ZodObject<{
116
+ kind: z.ZodLiteral<"locations">;
117
+ locations: z.ZodArray<z.ZodString>;
118
+ }, z.core.$strip>], "kind">;
119
+ access: z.ZodArray<z.ZodEnum<{
120
+ create: "create";
121
+ delete: "delete";
122
+ view: "view";
123
+ }>>;
124
+ includeLinked: z.ZodOptional<z.ZodBoolean>;
125
+ }, z.core.$strip>], "type">>]>;
126
+ export type CredentialScope = z.infer<typeof CredentialScopeSchema>;
127
+ /** Every access flavour — what a person's session holds on addon routes. */
128
+ export declare const ALL_METHOD_ACCESS: readonly ['view', 'create', 'delete'];
129
+ /** True iff the scope set holds `'*'`. */
130
+ export declare function scopesGrantAdmin(scopes: readonly CredentialScope[]): boolean;
131
+ /**
132
+ * The share-view grant that RESTRICTS this principal, or `null` when it holds
133
+ * none. Fail closed: a set that mixes a share-view grant with anything else
134
+ * is still restricted to its FIRST share-view grant, never widened by the rest.
135
+ */
136
+ export declare function shareViewGrantOf(scopes: readonly CredentialScope[]): ShareViewGrant | null;
137
+ /** The capability grants the tRPC scope matcher reads. */
138
+ export declare function capabilityScopesOf(scopes: readonly CredentialScope[]): readonly TokenScope[];
139
+ /** True iff the set reaches every addon's own routes at `access`. */
140
+ export declare function scopesAllowAddonRoutes(scopes: readonly CredentialScope[], access: z.infer<typeof MethodAccessSchema>): boolean;
141
+ /**
142
+ * Parse a scope array from an untrusted source (a JWT claim, a stored row).
143
+ * Any element that does not parse makes the WHOLE set unusable — `null` — so
144
+ * a corrupt grant can never degrade into a partial one.
145
+ */
146
+ export declare function parseCredentialScopes(raw: unknown): readonly CredentialScope[] | null;
147
+ /**
148
+ * The `kind` claim of a unified token. It names the TOKEN FAMILY (so every
149
+ * older gate that classifies a hub JWT refuses it — `classifyBearerPrincipal`
150
+ * treats any `kind` it does not know as not-a-credential), never what the
151
+ * token may do: that is its `scopes`, and only its `scopes`.
152
+ */
153
+ export declare const CREDENTIAL_TOKEN_KIND = "credential";
154
+ /**
155
+ * The claims of a unified token (`auth.mintToken`). It carries no `exp`: its
156
+ * row (looked up by `jti` on every verify, for revocation) holds the ONE
157
+ * expiry, so a share link can be extended and a JWT clock can never disagree
158
+ * with the row.
159
+ */
160
+ export declare const CredentialTokenClaimsSchema: z.ZodObject<{
161
+ kind: z.ZodLiteral<"credential">;
162
+ sub: z.ZodString;
163
+ jti: z.ZodString;
164
+ scopes: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodObject<{
165
+ type: z.ZodLiteral<"share-view">;
166
+ grant: z.ZodObject<{
167
+ kind: z.ZodEnum<{
168
+ "events-view": "events-view";
169
+ "grid-view": "grid-view";
170
+ }>;
171
+ deviceIds: z.ZodArray<z.ZodNumber>;
172
+ talk: z.ZodOptional<z.ZodBoolean>;
173
+ }, z.core.$strip>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ type: z.ZodLiteral<"addon-routes">;
176
+ access: z.ZodArray<z.ZodEnum<{
177
+ create: "create";
178
+ delete: "delete";
179
+ view: "view";
180
+ }>>;
181
+ }, z.core.$strip>, z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
182
+ type: z.ZodLiteral<"category">;
183
+ target: z.ZodEnum<{
184
+ device: "device";
185
+ system: "system";
186
+ }>;
187
+ access: z.ZodArray<z.ZodEnum<{
188
+ create: "create";
189
+ delete: "delete";
190
+ view: "view";
191
+ }>>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ type: z.ZodLiteral<"capability">;
194
+ target: z.ZodString;
195
+ access: z.ZodArray<z.ZodEnum<{
196
+ create: "create";
197
+ delete: "delete";
198
+ view: "view";
199
+ }>>;
200
+ }, z.core.$strip>, z.ZodObject<{
201
+ type: z.ZodLiteral<"addon">;
202
+ target: z.ZodString;
203
+ access: z.ZodArray<z.ZodEnum<{
204
+ create: "create";
205
+ delete: "delete";
206
+ view: "view";
207
+ }>>;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ type: z.ZodLiteral<"device">;
210
+ selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
211
+ kind: z.ZodLiteral<"all">;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"ids">;
214
+ ids: z.ZodArray<z.ZodNumber>;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ kind: z.ZodLiteral<"types">;
217
+ types: z.ZodArray<z.ZodEnum<typeof import("../index.js").DeviceType>>;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ kind: z.ZodLiteral<"locations">;
220
+ locations: z.ZodArray<z.ZodString>;
221
+ }, z.core.$strip>], "kind">;
222
+ access: z.ZodArray<z.ZodEnum<{
223
+ create: "create";
224
+ delete: "delete";
225
+ view: "view";
226
+ }>>;
227
+ includeLinked: z.ZodOptional<z.ZodBoolean>;
228
+ }, z.core.$strip>], "type">>]>>;
229
+ }, z.core.$strip>;
230
+ export type CredentialTokenClaims = z.infer<typeof CredentialTokenClaimsSchema>;
package/dist/client.js CHANGED
@@ -558,6 +558,105 @@ zod.z.object({
558
558
  codec: zod.z.string().optional(),
559
559
  resolution: CamStreamResolutionSchema.optional()
560
560
  });
561
+ //#endregion
562
+ //#region src/device/device-type.ts
563
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
564
+ DeviceType["Camera"] = "camera";
565
+ DeviceType["Hub"] = "hub";
566
+ DeviceType["Light"] = "light";
567
+ DeviceType["Siren"] = "siren";
568
+ DeviceType["Switch"] = "switch";
569
+ DeviceType["Sensor"] = "sensor";
570
+ DeviceType["Thermostat"] = "thermostat";
571
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
572
+ * `climate-control` cap surface with `Thermostat` but renders a
573
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
574
+ * independent vertical/horizontal swing). Sources: native Gree, and
575
+ * reusable by other AC integrations. */
576
+ DeviceType["Climate"] = "climate";
577
+ DeviceType["Button"] = "button";
578
+ /** Generic stateless event emitter — carries a device's EXACT declared
579
+ * event vocabulary verbatim (no normalization). Installed with the
580
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
581
+ * HA bus events (e.g. `zha_event`, generic). */
582
+ DeviceType["EventEmitter"] = "event-emitter";
583
+ /** Firmware/software update entity — current vs available version,
584
+ * updatable flag, update state, and an install action. Installed with
585
+ * the `update` cap. Sources: Homematic firmware-update channels (and
586
+ * reusable by other providers, e.g. HA `update.*` entities). */
587
+ DeviceType["Update"] = "update";
588
+ DeviceType["Generic"] = "generic";
589
+ /** Generic notification delivery target (HA `notify.<service>`, future
590
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
591
+ * endpoint; the `notifier` cap defines the send surface. */
592
+ DeviceType["Notifier"] = "notifier";
593
+ /** Pre-recorded action sequence with optional parameters
594
+ * (HA `script.*`). Runnable via `script-runner` cap. */
595
+ DeviceType["Script"] = "script";
596
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
597
+ * trigger surface exposed via `automation-control` cap. */
598
+ DeviceType["Automation"] = "automation";
599
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
600
+ DeviceType["Lock"] = "lock";
601
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
602
+ * `valve.*`). `cover` cap with sub-roles for variant. */
603
+ DeviceType["Cover"] = "cover";
604
+ /** Pipe / water / gas valve with open/close/stop and optional
605
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
606
+ * modelled on the same open/closed lifecycle. */
607
+ DeviceType["Valve"] = "valve";
608
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
609
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
610
+ * modelled on the same target / mode lifecycle. */
611
+ DeviceType["Humidifier"] = "humidifier";
612
+ /** Water heater / boiler with target temperature + operation mode +
613
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
614
+ * climate-family actuator. */
615
+ DeviceType["WaterHeater"] = "water-heater";
616
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
617
+ DeviceType["Fan"] = "fan";
618
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
619
+ * the camera surface — those use `Camera`. `media-player` cap. */
620
+ DeviceType["MediaPlayer"] = "media-player";
621
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
622
+ * `alarm-panel` cap. */
623
+ DeviceType["AlarmPanel"] = "alarm-panel";
624
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
625
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
626
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
627
+ * TextControl / DateTimeControl. */
628
+ DeviceType["Control"] = "control";
629
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
630
+ * `presence` cap. */
631
+ DeviceType["Presence"] = "presence";
632
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
633
+ * `weather` cap. */
634
+ DeviceType["Weather"] = "weather";
635
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
636
+ DeviceType["Vacuum"] = "vacuum";
637
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
638
+ * `lawn-mower-control` cap. */
639
+ DeviceType["LawnMower"] = "lawn-mower";
640
+ /** Physical HA device group — parent container for entity-children
641
+ * adopted from a single HA device entry. Not renderable as a
642
+ * standalone device; exists only to anchor child entities. */
643
+ DeviceType["Container"] = "container";
644
+ /** Single still-image entity (HA `image.*`). Read-only display of an
645
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
646
+ DeviceType["Image"] = "image";
647
+ /** Smart pet feeder — cloud-connected food dispenser with a bowl food
648
+ * level, battery, desiccant life, feeding state and manual-feed /
649
+ * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
650
+ * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
651
+ * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
652
+ * integrations sharing the same food/desiccant/hopper surface. */
653
+ DeviceType["PetFeeder"] = "pet-feeder";
654
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
655
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
656
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
657
+ DeviceType["Dishwasher"] = "dishwasher";
658
+ return DeviceType;
659
+ }({});
561
660
  zod.z.enum(["new-session", "step-up"]);
562
661
  zod.z.enum(["en", "it"]);
563
662
  /** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
@@ -911,105 +1010,6 @@ function optionalMethod(input, output, options) {
911
1010
  };
912
1011
  }
913
1012
  //#endregion
914
- //#region src/device/device-type.ts
915
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
916
- DeviceType["Camera"] = "camera";
917
- DeviceType["Hub"] = "hub";
918
- DeviceType["Light"] = "light";
919
- DeviceType["Siren"] = "siren";
920
- DeviceType["Switch"] = "switch";
921
- DeviceType["Sensor"] = "sensor";
922
- DeviceType["Thermostat"] = "thermostat";
923
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
924
- * `climate-control` cap surface with `Thermostat` but renders a
925
- * dedicated AC-appropriate control UI (mode chips, fan speed,
926
- * independent vertical/horizontal swing). Sources: native Gree, and
927
- * reusable by other AC integrations. */
928
- DeviceType["Climate"] = "climate";
929
- DeviceType["Button"] = "button";
930
- /** Generic stateless event emitter — carries a device's EXACT declared
931
- * event vocabulary verbatim (no normalization). Installed with the
932
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
933
- * HA bus events (e.g. `zha_event`, generic). */
934
- DeviceType["EventEmitter"] = "event-emitter";
935
- /** Firmware/software update entity — current vs available version,
936
- * updatable flag, update state, and an install action. Installed with
937
- * the `update` cap. Sources: Homematic firmware-update channels (and
938
- * reusable by other providers, e.g. HA `update.*` entities). */
939
- DeviceType["Update"] = "update";
940
- DeviceType["Generic"] = "generic";
941
- /** Generic notification delivery target (HA `notify.<service>`, future
942
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
943
- * endpoint; the `notifier` cap defines the send surface. */
944
- DeviceType["Notifier"] = "notifier";
945
- /** Pre-recorded action sequence with optional parameters
946
- * (HA `script.*`). Runnable via `script-runner` cap. */
947
- DeviceType["Script"] = "script";
948
- /** Automation rule (HA `automation.*`) — enable/disable + manual
949
- * trigger surface exposed via `automation-control` cap. */
950
- DeviceType["Automation"] = "automation";
951
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
952
- DeviceType["Lock"] = "lock";
953
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
954
- * `valve.*`). `cover` cap with sub-roles for variant. */
955
- DeviceType["Cover"] = "cover";
956
- /** Pipe / water / gas valve with open/close/stop and optional
957
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
958
- * modelled on the same open/closed lifecycle. */
959
- DeviceType["Valve"] = "valve";
960
- /** Humidifier / dehumidifier with on/off + target humidity + mode
961
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
962
- * modelled on the same target / mode lifecycle. */
963
- DeviceType["Humidifier"] = "humidifier";
964
- /** Water heater / boiler with target temperature + operation mode +
965
- * away mode (HA `water_heater.*`). `water-heater` cap — a
966
- * climate-family actuator. */
967
- DeviceType["WaterHeater"] = "water-heater";
968
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
969
- DeviceType["Fan"] = "fan";
970
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
971
- * the camera surface — those use `Camera`. `media-player` cap. */
972
- DeviceType["MediaPlayer"] = "media-player";
973
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
974
- * `alarm-panel` cap. */
975
- DeviceType["AlarmPanel"] = "alarm-panel";
976
- /** Generic user-settable input (HA `number` / `input_number` / `select`
977
- * / `input_select` / `text` / `input_text` / `input_datetime`).
978
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
979
- * TextControl / DateTimeControl. */
980
- DeviceType["Control"] = "control";
981
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
982
- * `presence` cap. */
983
- DeviceType["Presence"] = "presence";
984
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
985
- * `weather` cap. */
986
- DeviceType["Weather"] = "weather";
987
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
988
- DeviceType["Vacuum"] = "vacuum";
989
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
990
- * `lawn-mower-control` cap. */
991
- DeviceType["LawnMower"] = "lawn-mower";
992
- /** Physical HA device group — parent container for entity-children
993
- * adopted from a single HA device entry. Not renderable as a
994
- * standalone device; exists only to anchor child entities. */
995
- DeviceType["Container"] = "container";
996
- /** Single still-image entity (HA `image.*`). Read-only display of an
997
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
998
- DeviceType["Image"] = "image";
999
- /** Smart pet feeder — cloud-connected food dispenser with a bowl food
1000
- * level, battery, desiccant life, feeding state and manual-feed /
1001
- * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
1002
- * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
1003
- * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
1004
- * integrations sharing the same food/desiccant/hopper surface. */
1005
- DeviceType["PetFeeder"] = "pet-feeder";
1006
- /** Built-in dishwasher — program lifecycle, door / remote-start gates,
1007
- * salt and rinse-aid levels. Installed with the `dishwasher` cap.
1008
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
1009
- DeviceType["Dishwasher"] = "dishwasher";
1010
- return DeviceType;
1011
- }({});
1012
- //#endregion
1013
1013
  //#region src/device/icon-catalog.generated.ts
1014
1014
  /** Lucide category ids, alphabetical. `ICON_META` indexes into this. */
1015
1015
  var ICON_CATEGORY_IDS = [
package/dist/client.mjs CHANGED
@@ -557,6 +557,105 @@ z.object({
557
557
  codec: z.string().optional(),
558
558
  resolution: CamStreamResolutionSchema.optional()
559
559
  });
560
+ //#endregion
561
+ //#region src/device/device-type.ts
562
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
563
+ DeviceType["Camera"] = "camera";
564
+ DeviceType["Hub"] = "hub";
565
+ DeviceType["Light"] = "light";
566
+ DeviceType["Siren"] = "siren";
567
+ DeviceType["Switch"] = "switch";
568
+ DeviceType["Sensor"] = "sensor";
569
+ DeviceType["Thermostat"] = "thermostat";
570
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
571
+ * `climate-control` cap surface with `Thermostat` but renders a
572
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
573
+ * independent vertical/horizontal swing). Sources: native Gree, and
574
+ * reusable by other AC integrations. */
575
+ DeviceType["Climate"] = "climate";
576
+ DeviceType["Button"] = "button";
577
+ /** Generic stateless event emitter — carries a device's EXACT declared
578
+ * event vocabulary verbatim (no normalization). Installed with the
579
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
580
+ * HA bus events (e.g. `zha_event`, generic). */
581
+ DeviceType["EventEmitter"] = "event-emitter";
582
+ /** Firmware/software update entity — current vs available version,
583
+ * updatable flag, update state, and an install action. Installed with
584
+ * the `update` cap. Sources: Homematic firmware-update channels (and
585
+ * reusable by other providers, e.g. HA `update.*` entities). */
586
+ DeviceType["Update"] = "update";
587
+ DeviceType["Generic"] = "generic";
588
+ /** Generic notification delivery target (HA `notify.<service>`, future
589
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
590
+ * endpoint; the `notifier` cap defines the send surface. */
591
+ DeviceType["Notifier"] = "notifier";
592
+ /** Pre-recorded action sequence with optional parameters
593
+ * (HA `script.*`). Runnable via `script-runner` cap. */
594
+ DeviceType["Script"] = "script";
595
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
596
+ * trigger surface exposed via `automation-control` cap. */
597
+ DeviceType["Automation"] = "automation";
598
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
599
+ DeviceType["Lock"] = "lock";
600
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
601
+ * `valve.*`). `cover` cap with sub-roles for variant. */
602
+ DeviceType["Cover"] = "cover";
603
+ /** Pipe / water / gas valve with open/close/stop and optional
604
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
605
+ * modelled on the same open/closed lifecycle. */
606
+ DeviceType["Valve"] = "valve";
607
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
608
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
609
+ * modelled on the same target / mode lifecycle. */
610
+ DeviceType["Humidifier"] = "humidifier";
611
+ /** Water heater / boiler with target temperature + operation mode +
612
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
613
+ * climate-family actuator. */
614
+ DeviceType["WaterHeater"] = "water-heater";
615
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
616
+ DeviceType["Fan"] = "fan";
617
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
618
+ * the camera surface — those use `Camera`. `media-player` cap. */
619
+ DeviceType["MediaPlayer"] = "media-player";
620
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
621
+ * `alarm-panel` cap. */
622
+ DeviceType["AlarmPanel"] = "alarm-panel";
623
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
624
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
625
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
626
+ * TextControl / DateTimeControl. */
627
+ DeviceType["Control"] = "control";
628
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
629
+ * `presence` cap. */
630
+ DeviceType["Presence"] = "presence";
631
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
632
+ * `weather` cap. */
633
+ DeviceType["Weather"] = "weather";
634
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
635
+ DeviceType["Vacuum"] = "vacuum";
636
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
637
+ * `lawn-mower-control` cap. */
638
+ DeviceType["LawnMower"] = "lawn-mower";
639
+ /** Physical HA device group — parent container for entity-children
640
+ * adopted from a single HA device entry. Not renderable as a
641
+ * standalone device; exists only to anchor child entities. */
642
+ DeviceType["Container"] = "container";
643
+ /** Single still-image entity (HA `image.*`). Read-only display of an
644
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
645
+ DeviceType["Image"] = "image";
646
+ /** Smart pet feeder — cloud-connected food dispenser with a bowl food
647
+ * level, battery, desiccant life, feeding state and manual-feed /
648
+ * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
649
+ * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
650
+ * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
651
+ * integrations sharing the same food/desiccant/hopper surface. */
652
+ DeviceType["PetFeeder"] = "pet-feeder";
653
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
654
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
655
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
656
+ DeviceType["Dishwasher"] = "dishwasher";
657
+ return DeviceType;
658
+ }({});
560
659
  z.enum(["new-session", "step-up"]);
561
660
  z.enum(["en", "it"]);
562
661
  /** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
@@ -910,105 +1009,6 @@ function optionalMethod(input, output, options) {
910
1009
  };
911
1010
  }
912
1011
  //#endregion
913
- //#region src/device/device-type.ts
914
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
915
- DeviceType["Camera"] = "camera";
916
- DeviceType["Hub"] = "hub";
917
- DeviceType["Light"] = "light";
918
- DeviceType["Siren"] = "siren";
919
- DeviceType["Switch"] = "switch";
920
- DeviceType["Sensor"] = "sensor";
921
- DeviceType["Thermostat"] = "thermostat";
922
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
923
- * `climate-control` cap surface with `Thermostat` but renders a
924
- * dedicated AC-appropriate control UI (mode chips, fan speed,
925
- * independent vertical/horizontal swing). Sources: native Gree, and
926
- * reusable by other AC integrations. */
927
- DeviceType["Climate"] = "climate";
928
- DeviceType["Button"] = "button";
929
- /** Generic stateless event emitter — carries a device's EXACT declared
930
- * event vocabulary verbatim (no normalization). Installed with the
931
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
932
- * HA bus events (e.g. `zha_event`, generic). */
933
- DeviceType["EventEmitter"] = "event-emitter";
934
- /** Firmware/software update entity — current vs available version,
935
- * updatable flag, update state, and an install action. Installed with
936
- * the `update` cap. Sources: Homematic firmware-update channels (and
937
- * reusable by other providers, e.g. HA `update.*` entities). */
938
- DeviceType["Update"] = "update";
939
- DeviceType["Generic"] = "generic";
940
- /** Generic notification delivery target (HA `notify.<service>`, future
941
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
942
- * endpoint; the `notifier` cap defines the send surface. */
943
- DeviceType["Notifier"] = "notifier";
944
- /** Pre-recorded action sequence with optional parameters
945
- * (HA `script.*`). Runnable via `script-runner` cap. */
946
- DeviceType["Script"] = "script";
947
- /** Automation rule (HA `automation.*`) — enable/disable + manual
948
- * trigger surface exposed via `automation-control` cap. */
949
- DeviceType["Automation"] = "automation";
950
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
951
- DeviceType["Lock"] = "lock";
952
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
953
- * `valve.*`). `cover` cap with sub-roles for variant. */
954
- DeviceType["Cover"] = "cover";
955
- /** Pipe / water / gas valve with open/close/stop and optional
956
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
957
- * modelled on the same open/closed lifecycle. */
958
- DeviceType["Valve"] = "valve";
959
- /** Humidifier / dehumidifier with on/off + target humidity + mode
960
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
961
- * modelled on the same target / mode lifecycle. */
962
- DeviceType["Humidifier"] = "humidifier";
963
- /** Water heater / boiler with target temperature + operation mode +
964
- * away mode (HA `water_heater.*`). `water-heater` cap — a
965
- * climate-family actuator. */
966
- DeviceType["WaterHeater"] = "water-heater";
967
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
968
- DeviceType["Fan"] = "fan";
969
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
970
- * the camera surface — those use `Camera`. `media-player` cap. */
971
- DeviceType["MediaPlayer"] = "media-player";
972
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
973
- * `alarm-panel` cap. */
974
- DeviceType["AlarmPanel"] = "alarm-panel";
975
- /** Generic user-settable input (HA `number` / `input_number` / `select`
976
- * / `input_select` / `text` / `input_text` / `input_datetime`).
977
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
978
- * TextControl / DateTimeControl. */
979
- DeviceType["Control"] = "control";
980
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
981
- * `presence` cap. */
982
- DeviceType["Presence"] = "presence";
983
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
984
- * `weather` cap. */
985
- DeviceType["Weather"] = "weather";
986
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
987
- DeviceType["Vacuum"] = "vacuum";
988
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
989
- * `lawn-mower-control` cap. */
990
- DeviceType["LawnMower"] = "lawn-mower";
991
- /** Physical HA device group — parent container for entity-children
992
- * adopted from a single HA device entry. Not renderable as a
993
- * standalone device; exists only to anchor child entities. */
994
- DeviceType["Container"] = "container";
995
- /** Single still-image entity (HA `image.*`). Read-only display of an
996
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
997
- DeviceType["Image"] = "image";
998
- /** Smart pet feeder — cloud-connected food dispenser with a bowl food
999
- * level, battery, desiccant life, feeding state and manual-feed /
1000
- * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
1001
- * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
1002
- * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
1003
- * integrations sharing the same food/desiccant/hopper surface. */
1004
- DeviceType["PetFeeder"] = "pet-feeder";
1005
- /** Built-in dishwasher — program lifecycle, door / remote-start gates,
1006
- * salt and rinse-aid levels. Installed with the `dishwasher` cap.
1007
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
1008
- DeviceType["Dishwasher"] = "dishwasher";
1009
- return DeviceType;
1010
- }({});
1011
- //#endregion
1012
1012
  //#region src/device/icon-catalog.generated.ts
1013
1013
  /** Lucide category ids, alphabetical. `ICON_META` indexes into this. */
1014
1014
  var ICON_CATEGORY_IDS = [
package/dist/index.d.ts CHANGED
@@ -151,6 +151,7 @@ export type { AvailableEngine, PipelineAddonSchema, PipelineDefaultStep, Pipelin
151
151
  export * from './types/pipeline-step.js';
152
152
  export * from './types/tracked.js';
153
153
  export { type BearerPayloadShape, type BearerPrincipal, classifyBearerPrincipal, methodAccessForHttpMethod, type PrincipalAddonReachInput, type PrincipalAddonReachVerdict, principalMayReachAddon, scopesAllowAddon, scopesAllowDeviceCap, } from './auth/principal-scope.js';
154
+ export { ADMIN_SCOPE, ALL_METHOD_ACCESS, type AddonRoutesScope, AddonRoutesScopeSchema, capabilityScopesOf, CREDENTIAL_TOKEN_KIND, type CredentialScope, CredentialScopeSchema, type CredentialTokenClaims, CredentialTokenClaimsSchema, parseCredentialScopes, SHARE_VIEW_MAX_DEVICES, scopesAllowAddonRoutes, scopesGrantAdmin, type ShareViewGrant, ShareViewGrantSchema, type ShareViewScope, ShareViewScopeSchema, shareViewGrantOf, } from './auth/credential-scope.js';
154
155
  export { APP_AUTH_CALLBACK_MAX_LENGTH, APP_AUTH_CALLBACK_URLS, canonicalizeAppCallback, hasUrlScheme, parseAppAuthCallback, } from './auth/app-callback.js';
155
156
  export { APP_FLOW_DEFAULT_REDIRECT, APP_FLOW_REFUSAL_MESSAGES, APP_FLOW_STATE_PREFIX, APP_REFUSED_PATH, APP_START_REFUSAL_MESSAGES, type AppFlowParse, type AppFlowPurpose, AppFlowPurposeSchema, type AppFlowRefusal, type AppFlowRequest, type AppPageLang, AppPageLangSchema, type AppLoginPath, AppLoginPathSchema, type AppStartRefusal, appFlowLocation, isAppStartRefusal, parseAppFlowRequest, parseAppPageLang, } from './auth/app-flow.js';
156
157
  export { SSO_STATE_COOKIE, SSO_STATE_COOKIE_MAX_AGE_SEC } from './auth/sso-state.js';