@camstack/types 1.2.584 → 1.2.586

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/addon/instance-link.d.ts +3 -1
  3. package/dist/addon.d.ts +3 -2
  4. package/dist/addon.js +3 -1
  5. package/dist/addon.mjs +2 -2
  6. package/dist/audit/command-origin-claim.d.ts +33 -0
  7. package/dist/audit/device-transition.d.ts +35 -2
  8. package/dist/capabilities/capability-definition.d.ts +2 -1
  9. package/dist/capabilities/device-transitions.cap.d.ts +44 -0
  10. package/dist/capabilities/index.d.ts +6 -3
  11. package/dist/capabilities/notification-rules.cap.d.ts +70 -0
  12. package/dist/capabilities/siren-duration.d.ts +15 -0
  13. package/dist/capabilities/siren.cap.d.ts +175 -0
  14. package/dist/capabilities/tags.cap.d.ts +42 -16
  15. package/dist/capabilities/terminal-session.cap.d.ts +7 -1
  16. package/dist/client.js +682 -614
  17. package/dist/client.mjs +682 -614
  18. package/dist/generated/addon-api.d.ts +50 -0
  19. package/dist/generated/addon-cap-facts.d.ts +1 -1
  20. package/dist/generated/cap-status-types.d.ts +3 -1
  21. package/dist/generated/cap-vocabulary.d.ts +1 -1
  22. package/dist/generated/capability-router-map.d.ts +5 -2
  23. package/dist/generated/device-local-state.d.ts +3 -0
  24. package/dist/generated/device-proxy.d.ts +3 -0
  25. package/dist/generated/device-scoped-caps.d.ts +1 -1
  26. package/dist/generated/history-catalog.d.ts +1 -1
  27. package/dist/generated/method-access-map.d.ts +1 -1
  28. package/dist/generated/method-device-selectors.d.ts +1 -1
  29. package/dist/generated/runtime-state-durability.d.ts +1 -1
  30. package/dist/generated/system-proxy.d.ts +1 -1
  31. package/dist/helpers/trpc-leaf.d.ts +4 -3
  32. package/dist/index.js +387 -17
  33. package/dist/index.mjs +373 -18
  34. package/dist/notification/timelapse-rule.d.ts +3 -0
  35. package/dist/{sleep-DnhxKL99.mjs → sleep-Ch7Q7UtE.mjs} +728 -620
  36. package/dist/{sleep-Coq9CYAH.js → sleep-DwRtgB2i.js} +739 -619
  37. package/package.json +1 -1
