@camstack/types 1.2.305 → 1.2.307

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.
@@ -26,6 +26,12 @@ export interface FieldValueOutcome {
26
26
  readonly reason: string | null;
27
27
  /** When a windowed builtin's answer flips on its own; null when nothing will. */
28
28
  readonly deadline: number | null;
29
+ /**
30
+ * The value is the field's LAST output, held over a source that did not
31
+ * answer: the expression did not run. Set by the composer for an
32
+ * edge-latched (`rose`) field (D713) — a recovery from it is a recovery from unavailable.
33
+ */
34
+ readonly held?: true;
29
35
  }
30
36
  export interface FieldUnavailableOutcome {
31
37
  readonly state: 'unavailable';
@@ -35,6 +41,12 @@ export interface FieldUnavailableOutcome {
35
41
  readonly fatal: boolean;
36
42
  /** Fatal, or a non-fatal unavailability that is an answer (see the header). Absent = not confirmed. */
37
43
  readonly confirmed?: boolean;
44
+ /**
45
+ * Every source answered and the expression failed on the values. Absent =
46
+ * a source did not answer. Only the latter is an outage a stateful edge
47
+ * must re-baseline after (D716).
48
+ */
49
+ readonly expressionFailed?: true;
38
50
  }
39
51
  export type FieldOutcome = FieldValueOutcome | FieldUnavailableOutcome;
40
52
  export interface EvaluateCompositionFieldInput {
@@ -3,13 +3,25 @@
3
3
  *
4
4
  * The orchestrator is the only writer of a camera's `motion` runtime slice, and
5
5
  * it writes the EFFECTIVE value on the hub. A camera provider's local runtime
6
- * state therefore holds no `motion` slice, and its `motion.isDetected` answers
7
- * from here. Two answers are UNKNOWN, and both make the call fail rather than
8
- * answer `false` (D49, D393):
9
- * - the read did not answer (the hub is unreachable, the call threw);
10
- * - the read answered with no `detected`: nobody has published the camera's
11
- * motion since the hub started (the slice is session-durable).
6
+ * state therefore holds no `motion` slice, and BOTH of its `motion` reads —
7
+ * `isDetected` and `getStatus` — answer from here. Build the provider with
8
+ * {@link hubMotionNativeProvider}: a provider that serves only `isDetected`
9
+ * gets the framework's default `getStatus`, which reads the provider's LOCAL
10
+ * runtime state, and that answered `null` for every camera on the fleet while
11
+ * the hub's slice was written (the viewer's Motion order ranked one composite
12
+ * grid above every camera, 2026-10-06).
13
+ *
14
+ * The two reads say "unknown" in the shape their contract allows:
15
+ * - the read did not answer (the hub is unreachable, the call threw): both
16
+ * fail, neither answers "no motion" (D49, D393);
17
+ * - nobody has published the camera's motion since the hub started (the slice
18
+ * is session-durable): `getStatus` answers `null` — the status contract's
19
+ * own "no status" — and `isDetected`, a bare boolean with no room for it,
20
+ * fails;
21
+ * - a slice that is not a `MotionStatus`: both fail, naming the device.
12
22
  */
23
+ import { type InferNativeProvider } from '../capabilities/capability-definition.js';
24
+ import { type MotionStatus, type motionCapability } from '../capabilities/motion.cap.js';
13
25
  /** The one `deviceState` read this needs. `ctx.api.deviceState` satisfies it. */
14
26
  export interface HubMotionSliceReader {
15
27
  readonly getCapSlice: {
@@ -19,4 +31,16 @@ export interface HubMotionSliceReader {
19
31
  }) => Promise<Readonly<Record<string, unknown>> | null>;
20
32
  };
21
33
  }
34
+ /**
35
+ * The hub's `motion` slice as a `MotionStatus`, or `null` when nobody has
36
+ * published it since the hub started. Throws when the hub does not answer or
37
+ * the slice is malformed — never a made-up "no motion".
38
+ */
39
+ export declare function readHubMotionStatus(deviceState: HubMotionSliceReader, deviceId: number): Promise<MotionStatus | null>;
22
40
  export declare function readHubMotionDetected(deviceState: HubMotionSliceReader, deviceId: number): Promise<boolean>;
