@camstack/types 1.2.408 → 1.2.410

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.
@@ -0,0 +1,90 @@
1
+ /**
2
+ * display-palette — the cluster's one colour table (D939).
3
+ *
4
+ * Hub singleton. `getPalette` reports `unknown` when the settings store
5
+ * cannot be read; it does not pretend the bundled preset was stored.
6
+ * `setPalette` refuses a palette that fails the ΔE / contrast rule and names
7
+ * the pairs.
8
+ */
9
+ import { z } from 'zod';
10
+ import { type InferProvider } from './capability-definition.js';
11
+ export declare const displayPaletteCapability: {
12
+ readonly name: 'display-palette';
13
+ readonly scope: 'system';
14
+ readonly mode: 'singleton';
15
+ readonly methods: {
16
+ readonly getPalette: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ status: z.ZodLiteral<"ready">;
18
+ presetId: z.ZodEnum<{
19
+ camstack: "camstack";
20
+ "high-contrast": "high-contrast";
21
+ "okabe-ito": "okabe-ito";
22
+ }>;
23
+ customized: z.ZodBoolean;
24
+ source: z.ZodEnum<{
25
+ stored: "stored";
26
+ unconfigured: "unconfigured";
27
+ }>;
28
+ swatches: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ form: z.ZodLiteral<"solid">;
30
+ hex: z.ZodString;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ form: z.ZodLiteral<"gradient">;
33
+ hex: z.ZodString;
34
+ alphas: z.ZodArray<z.ZodNumber>;
35
+ }, z.core.$strip>], "form">>;
36
+ fallbacks: z.ZodArray<z.ZodString>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ status: z.ZodLiteral<"unknown">;
39
+ reason: z.ZodString;
40
+ }, z.core.$strip>], "status">, import("./capability-definition.js").CapabilityMethodKind>;
41
+ readonly listPresets: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
42
+ id: z.ZodString;
43
+ name: z.ZodString;
44
+ swatches: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
45
+ form: z.ZodLiteral<"solid">;
46
+ hex: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ form: z.ZodLiteral<"gradient">;
49
+ hex: z.ZodString;
50
+ alphas: z.ZodArray<z.ZodNumber>;
51
+ }, z.core.$strip>], "form">>;
52
+ fallbacks: z.ZodArray<z.ZodString>;
53
+ }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
54
+ readonly setPalette: import("./capability-definition.js").CapabilityMethodSchema<z.ZodUnion<readonly [z.ZodObject<{
55
+ presetId: z.ZodString;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ presetId: z.ZodString;
58
+ overrides: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
59
+ form: z.ZodLiteral<"solid">;
60
+ hex: z.ZodString;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ form: z.ZodLiteral<"gradient">;
63
+ hex: z.ZodString;
64
+ alphas: z.ZodArray<z.ZodNumber>;
65
+ }, z.core.$strip>], "form">>;
66
+ }, z.core.$strip>]>, z.ZodObject<{
67
+ status: z.ZodLiteral<"ready">;
68
+ presetId: z.ZodEnum<{
69
+ camstack: "camstack";
70
+ "high-contrast": "high-contrast";
71
+ "okabe-ito": "okabe-ito";
72
+ }>;
73
+ customized: z.ZodBoolean;
74
+ source: z.ZodEnum<{
75
+ stored: "stored";
76
+ unconfigured: "unconfigured";
77
+ }>;
78
+ swatches: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
79
+ form: z.ZodLiteral<"solid">;
80
+ hex: z.ZodString;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ form: z.ZodLiteral<"gradient">;
83
+ hex: z.ZodString;
84
+ alphas: z.ZodArray<z.ZodNumber>;
85
+ }, z.core.$strip>], "form">>;
86
+ fallbacks: z.ZodArray<z.ZodString>;
87
+ }, z.core.$strip>, "mutation">;
88
+ };
89
+ };
90
+ export type IDisplayPaletteProvider = InferProvider<typeof displayPaletteCapability>;
@@ -174,6 +174,7 @@ export { type CoverState, CoverStateSchema, type CoverStatus, CoverStatusSchema,
174
174
  export { type DayNightMode, DayNightModeSchema, type DayNightOptions, DayNightOptionsSchema, type DayNightSettingsPatch, DayNightSettingsPatchSchema, type DayNightStatus, DayNightStatusSchema, dayNightCapability, type IDayNightProvider, } from './day-night.cap.js';
175
175
  export { type DeviceDiscoveryStatus, DeviceDiscoveryStatusSchema, type DiscoveredChildDevice, DiscoveredChildDeviceSchema, type DiscoveredChildStatus, DiscoveredChildStatusSchema, deviceDiscoveryCapability, type IDeviceDiscoveryNativeProvider, type IDeviceDiscoveryProvider, } from './device-discovery.cap.js';
176
176
  export { deviceOpsCapability, type IDeviceOpsProvider, type RawStateResult, RawStateResultSchema, } from './device-ops.cap.js';
177
+ export { displayPaletteCapability, type IDisplayPaletteProvider, } from './display-palette.cap.js';
177
178
  export { type DeviceStatus, DeviceStatusSchema, deviceStatusCapability, type IDeviceStatusProvider, } from './device-status.cap.js';
178
179
  export { type DishwasherAccess, DishwasherAccessSchema, type DishwasherAvailability, DishwasherAvailabilitySchema, type DishwasherOperationState, DishwasherOperationStateSchema, type DishwasherOptionDescriptor, DishwasherOptionDescriptorSchema, type DishwasherOptions, DishwasherOptionsSchema, type DishwasherProgram, DishwasherProgramSchema, type DishwasherState, DishwasherStateSchema, type DishwasherStatus, DishwasherStatusSchema, type DishwasherValue, DishwasherValueSchema, dishwasherCapability, type IDishwasherProvider, } from './dishwasher.cap.js';
179
180
  export { DOORBELL_RISE_DEBOUNCE_MS, type DoorbellPressEvent, DoorbellPressEventSchema, type DoorbellStatus, DoorbellStatusSchema, doorbellCapability, type IDoorbellProvider, } from './doorbell.cap.js';
@@ -318,6 +319,7 @@ import type { deviceExportCapability } from './device-export.cap.js';
318
319
  import type { deviceExtensionCapability } from './device-extension.cap.js';
319
320
  import type { deviceManagerCapability } from './device-manager.cap.js';
320
321
  import type { deviceOpsCapability } from './device-ops.cap.js';
322
+ import type { displayPaletteCapability } from './display-palette.cap.js';
321
323
  import type { deviceProviderCapability } from './device-provider.cap.js';
322
324
  import type { deviceStateCapability } from './device-state.cap.js';
323
325
  import type { deviceStatusCapability } from './device-status.cap.js';
@@ -435,6 +437,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
435
437
  import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
436
438
  import type { zoneRulesCapability } from './zone-rules.cap.js';
437
439
  import type { zonesCapability } from './zones.cap.js';
438
- type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof runningStateCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof oidcConnectionsCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof networkLinkCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability | typeof dishwasherCapability;
440
+ type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof runningStateCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof displayPaletteCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof oidcConnectionsCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof networkLinkCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability | typeof dishwasherCapability;
439
441
  export type CapabilityName = AnyCapability['name'];
440
442
  export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
@@ -0,0 +1,169 @@
1
+ /** Frozen palette tables (D939). The spec refuses a table that breaks the rule. */
2
+ export declare const CAMSTACK_HEX: {
3
+ readonly motion: '#d946ef';
4
+ readonly audio: '#059eb8';
5
+ readonly recording: '#ef4444';
6
+ readonly live: '#8d7a00';
7
+ readonly heatmapScrub: '#4b32ff';
8
+ readonly person: '#11a64c';
9
+ readonly vehicle: '#3b82f6';
10
+ readonly animal: '#ea6a09';
11
+ readonly package: '#924667';
12
+ readonly sensor: '#624bbc';
13
+ readonly control: '#944d24';
14
+ readonly face: '#ed4f8d';
15
+ readonly plate: '#4b7027';
16
+ readonly car: '#9684cf';
17
+ readonly truck: '#0f9b89';
18
+ readonly bus: '#a734a9';
19
+ readonly motorcycle: '#c1133a';
20
+ readonly bicycle: '#0e6a9b';
21
+ readonly airplane: '#7c9928';
22
+ readonly boat: '#b17933';
23
+ readonly train: '#ad6ca3';
24
+ readonly bird: '#0f7c55';
25
+ readonly dog: '#c82700';
26
+ readonly cat: '#7268f2';
27
+ readonly horse: '#cb795e';
28
+ readonly sheep: '#b8636b';
29
+ readonly cow: '#cb2969';
30
+ readonly elephant: '#1158d2';
31
+ readonly bear: '#8d5e00';
32
+ readonly zebra: '#0097d6';
33
+ readonly giraffe: '#8f61bb';
34
+ readonly 'package-delivered': '#cd3f9b';
35
+ readonly 'package-picked-up': '#388a08';
36
+ readonly suitcase: '#666800';
37
+ readonly backpack: '#ec5022';
38
+ readonly handbag: '#a76ef8';
39
+ readonly contact: '#ab5a49';
40
+ readonly 'motion-sensor': '#b95d1a';
41
+ readonly smoke: '#dd3858';
42
+ readonly flood: '#b31e7d';
43
+ readonly gas: '#5b70b5';
44
+ readonly 'carbon-monoxide': '#7b4e8e';
45
+ readonly vibration: '#e65bba';
46
+ readonly tamper: '#98464b';
47
+ readonly presence: '#3a9468';
48
+ readonly 'enum-sensor': '#7885f8';
49
+ readonly 'device-event': '#8c43c8';
50
+ readonly lock: '#649653';
51
+ readonly cover: '#c67597';
52
+ readonly switch: '#7a812a';
53
+ readonly siren: '#ac5d7f';
54
+ readonly button: '#b276cd';
55
+ readonly doorbell: '#0087ab';
56
+ };
57
+ export declare const CAMSTACK_FALLBACK: readonly ['#b34dc7', '#1d7d34', '#db6b6c', '#a43d29', '#0e6ee6', '#29a10b', '#a98731', '#0181c6'];
58
+ export declare const HIGH_CONTRAST_HEX: {
59
+ readonly motion: '#964360';
60
+ readonly audio: '#23a132';
61
+ readonly recording: '#2494ca';
62
+ readonly live: '#bd7e2b';
63
+ readonly heatmapScrub: '#ad6eea';
64
+ readonly person: '#62611e';
65
+ readonly vehicle: '#f4534c';
66
+ readonly animal: '#1556cd';
67
+ readonly package: '#9c4415';
68
+ readonly sensor: '#066c48';
69
+ readonly control: '#f2479f';
70
+ readonly face: '#139d8a';
71
+ readonly plate: '#909024';
72
+ readonly car: '#8e35ab';
73
+ readonly truck: '#bd0b2b';
74
+ readonly bus: '#7a88ca';
75
+ readonly motorcycle: '#e26725';
76
+ readonly bicycle: '#a6679b';
77
+ readonly airplane: '#7c5720';
78
+ readonly boat: '#467a1b';
79
+ readonly train: '#6f65a4';
80
+ readonly bird: '#cb717f';
81
+ readonly dog: '#c62490';
82
+ readonly cat: '#b36850';
83
+ readonly horse: '#1872ac';
84
+ readonly sheep: '#927939';
85
+ readonly cow: '#428a5c';
86
+ readonly elephant: '#d41160';
87
+ readonly bear: '#799453';
88
+ readonly zebra: '#a85455';
89
+ readonly giraffe: '#746be8';
90
+ readonly 'package-delivered': '#824a80';
91
+ readonly 'package-picked-up': '#614ac1';
92
+ readonly suitcase: '#2f77f3';
93
+ readonly backpack: '#fa476d';
94
+ readonly handbag: '#c14cbe';
95
+ readonly contact: '#c83921';
96
+ readonly 'motion-sensor': '#a07ebd';
97
+ readonly smoke: '#a25b13';
98
+ readonly flood: '#526bab';
99
+ readonly gas: '#924938';
100
+ readonly 'carbon-monoxide': '#bb7e53';
101
+ readonly vibration: '#b66182';
102
+ readonly tamper: '#3c6931';
103
+ readonly presence: '#6c851d';
104
+ readonly 'enum-sensor': '#ad2d48';
105
+ readonly 'device-event': '#5e9b04';
106
+ readonly lock: '#00a062';
107
+ readonly cover: '#ad8624';
108
+ readonly switch: '#d05259';
109
+ readonly siren: '#cd67b3';
110
+ readonly button: '#c9746a';
111
+ readonly doorbell: '#338eeb';
112
+ };
113
+ export declare const HIGH_CONTRAST_FALLBACK: readonly ['#817f3b', '#a0733e', '#8658b2', '#956301', '#bc652d', '#647331', '#a14c9e', '#d14e71'];
114
+ export declare const OKABE_ITO_HEX: {
115
+ readonly motion: '#b88128';
116
+ readonly audio: '#1096c8';
117
+ readonly recording: '#009e73';
118
+ readonly live: '#9c8c22';
119
+ readonly heatmapScrub: '#0072b2';
120
+ readonly person: '#d55e00';
121
+ readonly vehicle: '#c0739f';
122
+ readonly animal: '#226d18';
123
+ readonly package: '#91446c';
124
+ readonly sensor: '#217b56';
125
+ readonly control: '#648647';
126
+ readonly face: '#c22998';
127
+ readonly plate: '#fa4575';
128
+ readonly car: '#956301';
129
+ readonly truck: '#2f77f3';
130
+ readonly bus: '#7a4e86';
131
+ readonly motorcycle: '#f54597';
132
+ readonly bicycle: '#bb3e75';
133
+ readonly airplane: '#e054c0';
134
+ readonly boat: '#457942';
135
+ readonly train: '#867afa';
136
+ readonly bird: '#88914c';
137
+ readonly dog: '#1556cd';
138
+ readonly cat: '#71702c';
139
+ readonly horse: '#9b4fa4';
140
+ readonly sheep: '#c0559d';
141
+ readonly cow: '#d14f65';
142
+ readonly elephant: '#98470f';
143
+ readonly bear: '#595896';
144
+ readonly zebra: '#96790e';
145
+ readonly giraffe: '#cb717b';
146
+ readonly 'package-delivered': '#139d8a';
147
+ readonly 'package-picked-up': '#906ead';
148
+ readonly suitcase: '#d02939';
149
+ readonly backpack: '#d41160';
150
+ readonly handbag: '#f64f54';
151
+ readonly contact: '#7258d2';
152
+ readonly 'motion-sensor': '#b66182';
153
+ readonly smoke: '#627abb';
154
+ readonly flood: '#b86ae4';
155
+ readonly gas: '#a95261';
156
+ readonly 'carbon-monoxide': '#c65d3c';
157
+ readonly vibration: '#7a40b7';
158
+ readonly tamper: '#914b34';
159
+ readonly presence: '#9481c3';
160
+ readonly 'enum-sensor': '#ac6d47';
161
+ readonly 'device-event': '#7b6fce';
162
+ readonly lock: '#c67662';
163
+ readonly cover: '#a6564d';
164
+ readonly switch: '#ad2c4e';
165
+ readonly siren: '#348e08';
166
+ readonly button: '#d27303';
167
+ readonly doorbell: '#55770f';
168
+ };
169
+ export declare const OKABE_ITO_FALLBACK: readonly ['#9a3784', '#a7392c', '#409d50', '#6987e7', '#ee5b3d', '#c0430d', '#af79b3', '#4b6628'];
@@ -0,0 +1,171 @@
1
+ /**
2
+ * The display palette (D939). One table of colours, three presets, one
3
+ * validator. Taxonomy colours and every consumer read this — there is no
4
+ * second hex table.
5
+ */
6
+ import { z } from 'zod';
7
+ import { AUDIO_GRADIENT_ALPHAS, PALETTE_ENTRY_IDS, PALETTE_PRESET_IDS, type PalettePresetId } from './palette-entries.js';
8
+ import { PALETTE_BACKGROUNDS, PALETTE_MIN_CONTRAST, PALETTE_MIN_DELTA_E, PALETTE_MIN_DELTA_E_MARK, type PaletteBackground } from './palette-cie.js';
9
+ export { AUDIO_GRADIENT_ALPHAS, PALETTE_BACKGROUNDS, PALETTE_ENTRY_IDS, PALETTE_MIN_CONTRAST, PALETTE_MIN_DELTA_E, PALETTE_MIN_DELTA_E_MARK, PALETTE_PRESET_IDS, };
10
+ export type { PaletteBackground } from './palette-cie.js';
11
+ export type { PaletteEntryId, PalettePresetId } from './palette-entries.js';
12
+ export declare const paletteHexSchema: z.ZodString;
13
+ export declare const paletteSolidSchema: z.ZodObject<{
14
+ form: z.ZodLiteral<"solid">;
15
+ hex: z.ZodString;
16
+ }, z.core.$strip>;
17
+ export declare const paletteGradientSchema: z.ZodObject<{
18
+ form: z.ZodLiteral<"gradient">;
19
+ hex: z.ZodString;
20
+ alphas: z.ZodArray<z.ZodNumber>;
21
+ }, z.core.$strip>;
22
+ export declare const paletteSwatchSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
+ form: z.ZodLiteral<"solid">;
24
+ hex: z.ZodString;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ form: z.ZodLiteral<"gradient">;
27
+ hex: z.ZodString;
28
+ alphas: z.ZodArray<z.ZodNumber>;
29
+ }, z.core.$strip>], "form">;
30
+ export type PaletteSwatch = z.infer<typeof paletteSwatchSchema>;
31
+ export type PaletteSwatchMap = Readonly<Record<string, PaletteSwatch>>;
32
+ export type PaletteViolation = {
33
+ readonly code: 'too-close';
34
+ readonly left: string;
35
+ readonly right: string;
36
+ readonly deltaE: number;
37
+ } | {
38
+ readonly code: 'low-contrast';
39
+ readonly entry: string;
40
+ readonly background: PaletteBackground;
41
+ readonly contrast: number;
42
+ } | {
43
+ readonly code: 'missing-entry';
44
+ readonly entry: string;
45
+ } | {
46
+ readonly code: 'unknown-entry';
47
+ readonly entry: string;
48
+ } | {
49
+ readonly code: 'bad-gradient';
50
+ readonly entry: string;
51
+ } | {
52
+ readonly code: 'bad-fallbacks';
53
+ } | {
54
+ readonly code: 'unknown-preset';
55
+ readonly presetId: string;
56
+ };
57
+ export type PaletteVerdict = {
58
+ readonly ok: true;
59
+ } | {
60
+ readonly ok: false;
61
+ readonly violations: readonly PaletteViolation[];
62
+ };
63
+ export declare const paletteReadySchema: z.ZodObject<{
64
+ status: z.ZodLiteral<"ready">;
65
+ presetId: z.ZodEnum<{
66
+ camstack: "camstack";
67
+ "high-contrast": "high-contrast";
68
+ "okabe-ito": "okabe-ito";
69
+ }>;
70
+ customized: z.ZodBoolean;
71
+ source: z.ZodEnum<{
72
+ stored: "stored";
73
+ unconfigured: "unconfigured";
74
+ }>;
75
+ swatches: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
76
+ form: z.ZodLiteral<"solid">;
77
+ hex: z.ZodString;
78
+ }, z.core.$strip>, z.ZodObject<{
79
+ form: z.ZodLiteral<"gradient">;
80
+ hex: z.ZodString;
81
+ alphas: z.ZodArray<z.ZodNumber>;
82
+ }, z.core.$strip>], "form">>;
83
+ fallbacks: z.ZodArray<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export declare const paletteUnknownSchema: z.ZodObject<{
86
+ status: z.ZodLiteral<"unknown">;
87
+ reason: z.ZodString;
88
+ }, z.core.$strip>;
89
+ export declare const paletteResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ status: z.ZodLiteral<"ready">;
91
+ presetId: z.ZodEnum<{
92
+ camstack: "camstack";
93
+ "high-contrast": "high-contrast";
94
+ "okabe-ito": "okabe-ito";
95
+ }>;
96
+ customized: z.ZodBoolean;
97
+ source: z.ZodEnum<{
98
+ stored: "stored";
99
+ unconfigured: "unconfigured";
100
+ }>;
101
+ swatches: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
102
+ form: z.ZodLiteral<"solid">;
103
+ hex: z.ZodString;
104
+ }, z.core.$strip>, z.ZodObject<{
105
+ form: z.ZodLiteral<"gradient">;
106
+ hex: z.ZodString;
107
+ alphas: z.ZodArray<z.ZodNumber>;
108
+ }, z.core.$strip>], "form">>;
109
+ fallbacks: z.ZodArray<z.ZodString>;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ status: z.ZodLiteral<"unknown">;
112
+ reason: z.ZodString;
113
+ }, z.core.$strip>], "status">;
114
+ export type PaletteResult = z.infer<typeof paletteResultSchema>;
115
+ export type PaletteReady = z.infer<typeof paletteReadySchema>;
116
+ export declare const setPaletteInputSchema: z.ZodUnion<readonly [z.ZodObject<{
117
+ presetId: z.ZodString;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ presetId: z.ZodString;
120
+ overrides: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
121
+ form: z.ZodLiteral<"solid">;
122
+ hex: z.ZodString;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ form: z.ZodLiteral<"gradient">;
125
+ hex: z.ZodString;
126
+ alphas: z.ZodArray<z.ZodNumber>;
127
+ }, z.core.$strip>], "form">>;
128
+ }, z.core.$strip>]>;
129
+ export type SetPaletteInput = z.infer<typeof setPaletteInputSchema>;
130
+ export declare const storedPaletteSchema: z.ZodObject<{
131
+ presetId: z.ZodString;
132
+ overrides: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
133
+ form: z.ZodLiteral<"solid">;
134
+ hex: z.ZodString;
135
+ }, z.core.$strip>, z.ZodObject<{
136
+ form: z.ZodLiteral<"gradient">;
137
+ hex: z.ZodString;
138
+ alphas: z.ZodArray<z.ZodNumber>;
139
+ }, z.core.$strip>], "form">>;
140
+ }, z.core.$strip>;
141
+ export type StoredPalette = z.infer<typeof storedPaletteSchema>;
142
+ export interface DisplayPreset {
143
+ readonly id: PalettePresetId;
144
+ readonly name: string;
145
+ readonly swatches: PaletteSwatchMap;
146
+ readonly fallbacks: readonly string[];
147
+ }
148
+ export declare const DISPLAY_PRESETS: readonly DisplayPreset[];
149
+ export declare function presetById(id: string): DisplayPreset | undefined;
150
+ export declare function bundledCamstack(): PaletteReady;
151
+ export declare function swatchHex(swatch: PaletteSwatch): string;
152
+ /** Refuse a palette whose entries are not pairwise distinct on both themes. */
153
+ export declare function validatePalette(swatches: PaletteSwatchMap, fallbacks: readonly string[]): PaletteVerdict;
154
+ export declare function formatPaletteViolation(violation: PaletteViolation): string;
155
+ export declare function formatPaletteViolations(violations: readonly PaletteViolation[]): string;
156
+ export declare class PaletteRejectedError extends Error {
157
+ readonly violations: readonly PaletteViolation[];
158
+ constructor(violations: readonly PaletteViolation[]);
159
+ }
160
+ /** Colour a kind paints with. Audio leaves share the audio gradient's hex. */
161
+ export declare function paintHex(swatches: PaletteSwatchMap, fallbacks: readonly string[], kind: string): string;
162
+ export declare function mergeOverrides(base: PaletteSwatchMap, overrides: Readonly<Record<string, PaletteSwatch>>): PaletteSwatchMap;
163
+ /** The palette a `setPalette` input would store. Invalid input is a refusal. */
164
+ export declare function paletteFromInput(input: SetPaletteInput): PaletteReady;
165
+ /**
166
+ * Interpret a settings blob. A missing row is the bundled preset and says so.
167
+ * A blob that does not parse, names an unknown preset, or fails the rule is
168
+ * `unknown` — never the default wearing the stored preset's name.
169
+ */
170
+ export declare function paletteFromStored(value: unknown): PaletteResult;
171
+ export declare function storedFromReady(ready: PaletteReady, overrides: Readonly<Record<string, PaletteSwatch>>): StoredPalette;
@@ -21,24 +21,13 @@ export interface EventTaxonomyEntry {
21
21
  /** English fallback label (UI translates `labelKey` when it can). */
22
22
  readonly label: string;
23
23
  }
