@camstack/types 1.2.405 → 1.2.407

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 (69) hide show
  1. package/dist/addon.js +21 -2
  2. package/dist/addon.mjs +21 -2
  3. package/dist/capabilities/battery.cap.d.ts +46 -0
  4. package/dist/capabilities/capability-definition.d.ts +8 -0
  5. package/dist/capabilities/consumables.cap.d.ts +110 -0
  6. package/dist/capabilities/customize-catalog.d.ts +72 -0
  7. package/dist/capabilities/customize-spec.d.ts +202 -0
  8. package/dist/capabilities/doorbell.cap.d.ts +39 -0
  9. package/dist/capabilities/index.d.ts +6 -4
  10. package/dist/capabilities/motion.cap.d.ts +39 -0
  11. package/dist/capabilities/notification-rules.cap.d.ts +3 -78
  12. package/dist/capabilities/osd-manager.cap.d.ts +0 -18
  13. package/dist/capabilities/running-state.cap.d.ts +140 -0
  14. package/dist/catalogs/sensor-active-state.d.ts +1 -1
  15. package/dist/client.js +11 -63
  16. package/dist/client.mjs +11 -63
  17. package/dist/composition/customize/__fixtures__/refs.d.ts +27 -0
  18. package/dist/composition/customize/__fixtures__/stored-cases.d.ts +13 -0
  19. package/dist/composition/customize/event-compile.d.ts +20 -0
  20. package/dist/composition/customize/event-decode.d.ts +19 -0
  21. package/dist/composition/customize/event-eval.d.ts +35 -0
  22. package/dist/composition/customize/event-status.d.ts +49 -0
  23. package/dist/composition/customize/field-source.d.ts +5 -0
  24. package/dist/composition/customize/keyed-array-compile.d.ts +26 -0
  25. package/dist/composition/customize/keyed-array-decode.d.ts +20 -0
  26. package/dist/composition/customize/keyed-array-expr.d.ts +10 -0
  27. package/dist/composition/customize/keyed-array-status.d.ts +22 -0
  28. package/dist/composition/customize/normalize.d.ts +4 -0
  29. package/dist/composition/customize/override-draft.d.ts +311 -0
  30. package/dist/composition/customize/scalar-compile.d.ts +13 -0
  31. package/dist/composition/customize/scalar-decode.d.ts +17 -0
  32. package/dist/composition/customize/scalar-expr.d.ts +33 -0
  33. package/dist/composition/customize/scalar-status.d.ts +31 -0
  34. package/dist/composition/customize/stored.d.ts +15 -0
  35. package/dist/composition/index.d.ts +0 -1
  36. package/dist/{composition-CB6PMT9p.mjs → composition-BJ8iAZb3.mjs} +87 -3
  37. package/dist/{composition-eoYYVfOp.js → composition-CSLSFGTO.js} +87 -3
  38. package/dist/device/cap-vocabulary/entries/appliances.d.ts +1 -1
  39. package/dist/enums/event-category.d.ts +4 -0
  40. package/dist/enums.js +1 -1
  41. package/dist/enums.mjs +1 -1
  42. package/dist/{event-category-fDPduoeC.mjs → event-category-Ceif8n-v.mjs} +4 -0
  43. package/dist/{event-category-CXrwjC3e.js → event-category-DG6Vir8Z.js} +4 -0
  44. package/dist/expression/builtins.d.ts +7 -18
  45. package/dist/expression/expression-source.d.ts +14 -2
  46. package/dist/generated/addon-api.d.ts +14 -0
  47. package/dist/generated/addon-cap-facts.d.ts +1 -1
  48. package/dist/generated/cap-status-types.d.ts +3 -1
  49. package/dist/generated/capability-router-map.d.ts +5 -2
  50. package/dist/generated/customize-catalog.d.ts +229 -0
  51. package/dist/generated/device-local-state.d.ts +3 -0
  52. package/dist/generated/device-proxy.d.ts +3 -0
  53. package/dist/generated/device-scoped-caps.d.ts +1 -1
  54. package/dist/generated/history-catalog.d.ts +1 -1
  55. package/dist/generated/method-access-map.d.ts +1 -1
  56. package/dist/generated/method-device-selectors.d.ts +1 -1
  57. package/dist/generated/runtime-state-durability.d.ts +1 -1
  58. package/dist/index.d.ts +16 -0
  59. package/dist/index.js +2385 -173
  60. package/dist/index.mjs +2351 -171
  61. package/dist/interfaces/config-ui.d.ts +69 -2
  62. package/dist/node.js +1 -1
  63. package/dist/node.mjs +1 -1
  64. package/dist/running-state/defaults.d.ts +6 -0
  65. package/dist/running-state/from-operation.d.ts +14 -0
  66. package/dist/{sleep-CHIEEJkY.mjs → sleep-CYfIZzGv.mjs} +7 -3
  67. package/dist/{sleep-BKS4OPMo.js → sleep-UP964hNP.js} +7 -3
  68. package/package.json +1 -1
  69. package/dist/composition/presets/doorbell-feature.d.ts +0 -20
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Assignment status for a pulse feature and a span's camera-sensors
3
+ * authority (D936, D315, D49). Pending and unreadable are not an empty list.
4
+ */
5
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
6
+ import type { CameraSensorAttachment, CameraSensorMode, CameraSensorsStatus } from '../../pipeline/camera-sensors.js';
7
+ import type { CustomizeAssignmentStatus } from './override-draft.js';
8
+ import type { ScalarRead, ScalarSourcePresence } from './scalar-status.js';
9
+ export interface PulseStatusInput {
10
+ readonly cap: string;
11
+ readonly targetId: string;
12
+ readonly device: CompositionSourceRef;
13
+ readonly timestampPath: string;
14
+ readonly counterPath: string;
15
+ readonly apply: 'add' | 'replace';
16
+ readonly stored: ScalarRead<CompositionFieldsFeature | null>;
17
+ readonly sourcePresence: ScalarSourcePresence;
18
+ readonly sourceUnknownReason: string | null;
19
+ }
20
+ export interface PulseAssignmentProjection {
21
+ readonly text: string;
22
+ readonly status: CustomizeAssignmentStatus;
23
+ }
24
+ export interface SpanSensorRow {
25
+ readonly key: string;
26
+ readonly addonId: string;
27
+ readonly stableId: string;
28
+ readonly name: string;
29
+ readonly mode: CameraSensorMode;
30
+ readonly state: CameraSensorAttachment['state'];
31
+ readonly reason: string | null;
32
+ }
33
+ export interface SpanAssignmentProjection {
34
+ readonly text: string;
35
+ readonly writable: boolean;
36
+ readonly rows: readonly SpanSensorRow[];
37
+ readonly status: CustomizeAssignmentStatus;
38
+ }
39
+ export type SpanRead = {
40
+ readonly kind: 'pending';
41
+ } | {
42
+ readonly kind: 'unknown';
43
+ readonly reason: string | null;
44
+ } | {
45
+ readonly kind: 'known';
46
+ readonly value: CameraSensorsStatus;
47
+ };
48
+ export declare function projectPulseAssignment(input: PulseStatusInput): PulseAssignmentProjection;
49
+ export declare function projectSpanAssignment(targetId: string, stored: SpanRead): SpanAssignmentProjection;
@@ -0,0 +1,5 @@
1
+ import type { CompositionExpressionSource, CompositionFieldSource, CompositionFromSource, CompositionSourceRef } from '../composition.js';
2
+ export declare function fromRead(source: CompositionSourceRef, cap: string, fieldPath: string): CompositionFromSource;
3
+ export declare function expression(expr: string, bindings: CompositionExpressionSource['bindings']): CompositionFieldSource;
4
+ export declare function literal(expr: string): CompositionFieldSource;
5
+ export declare function isLiteral(source: CompositionFieldSource | undefined, expr: string): boolean;
@@ -0,0 +1,26 @@
1
+ import { type CompositionFieldsFeature, type CompositionSourceRef } from '../composition.js';
2
+ import type { KeyedArrayOverrideDraft } from './override-draft.js';
3
+ import type { CustomizeRoundTrip } from './stored.js';
4
+ export type KeyedSourceValueKind = 'boolean' | 'number' | 'string' | 'enum';
5
+ export interface KeyedArrayLiteral {
6
+ readonly path: string;
7
+ readonly value: string;
8
+ }
9
+ export interface KeyedArrayItemCompile {
10
+ readonly draft: KeyedArrayOverrideDraft;
11
+ readonly sourceValueKind: KeyedSourceValueKind;
12
+ readonly sourceUnit: string | null;
13
+ readonly literals: readonly KeyedArrayLiteral[];
14
+ }
15
+ export interface KeyedArrayCompileInput {
16
+ readonly cap: string;
17
+ readonly targetId: string;
18
+ readonly device: CompositionSourceRef;
19
+ readonly apply: 'add' | 'replace';
20
+ readonly items: readonly KeyedArrayItemCompile[];
21
+ }
22
+ export declare function compileKeyedArrayOverride(input: KeyedArrayCompileInput): CustomizeRoundTrip<CompositionFieldsFeature>;
23
+ /** Put one compiled item into an existing feature. Other items stay as stored. */
24
+ export declare function mergeKeyedArrayItem(current: CompositionFieldsFeature | null, compiled: CompositionFieldsFeature, key: string): CompositionFieldsFeature | null;
25
+ /** The feature without item `key`. Null when that item was the last one. */
26
+ export declare function withoutKeyedArrayItem(feature: CompositionFieldsFeature, key: string): CompositionFieldsFeature | null;
@@ -0,0 +1,20 @@
1
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
2
+ import { type KeyedArrayItemCompile } from './keyed-array-compile.js';
3
+ export interface KeyedArrayItemView {
4
+ readonly key: string;
5
+ readonly label: string;
6
+ readonly recognized: boolean;
7
+ readonly compile: KeyedArrayItemCompile | null;
8
+ }
9
+ export interface KeyedArrayRead {
10
+ readonly canonical: boolean;
11
+ readonly apply: 'add' | 'replace';
12
+ readonly items: readonly KeyedArrayItemView[];
13
+ }
14
+ export declare function readKeyedArrayItems(feature: CompositionFieldsFeature, cap: string, targetId: string): KeyedArrayRead | null;
15
+ export declare function decodeKeyedArrayOverride(input: {
16
+ readonly feature: CompositionFieldsFeature;
17
+ readonly device: CompositionSourceRef;
18
+ readonly cap: string;
19
+ readonly targetId: string;
20
+ }): KeyedArrayRead | null;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Canonical expression text for one keyed-array transform. The decoder reads
3
+ * only this spelling.
4
+ */
5
+ import type { CustomizeTransformDraft } from './override-draft.js';
6
+ export declare function enumMapExpr(mapping: Readonly<Record<string, string | null>>): string | null;
7
+ export declare function parseEnumMap(expr: string): Readonly<Record<string, string | null>> | null;
8
+ export declare function enumMapDraft(mapping: Readonly<Record<string, string | null>>): Extract<CustomizeTransformDraft, {
9
+ kind: 'enum-map';
10
+ }>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Assignment-status projection for one keyed-array target (D936). Pending and
3
+ * unknown are unanswered reads. A confirmed-gone source leaves an added array
4
+ * assigned: the native rows are a different authority.
5
+ */
6
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
7
+ import type { CustomizeAssignmentStatus } from './override-draft.js';
8
+ import type { ScalarRead, ScalarSourcePresence } from './scalar-status.js';
9
+ export interface KeyedArrayStatusInput {
10
+ readonly cap: string;
11
+ readonly targetId: string;
12
+ readonly device: CompositionSourceRef;
13
+ readonly stored: ScalarRead<CompositionFieldsFeature | null>;
14
+ readonly sourcePresence: ScalarSourcePresence;
15
+ readonly sourceUnknownReason: string | null;
16
+ }
17
+ export interface KeyedArrayAssignmentProjection {
18
+ readonly text: string;
19
+ readonly assignedCount: number;
20
+ readonly status: CustomizeAssignmentStatus;
21
+ }
22
+ export declare function projectKeyedArrayAssignment(input: KeyedArrayStatusInput): KeyedArrayAssignmentProjection;
@@ -0,0 +1,4 @@
1
+ import type { CustomizeStored } from './stored.js';
2
+ /** Key order is not part of the stored contract. Array order is. */
3
+ export declare function normalizeStored(stored: CustomizeStored): unknown;
4
+ export declare function sameStored(a: CustomizeStored, b: CustomizeStored): boolean;
@@ -0,0 +1,311 @@
1
+ /**
2
+ * A saved Customize assignment (D936). The schema is the type: callers use
3
+ * `z.infer`, they do not restate the shape.
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const OverrideSourceSchema: z.ZodObject<{
7
+ addonId: z.ZodString;
8
+ stableId: z.ZodString;
9
+ cap: z.ZodString;
10
+ fieldPath: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export type OverrideSource = z.infer<typeof OverrideSourceSchema>;
13
+ export declare const IdentityTransformDraftSchema: z.ZodObject<{
14
+ kind: z.ZodLiteral<"identity">;
15
+ }, z.core.$strip>;
16
+ export declare const InvertTransformDraftSchema: z.ZodObject<{
17
+ kind: z.ZodLiteral<"invert">;
18
+ }, z.core.$strip>;
19
+ export declare const ThresholdTransformDraftSchema: z.ZodObject<{
20
+ kind: z.ZodLiteral<"threshold">;
21
+ comparison: z.ZodEnum<{
22
+ gte: "gte";
23
+ lte: "lte";
24
+ }>;
25
+ threshold: z.ZodNumber;
26
+ startDwellMs: z.ZodNumber;
27
+ stopDwellMs: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ export declare const LinearTransformDraftSchema: z.ZodObject<{
30
+ kind: z.ZodLiteral<"linear">;
31
+ scale: z.ZodNumber;
32
+ offset: z.ZodNumber;
33
+ clampMin: z.ZodOptional<z.ZodNumber>;
34
+ clampMax: z.ZodOptional<z.ZodNumber>;
35
+ }, z.core.$strip>;
36
+ export declare const EnumMapTransformDraftSchema: z.ZodObject<{
37
+ kind: z.ZodLiteral<"enum-map">;
38
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
39
+ }, z.core.$strip>;
40
+ export declare const NumberBridgeTransformDraftSchema: z.ZodObject<{
41
+ kind: z.ZodLiteral<"number">;
42
+ }, z.core.$strip>;
43
+ export declare const CustomizeTransformDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
44
+ kind: z.ZodLiteral<"identity">;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ kind: z.ZodLiteral<"invert">;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"threshold">;
49
+ comparison: z.ZodEnum<{
50
+ gte: "gte";
51
+ lte: "lte";
52
+ }>;
53
+ threshold: z.ZodNumber;
54
+ startDwellMs: z.ZodNumber;
55
+ stopDwellMs: z.ZodNumber;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ kind: z.ZodLiteral<"linear">;
58
+ scale: z.ZodNumber;
59
+ offset: z.ZodNumber;
60
+ clampMin: z.ZodOptional<z.ZodNumber>;
61
+ clampMax: z.ZodOptional<z.ZodNumber>;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"enum-map">;
64
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ kind: z.ZodLiteral<"number">;
67
+ }, z.core.$strip>], "kind">;
68
+ export type CustomizeTransformDraft = z.infer<typeof CustomizeTransformDraftSchema>;
69
+ export declare const ScalarOverrideDraftSchema: z.ZodObject<{
70
+ kind: z.ZodLiteral<"scalar">;
71
+ cap: z.ZodString;
72
+ targetId: z.ZodString;
73
+ source: z.ZodObject<{
74
+ addonId: z.ZodString;
75
+ stableId: z.ZodString;
76
+ cap: z.ZodString;
77
+ fieldPath: z.ZodString;
78
+ }, z.core.$strip>;
79
+ transform: z.ZodDiscriminatedUnion<[z.ZodObject<{
80
+ kind: z.ZodLiteral<"identity">;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"invert">;
83
+ }, z.core.$strip>, z.ZodObject<{
84
+ kind: z.ZodLiteral<"threshold">;
85
+ comparison: z.ZodEnum<{
86
+ gte: "gte";
87
+ lte: "lte";
88
+ }>;
89
+ threshold: z.ZodNumber;
90
+ startDwellMs: z.ZodNumber;
91
+ stopDwellMs: z.ZodNumber;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ kind: z.ZodLiteral<"linear">;
94
+ scale: z.ZodNumber;
95
+ offset: z.ZodNumber;
96
+ clampMin: z.ZodOptional<z.ZodNumber>;
97
+ clampMax: z.ZodOptional<z.ZodNumber>;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ kind: z.ZodLiteral<"enum-map">;
100
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ kind: z.ZodLiteral<"number">;
103
+ }, z.core.$strip>], "kind">;
104
+ }, z.core.$strip>;
105
+ export type ScalarOverrideDraft = z.infer<typeof ScalarOverrideDraftSchema>;
106
+ export declare const KeyedArrayOverrideDraftSchema: z.ZodObject<{
107
+ kind: z.ZodLiteral<"keyedArray">;
108
+ cap: z.ZodString;
109
+ targetId: z.ZodString;
110
+ key: z.ZodString;
111
+ label: z.ZodString;
112
+ fieldPath: z.ZodString;
113
+ source: z.ZodObject<{
114
+ addonId: z.ZodString;
115
+ stableId: z.ZodString;
116
+ cap: z.ZodString;
117
+ fieldPath: z.ZodString;
118
+ }, z.core.$strip>;
119
+ transform: z.ZodDiscriminatedUnion<[z.ZodObject<{
120
+ kind: z.ZodLiteral<"identity">;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ kind: z.ZodLiteral<"invert">;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ kind: z.ZodLiteral<"threshold">;
125
+ comparison: z.ZodEnum<{
126
+ gte: "gte";
127
+ lte: "lte";
128
+ }>;
129
+ threshold: z.ZodNumber;
130
+ startDwellMs: z.ZodNumber;
131
+ stopDwellMs: z.ZodNumber;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ kind: z.ZodLiteral<"linear">;
134
+ scale: z.ZodNumber;
135
+ offset: z.ZodNumber;
136
+ clampMin: z.ZodOptional<z.ZodNumber>;
137
+ clampMax: z.ZodOptional<z.ZodNumber>;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ kind: z.ZodLiteral<"enum-map">;
140
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ kind: z.ZodLiteral<"number">;
143
+ }, z.core.$strip>], "kind">;
144
+ }, z.core.$strip>;
145
+ export type KeyedArrayOverrideDraft = z.infer<typeof KeyedArrayOverrideDraftSchema>;
146
+ export declare const PulseOverrideDraftSchema: z.ZodObject<{
147
+ kind: z.ZodLiteral<"pulse">;
148
+ cap: z.ZodString;
149
+ targetId: z.ZodString;
150
+ enabled: z.ZodBoolean;
151
+ debounceMs: z.ZodNumber;
152
+ sources: z.ZodArray<z.ZodObject<{
153
+ addonId: z.ZodString;
154
+ stableId: z.ZodString;
155
+ cap: z.ZodString;
156
+ fieldPath: z.ZodString;
157
+ }, z.core.$strip>>;
158
+ }, z.core.$strip>;
159
+ export type PulseOverrideDraft = z.infer<typeof PulseOverrideDraftSchema>;
160
+ export declare const SpanSourceDraftSchema: z.ZodObject<{
161
+ addonId: z.ZodString;
162
+ stableId: z.ZodString;
163
+ cap: z.ZodString;
164
+ fieldPath: z.ZodString;
165
+ mode: z.ZodOptional<z.ZodEnum<{
166
+ confirm: "confirm";
167
+ "in-addition": "in-addition";
168
+ replace: "replace";
169
+ }>>;
170
+ }, z.core.$strip>;
171
+ export type SpanSourceDraft = z.infer<typeof SpanSourceDraftSchema>;
172
+ export declare const SpanOverrideDraftSchema: z.ZodObject<{
173
+ kind: z.ZodLiteral<"span">;
174
+ cap: z.ZodString;
175
+ targetId: z.ZodString;
176
+ timeoutMs: z.ZodNumber;
177
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
178
+ sources: z.ZodArray<z.ZodObject<{
179
+ addonId: z.ZodString;
180
+ stableId: z.ZodString;
181
+ cap: z.ZodString;
182
+ fieldPath: z.ZodString;
183
+ mode: z.ZodOptional<z.ZodEnum<{
184
+ confirm: "confirm";
185
+ "in-addition": "in-addition";
186
+ replace: "replace";
187
+ }>>;
188
+ }, z.core.$strip>>;
189
+ }, z.core.$strip>;
190
+ export type SpanOverrideDraft = z.infer<typeof SpanOverrideDraftSchema>;
191
+ export declare const OverrideDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
192
+ kind: z.ZodLiteral<"scalar">;
193
+ cap: z.ZodString;
194
+ targetId: z.ZodString;
195
+ source: z.ZodObject<{
196
+ addonId: z.ZodString;
197
+ stableId: z.ZodString;
198
+ cap: z.ZodString;
199
+ fieldPath: z.ZodString;
200
+ }, z.core.$strip>;
201
+ transform: z.ZodDiscriminatedUnion<[z.ZodObject<{
202
+ kind: z.ZodLiteral<"identity">;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ kind: z.ZodLiteral<"invert">;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"threshold">;
207
+ comparison: z.ZodEnum<{
208
+ gte: "gte";
209
+ lte: "lte";
210
+ }>;
211
+ threshold: z.ZodNumber;
212
+ startDwellMs: z.ZodNumber;
213
+ stopDwellMs: z.ZodNumber;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ kind: z.ZodLiteral<"linear">;
216
+ scale: z.ZodNumber;
217
+ offset: z.ZodNumber;
218
+ clampMin: z.ZodOptional<z.ZodNumber>;
219
+ clampMax: z.ZodOptional<z.ZodNumber>;
220
+ }, z.core.$strip>, z.ZodObject<{
221
+ kind: z.ZodLiteral<"enum-map">;
222
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
223
+ }, z.core.$strip>, z.ZodObject<{
224
+ kind: z.ZodLiteral<"number">;
225
+ }, z.core.$strip>], "kind">;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"keyedArray">;
228
+ cap: z.ZodString;
229
+ targetId: z.ZodString;
230
+ key: z.ZodString;
231
+ label: z.ZodString;
232
+ fieldPath: z.ZodString;
233
+ source: z.ZodObject<{
234
+ addonId: z.ZodString;
235
+ stableId: z.ZodString;
236
+ cap: z.ZodString;
237
+ fieldPath: z.ZodString;
238
+ }, z.core.$strip>;
239
+ transform: z.ZodDiscriminatedUnion<[z.ZodObject<{
240
+ kind: z.ZodLiteral<"identity">;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ kind: z.ZodLiteral<"invert">;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ kind: z.ZodLiteral<"threshold">;
245
+ comparison: z.ZodEnum<{
246
+ gte: "gte";
247
+ lte: "lte";
248
+ }>;
249
+ threshold: z.ZodNumber;
250
+ startDwellMs: z.ZodNumber;
251
+ stopDwellMs: z.ZodNumber;
252
+ }, z.core.$strip>, z.ZodObject<{
253
+ kind: z.ZodLiteral<"linear">;
254
+ scale: z.ZodNumber;
255
+ offset: z.ZodNumber;
256
+ clampMin: z.ZodOptional<z.ZodNumber>;
257
+ clampMax: z.ZodOptional<z.ZodNumber>;
258
+ }, z.core.$strip>, z.ZodObject<{
259
+ kind: z.ZodLiteral<"enum-map">;
260
+ mapping: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
261
+ }, z.core.$strip>, z.ZodObject<{
262
+ kind: z.ZodLiteral<"number">;
263
+ }, z.core.$strip>], "kind">;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ kind: z.ZodLiteral<"pulse">;
266
+ cap: z.ZodString;
267
+ targetId: z.ZodString;
268
+ enabled: z.ZodBoolean;
269
+ debounceMs: z.ZodNumber;
270
+ sources: z.ZodArray<z.ZodObject<{
271
+ addonId: z.ZodString;
272
+ stableId: z.ZodString;
273
+ cap: z.ZodString;
274
+ fieldPath: z.ZodString;
275
+ }, z.core.$strip>>;
276
+ }, z.core.$strip>, z.ZodObject<{
277
+ kind: z.ZodLiteral<"span">;
278
+ cap: z.ZodString;
279
+ targetId: z.ZodString;
280
+ timeoutMs: z.ZodNumber;
281
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
282
+ sources: z.ZodArray<z.ZodObject<{
283
+ addonId: z.ZodString;
284
+ stableId: z.ZodString;
285
+ cap: z.ZodString;
286
+ fieldPath: z.ZodString;
287
+ mode: z.ZodOptional<z.ZodEnum<{
288
+ confirm: "confirm";
289
+ "in-addition": "in-addition";
290
+ replace: "replace";
291
+ }>>;
292
+ }, z.core.$strip>>;
293
+ }, z.core.$strip>], "kind">;
294
+ export type OverrideDraft = z.infer<typeof OverrideDraftSchema>;
295
+ /** Effective authority for one declared target. Not a second stored switch. */
296
+ export declare const CustomizeAssignmentStatusSchema: z.ZodObject<{
297
+ targetId: z.ZodString;
298
+ configured: z.ZodBoolean;
299
+ source: z.ZodEnum<{
300
+ assigned: "assigned";
301
+ native: "native";
302
+ }>;
303
+ state: z.ZodEnum<{
304
+ active: "active";
305
+ released: "released";
306
+ stale: "stale";
307
+ unavailable: "unavailable";
308
+ }>;
309
+ reason: z.ZodNullable<z.ZodString>;
310
+ }, z.core.$strip>;
311
+ export type CustomizeAssignmentStatus = z.infer<typeof CustomizeAssignmentStatusSchema>;
@@ -0,0 +1,13 @@
1
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
2
+ import type { ScalarOverrideDraft } from './override-draft.js';
3
+ import type { CustomizeRoundTrip } from './stored.js';
4
+ export type ScalarValueKind = 'boolean' | 'number' | 'string';
5
+ export interface ScalarCompileInput {
6
+ readonly draft: ScalarOverrideDraft;
7
+ readonly device: CompositionSourceRef;
8
+ readonly apply: 'add' | 'replace';
9
+ readonly sourceValueKind: ScalarValueKind;
10
+ readonly changedAtField: string | null;
11
+ readonly sourceUnit: string | null;
12
+ }
13
+ export declare function compileScalarOverride(input: ScalarCompileInput): CustomizeRoundTrip<CompositionFieldsFeature>;
@@ -0,0 +1,17 @@
1
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
2
+ import type { ScalarOverrideDraft } from './override-draft.js';
3
+ import { type ScalarValueKind } from './scalar-compile.js';
4
+ export interface ScalarDecoded {
5
+ readonly draft: ScalarOverrideDraft;
6
+ readonly apply: 'add' | 'replace';
7
+ readonly sourceValueKind: ScalarValueKind;
8
+ readonly changedAtField: string | null;
9
+ readonly sourceUnit: string | null;
10
+ }
11
+ export interface ScalarDecodeInput {
12
+ readonly feature: CompositionFieldsFeature;
13
+ readonly device: CompositionSourceRef;
14
+ readonly cap: string;
15
+ readonly targetId: string;
16
+ }
17
+ export declare function decodeScalarOverride(input: ScalarDecodeInput): ScalarDecoded | null;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Canonical expression text for one scalar transform. The decoder reads only
3
+ * this spelling, so a stored row from the current builders still matches.
4
+ */
5
+ import type { CompositionFieldSource } from '../composition.js';
6
+ export declare function unsignedToken(value: number): string | null;
7
+ export declare function signedToken(value: number): string | null;
8
+ export declare function constantExpr(value: string | number | boolean | null): string | null;
9
+ export declare function isIdentifier(path: string): boolean;
10
+ export declare function dwellExpr(comparison: 'gte' | 'lte', threshold: string, start: string, stop: string): string;
11
+ export declare function linearExpr(inner: 'x' | 'number(x)', scale: string, offset: string, clampMin: string | null, clampMax: string | null): string;
12
+ export interface ParsedDwell {
13
+ readonly comparison: 'gte' | 'lte';
14
+ readonly threshold: number;
15
+ readonly startDwellMs: number;
16
+ readonly stopDwellMs: number;
17
+ }
18
+ export declare function parseDwell(expr: string): ParsedDwell | null;
19
+ export interface ParsedLinear {
20
+ readonly inner: 'x' | 'number(x)';
21
+ readonly scale: number;
22
+ readonly offset: number;
23
+ readonly clampMin?: number;
24
+ readonly clampMax?: number;
25
+ }
26
+ export declare function parseLinear(expr: string): ParsedLinear | null;
27
+ export interface BoundRead {
28
+ readonly cap: string;
29
+ readonly fieldPath: string;
30
+ readonly addonId: string;
31
+ readonly stableId: string;
32
+ }
33
+ export declare function singleFrom(source: CompositionFieldSource): BoundRead | null;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Assignment-status projection for one scalar target (D936, D315, D393).
3
+ * Pending and unknown are unanswered reads. A failed read never becomes 0.
4
+ * A confirmed-gone source releases a replacement to native and leaves an
5
+ * added field assigned.
6
+ */
7
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
8
+ import type { CustomizeAssignmentStatus } from './override-draft.js';
9
+ export type ScalarRead<T> = {
10
+ readonly kind: 'pending';
11
+ } | {
12
+ readonly kind: 'unknown';
13
+ readonly reason: string | null;
14
+ } | {
15
+ readonly kind: 'known';
16
+ readonly value: T;
17
+ };
18
+ export type ScalarSourcePresence = 'pending' | 'present' | 'absent' | 'unknown';
19
+ export interface ScalarStatusInput {
20
+ readonly cap: string;
21
+ readonly targetId: string;
22
+ readonly device: CompositionSourceRef;
23
+ readonly stored: ScalarRead<CompositionFieldsFeature | null>;
24
+ readonly sourcePresence: ScalarSourcePresence;
25
+ readonly sourceUnknownReason: string | null;
26
+ }
27
+ export interface ScalarAssignmentProjection {
28
+ readonly text: string;
29
+ readonly status: CustomizeAssignmentStatus;
30
+ }
31
+ export declare function projectScalarAssignment(input: ScalarStatusInput): ScalarAssignmentProjection;
@@ -0,0 +1,15 @@
1
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
2
+ /** A composition claim. `target` is the device the feature lands on. */
3
+ export interface CompositionCustomizeStored {
4
+ readonly family: 'composition';
5
+ readonly target: CompositionSourceRef;
6
+ readonly feature: CompositionFieldsFeature;
7
+ }
8
+ export type CustomizeStored = CompositionCustomizeStored;
9
+ export type CustomizeRoundTrip<T> = {
10
+ readonly ok: true;
11
+ readonly value: T;
12
+ } | {
13
+ readonly ok: false;
14
+ readonly reason: string;
15
+ };
@@ -11,7 +11,6 @@ export * from './composition-report.js';
11
11
  export * from './evaluate-field.js';
12
12
  export * from './examples.js';
13
13
  export * from './expression-kinds.js';
14
- export * from './presets/doorbell-feature.js';
15
14
  export * from './presets/numeric-transforms.js';
16
15
  export * from './state-fields.js';
17
16
  export * from './validate-composition.js';