41
+ /**
42
+ * The native `motion` provider of a camera whose slice the orchestrator writes
43
+ * (D696): `isDetected` AND `getStatus`, both from the hub. `owner` names the
44
+ * provider class in the deviceId-mismatch error.
45
+ */
46
+ export declare function hubMotionNativeProvider(deviceState: HubMotionSliceReader, deviceId: number, owner: string): InferNativeProvider<typeof motionCapability>;
@@ -88,6 +88,8 @@ export declare const LOCATION_ICON_FALLBACK: LocationIconId;
88
88
  /** Wire/storage schema for one icon id. */
89
89
  export declare const LocationIconIdSchema: z.ZodEnum<{
90
90
  package: "package";
91
+ car: "car";
92
+ umbrella: "umbrella";
91
93
  "map-pin": "map-pin";
92
94
  house: "house";
93
95
  "door-open": "door-open";
@@ -96,11 +98,9 @@ export declare const LocationIconIdSchema: z.ZodEnum<{
96
98
  "bed-double": "bed-double";
97
99
  bath: "bath";
98
100
  briefcase: "briefcase";
99
- car: "car";
100
101
  "circle-parking": "circle-parking";
101
102
  route: "route";
102
103
  trees: "trees";
103
- umbrella: "umbrella";
104
104
  "waves-ladder": "waves-ladder";
105
105
  fence: "fence";
106
106
  warehouse: "warehouse";
@@ -122,6 +122,8 @@ export declare const LocationIconAssignmentSchema: z.ZodObject<{
122
122
  locationKey: z.ZodString;
123
123
  icon: z.ZodEnum<{
124
124
  package: "package";
125
+ car: "car";
126
+ umbrella: "umbrella";
125
127
  "map-pin": "map-pin";
126
128
  house: "house";
127
129
  "door-open": "door-open";
@@ -130,11 +132,9 @@ export declare const LocationIconAssignmentSchema: z.ZodObject<{
130
132
  "bed-double": "bed-double";
131
133
  bath: "bath";
132
134
  briefcase: "briefcase";
133
- car: "car";
134
135
  "circle-parking": "circle-parking";
135
136
  route: "route";
136
137
  trees: "trees";
137
- umbrella: "umbrella";
138
138
  "waves-ladder": "waves-ladder";
139
139
  fence: "fence";
140
140
  warehouse: "warehouse";
@@ -45,6 +45,8 @@ export declare const SiteZoneSchema: z.ZodObject<{
45
45
  label: z.ZodString;
46
46
  icon: z.ZodNullable<z.ZodEnum<{
47
47
  package: "package";
48
+ car: "car";
49
+ umbrella: "umbrella";
48
50
  "map-pin": "map-pin";
49
51
  house: "house";
50
52
  "door-open": "door-open";
@@ -53,11 +55,9 @@ export declare const SiteZoneSchema: z.ZodObject<{
53
55
  "bed-double": "bed-double";
54
56
  bath: "bath";
55
57
  briefcase: "briefcase";
56
- car: "car";
57
58
  "circle-parking": "circle-parking";
58
59
  route: "route";
59
60
  trees: "trees";
60
- umbrella: "umbrella";
61
61
  "waves-ladder": "waves-ladder";
62
62
  fence: "fence";
63
63
  warehouse: "warehouse";
package/dist/index.d.ts CHANGED
@@ -152,6 +152,8 @@ export * from './device-extension/index.js';
152
152
  export * from './composition/index.js';
153
153
  export { APPLE_SA_TO_MACRO, AUDIO_MACRO_LABELS, getAudioMacroClassIds, mapAudioLabelToMacro, YAMNET_TO_MACRO, } from './catalogs/audio-classmap.js';
154
154
  export { COCO_80_LABELS, COCO_TO_MACRO, DETECTION_MACRO_CLASSES, isDetectionMacroClass, MACRO_LABELS, } from './catalogs/coco-classmap.js';
155
+ export { buildFrigateClassMap, type ClassMapMacroTarget, FRIGATE_PLUS_TO_MACRO, FRIGATE_PLUS_UNMAPPED_LABELS, type FrigateLabelFields, frigateLabelFields, } from './catalogs/frigate-plus-classmap.js';
156
+ export { type ClassifierFillDeclaration, DEFAULT_LABEL_LINK_POLICY, deriveClassifierFills, FILLABLE_STEP_IDS, FILLABLE_STEP_MACRO, FILLABLE_STEP_VOCABULARIES, type FillableStepId, fillFor, isCocoLabelmap, isFillableStepId, LABEL_LINK_POLICIES, LABEL_LINK_SETTING_KEY, type LabelLinkDecision, type LabelLinkPolicy, type LinkedStepState, LINKED_LABEL_STEP_PREFIX, linkedLabelStepId, linkedStepOf, readLabelLinkPolicy, resolveLabelLink, } from './catalogs/classifier-fill.js';
155
157
  export { DEVICE_STATE_READERS, readDeviceStateFrom, stateVocabularyFor, } from './catalogs/device-state-vocabulary.js';
156
158
  export { colorForKind, DEFAULT_EVENT_COLOR, EVENT_TAXONOMY, type EventTaxonomyCategory, type EventTaxonomyEntry, type EventTaxonomyLevel, getTaxonomyEntry, subKindsOf, TAXONOMY_COLORS, } from './catalogs/event-taxonomy.js';
157
159
  export { buildNcTaxonomy, NC_TAXONOMY, type NcTaxonomy, type NcTaxonomyEntry, NcTaxonomyEntrySchema, NcTaxonomySchema, } from './catalogs/nc-taxonomy.js';
@@ -261,7 +263,7 @@ export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseG
261
263
  export { CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, type ClusterModelScopedStep, type ClusterStepModels, type ClusterStepSettingField, type ClusterStepSettings, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, type HydratedClusterSection, type HydratedClusterView, interpretStoredClusterModel, type InvalidClusterStepModelEntry, invalidClusterStepModelEntries, isClusterScopedStep, overlayClusterStepSettings, pickClusterStepModels, pickClusterStepSettings, pickInvalidClusterStepModels, readClusterStepModels, readClusterStepSettings, resolveClusterStepModelId, type StepModelScope, type StoredClusterModelInterpretation, } from './pipeline/cluster-model-scope.js';
262
264
  export { CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_TRIGGER, type CameraSensorAttachment, CameraSensorAttachmentSchema, type CameraSensorRef, CameraSensorRefSchema, cameraSensorRefKey, type CameraSensorsConfig, CameraSensorsConfigSchema, type CameraOwnMotion, CameraOwnMotionSchema, type CameraRawLevel, CameraRawLevelSchema, type CameraSensorEntry, CameraSensorEntrySchema, type CameraSensorMode, CameraSensorModeSchema, type CameraSensorsNotEnforced, CameraSensorsNotEnforcedSchema, type CameraSensorsNotForwarded, CameraSensorsNotForwardedSchema, type CameraSensorsStatus, CameraSensorsStatusSchema, DEFAULT_CAMERA_SENSOR_MODE, MAX_CAMERA_SENSORS, type MotionTriggeredBy, type MotionTriggeredByReading, MotionTriggeredBySchema, readMotionTriggeredBy, } from './pipeline/camera-sensors.js';
263
265
  export { cameraOwnsMotionViaSensor } from './pipeline/motion-ownership.js';
264
- export { readHubMotionDetected } from './device/hub-motion-read.js';
266
+ export { hubMotionNativeProvider, readHubMotionDetected, readHubMotionStatus, } from './device/hub-motion-read.js';
265
267
  export { type ProviderMotionData, ProviderMotionDataSchema, providerMotionEvent, } from './pipeline/provider-motion.js';
266
268
  export { type FormatRunnableModel, stepModelRunsOnFormat, } from './pipeline/step-format-runnable.js';
267
269
  export { DEFAULT_DETAIL_CROP_CONVENTION, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, type DetailCropConvention, DetailCropConventionSchema, type DetailCropRect, deriveDetailCropRect, FULL_IMAGE_BBOX, type HydratedSettingsSection, type HydratedSettingsView, pickDetailCropConvention, readDetailCropConvention, } from './pipeline/detail-crop.js';