@camstack/types 1.2.264 → 1.2.265

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.
@@ -42,10 +42,10 @@ export declare const MAX_CONDITION_LEAVES = 32;
42
42
  * `kind` in `deviceManager.getWireableFields`, never hand-maintained. */
43
43
  export declare const AutomationConditionOperatorSchema: z.ZodEnum<{
44
44
  in: "in";
45
- gte: "gte";
46
45
  eq: "eq";
47
46
  ne: "ne";
48
47
  gt: "gt";
48
+ gte: "gte";
49
49
  lt: "lt";
50
50
  lte: "lte";
51
51
  contains: "contains";
@@ -0,0 +1,328 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ /**
4
+ * composer — runs every DECLARATIVE composition (D659).
5
+ *
6
+ * Internal and admin-only: its one caller is `core-blocks`' supervisor, which
7
+ * sends the WHOLE set of composition blocks on every converge (idempotent),
8
+ * and reads their state for the API. Nothing else talks to it.
9
+ */
10
+ /** The composer's runner id, `resolveRunnerId(decl, 'composer')`; pinned by `composer-manifest.spec.ts`. */
11
+ export declare const COMPOSER_RUNNER_ID = "composer";
12
+ export declare const ComposerBlockSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ name: z.ZodString;
15
+ enabled: z.ZodBoolean;
16
+ updatedAt: z.ZodNumber;
17
+ composition: z.ZodObject<{
18
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
19
+ kind: z.ZodLiteral<"new">;
20
+ type: z.ZodEnum<typeof import("../index.js").DeviceType>;
21
+ role: z.ZodOptional<z.ZodEnum<typeof import("../index.js").DeviceRole>>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"existing">;
24
+ device: z.ZodObject<{
25
+ addonId: z.ZodString;
26
+ stableId: z.ZodString;
27
+ }, z.core.$strip>;
28
+ }, z.core.$strip>], "kind">;
29
+ features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ kind: z.ZodLiteral<"fields">;
31
+ cap: z.ZodString;
32
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ source: z.ZodObject<{
34
+ addonId: z.ZodString;
35
+ stableId: z.ZodString;
36
+ }, z.core.$strip>;
37
+ cap: z.ZodString;
38
+ fieldPath: z.ZodString;
39
+ kind: z.ZodLiteral<"from">;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ kind: z.ZodLiteral<"expression">;
42
+ expr: z.ZodString;
43
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
44
+ source: z.ZodObject<{
45
+ addonId: z.ZodString;
46
+ stableId: z.ZodString;
47
+ }, z.core.$strip>;
48
+ cap: z.ZodString;
49
+ fieldPath: z.ZodString;
50
+ kind: z.ZodLiteral<"from">;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"literal">;
53
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
54
+ }, z.core.$strip>], "kind">>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"code">;
57
+ code: z.ZodString;
58
+ }, z.core.$strip>], "kind">>;
59
+ commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ kind: z.ZodLiteral<"forward">;
61
+ source: z.ZodObject<{
62
+ addonId: z.ZodString;
63
+ stableId: z.ZodString;
64
+ }, z.core.$strip>;
65
+ cap: z.ZodString;
66
+ method: z.ZodString;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ kind: z.ZodLiteral<"code">;
69
+ code: z.ZodString;
70
+ }, z.core.$strip>], "kind">>>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ kind: z.ZodLiteral<"passthrough">;
73
+ cap: z.ZodString;
74
+ source: z.ZodObject<{
75
+ addonId: z.ZodString;
76
+ stableId: z.ZodString;
77
+ }, z.core.$strip>;
78
+ }, z.core.$strip>], "kind">>;
79
+ }, z.core.$strip>;
80
+ }, z.core.$strip>;
81
+ export type ComposerBlock = z.infer<typeof ComposerBlockSchema>;
82
+ /**
83
+ * A stored composition row that no longer PARSES — a schema a release
84
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
85
+ * its device as a placeholder and reports the block `failed` naming the parse
86
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
87
+ */
88
+ export declare const ComposerUnreadableBlockSchema: z.ZodObject<{
89
+ id: z.ZodString;
90
+ name: z.ZodNullable<z.ZodString>;
91
+ error: z.ZodString;
92
+ }, z.core.$strip>;
93
+ export type ComposerUnreadableBlock = z.infer<typeof ComposerUnreadableBlockSchema>;
94
+ export declare const ComposerApplyInputSchema: z.ZodObject<{
95
+ integrationId: z.ZodNullable<z.ZodString>;
96
+ storeLoaded: z.ZodBoolean;
97
+ blocks: z.ZodArray<z.ZodObject<{
98
+ id: z.ZodString;
99
+ name: z.ZodString;
100
+ enabled: z.ZodBoolean;
101
+ updatedAt: z.ZodNumber;
102
+ composition: z.ZodObject<{
103
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ kind: z.ZodLiteral<"new">;
105
+ type: z.ZodEnum<typeof import("../index.js").DeviceType>;
106
+ role: z.ZodOptional<z.ZodEnum<typeof import("../index.js").DeviceRole>>;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ kind: z.ZodLiteral<"existing">;
109
+ device: z.ZodObject<{
110
+ addonId: z.ZodString;
111
+ stableId: z.ZodString;
112
+ }, z.core.$strip>;
113
+ }, z.core.$strip>], "kind">;
114
+ features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
115
+ kind: z.ZodLiteral<"fields">;
116
+ cap: z.ZodString;
117
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
118
+ source: z.ZodObject<{
119
+ addonId: z.ZodString;
120
+ stableId: z.ZodString;
121
+ }, z.core.$strip>;
122
+ cap: z.ZodString;
123
+ fieldPath: z.ZodString;
124
+ kind: z.ZodLiteral<"from">;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ kind: z.ZodLiteral<"expression">;
127
+ expr: z.ZodString;
128
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
129
+ source: z.ZodObject<{
130
+ addonId: z.ZodString;
131
+ stableId: z.ZodString;
132
+ }, z.core.$strip>;
133
+ cap: z.ZodString;
134
+ fieldPath: z.ZodString;
135
+ kind: z.ZodLiteral<"from">;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ kind: z.ZodLiteral<"literal">;
138
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
139
+ }, z.core.$strip>], "kind">>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ kind: z.ZodLiteral<"code">;
142
+ code: z.ZodString;
143
+ }, z.core.$strip>], "kind">>;
144
+ commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
145
+ kind: z.ZodLiteral<"forward">;
146
+ source: z.ZodObject<{
147
+ addonId: z.ZodString;
148
+ stableId: z.ZodString;
149
+ }, z.core.$strip>;
150
+ cap: z.ZodString;
151
+ method: z.ZodString;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ kind: z.ZodLiteral<"code">;
154
+ code: z.ZodString;
155
+ }, z.core.$strip>], "kind">>>;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ kind: z.ZodLiteral<"passthrough">;
158
+ cap: z.ZodString;
159
+ source: z.ZodObject<{
160
+ addonId: z.ZodString;
161
+ stableId: z.ZodString;
162
+ }, z.core.$strip>;
163
+ }, z.core.$strip>], "kind">>;
164
+ }, z.core.$strip>;
165
+ }, z.core.$strip>>;
166
+ restartBlockIds: z.ZodArray<z.ZodString>;
167
+ unreadableBlocks: z.ZodArray<z.ZodObject<{
168
+ id: z.ZodString;
169
+ name: z.ZodNullable<z.ZodString>;
170
+ error: z.ZodString;
171
+ }, z.core.$strip>>;
172
+ }, z.core.$strip>;
173
+ export type ComposerApplyInput = z.infer<typeof ComposerApplyInputSchema>;
174
+ export declare const ComposerBlockVerdictSchema: z.ZodObject<{
175
+ blockId: z.ZodString;
176
+ status: z.ZodEnum<{
177
+ running: "running";
178
+ failed: "failed";
179
+ stopped: "stopped";
180
+ starting: "starting";
181
+ }>;
182
+ reason: z.ZodOptional<z.ZodString>;
183
+ }, z.core.$strip>;
184
+ export type ComposerBlockVerdict = z.infer<typeof ComposerBlockVerdictSchema>;
185
+ export declare const ComposerApplyResultSchema: z.ZodObject<{
186
+ blocks: z.ZodArray<z.ZodObject<{
187
+ blockId: z.ZodString;
188
+ status: z.ZodEnum<{
189
+ running: "running";
190
+ failed: "failed";
191
+ stopped: "stopped";
192
+ starting: "starting";
193
+ }>;
194
+ reason: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>>;
196
+ acted: z.ZodBoolean;
197
+ }, z.core.$strip>;
198
+ export type ComposerApplyResult = z.infer<typeof ComposerApplyResultSchema>;
199
+ export declare const composerCapability: {
200
+ readonly name: "composer";
201
+ readonly scope: "system";
202
+ readonly mode: "singleton";
203
+ readonly internal: true;
204
+ readonly methods: {
205
+ /**
206
+ * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
207
+ * `router({})` throws on one — every cap router is built at boot.
208
+ */
209
+ readonly applyBlocks: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
210
+ integrationId: z.ZodNullable<z.ZodString>;
211
+ storeLoaded: z.ZodBoolean;
212
+ blocks: z.ZodArray<z.ZodObject<{
213
+ id: z.ZodString;
214
+ name: z.ZodString;
215
+ enabled: z.ZodBoolean;
216
+ updatedAt: z.ZodNumber;
217
+ composition: z.ZodObject<{
218
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
219
+ kind: z.ZodLiteral<"new">;
220
+ type: z.ZodEnum<typeof import("../index.js").DeviceType>;
221
+ role: z.ZodOptional<z.ZodEnum<typeof import("../index.js").DeviceRole>>;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ kind: z.ZodLiteral<"existing">;
224
+ device: z.ZodObject<{
225
+ addonId: z.ZodString;
226
+ stableId: z.ZodString;
227
+ }, z.core.$strip>;
228
+ }, z.core.$strip>], "kind">;
229
+ features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
230
+ kind: z.ZodLiteral<"fields">;
231
+ cap: z.ZodString;
232
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ source: z.ZodObject<{
234
+ addonId: z.ZodString;
235
+ stableId: z.ZodString;
236
+ }, z.core.$strip>;
237
+ cap: z.ZodString;
238
+ fieldPath: z.ZodString;
239
+ kind: z.ZodLiteral<"from">;
240
+ }, z.core.$strip>, z.ZodObject<{
241
+ kind: z.ZodLiteral<"expression">;
242
+ expr: z.ZodString;
243
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
244
+ source: z.ZodObject<{
245
+ addonId: z.ZodString;
246
+ stableId: z.ZodString;
247
+ }, z.core.$strip>;
248
+ cap: z.ZodString;
249
+ fieldPath: z.ZodString;
250
+ kind: z.ZodLiteral<"from">;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ kind: z.ZodLiteral<"literal">;
253
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
254
+ }, z.core.$strip>], "kind">>;
255
+ }, z.core.$strip>, z.ZodObject<{
256
+ kind: z.ZodLiteral<"code">;
257
+ code: z.ZodString;
258
+ }, z.core.$strip>], "kind">>;
259
+ commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
260
+ kind: z.ZodLiteral<"forward">;
261
+ source: z.ZodObject<{
262
+ addonId: z.ZodString;
263
+ stableId: z.ZodString;
264
+ }, z.core.$strip>;
265
+ cap: z.ZodString;
266
+ method: z.ZodString;
267
+ }, z.core.$strip>, z.ZodObject<{
268
+ kind: z.ZodLiteral<"code">;
269
+ code: z.ZodString;
270
+ }, z.core.$strip>], "kind">>>;
271
+ }, z.core.$strip>, z.ZodObject<{
272
+ kind: z.ZodLiteral<"passthrough">;
273
+ cap: z.ZodString;
274
+ source: z.ZodObject<{
275
+ addonId: z.ZodString;
276
+ stableId: z.ZodString;
277
+ }, z.core.$strip>;
278
+ }, z.core.$strip>], "kind">>;
279
+ }, z.core.$strip>;
280
+ }, z.core.$strip>>;
281
+ restartBlockIds: z.ZodArray<z.ZodString>;
282
+ unreadableBlocks: z.ZodArray<z.ZodObject<{
283
+ id: z.ZodString;
284
+ name: z.ZodNullable<z.ZodString>;
285
+ error: z.ZodString;
286
+ }, z.core.$strip>>;
287
+ }, z.core.$strip>, z.ZodObject<{
288
+ blocks: z.ZodArray<z.ZodObject<{
289
+ blockId: z.ZodString;
290
+ status: z.ZodEnum<{
291
+ running: "running";
292
+ failed: "failed";
293
+ stopped: "stopped";
294
+ starting: "starting";
295
+ }>;
296
+ reason: z.ZodOptional<z.ZodString>;
297
+ }, z.core.$strip>>;
298
+ acted: z.ZodBoolean;
299
+ }, z.core.$strip>, "mutation">;
300
+ readonly getStates: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
301
+ blockIds: z.ZodArray<z.ZodString>;
302
+ }, z.core.$strip>, z.ZodObject<{
303
+ states: z.ZodArray<z.ZodObject<{
304
+ blockId: z.ZodString;
305
+ deviceId: z.ZodNullable<z.ZodNumber>;
306
+ status: z.ZodEnum<{
307
+ running: "running";
308
+ failed: "failed";
309
+ stopped: "stopped";
310
+ starting: "starting";
311
+ }>;
312
+ reason: z.ZodOptional<z.ZodString>;
313
+ fields: z.ZodArray<z.ZodObject<{
314
+ cap: z.ZodString;
315
+ path: z.ZodString;
316
+ state: z.ZodEnum<{
317
+ unavailable: "unavailable";
318
+ fresh: "fresh";
319
+ stale: "stale";
320
+ }>;
321
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
322
+ reason: z.ZodOptional<z.ZodString>;
323
+ }, z.core.$strip>>;
324
+ }, z.core.$strip>>;
325
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
326
+ };
327
+ };
328
+ export type IComposerProvider = InferProvider<typeof composerCapability>;
@@ -26,9 +26,9 @@ import { DeviceType } from '../device/device-type.js';
26
26
  */
