@camstack/types 1.2.26 → 1.2.28

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.
@@ -145,6 +145,92 @@ export type NcZoneCondition = z.infer<typeof NcZoneConditionSchema>;
145
145
  * The P1 condition set — a flat AND of groups; absent group = pass;
146
146
  * membership lists are OR within the list (spec §2.3).
147
147
  */
148
+ /**
149
+ * What a rule may actuate.
150
+ *
151
+ * **No hand-maintained allowlist** (operator decision, and the right one — a
152
+ * written list of methods is a third parallel map to keep aligned, and this
153
+ * repo has paid for those). The boundary instead comes from a property the
154
+ * capabilities already carry: an action may target only a **device-scoped**
155
+ * capability method.
156
+ *
157
+ * That is not decoration. A rule can be authored by a NON-ADMIN — personal
158
+ * rules are a supported flow — and the executor runs with the addon's
159
+ * privileges, so an unbounded action is an arbitrary RPC channel with a
160
+ * privilege escalation attached. Restricting to device scope excludes the
161
+ * system caps (`device-manager.removeDevice` and friends) by construction,
162
+ * costs nothing to maintain, and cannot rot: a cap that stops being
163
+ * device-scoped stops being actuatable in the same change.
164
+ *
165
+ * The executor enforces it; {@link NcRuleActionSchema} carries the intent.
166
+ */
167
+ /**
168
+ * One step of a sequence.
169
+ *
170
+ * `wait` is a first-class step rather than a property of the next action: it is
171
+ * what makes a sequence a SEQUENCE and not a list — "unlock, wait 5s, open"
172
+ * cannot be expressed otherwise.
173
+ */
174
+ export declare const NcRuleActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
175
+ kind: z.ZodLiteral<"wait">;
176
+ seconds: z.ZodNumber;
177
+ }, z.core.$strip>, z.ZodObject<{
178
+ kind: z.ZodLiteral<"cap">;
179
+ deviceId: z.ZodNumber;
180
+ cap: z.ZodString;
181
+ method: z.ZodString;
182
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
183
+ }, z.core.$strip>], "kind">;
184
+ export type NcRuleAction = z.infer<typeof NcRuleActionSchema>;
185
+ /**
186
+ * A named, ordered run of steps with its own throttle.
187
+ *
188
+ * `minDelaySec` exists because a noisy rule otherwise hammers a physical
189
+ * actuator — the rule's own cooldown governs NOTIFICATIONS, which is a
190
+ * different budget from "how often may this gate actually open".
191
+ */
192
+ export declare const NcRuleActionSequenceSchema: z.ZodObject<{
193
+ name: z.ZodString;
194
+ enabled: z.ZodBoolean;
195
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
196
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
197
+ kind: z.ZodLiteral<"wait">;
198
+ seconds: z.ZodNumber;
199
+ }, z.core.$strip>, z.ZodObject<{
200
+ kind: z.ZodLiteral<"cap">;
201
+ deviceId: z.ZodNumber;
202
+ cap: z.ZodString;
203
+ method: z.ZodString;
204
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
205
+ }, z.core.$strip>], "kind">>;
206
+ }, z.core.$strip>;
207
+ export type NcRuleActionSequence = z.infer<typeof NcRuleActionSequenceSchema>;
208
+ /**
209
+ * Sequences a rule runs, by hook point.
210
+ *
211
+ * ONLY `onTrigger` is here, deliberately. The reference also has activation /
212
+ * deactivation / reset / post-generation hooks, and they are wanted — but this
213
+ * repo's expensive failure mode is declaring a surface nothing produces, so a
214
+ * hook appears here in the same change that produces its edge, never before.
215
+ */
216
+ export declare const NcRuleActionsSchema: z.ZodObject<{
217
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ name: z.ZodString;
219
+ enabled: z.ZodBoolean;
220
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
221
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
222
+ kind: z.ZodLiteral<"wait">;
223
+ seconds: z.ZodNumber;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ kind: z.ZodLiteral<"cap">;
226
+ deviceId: z.ZodNumber;
227
+ cap: z.ZodString;
228
+ method: z.ZodString;
229
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
230
+ }, z.core.$strip>], "kind">>;
231
+ }, z.core.$strip>>>;
232
+ }, z.core.$strip>;
233
+ export type NcRuleActions = z.infer<typeof NcRuleActionsSchema>;
148
234
  /**
149
235
  * "This rule applies only while `deviceId` is in one of `states`."
150
236
  *
@@ -447,6 +533,23 @@ export declare const NcRuleInputSchema: z.ZodObject<{
447
533
  priority: z.ZodDefault<z.ZodNumber>;
448
534
  ownerUserId: z.ZodOptional<z.ZodString>;
449
535
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
536
+ actions: z.ZodOptional<z.ZodObject<{
537
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
538
+ name: z.ZodString;
539
+ enabled: z.ZodBoolean;
540
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
541
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
542
+ kind: z.ZodLiteral<"wait">;
543
+ seconds: z.ZodNumber;
544
+ }, z.core.$strip>, z.ZodObject<{
545
+ kind: z.ZodLiteral<"cap">;
546
+ deviceId: z.ZodNumber;
547
+ cap: z.ZodString;
548
+ method: z.ZodString;
549
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
550
+ }, z.core.$strip>], "kind">>;
551
+ }, z.core.$strip>>>;
552
+ }, z.core.$strip>>;
450
553
  }, z.core.$strip>;
451
554
  export type NcRuleInput = z.infer<typeof NcRuleInputSchema>;
452
555
  /**
@@ -588,6 +691,23 @@ export declare const NcRulePatchSchema: z.ZodObject<{
588
691
  priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
589
692
  ownerUserId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
590
693
  snoozeAllowGlobal: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
694
+ actions: z.ZodOptional<z.ZodOptional<z.ZodObject<{
695
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
696
+ name: z.ZodString;
697
+ enabled: z.ZodBoolean;
698
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
699
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
700
+ kind: z.ZodLiteral<"wait">;
701
+ seconds: z.ZodNumber;
702
+ }, z.core.$strip>, z.ZodObject<{
703
+ kind: z.ZodLiteral<"cap">;
704
+ deviceId: z.ZodNumber;
705
+ cap: z.ZodString;
706
+ method: z.ZodString;
707
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
708
+ }, z.core.$strip>], "kind">>;
709
+ }, z.core.$strip>>>;
710
+ }, z.core.$strip>>>;
591
711
  disabledTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
592
712
  }, z.core.$strip>;
593
713
  export type NcRulePatch = z.infer<typeof NcRulePatchSchema>;
@@ -722,6 +842,23 @@ export declare const NcRuleSchema: z.ZodObject<{
722
842
  priority: z.ZodDefault<z.ZodNumber>;
723
843
  ownerUserId: z.ZodOptional<z.ZodString>;
724
844
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
845
+ actions: z.ZodOptional<z.ZodObject<{
846
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
847
+ name: z.ZodString;
848
+ enabled: z.ZodBoolean;
849
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
850
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
851
+ kind: z.ZodLiteral<"wait">;
852
+ seconds: z.ZodNumber;
853
+ }, z.core.$strip>, z.ZodObject<{
854
+ kind: z.ZodLiteral<"cap">;
855
+ deviceId: z.ZodNumber;
856
+ cap: z.ZodString;
857
+ method: z.ZodString;
858
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
859
+ }, z.core.$strip>], "kind">>;
860
+ }, z.core.$strip>>>;
861
+ }, z.core.$strip>>;
725
862
  id: z.ZodString;
726
863
  createdBy: z.ZodString;
727
864
  createdAt: z.ZodNumber;
@@ -1108,6 +1245,23 @@ export declare const notificationRulesCapability: {
1108
1245
  priority: z.ZodDefault<z.ZodNumber>;
1109
1246
  ownerUserId: z.ZodOptional<z.ZodString>;
1110
1247
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
1248
+ actions: z.ZodOptional<z.ZodObject<{
1249
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
1250
+ name: z.ZodString;
1251
+ enabled: z.ZodBoolean;
1252
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
1253
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1254
+ kind: z.ZodLiteral<"wait">;
1255
+ seconds: z.ZodNumber;
1256
+ }, z.core.$strip>, z.ZodObject<{
1257
+ kind: z.ZodLiteral<"cap">;
1258
+ deviceId: z.ZodNumber;
1259
+ cap: z.ZodString;
1260
+ method: z.ZodString;
1261
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1262
+ }, z.core.$strip>], "kind">>;
1263
+ }, z.core.$strip>>>;
1264
+ }, z.core.$strip>>;
1111
1265
  id: z.ZodString;
1112
1266
  createdBy: z.ZodString;
1113
1267
  createdAt: z.ZodNumber;
@@ -1248,6 +1402,23 @@ export declare const notificationRulesCapability: {
1248
1402
  priority: z.ZodDefault<z.ZodNumber>;
1249
1403
  ownerUserId: z.ZodOptional<z.ZodString>;
1250
1404
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
1405
+ actions: z.ZodOptional<z.ZodObject<{
1406
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
1407
+ name: z.ZodString;
1408
+ enabled: z.ZodBoolean;
1409
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
1410
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1411
+ kind: z.ZodLiteral<"wait">;
1412
+ seconds: z.ZodNumber;
1413
+ }, z.core.$strip>, z.ZodObject<{
1414
+ kind: z.ZodLiteral<"cap">;
1415
+ deviceId: z.ZodNumber;
1416
+ cap: z.ZodString;
1417
+ method: z.ZodString;
1418
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1419
+ }, z.core.$strip>], "kind">>;
1420
+ }, z.core.$strip>>>;
1421
+ }, z.core.$strip>>;
1251
1422
  id: z.ZodString;
1252
1423
  createdBy: z.ZodString;
1253
1424
  createdAt: z.ZodNumber;
@@ -1386,6 +1557,23 @@ export declare const notificationRulesCapability: {
1386
1557
  priority: z.ZodDefault<z.ZodNumber>;
1387
1558
  ownerUserId: z.ZodOptional<z.ZodString>;
1388
1559
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
1560
+ actions: z.ZodOptional<z.ZodObject<{
1561
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
1562
+ name: z.ZodString;
1563
+ enabled: z.ZodBoolean;
1564
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
1565
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1566
+ kind: z.ZodLiteral<"wait">;
1567
+ seconds: z.ZodNumber;
1568
+ }, z.core.$strip>, z.ZodObject<{
1569
+ kind: z.ZodLiteral<"cap">;
1570
+ deviceId: z.ZodNumber;
1571
+ cap: z.ZodString;
1572
+ method: z.ZodString;
1573
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1574
+ }, z.core.$strip>], "kind">>;
1575
+ }, z.core.$strip>>>;
1576
+ }, z.core.$strip>>;
1389
1577
  }, z.core.$strip>;
1390
1578
  }, z.core.$strip>, z.ZodObject<{
1391
1579
  rule: z.ZodObject<{
@@ -1518,6 +1706,23 @@ export declare const notificationRulesCapability: {
1518
1706
  priority: z.ZodDefault<z.ZodNumber>;
1519
1707
  ownerUserId: z.ZodOptional<z.ZodString>;
1520
1708
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
1709
+ actions: z.ZodOptional<z.ZodObject<{
1710
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
1711
+ name: z.ZodString;
1712
+ enabled: z.ZodBoolean;
1713
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
1714
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1715
+ kind: z.ZodLiteral<"wait">;
1716
+ seconds: z.ZodNumber;
1717
+ }, z.core.$strip>, z.ZodObject<{
1718
+ kind: z.ZodLiteral<"cap">;
1719
+ deviceId: z.ZodNumber;
1720
+ cap: z.ZodString;
1721
+ method: z.ZodString;
1722
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1723
+ }, z.core.$strip>], "kind">>;
1724
+ }, z.core.$strip>>>;
1725
+ }, z.core.$strip>>;
1521
1726
  id: z.ZodString;
1522
1727
  createdBy: z.ZodString;
1523
1728
  createdAt: z.ZodNumber;
@@ -1659,6 +1864,23 @@ export declare const notificationRulesCapability: {
1659
1864
  priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1660
1865
  ownerUserId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1661
1866
  snoozeAllowGlobal: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1867
+ actions: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1868
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
1869
+ name: z.ZodString;
1870
+ enabled: z.ZodBoolean;
1871
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
1872
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1873
+ kind: z.ZodLiteral<"wait">;
1874
+ seconds: z.ZodNumber;
1875
+ }, z.core.$strip>, z.ZodObject<{
1876
+ kind: z.ZodLiteral<"cap">;
1877
+ deviceId: z.ZodNumber;
1878
+ cap: z.ZodString;
1879
+ method: z.ZodString;
1880
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1881
+ }, z.core.$strip>], "kind">>;
1882
+ }, z.core.$strip>>>;
1883
+ }, z.core.$strip>>>;
1662
1884
  disabledTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1663
1885
  }, z.core.$strip>;
1664
1886
  }, z.core.$strip>, z.ZodObject<{
@@ -1792,6 +2014,23 @@ export declare const notificationRulesCapability: {
1792
2014
  priority: z.ZodDefault<z.ZodNumber>;
1793
2015
  ownerUserId: z.ZodOptional<z.ZodString>;
1794
2016
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
2017
+ actions: z.ZodOptional<z.ZodObject<{
2018
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
2019
+ name: z.ZodString;
2020
+ enabled: z.ZodBoolean;
2021
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
2022
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2023
+ kind: z.ZodLiteral<"wait">;
2024
+ seconds: z.ZodNumber;
2025
+ }, z.core.$strip>, z.ZodObject<{
2026
+ kind: z.ZodLiteral<"cap">;
2027
+ deviceId: z.ZodNumber;
2028
+ cap: z.ZodString;
2029
+ method: z.ZodString;
2030
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2031
+ }, z.core.$strip>], "kind">>;
2032
+ }, z.core.$strip>>>;
2033
+ }, z.core.$strip>>;
1795
2034
  id: z.ZodString;
1796
2035
  createdBy: z.ZodString;
1797
2036
  createdAt: z.ZodNumber;
@@ -1948,6 +2187,23 @@ export declare const notificationRulesCapability: {
1948
2187
  priority: z.ZodDefault<z.ZodNumber>;
1949
2188
  ownerUserId: z.ZodOptional<z.ZodString>;
1950
2189
  snoozeAllowGlobal: z.ZodOptional<z.ZodBoolean>;
2190
+ actions: z.ZodOptional<z.ZodObject<{
2191
+ onTrigger: z.ZodOptional<z.ZodArray<z.ZodObject<{
2192
+ name: z.ZodString;
2193
+ enabled: z.ZodBoolean;
2194
+ minDelaySec: z.ZodOptional<z.ZodNumber>;
2195
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2196
+ kind: z.ZodLiteral<"wait">;
2197
+ seconds: z.ZodNumber;
2198
+ }, z.core.$strip>, z.ZodObject<{
2199
+ kind: z.ZodLiteral<"cap">;
2200
+ deviceId: z.ZodNumber;
2201
+ cap: z.ZodString;
2202
+ method: z.ZodString;
2203
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2204
+ }, z.core.$strip>], "kind">>;
2205
+ }, z.core.$strip>>>;
2206
+ }, z.core.$strip>>;
1951
2207
  }, z.core.$strip>;
1952
2208
  lookbackMinutes: z.ZodDefault<z.ZodNumber>;
1953
2209
  }, z.core.$strip>, z.ZodObject<{
@@ -67,10 +67,10 @@ export declare const PrivacyMaskStatusSchema: z.ZodObject<{
67
67
  export declare const PrivacyMaskOptionsSchema: z.ZodObject<{
68
68
  maxRegions: z.ZodNumber;
69
69
  supportedShapes: z.ZodArray<z.ZodEnum<{
70
+ line: "line";
70
71
  polygon: "polygon";
71
72
  rect: "rect";
72
73
  grid: "grid";
73
- line: "line";
74
74
  }>>;
75
75
  polygonVertices: z.ZodOptional<z.ZodObject<{
76
76
  min: z.ZodNumber;
@@ -123,10 +123,10 @@ export declare const privacyMaskCapability: {
123
123
  }, z.core.$strip>, z.ZodObject<{
124
124
  maxRegions: z.ZodNumber;
125
125
  supportedShapes: z.ZodArray<z.ZodEnum<{
126
+ line: "line";
126
127
  polygon: "polygon";
127
128
  rect: "rect";
128
129
  grid: "grid";
129
- line: "line";
130
130
  }>>;
131
131
  polygonVertices: z.ZodOptional<z.ZodObject<{
132
132
  min: z.ZodNumber;
@@ -28,6 +28,7 @@ import type { climateControlCapability } from '../capabilities/climate-control.c
28
28
  import type { colorCapability } from '../capabilities/color.cap.js';
29
29
  import type { consumablesCapability } from '../capabilities/consumables.cap.js';
30
30
  import type { controlCapability } from '../capabilities/control.cap.js';
31
+ import type { coreBlocksCapability } from '../capabilities/core-blocks.cap.js';
31
32
  import type { coverCapability } from '../capabilities/cover.cap.js';
32
33
  import type { customModelRegistryCapability } from '../capabilities/custom-model-registry.cap.js';
33
34
  import type { dataStoreProviderCapability } from '../capabilities/data-store-provider.cap.js';
@@ -1390,6 +1391,69 @@ export type AppRouter = TrpcCoreRouter<{
1390
1391
  meta: object;
1391
1392
  }>;
1392
1393
  }>>;
1394
+ coreBlocks: TRPCBuiltRouter<{
1395
+ ctx: TrpcContext;
1396
+ meta: object;
1397
+ errorShape: AugmentedErrorShape;
1398
+ transformer: true;
1399
+ }, TRPCDecorateCreateRouterOptions<{
1400
+ list: TRPCQueryProcedure<{
1401
+ input: {
1402
+ [x: string]: unknown;
1403
+ } & z.input<typeof coreBlocksCapability.methods.list.input>;
1404
+ output: z.infer<typeof coreBlocksCapability.methods.list.output>;
1405
+ meta: object;
1406
+ }>;
1407
+ get: TRPCQueryProcedure<{
1408
+ input: {
1409
+ [x: string]: unknown;
1410
+ } & z.input<typeof coreBlocksCapability.methods.get.input>;
1411
+ output: z.infer<typeof coreBlocksCapability.methods.get.output>;
1412
+ meta: object;
1413
+ }>;
1414
+ create: TRPCMutationProcedure<{
1415
+ input: {
1416
+ [x: string]: unknown;
1417
+ } & z.input<typeof coreBlocksCapability.methods.create.input>;
1418
+ output: z.infer<typeof coreBlocksCapability.methods.create.output>;
1419
+ meta: object;
1420
+ }>;
1421
+ update: TRPCMutationProcedure<{
1422
+ input: {
1423
+ [x: string]: unknown;
1424
+ } & z.input<typeof coreBlocksCapability.methods.update.input>;
1425
+ output: z.infer<typeof coreBlocksCapability.methods.update.output>;
1426
+ meta: object;
1427
+ }>;
1428
+ delete: TRPCMutationProcedure<{
1429
+ input: {
1430
+ [x: string]: unknown;
1431
+ } & z.input<typeof coreBlocksCapability.methods.delete.input>;
1432
+ output: z.infer<typeof coreBlocksCapability.methods.delete.output>;
1433
+ meta: object;
1434
+ }>;
1435
+ setEnabled: TRPCMutationProcedure<{
1436
+ input: {
1437
+ [x: string]: unknown;
1438
+ } & z.input<typeof coreBlocksCapability.methods.setEnabled.input>;
1439
+ output: z.infer<typeof coreBlocksCapability.methods.setEnabled.output>;
1440
+ meta: object;
1441
+ }>;
1442
+ compile: TRPCMutationProcedure<{
1443
+ input: {
1444
+ [x: string]: unknown;
1445
+ } & z.input<typeof coreBlocksCapability.methods.compile.input>;
1446
+ output: z.infer<typeof coreBlocksCapability.methods.compile.output>;
1447
+ meta: object;
1448
+ }>;
1449
+ getTypeDefs: TRPCQueryProcedure<{
1450
+ input: {
1451
+ [x: string]: unknown;
1452
+ } & z.input<typeof coreBlocksCapability.methods.getTypeDefs.input>;
1453
+ output: z.infer<typeof coreBlocksCapability.methods.getTypeDefs.output>;
1454
+ meta: object;
1455
+ }>;
1456
+ }>>;
1393
1457
  cover: TRPCBuiltRouter<{
1394
1458
  ctx: TrpcContext;
1395
1459
  meta: object;
@@ -33,6 +33,7 @@ export { connectivityCapability } from '../capabilities/connectivity.cap.js';
33
33
  export { consumablesCapability } from '../capabilities/consumables.cap.js';
34
34
  export { contactCapability } from '../capabilities/contact.cap.js';
35
35
  export { controlCapability } from '../capabilities/control.cap.js';
36
+ export { coreBlocksCapability } from '../capabilities/core-blocks.cap.js';
36
37
  export { coverCapability } from '../capabilities/cover.cap.js';
37
38
  export { customModelRegistryCapability } from '../capabilities/custom-model-registry.cap.js';
38
39
  export { dataStoreProviderCapability } from '../capabilities/data-store-provider.cap.js';
@@ -178,6 +179,7 @@ export declare const CAPABILITY_NAMES: {
178
179
  readonly consumables: "consumables";
179
180
  readonly contact: "contact";
180
181
  readonly control: "control";
182
+ readonly coreBlocks: "core-blocks";
181
183
  readonly cover: "cover";
182
184
  readonly customModelRegistry: "custom-model-registry";
183
185
  readonly dataStoreProvider: "data-store-provider";
@@ -336,6 +338,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
336
338
  readonly consumables: TRouter;
337
339
  readonly contact: TRouter;
338
340
  readonly control: TRouter;
341
+ readonly coreBlocks: TRouter;
339
342
  readonly cover: TRouter;
340
343
  readonly customModelRegistry: TRouter;
341
344
  readonly dataStoreProvider: TRouter;
@@ -446,8 +449,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
446
449
  readonly zoneRules: TRouter;
447
450
  readonly zones: TRouter;
448
451
  }
449
- /** Capability names whose mode is `singleton` (121 caps). */
450
- export declare const SINGLETON_CAPABILITY_NAMES: readonly ["accessories", "addon-pages", "addon-settings", "addon-widgets", "addons", "admin-ui", "air-quality-sensor", "alarm-panel", "alerts", "ambient-light-sensor", "audio-analysis", "audio-analyzer", "audio-codec", "audio-metrics", "automation-control", "backup", "battery", "binary", "brightness", "button", "camera-credentials", "camera-pipeline-config", "camera-streams", "carbon-monoxide", "climate-control", "color", "connectivity", "consumables", "contact", "control", "cover", "day-night", "decoder", "detection-pipeline", "device-adoption", "device-discovery", "device-manager", "device-ops", "device-state", "device-status", "doorbell", "enum-sensor", "event-emitter", "events", "face-gallery", "fan-control", "feature-probe", "filesystem-browse", "flood", "gas", "humidifier", "humidity-sensor", "image", "image-settings", "integrations", "intercom", "lawn-mower-control", "llm-runtime", "local-network", "lock-control", "media-player", "metrics-provider", "model-convert", "model-distributor", "motion", "motion-detection", "motion-trigger", "motion-zones", "native-object-detection", "network-quality", "nodes", "notification-rules", "notifier", "numeric-sensor", "osd", "pet-feeder", "pipeline-analytics", "pipeline-executor", "pipeline-orchestrator", "pipeline-runner", "plate-gallery", "platform-probe", "power-meter", "presence", "pressure-sensor", "privacy-mask", "ptz", "ptz-autotrack", "reboot", "recording", "recordingExport", "scene-monitor", "script-runner", "server-management", "settings-store", "smoke", "snapshot", "sso-bridge", "storage", "stream-broker", "stream-catalog", "stream-params", "switch", "system", "tamper", "temperature-sensor", "terminal-session", "toast", "update", "user-management", "vacuum-control", "valve", "vibration", "videoclips", "viewer-ui", "water-heater", "weather", "webrtc-session", "zone-analytics", "zone-rules", "zones"];
452
+ /** Capability names whose mode is `singleton` (122 caps). */
453
+ export declare const SINGLETON_CAPABILITY_NAMES: readonly ["accessories", "addon-pages", "addon-settings", "addon-widgets", "addons", "admin-ui", "air-quality-sensor", "alarm-panel", "alerts", "ambient-light-sensor", "audio-analysis", "audio-analyzer", "audio-codec", "audio-metrics", "automation-control", "backup", "battery", "binary", "brightness", "button", "camera-credentials", "camera-pipeline-config", "camera-streams", "carbon-monoxide", "climate-control", "color", "connectivity", "consumables", "contact", "control", "core-blocks", "cover", "day-night", "decoder", "detection-pipeline", "device-adoption", "device-discovery", "device-manager", "device-ops", "device-state", "device-status", "doorbell", "enum-sensor", "event-emitter", "events", "face-gallery", "fan-control", "feature-probe", "filesystem-browse", "flood", "gas", "humidifier", "humidity-sensor", "image", "image-settings", "integrations", "intercom", "lawn-mower-control", "llm-runtime", "local-network", "lock-control", "media-player", "metrics-provider", "model-convert", "model-distributor", "motion", "motion-detection", "motion-trigger", "motion-zones", "native-object-detection", "network-quality", "nodes", "notification-rules", "notifier", "numeric-sensor", "osd", "pet-feeder", "pipeline-analytics", "pipeline-executor", "pipeline-orchestrator", "pipeline-runner", "plate-gallery", "platform-probe", "power-meter", "presence", "pressure-sensor", "privacy-mask", "ptz", "ptz-autotrack", "reboot", "recording", "recordingExport", "scene-monitor", "script-runner", "server-management", "settings-store", "smoke", "snapshot", "sso-bridge", "storage", "stream-broker", "stream-catalog", "stream-params", "switch", "system", "tamper", "temperature-sensor", "terminal-session", "toast", "update", "user-management", "vacuum-control", "valve", "vibration", "videoclips", "viewer-ui", "water-heater", "weather", "webrtc-session", "zone-analytics", "zone-rules", "zones"];
451
454
  /** Union of singleton capability names (literal string union). */
