@camstack/types 1.2.406 → 1.2.408
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.
- package/dist/capabilities/battery.cap.d.ts +46 -0
- package/dist/capabilities/capability-definition.d.ts +8 -0
- package/dist/capabilities/composer.cap.d.ts +22 -0
- package/dist/capabilities/consumables.cap.d.ts +110 -0
- package/dist/capabilities/customize-catalog.d.ts +72 -0
- package/dist/capabilities/customize-spec.d.ts +202 -0
- package/dist/capabilities/doorbell.cap.d.ts +39 -0
- package/dist/capabilities/index.d.ts +3 -3
- package/dist/capabilities/motion.cap.d.ts +39 -0
- package/dist/capabilities/running-state.cap.d.ts +68 -4
- package/dist/catalogs/sensor-active-state.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/client.mjs +1 -1
- package/dist/composition/customize/__fixtures__/refs.d.ts +27 -0
- package/dist/composition/customize/__fixtures__/stored-cases.d.ts +13 -0
- package/dist/composition/customize/event-compile.d.ts +20 -0
- package/dist/composition/customize/event-decode.d.ts +19 -0
- package/dist/composition/customize/event-eval.d.ts +35 -0
- package/dist/composition/customize/event-status.d.ts +49 -0
- package/dist/composition/customize/field-source.d.ts +5 -0
- package/dist/composition/customize/keyed-array-compile.d.ts +26 -0
- package/dist/composition/customize/keyed-array-decode.d.ts +20 -0
- package/dist/composition/customize/keyed-array-expr.d.ts +10 -0
- package/dist/composition/customize/keyed-array-status.d.ts +22 -0
- package/dist/composition/customize/normalize.d.ts +4 -0
- package/dist/composition/customize/override-draft.d.ts +311 -0
- package/dist/composition/customize/scalar-compile.d.ts +13 -0
- package/dist/composition/customize/scalar-decode.d.ts +17 -0
- package/dist/composition/customize/scalar-expr.d.ts +33 -0
- package/dist/composition/customize/scalar-status.d.ts +31 -0
- package/dist/composition/customize/stored.d.ts +15 -0
- package/dist/composition/index.d.ts +0 -1
- package/dist/{composition-xz-ud5EQ.mjs → composition-BJ8iAZb3.mjs} +1 -1
- package/dist/{composition-RmnnN39T.js → composition-CSLSFGTO.js} +1 -1
- package/dist/generated/customize-catalog.d.ts +229 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +2277 -292
- package/dist/index.mjs +2254 -288
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/running-state/defaults.d.ts +3 -0
- package/dist/running-state/from-operation.d.ts +4 -4
- package/package.json +1 -1
- package/dist/composition/presets/doorbell-feature.d.ts +0 -20
- package/dist/running-state/assignment.d.ts +0 -34
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { DeviceType } from '../device/device-type.js';
|
|
2
|
+
/**
|
|
3
|
+
* Customize catalog, projected from every `*.cap.ts` `customize` block.
|
|
4
|
+
* 5 caps. Field keys are `runtimeState` paths. No Zod.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
7
|
+
readonly battery: {
|
|
8
|
+
readonly version: 1;
|
|
9
|
+
readonly targets: readonly [{
|
|
10
|
+
readonly id: 'percentage';
|
|
11
|
+
readonly cardinality: 'scalar';
|
|
12
|
+
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat];
|
|
13
|
+
readonly apply: 'add-or-replace';
|
|
14
|
+
readonly vocabularyCap: 'battery';
|
|
15
|
+
readonly vocabularyStateField: 'percentage';
|
|
16
|
+
readonly sources: readonly [{
|
|
17
|
+
readonly kind: 'field';
|
|
18
|
+
readonly valueKinds: readonly ["number", "string"];
|
|
19
|
+
readonly transformKinds: readonly ["identity", "linear"];
|
|
20
|
+
}];
|
|
21
|
+
readonly sourceReport: {
|
|
22
|
+
readonly status: 'assignment-status';
|
|
23
|
+
};
|
|
24
|
+
readonly advancedExpression: true;
|
|
25
|
+
readonly path: 'percentage';
|
|
26
|
+
readonly valueKind: 'number';
|
|
27
|
+
readonly nullable: true;
|
|
28
|
+
readonly companions: readonly [{
|
|
29
|
+
readonly kind: 'constant';
|
|
30
|
+
readonly path: 'charging';
|
|
31
|
+
readonly value: 'unknown';
|
|
32
|
+
readonly when: 'add';
|
|
33
|
+
}, {
|
|
34
|
+
readonly kind: 'constant';
|
|
35
|
+
readonly path: 'sleeping';
|
|
36
|
+
readonly value: false;
|
|
37
|
+
readonly when: 'add';
|
|
38
|
+
}, {
|
|
39
|
+
readonly kind: 'clock';
|
|
40
|
+
readonly path: 'lastUpdated';
|
|
41
|
+
readonly when: 'add';
|
|
42
|
+
}];
|
|
43
|
+
}];
|
|
44
|
+
};
|
|
45
|
+
readonly consumables: {
|
|
46
|
+
readonly version: 1;
|
|
47
|
+
readonly targets: readonly [{
|
|
48
|
+
readonly id: 'items';
|
|
49
|
+
readonly cardinality: 'keyedArray';
|
|
50
|
+
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher];
|
|
51
|
+
readonly apply: 'add';
|
|
52
|
+
readonly vocabularyCap: 'consumables';
|
|
53
|
+
readonly sources: readonly [];
|
|
54
|
+
readonly sourceReport: {
|
|
55
|
+
readonly status: 'assignment-status';
|
|
56
|
+
};
|
|
57
|
+
readonly advancedExpression: true;
|
|
58
|
+
readonly path: 'items';
|
|
59
|
+
readonly keyField: 'key';
|
|
60
|
+
readonly labelField: 'label';
|
|
61
|
+
readonly nativeItems: 'read-only';
|
|
62
|
+
readonly fields: readonly [{
|
|
63
|
+
readonly path: 'level';
|
|
64
|
+
readonly valueKind: 'number';
|
|
65
|
+
readonly nullable: true;
|
|
66
|
+
readonly sources: readonly [{
|
|
67
|
+
readonly kind: 'numeric';
|
|
68
|
+
readonly transformKinds: readonly ["identity", "linear"];
|
|
69
|
+
}];
|
|
70
|
+
}, {
|
|
71
|
+
readonly path: 'remaining.value';
|
|
72
|
+
readonly valueKind: 'number';
|
|
73
|
+
readonly nullable: true;
|
|
74
|
+
readonly sources: readonly [{
|
|
75
|
+
readonly kind: 'numeric';
|
|
76
|
+
readonly transformKinds: readonly ["identity"];
|
|
77
|
+
}];
|
|
78
|
+
readonly literals: readonly [{
|
|
79
|
+
readonly path: 'remaining.unit';
|
|
80
|
+
readonly values: readonly ["days", "hours", "cycles"];
|
|
81
|
+
}];
|
|
82
|
+
}, {
|
|
83
|
+
readonly path: 'status';
|
|
84
|
+
readonly valueKind: 'enum';
|
|
85
|
+
readonly nullable: true;
|
|
86
|
+
readonly enumValues: readonly ["ok", "low", "empty", "full", "replace"];
|
|
87
|
+
readonly sources: readonly [{
|
|
88
|
+
readonly kind: 'enum';
|
|
89
|
+
readonly transformKinds: readonly ["enum-map"];
|
|
90
|
+
}];
|
|
91
|
+
}];
|
|
92
|
+
readonly traits: readonly [{
|
|
93
|
+
readonly path: 'kind';
|
|
94
|
+
readonly values: readonly ["wear", "supply", "waste"];
|
|
95
|
+
readonly defaultValue: 'wear';
|
|
96
|
+
}, {
|
|
97
|
+
readonly path: 'form';
|
|
98
|
+
readonly values: readonly ["part", "tank", "product", "bin"];
|
|
99
|
+
readonly defaultValue: 'part';
|
|
100
|
+
}];
|
|
101
|
+
readonly companions: readonly [{
|
|
102
|
+
readonly kind: 'clock';
|
|
103
|
+
readonly path: 'lastChangedAt';
|
|
104
|
+
readonly when: 'add';
|
|
105
|
+
}, {
|
|
106
|
+
readonly kind: 'clock';
|
|
107
|
+
readonly path: 'lastFetchedAt';
|
|
108
|
+
readonly when: 'add';
|
|
109
|
+
}];
|
|
110
|
+
}];
|
|
111
|
+
};
|
|
112
|
+
readonly doorbell: {
|
|
113
|
+
readonly version: 1;
|
|
114
|
+
readonly targets: readonly [{
|
|
115
|
+
readonly id: 'pressed';
|
|
116
|
+
readonly cardinality: 'event';
|
|
117
|
+
readonly deviceTypes: readonly [DeviceType.Camera];
|
|
118
|
+
readonly apply: 'add';
|
|
119
|
+
readonly vocabularyCap: 'doorbell';
|
|
120
|
+
readonly vocabularyEvent: 'onPressed';
|
|
121
|
+
readonly sources: readonly [{
|
|
122
|
+
readonly kind: 'binary';
|
|
123
|
+
readonly transformKinds: readonly [];
|
|
124
|
+
}, {
|
|
125
|
+
readonly kind: 'switch';
|
|
126
|
+
readonly transformKinds: readonly [];
|
|
127
|
+
}];
|
|
128
|
+
readonly sourceReport: {
|
|
129
|
+
readonly status: 'assignment-status';
|
|
130
|
+
};
|
|
131
|
+
readonly advancedExpression: true;
|
|
132
|
+
readonly shape: 'pulse';
|
|
133
|
+
readonly applyAuthority: {
|
|
134
|
+
readonly kind: 'composition-claim';
|
|
135
|
+
};
|
|
136
|
+
readonly eventName: 'onPressed';
|
|
137
|
+
readonly combine: 'any';
|
|
138
|
+
readonly edges: readonly ["rising"];
|
|
139
|
+
readonly timestampPath: 'lastPressedAt';
|
|
140
|
+
readonly counterPath: 'pressCountSinceStart';
|
|
141
|
+
readonly highWater: 'composer-advance';
|
|
142
|
+
readonly debounceMs: 2000;
|
|
143
|
+
}];
|
|
144
|
+
};
|
|
145
|
+
readonly motion: {
|
|
146
|
+
readonly version: 1;
|
|
147
|
+
readonly targets: readonly [{
|
|
148
|
+
readonly id: 'detected';
|
|
149
|
+
readonly cardinality: 'event';
|
|
150
|
+
readonly deviceTypes: readonly [DeviceType.Camera];
|
|
151
|
+
readonly apply: 'replace';
|
|
152
|
+
readonly vocabularyCap: 'motion';
|
|
153
|
+
readonly vocabularyEvent: 'onMotionChanged';
|
|
154
|
+
readonly sources: readonly [{
|
|
155
|
+
readonly kind: 'binary';
|
|
156
|
+
readonly transformKinds: readonly [];
|
|
157
|
+
}, {
|
|
158
|
+
readonly kind: 'switch';
|
|
159
|
+
readonly transformKinds: readonly [];
|
|
160
|
+
}];
|
|
161
|
+
readonly sourceReport: {
|
|
162
|
+
readonly status: 'assignment-status';
|
|
163
|
+
};
|
|
164
|
+
readonly advancedExpression: false;
|
|
165
|
+
readonly shape: 'span';
|
|
166
|
+
readonly applyAuthority: {
|
|
167
|
+
readonly kind: 'camera-sensors';
|
|
168
|
+
readonly timeoutField: 'motionCooldownMs';
|
|
169
|
+
};
|
|
170
|
+
readonly eventName: 'onMotionChanged';
|
|
171
|
+
readonly combine: 'any';
|
|
172
|
+
readonly start: 'rising-edge';
|
|
173
|
+
readonly end: 'falling-edge-or-timeout';
|
|
174
|
+
readonly timeoutMs: 30000;
|
|
175
|
+
readonly sourceModes: readonly ["in-addition", "confirm", "replace"];
|
|
176
|
+
}];
|
|
177
|
+
};
|
|
178
|
+
readonly 'running-state': {
|
|
179
|
+
readonly version: 1;
|
|
180
|
+
readonly targets: readonly [{
|
|
181
|
+
readonly id: 'running';
|
|
182
|
+
readonly cardinality: 'scalar';
|
|
183
|
+
readonly deviceTypes: readonly [DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder];
|
|
184
|
+
readonly apply: 'add-or-replace';
|
|
185
|
+
readonly vocabularyCap: 'running-state';
|
|
186
|
+
readonly vocabularyStateField: 'running';
|
|
187
|
+
readonly sources: readonly [{
|
|
188
|
+
readonly kind: 'switch';
|
|
189
|
+
readonly transformKinds: readonly ["identity"];
|
|
190
|
+
}, {
|
|
191
|
+
readonly kind: 'binary';
|
|
192
|
+
readonly transformKinds: readonly ["identity", "invert"];
|
|
193
|
+
}, {
|
|
194
|
+
readonly kind: 'numeric';
|
|
195
|
+
readonly requiredUnit: 'W';
|
|
196
|
+
readonly transformKinds: readonly ["threshold"];
|
|
197
|
+
}];
|
|
198
|
+
readonly sourceReport: {
|
|
199
|
+
readonly status: 'assignment-status';
|
|
200
|
+
readonly runtimeField: 'source';
|
|
201
|
+
readonly nativeValue: 'native';
|
|
202
|
+
readonly assignedValue: 'assigned';
|
|
203
|
+
};
|
|
204
|
+
readonly advancedExpression: true;
|
|
205
|
+
readonly path: 'running';
|
|
206
|
+
readonly valueKind: 'boolean';
|
|
207
|
+
readonly nullable: true;
|
|
208
|
+
readonly companions: readonly [{
|
|
209
|
+
readonly kind: 'constant';
|
|
210
|
+
readonly path: 'source';
|
|
211
|
+
readonly value: 'assigned';
|
|
212
|
+
readonly when: 'always';
|
|
213
|
+
}, {
|
|
214
|
+
readonly kind: 'constant';
|
|
215
|
+
readonly path: 'phase';
|
|
216
|
+
readonly value: null;
|
|
217
|
+
readonly when: 'always';
|
|
218
|
+
}, {
|
|
219
|
+
readonly kind: 'clock';
|
|
220
|
+
readonly path: 'lastFetchedAt';
|
|
221
|
+
readonly when: 'always';
|
|
222
|
+
}, {
|
|
223
|
+
readonly kind: 'transition-time';
|
|
224
|
+
readonly path: 'since';
|
|
225
|
+
readonly sourceChangedAt: 'prefer';
|
|
226
|
+
}];
|
|
227
|
+
}];
|
|
228
|
+
};
|
|
229
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -164,7 +164,6 @@ export type { AutomationAction, AutomationCondition, AutomationConditionAll, Aut
|
|
|
164
164
|
export { AutomationActionSchema, AutomationConditionOperatorSchema, AutomationConditionSchema, AutomationRecipeSchema, AutomationTriggerSchema, conditionDepth, countConditionLeaves, generateAutomationBlock, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, validateRecipeBounds, } from './automation/index.js';
|
|
165
165
|
export * from './cap-call-context.js';
|
|
166
166
|
export * from './capabilities/index.js';
|
|
167
|
-
export * from './running-state/assignment.js';
|
|
168
167
|
export * from './running-state/defaults.js';
|
|
169
168
|
export * from './running-state/from-operation.js';
|
|
170
169
|
export * from './clips/clip-event-labels.js';
|
|
@@ -255,6 +254,20 @@ export type { RuntimeStatePolicy } from './generated/runtime-state-durability.js
|
|
|
255
254
|
export { isRestoredCap, RESTORED_CAP_NAMES, RUNTIME_STATE_POLICY, runtimeStatePolicyFor, } from './generated/runtime-state-durability.js';
|
|
256
255
|
export { BucketAccumulator, bucketStartOf, type ClosedHistoryBucket, HISTORY_BUCKET_MS, MAX_REQUEUED_BUCKETS_PER_SERIES, } from './history/bucket-accumulator.js';
|
|
257
256
|
export { HISTORY_CATALOG, HISTORY_ITEM_CATALOG, HISTORY_NONE_CAPS, historyFieldsFor, } from './generated/history-catalog.js';
|
|
257
|
+
export { CAP_CUSTOMIZE_CATALOG } from './generated/customize-catalog.js';
|
|
258
|
+
export type { CustomizeCatalog, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, } from './capabilities/customize-catalog.js';
|
|
259
|
+
export type { CapabilityCustomizeSpec, CapabilityCustomizeTarget, CustomizeCardinality, EventCustomizeTarget, PulseEventCustomizeTarget, SpanEventCustomizeTarget, } from './capabilities/customize-spec.js';
|
|
260
|
+
export { CustomizeAssignmentStatusSchema, OverrideDraftSchema, type CustomizeAssignmentStatus, type OverrideDraft, } from './composition/customize/override-draft.js';
|
|
261
|
+
export { compileScalarOverride, type ScalarCompileInput, type ScalarValueKind, } from './composition/customize/scalar-compile.js';
|
|
262
|
+
export { decodeScalarOverride, type ScalarDecoded, type ScalarDecodeInput, } from './composition/customize/scalar-decode.js';
|
|
263
|
+
export { projectScalarAssignment, type ScalarAssignmentProjection, type ScalarRead, type ScalarSourcePresence, type ScalarStatusInput, } from './composition/customize/scalar-status.js';
|
|
264
|
+
export { compilePulseOverride, compileSpanOverride, type PulseCompileInput, type SpanCompileInput, type SpanCompiled, } from './composition/customize/event-compile.js';
|
|
265
|
+
export { decodePulseOverride, type PulseDecodeInput, type PulseDecoded, } from './composition/customize/event-decode.js';
|
|
266
|
+
export { INITIAL_PULSE, INITIAL_SPAN, stepPulse, stepSpan, type LevelSample, type PulseState, type SpanState, type SpanTiming, } from './composition/customize/event-eval.js';
|
|
267
|
+
export { projectPulseAssignment, projectSpanAssignment, type PulseAssignmentProjection, type PulseStatusInput, type SpanAssignmentProjection, type SpanRead, type SpanSensorRow, } from './composition/customize/event-status.js';
|
|
268
|
+
export { compileKeyedArrayOverride, mergeKeyedArrayItem, withoutKeyedArrayItem, type KeyedArrayCompileInput, type KeyedArrayItemCompile, type KeyedArrayLiteral, type KeyedSourceValueKind, } from './composition/customize/keyed-array-compile.js';
|
|
269
|
+
export { decodeKeyedArrayOverride, readKeyedArrayItems, type KeyedArrayItemView, type KeyedArrayRead, } from './composition/customize/keyed-array-decode.js';
|
|
270
|
+
export { projectKeyedArrayAssignment, type KeyedArrayAssignmentProjection, type KeyedArrayStatusInput, } from './composition/customize/keyed-array-status.js';
|
|
258
271
|
export type { ScopePresetId, ScopePresetSpec } from './generated/scope-presets.js';
|
|
259
272
|
export { SCOPE_PRESETS } from './generated/scope-presets.js';
|
|
260
273
|
export type { SystemProxy } from './generated/system-proxy.js';
|