27
27
  export declare const ControlKindSchema: z.ZodEnum<{
28
28
  text: "text";
29
+ datetime: "datetime";
29
30
  numeric: "numeric";
30
31
  select: "select";
31
- datetime: "datetime";
32
32
  }>;
33
33
  export type ControlKind = z.infer<typeof ControlKindSchema>;
34
34
  /**
@@ -54,9 +54,9 @@ export type ControlKind = z.infer<typeof ControlKindSchema>;
54
54
  export declare const ControlStatusSchema: z.ZodObject<{
55
55
  kind: z.ZodEnum<{
56
56
  text: "text";
57
+ datetime: "datetime";
57
58
  numeric: "numeric";
58
59
  select: "select";
59
- datetime: "datetime";
60
60
  }>;
61
61
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
62
62
  options: z.ZodArray<z.ZodString>;
@@ -115,9 +115,9 @@ export declare const controlCapability: {
115
115
  readonly schema: z.ZodObject<{
116
116
  kind: z.ZodEnum<{
117
117
  text: "text";
118
+ datetime: "datetime";
118
119
  numeric: "numeric";
119
120
  select: "select";
120
- datetime: "datetime";
121
121
  }>;
122
122
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
123
123
  options: z.ZodArray<z.ZodString>;
@@ -143,9 +143,9 @@ export declare const controlCapability: {
143
143
  readonly runtimeState: z.ZodObject<{
144
144
  kind: z.ZodEnum<{
145
145
  text: "text";
146
+ datetime: "datetime";
146
147
  numeric: "numeric";
147
148
  select: "select";
148
- datetime: "datetime";
149
149
  }>;
150
150
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
151
151
  options: z.ZodArray<z.ZodString>;