@@ -0,0 +1,175 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ import { DeviceType } from '../device/device-type.js';
4
+ /**
5
+ * Timed siren: trigger the siren for a duration and know until when it sounds.
6
+ *
7
+ * The plain on/off `switch` of a siren stays as it is (HomeKit / Alexa see a
8
+ * switch); this cap adds the part a switch cannot say — HOW LONG, and the
9
+ * moment the siren is expected to fall silent (`activeUntil`, epoch ms), so a
10
+ * UI can show the activation with a countdown.
11
+ *
12
+ * The allowed durations are never hardcoded: `getOptions` answers what the
13
+ * CAMERA reports (a discrete list or `{min,max,step}`), the default, and the
14
+ * unit truth — a camera that counts plays rather than seconds says so, with the
15
+ * seconds-per-play factor used to convert, and whether that factor was read
16
+ * from the camera or is an estimate.
17
+ */
18
+ /** What the camera counts natively. */
19
+ export declare const SirenDurationUnit: {
20
+ readonly Seconds: 'seconds';
21
+ readonly Plays: 'plays';
22
+ };
23
+ export type SirenDurationUnitValue = (typeof SirenDurationUnit)[keyof typeof SirenDurationUnit];
24
+ /** Where the numbers of an options answer come from. */
25
+ export declare const SirenOptionsSource: {
26
+ /** Read from the camera by this fetch. */
27
+ readonly Camera: 'camera';
28
+ /** The camera did not answer or does not advertise it; a documented fallback. */
29
+ readonly Fallback: 'fallback';
30
+ };
31
+ export type SirenOptionsSourceValue = (typeof SirenOptionsSource)[keyof typeof SirenOptionsSource];
32
+ export declare const SirenDurationRangeSchema: z.ZodObject<{
33
+ min: z.ZodNumber;
34
+ max: z.ZodNumber;
35
+ step: z.ZodNumber;
36
+ }, z.core.$strip>;
37
+ export type SirenDurationRange = z.infer<typeof SirenDurationRangeSchema>;
38
+ export declare const SirenOptionsSchema: z.ZodObject<{
39
+ allowedSeconds: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
40
+ rangeSeconds: z.ZodNullable<z.ZodObject<{
41
+ min: z.ZodNumber;
42
+ max: z.ZodNumber;
43
+ step: z.ZodNumber;
44
+ }, z.core.$strip>>;
45
+ defaultSeconds: z.ZodNumber;
46
+ unit: z.ZodEnum<{
47
+ plays: "plays";
48
+ seconds: "seconds";
49
+ }>;
50
+ secondsPerPlay: z.ZodNullable<z.ZodNumber>;
51
+ source: z.ZodEnum<{
52
+ camera: "camera";
53
+ fallback: "fallback";
54
+ }>;
55
+ fetchedAt: z.ZodNumber;
56
+ }, z.core.$strip>;
57
+ export type SirenOptions = z.infer<typeof SirenOptionsSchema>;
58
+ export declare const SirenStatusSchema: z.ZodObject<{
59
+ active: z.ZodBoolean;
60
+ activeUntil: z.ZodNullable<z.ZodNumber>;
61
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
62
+ lastTriggeredAt: z.ZodNumber;
63
+ }, z.core.$strip>;
64
+ export type SirenStatus = z.infer<typeof SirenStatusSchema>;
65
+ export declare const SirenRuntimeStateSchema: z.ZodObject<{
66
+ active: z.ZodBoolean;
67
+ activeUntil: z.ZodNullable<z.ZodNumber>;
68
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
69
+ lastTriggeredAt: z.ZodNumber;
70
+ lastFetchedAt: z.ZodNumber;
71
+ }, z.core.$strip>;
72
+ export type SirenRuntimeState = z.infer<typeof SirenRuntimeStateSchema>;
73
+ export declare const sirenCapability: {
74
+ readonly name: 'siren';
75
+ readonly scope: 'device';
76
+ readonly deviceNative: true;
77
+ readonly mode: 'singleton';
78
+ readonly deviceTypes: readonly [DeviceType.Siren];
79
+ readonly methods: {
80
+ /** The durations the camera allows, read from the camera. */
81
+ readonly getOptions: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
82
+ deviceId: z.ZodNumber;
83
+ }, z.core.$strip>, z.ZodObject<{
84
+ allowedSeconds: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
85
+ rangeSeconds: z.ZodNullable<z.ZodObject<{
86
+ min: z.ZodNumber;
87
+ max: z.ZodNumber;
88
+ step: z.ZodNumber;
89
+ }, z.core.$strip>>;
90
+ defaultSeconds: z.ZodNumber;
91
+ unit: z.ZodEnum<{
92
+ plays: "plays";
93
+ seconds: "seconds";
94
+ }>;
95
+ secondsPerPlay: z.ZodNullable<z.ZodNumber>;
96
+ source: z.ZodEnum<{
97
+ camera: "camera";
98
+ fallback: "fallback";
99
+ }>;
100
+ fetchedAt: z.ZodNumber;
101
+ }, z.core.$strip>, "query">;
102
+ /**
103
+ * Sound the siren. Without `durationSeconds` the camera default applies.
104
+ * Answers the state at the moment of the trigger (`activeUntil` included).
105
+ */
106
+ readonly trigger: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
107
+ deviceId: z.ZodNumber;
108
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
109
+ }, z.core.$strip>, z.ZodObject<{
110
+ active: z.ZodBoolean;
111
+ activeUntil: z.ZodNullable<z.ZodNumber>;
112
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
113
+ lastTriggeredAt: z.ZodNumber;
114
+ }, z.core.$strip>, "mutation">;
115
+ /** Silence the siren now. */
116
+ readonly stop: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
117
+ deviceId: z.ZodNumber;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ active: z.ZodBoolean;
120
+ activeUntil: z.ZodNullable<z.ZodNumber>;
121
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
122
+ lastTriggeredAt: z.ZodNumber;
123
+ }, z.core.$strip>, "mutation">;
124
+ };
125
+ readonly events: {
126
+ readonly onSirenChanged: {
127
+ readonly data: z.ZodObject<{
128
+ deviceId: z.ZodNumber;
129
+ active: z.ZodBoolean;
130
+ activeUntil: z.ZodNullable<z.ZodNumber>;
131
+ }, z.core.$strip>;
132
+ readonly notOperatorFacing: 'the `active` state trigger phrases both edges of this change';
133
+ };
134
+ };
135
+ readonly status: {
136
+ readonly schema: z.ZodObject<{
137
+ active: z.ZodBoolean;
138
+ activeUntil: z.ZodNullable<z.ZodNumber>;
139
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
140
+ lastTriggeredAt: z.ZodNumber;
141
+ }, z.core.$strip>;
142
+ readonly kind: 'command-driven';
143
+ };
144
+ readonly runtimeState: z.ZodObject<{
145
+ active: z.ZodBoolean;
146
+ activeUntil: z.ZodNullable<z.ZodNumber>;
147
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
148
+ lastTriggeredAt: z.ZodNumber;
149
+ lastFetchedAt: z.ZodNumber;
150
+ }, z.core.$strip>;
151
+ /**
152
+ * Runtime-state durability: **session** — a siren activation is a moment, not a fact to restore after a restart.
153
+ *
154
+ * See `RuntimeStateDurability`. Enforced by
155
+ * `scripts/check-runtime-state-durability.ts`.
156
+ */
157
+ readonly durability: 'session';
158
+ /**
159
+ * History (D850): none — an activation is already recorded by the switch / alarm events.
160
+ */
161
+ readonly history: 'none';
162
+ readonly vocabulary: {
163
+ readonly noun: import("../index.js").VocabL10n;
164
+ readonly order: 1170;
165
+ readonly state: readonly [{
166
+ readonly kind: 'boolean';
167
+ readonly field: 'active';
168
+ readonly label: import("../index.js").VocabL10n;
169
+ readonly whenTrue: import("../index.js").VocabL10n;
170
+ readonly whenFalse: import("../index.js").VocabL10n;
171
+ readonly icon: 'siren';
172
+ }];
173
+ };
174
+ };
175
+ export type ISirenProvider = InferProvider<typeof sirenCapability>;