452
455
  export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
453
456
  /** Capability names whose mode is `collection` (23 caps). */
@@ -0,0 +1,20 @@
1
+ /**
2
+ * AUTO-GENERATED by scripts/generate-device-scoped-caps.ts — DO NOT EDIT.
3
+ *
4
+ * Every `scope: 'device'` capability name, as plain data — so a forked runner
5
+ * can answer "may a rule actuate this?" without importing the schema barrel
6
+ * (~144MB RSS per runner, D28).
7
+ *
8
+ * Coverage: 80 device-scoped capabilities.
9
+ */
10
+ export declare const DEVICE_SCOPED_CAPS: ReadonlySet<string>;
11
+ /**
12
+ * True when `capName` is a device capability.
13
+ *
14
+ * This is the ONLY boundary on what a notification rule may actuate. A rule can
15
+ * be authored by a non-admin and the runner executes with the addon's
16
+ * privileges, so an unbounded action would be an arbitrary RPC channel with a
17
+ * privilege escalation attached. Device scope excludes the system caps
18
+ * (`device-manager.removeDevice` and friends) by construction.
19
+ */
20
+ export declare function isDeviceScopedCap(capName: string): boolean;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 844 method paths across 118 capabilities.
9
+ * Coverage: 852 method paths across 119 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -9,6 +9,7 @@ import type { audioAnalyzerCapability } from '../capabilities/audio-analyzer.cap
9
9
  import type { audioCodecCapability } from '../capabilities/audio-codec.cap.js';