24
- export declare const TAXONOMY_COLORS: {
25
- readonly motion: '#f59e0b';
26
- readonly audio: '#06b6d4';
27
- readonly person: '#22c55e';
28
- readonly vehicle: '#3b82f6';
29
- readonly animal: '#f97316';
30
- readonly package: '#a855f7';
31
- readonly sensor: '#8b5cf6';
32
- readonly control: '#10b981';
33
- readonly genericDetection: '#64748b';
34
- };
35
- /** Global default color when a kind is unknown (matches legacy box-drawer). */
36
- export declare const DEFAULT_EVENT_COLOR = "#22ff55";
24
+ /** Global default when a kind is unknown — the palette's first fallback. */
25
+ export declare const DEFAULT_EVENT_COLOR: string;
37
26
  /** The complete taxonomy dictionary, keyed by kind. */
38
27
  export declare const EVENT_TAXONOMY: Readonly<Record<string, EventTaxonomyEntry>>;
39
28
  /** Taxonomy entry for a kind, or undefined when unknown. */
40
29
  export declare function getTaxonomyEntry(kind: string): EventTaxonomyEntry | undefined;
41
- /** Color for a kind — dictionary value, else the global default. */
30
+ /** Color for a kind — the bundled palette, else a stable fallback. */
42
31
  export declare function colorForKind(kind: string): string;