10
10
  import type { backupCapability } from '../capabilities/backup.cap.js';
11
11
  import type { brokerCapability } from '../capabilities/broker.cap.js';
12
+ import type { coreBlocksCapability } from '../capabilities/core-blocks.cap.js';
12
13
  import type { decoderCapability } from '../capabilities/decoder.cap.js';
13
14
  import type { deviceAdoptionCapability } from '../capabilities/device-adoption.cap.js';
14
15
  import type { deviceExportCapability } from '../capabilities/device-export.cap.js';
@@ -59,6 +60,7 @@ export interface SystemProxy {
59
60
  readonly audioCodec: Pick<InferProvider<typeof audioCodecCapability>, 'listSupportedCodecs' | 'canHandle' | 'createDecodeSession' | 'createEncodeSession' | 'closeSession' | 'pushEncodedFrame' | 'pullPcm' | 'pushPcm' | 'pullEncoded' | 'flushEncode' | 'listActiveSessions'>;
60
61
  readonly backup: Pick<InferProvider<typeof backupCapability>, 'listDestinations' | 'trigger' | 'list' | 'listLocations' | 'getEntries' | 'restore' | 'delete' | 'listArchives' | 'upsertDestinationPolicy' | 'previewSchedule' | 'listSchedules' | 'upsertSchedule' | 'deleteSchedule'>;
61
62
  readonly broker: Pick<InferProvider<typeof brokerCapability>, 'list' | 'get' | 'listProviders' | 'add' | 'remove' | 'testConnection' | 'getSettings' | 'setSettings' | 'getBrokerConfig' | 'getSettingsSchema' | 'testSettings' | 'publish' | 'subscribe' | 'unsubscribe' | 'getState' | 'getStatus'>;
63
+ readonly coreBlocks: Pick<InferProvider<typeof coreBlocksCapability>, 'list' | 'get' | 'create' | 'update' | 'delete' | 'setEnabled' | 'compile' | 'getTypeDefs'>;
62
64
  readonly decoder: Pick<InferProvider<typeof decoderCapability>, 'supportsCodec' | 'getInfo' | 'createSession' | 'destroySession' | 'pushPacket' | 'openStream' | 'pullFrames' | 'pullHandles' | 'getFrame' | 'getShmStats' | 'updateConfig' | 'getStats' | 'listActiveSessions' | 'reprobeHwaccel'>;
63
65
  readonly deviceAdoption: Pick<InferProvider<typeof deviceAdoptionCapability>, 'listCandidateFilters' | 'listCandidates' | 'getCandidate' | 'refresh' | 'adopt' | 'release' | 'resync'>;
64
66
  readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice'>;
package/dist/index.d.ts CHANGED
@@ -121,6 +121,7 @@ export { COCO_80_LABELS, COCO_TO_MACRO, MACRO_LABELS, } from './catalogs/coco-cl
121
121
  export { AUDIO_MACRO_LABELS, YAMNET_TO_MACRO, APPLE_SA_TO_MACRO, mapAudioLabelToMacro, getAudioMacroClassIds, } from './catalogs/audio-classmap.js';
122
122
  export { EVENT_TAXONOMY, TAXONOMY_COLORS, DEFAULT_EVENT_COLOR, getTaxonomyEntry, colorForKind, subKindsOf, type EventTaxonomyEntry, type EventTaxonomyCategory, type EventTaxonomyLevel, } from './catalogs/event-taxonomy.js';
123
123
  export { NcTaxonomyEntrySchema, NcTaxonomySchema, buildNcTaxonomy, NC_TAXONOMY, type NcTaxonomyEntry, type NcTaxonomy, } from './catalogs/nc-taxonomy.js';
124
+ export { DEVICE_SCOPED_CAPS, isDeviceScopedCap } from './generated/device-scoped-caps.js';
124
125
  export { DEVICE_STATE_READERS, readDeviceStateFrom, stateVocabularyFor, } from './catalogs/device-state-vocabulary.js';
125
126
  export type { CameraMotionConfig, CameraNativeDetectionConfig, CameraDetectionCapabilities, } from './types/camera-detection.js';
126
127
  export { type DeviceTypeInfo, DEVICE_TYPE_INFO } from './types/device-type.js';