43
32
  /** The sub kinds whose `parentKind` is `macro` (empty for a leaf macro). */
44
33
  export declare function subKindsOf(macro: string): readonly EventTaxonomyEntry[];
@@ -0,0 +1,29 @@
1
+ /**
2
+ * CIEDE2000 and WCAG contrast for the display palette (D939).
3
+ *
4
+ * One implementation, shared by the hub validator, the admin editor and
5
+ * (phase 2) the viewer. The arithmetic matches the viewer's `src/theme/cie.ts`.
6
+ */
7
+ /** Page backgrounds the contrast rule is measured against. */
8
+ export declare const PALETTE_BACKGROUNDS: {
9
+ readonly dark: '#0c0a09';
10
+ readonly light: '#fafaf9';
11
+ };
12
+ export type PaletteBackground = keyof typeof PALETTE_BACKGROUNDS;
13
+ /** Two entries closer than this read as one mark. */
14
+ export declare const PALETTE_MIN_DELTA_E = 7;
15
+ /**
16
+ * The live cursor and the heatmap handle sit next to each other as small
17
+ * swatches. ΔE 7 still lets two olives read as one (the old CamStack pair
18
+ * was 12.8 on the same hue). The global floor stays 7 — the presets' closest
19
+ * pairs are 7.30, 7.49 and 7.01 — and these two marks must clear 20.
20
+ */
21
+ export declare const PALETTE_MIN_DELTA_E_MARK = 20;
22
+ /** Marks that are not event kinds and share the raised distance floor. */
23
+ export declare const PALETTE_MARK_PAIR: readonly ['live', 'heatmapScrub'];
24
+ /** Minimum WCAG contrast of an entry against either theme background. */
25
+ export declare const PALETTE_MIN_CONTRAST = 3;
26
+ /** WCAG contrast ratio of two `#rrggbb` colours. Non-hex returns 0. */
27
+ export declare function contrastRatio(a: string, b: string): number;
28
+ /** CIEDE2000. Non-hex returns 0 so a bad swatch fails the distinctness rule. */
29
+ export declare function deltaE00(hex1: string, hex2: string): number;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
3
+ * not entries. `heatmapScrub` is a mark, not an event kind.
4
+ */
5
+ export declare const PALETTE_ENTRY_IDS: readonly ['motion', 'audio', 'recording', 'live', 'heatmapScrub', 'person', 'vehicle', 'animal', 'package', 'sensor', 'control', 'face', 'plate', 'car', 'truck', 'bus', 'motorcycle', 'bicycle', 'airplane', 'boat', 'train', 'bird', 'dog', 'cat', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'package-delivered', 'package-picked-up', 'suitcase', 'backpack', 'handbag', 'contact', 'motion-sensor', 'smoke', 'flood', 'gas', 'carbon-monoxide', 'vibration', 'tamper', 'presence', 'enum-sensor', 'device-event', 'lock', 'cover', 'switch', 'siren', 'button', 'doorbell'];
6
+ export type PaletteEntryId = (typeof PALETTE_ENTRY_IDS)[number];
7
+ export declare const AUDIO_ENTRY_ID = "audio";
8
+ export declare const AUDIO_LEAF_PREFIX = "audio-";
9
+ /** Six rungs, quiet → loud. The opaque end is the entry's hex. */
10
+ export declare const AUDIO_GRADIENT_ALPHAS: readonly [0.3, 0.42, 0.55, 0.7, 0.85, 1];
11
+ export declare const PALETTE_FALLBACK_COUNT = 8;
12
+ export declare const PALETTE_PRESET_IDS: readonly ['camstack', 'high-contrast', 'okabe-ito'];
13
+ export type PalettePresetId = (typeof PALETTE_PRESET_IDS)[number];
14
+ export declare function isPaletteEntryId(id: string): id is PaletteEntryId;
15
+ export declare function isPalettePresetId(id: string): id is PalettePresetId;
@@ -0,0 +1,13 @@
1
+ import { type PaletteEntryId } from './palette-entries.js';
2
+ export interface PaletteLegendItem {
3
+ readonly id: PaletteEntryId;
4
+ readonly label: string;
5
+ }
6
+ export interface PaletteLegendGroup {
7
+ readonly id: PaletteEntryId;
8
+ readonly label: string;
9
+ readonly children: readonly PaletteLegendItem[];
10
+ }
11
+ export declare function paletteEntryLabel(id: string): string;
12
+ /** One row per root, subclasses underneath. Every palette entry appears once. */
13
+ export declare function paletteLegend(): readonly PaletteLegendGroup[];