@camstack/types 1.2.569 → 1.2.570
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/CHANGELOG.md +6 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/error.cap.d.ts +135 -0
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/client.js +3 -0
- package/dist/client.mjs +3 -0
- package/dist/device/base-device.d.ts +15 -0
- package/dist/device/device-error-episode.d.ts +24 -0
- package/dist/generated/addon-api.d.ts +14 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/cap-vocabulary.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/device-local-state.d.ts +3 -0
- package/dist/generated/device-proxy.d.ts +3 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/history-catalog.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/runtime-state-durability.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +232 -3
- package/dist/index.mjs +225 -4
- package/dist/{sleep-DbhT0DWV.mjs → sleep-BnR9qGOv.mjs} +54 -2
- package/dist/{sleep-DR76P1OE.js → sleep-Cr2-wtyQ.js} +54 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.570] - 2026-11-14
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A device can report a fault through the new error capability; its start and resolution reach the notification rules (no default rule)
|
|
15
|
+
|
|
10
16
|
## [1.2.569] - 2026-11-14
|
|
11
17
|
|
|
12
18
|
### Added
|
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-Cr2-wtyQ.js");
|
|
3
3
|
const require_event_category = require("./event-category-d9kiqCqC.js");
|
|
4
4
|
const require_composed_stable_id = require("./composed-stable-id-C3NfRTj8.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DEVICE_CHILDREN_BATCH_MAX, $n as isZodSecret, $r as recordSecretRef, A as CAP_ADVANCE_FIELDS, Ai as InvalidRecordError, An as PEER_BYTES_CHUNK_BYTES, Bi as TransactRefusedError, Bn as entryBody, Cn as MIN_SCRUBBED_LENGTH, Da as findMigrationsBlocked, Di as DeclarationRefusedError, Dn as registerKnownSecret, Ea as AddonMigrationsBlockedError, Ei as BatchTooLargeError, En as knownSecretCount, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordSecretUnavailableError, Fn as CALLER_USERNAME_HEADER, Fr as nodeIdOfScopedKey, G as readNodePin, Gn as RecordKindNameSchema, H as commandOrigin, Hi as UnknownRecordKindError, Hn as RecordFieldPathSchema, I as customAction, Ii as RecordTooLargeError, In as DATAPLANE_SECRET_HEADER, Ir as resolveDeviceSettings, J as PipelineRunResultBridge, Jn as assertValidDeclaration, Jr as collectSecretLeaves, Kn as RecordRetentionSchema, Kr as secretViewsOf, L as defineCustomActions, Li as RecordUniqueViolationError, Lr as resolvedValues, Mi as PlaintextSecretError, Mn as PEER_BYTES_STALL_MS, N as CAP_STATE_LEAVES, Ni as RECORDS_ERROR_CODES, Nn as PEER_BYTES_TICKET_TTL_MS, O as HF_REPO, Oi as FilterRequiredError, On as scrubKnownSecrets, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordNotFoundError, Pr as SCOPED_SETTINGS_SCOPES, Q as deviceOpsCapability, Qn as collectZodSecretPaths, Qr as recordSecretCollection, R as describeCustomActions, Ri as RecordsError, Rn as DisposerChain, Si as parseSecretRef, Sn as createSecretsAccess, T as isCommand, Tn as forgetKnownSecret, U as nodePin, Ui as asRecordsError, Un as RecordIndexSchema, Vi as UnindexedFilterError, Vn as EntryDescriptorSchema, W as readCommandOrigin, Wi as recordsErrorFromMessage, Wn as RecordKindDeclarationSchema, X as MIGRATION_API_VERSION, Xn as defineRecordKinds, Xr as parseSecretPath, Y as PipelineStepInputSchema, Yn as declarationsOf, Yr as mapSecretLeaves, Zr as recordArrayItemPath, _a as makeSecretMarker, _i as buildSecretRef, _n as makeInMemoryRecords, ai as RECORD_DEFAULT_MAX_DATA_BYTES, bi as isSecretRef, bn as resolveSecretViewsIn, c as asString, ci as RECORD_MAX_DATA_BYTES, d as parseJsonUnknown, da as SECRET_CLEAR, di as RECORD_QUERY_MAX, ea as createEvent, ei as secretArrayPrefixes, et as adminUiCapability, f as hfModelUrl, fa as classifySecretWrite, fi as RECORD_SECRET_COLLECTION_PREFIX, g as createDeviceProxy, ga as isSecretMarkerLike, gi as arrayItemFieldPath, gn as ruleFireOfClaim, gr as ErrorI18nPayloadSchema, h as isDeviceScopedCap, ha as isSecretMarker, hi as SECRET_REF_SCHEME, hn as RuleFireOriginSchema, ht as ReadinessTimeoutError, ii as RECORD_DATABASES, j as CAP_METHOD_TIMEOUTS_MS, ji as NoCallerError, jn as PEER_BYTES_MAX_OUTSTANDING, ki as ForeignSecretMarkerError, kn as shortSecretRefHash, li as RECORD_MAX_INDEXES, m as DEVICE_SCOPED_CAPS, ma as isSecretFieldView, mi as RECORD_SWEEP_INTERVAL_MS, mn as CommandOriginClaimSchema, mt as ReadinessRegistry, ni as RECORD_BATCH_MAX_BYTES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_DELETE_BATCH, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretClear, pi as RECORD_SETTINGS_MAX_ROWS, pt as MODEL_FORMATS, q as viewerUiCapability, qn as StoredRecordKindDeclarationSchema, qr as REMOVE_LEAF, r as maskUrlCredentials, ri as RECORD_CLASSES, si as RECORD_ID_MAX_LENGTH, sr as expandCapMethods, t as sleep, ta as emitReadiness, ti as RECORD_BATCH_MAX, ui as RECORD_MAX_INDEX_FIELDS, v as addonSliceHandleApi, va as toSecretFieldView, vi as formatSecretScope, vn as createRecordsAccess, vt as scopeKey, wn as clearKnownSecrets, wr as normalizeAddonInitResult, xi as normalizeSecretOwner, xn as REVALIDATE_AFTER_MS, xr as BaseAddon, y as createEventBusSliceSource, yi as globalSecretScope, yn as assertTransactScope, yr as readErrorI18n, zi as RevConflictError, zn as defineEntryKind } from "./sleep-
|
|
1
|
+
import { $ as DEVICE_CHILDREN_BATCH_MAX, $n as isZodSecret, $r as recordSecretRef, A as CAP_ADVANCE_FIELDS, Ai as InvalidRecordError, An as PEER_BYTES_CHUNK_BYTES, Bi as TransactRefusedError, Bn as entryBody, Cn as MIN_SCRUBBED_LENGTH, Da as findMigrationsBlocked, Di as DeclarationRefusedError, Dn as registerKnownSecret, Ea as AddonMigrationsBlockedError, Ei as BatchTooLargeError, En as knownSecretCount, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordSecretUnavailableError, Fn as CALLER_USERNAME_HEADER, Fr as nodeIdOfScopedKey, G as readNodePin, Gn as RecordKindNameSchema, H as commandOrigin, Hi as UnknownRecordKindError, Hn as RecordFieldPathSchema, I as customAction, Ii as RecordTooLargeError, In as DATAPLANE_SECRET_HEADER, Ir as resolveDeviceSettings, J as PipelineRunResultBridge, Jn as assertValidDeclaration, Jr as collectSecretLeaves, Kn as RecordRetentionSchema, Kr as secretViewsOf, L as defineCustomActions, Li as RecordUniqueViolationError, Lr as resolvedValues, Mi as PlaintextSecretError, Mn as PEER_BYTES_STALL_MS, N as CAP_STATE_LEAVES, Ni as RECORDS_ERROR_CODES, Nn as PEER_BYTES_TICKET_TTL_MS, O as HF_REPO, Oi as FilterRequiredError, On as scrubKnownSecrets, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordNotFoundError, Pr as SCOPED_SETTINGS_SCOPES, Q as deviceOpsCapability, Qn as collectZodSecretPaths, Qr as recordSecretCollection, R as describeCustomActions, Ri as RecordsError, Rn as DisposerChain, Si as parseSecretRef, Sn as createSecretsAccess, T as isCommand, Tn as forgetKnownSecret, U as nodePin, Ui as asRecordsError, Un as RecordIndexSchema, Vi as UnindexedFilterError, Vn as EntryDescriptorSchema, W as readCommandOrigin, Wi as recordsErrorFromMessage, Wn as RecordKindDeclarationSchema, X as MIGRATION_API_VERSION, Xn as defineRecordKinds, Xr as parseSecretPath, Y as PipelineStepInputSchema, Yn as declarationsOf, Yr as mapSecretLeaves, Zr as recordArrayItemPath, _a as makeSecretMarker, _i as buildSecretRef, _n as makeInMemoryRecords, ai as RECORD_DEFAULT_MAX_DATA_BYTES, bi as isSecretRef, bn as resolveSecretViewsIn, c as asString, ci as RECORD_MAX_DATA_BYTES, d as parseJsonUnknown, da as SECRET_CLEAR, di as RECORD_QUERY_MAX, ea as createEvent, ei as secretArrayPrefixes, et as adminUiCapability, f as hfModelUrl, fa as classifySecretWrite, fi as RECORD_SECRET_COLLECTION_PREFIX, g as createDeviceProxy, ga as isSecretMarkerLike, gi as arrayItemFieldPath, gn as ruleFireOfClaim, gr as ErrorI18nPayloadSchema, h as isDeviceScopedCap, ha as isSecretMarker, hi as SECRET_REF_SCHEME, hn as RuleFireOriginSchema, ht as ReadinessTimeoutError, ii as RECORD_DATABASES, j as CAP_METHOD_TIMEOUTS_MS, ji as NoCallerError, jn as PEER_BYTES_MAX_OUTSTANDING, ki as ForeignSecretMarkerError, kn as shortSecretRefHash, li as RECORD_MAX_INDEXES, m as DEVICE_SCOPED_CAPS, ma as isSecretFieldView, mi as RECORD_SWEEP_INTERVAL_MS, mn as CommandOriginClaimSchema, mt as ReadinessRegistry, ni as RECORD_BATCH_MAX_BYTES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_DELETE_BATCH, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretClear, pi as RECORD_SETTINGS_MAX_ROWS, pt as MODEL_FORMATS, q as viewerUiCapability, qn as StoredRecordKindDeclarationSchema, qr as REMOVE_LEAF, r as maskUrlCredentials, ri as RECORD_CLASSES, si as RECORD_ID_MAX_LENGTH, sr as expandCapMethods, t as sleep, ta as emitReadiness, ti as RECORD_BATCH_MAX, ui as RECORD_MAX_INDEX_FIELDS, v as addonSliceHandleApi, va as toSecretFieldView, vi as formatSecretScope, vn as createRecordsAccess, vt as scopeKey, wn as clearKnownSecrets, wr as normalizeAddonInitResult, xi as normalizeSecretOwner, xn as REVALIDATE_AFTER_MS, xr as BaseAddon, y as createEventBusSliceSource, yi as globalSecretScope, yn as assertTransactScope, yr as readErrorI18n, zi as RevConflictError, zn as defineEntryKind } from "./sleep-BnR9qGOv.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-Dhcd0TRH.mjs";
|
|
3
3
|
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-RvQIEpqg.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
/** How loudly a fault wants the operator. Both tiers raise the attention event. */
|
|
4
|
+
export declare const DeviceErrorSeveritySchema: z.ZodEnum<{
|
|
5
|
+
error: "error";
|
|
6
|
+
warning: "warning";
|
|
7
|
+
}>;
|
|
8
|
+
export type DeviceErrorSeverity = z.infer<typeof DeviceErrorSeveritySchema>;
|
|
9
|
+
/** One fault of a device that can raise several at once. */
|
|
10
|
+
export declare const DeviceFaultSchema: z.ZodObject<{
|
|
11
|
+
code: z.ZodString;
|
|
12
|
+
label: z.ZodString;
|
|
13
|
+
severity: z.ZodEnum<{
|
|
14
|
+
error: "error";
|
|
15
|
+
warning: "warning";
|
|
16
|
+
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type DeviceFault = z.infer<typeof DeviceFaultSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* The fault a device reports right now. One slice per device.
|
|
21
|
+
*
|
|
22
|
+
* `active` is tri-state: `null` is "the provider has not read it yet" and is
|
|
23
|
+
* never drawn as "no fault" nor as a fault (D315, D393). The provider filters
|
|
24
|
+
* what is not a fault (a completion or reminder code) BEFORE it writes `true`.
|
|
25
|
+
*
|
|
26
|
+
* The cap's name is the key a template reads (`{{ alias.error.label }}`, D1021).
|
|
27
|
+
*/
|
|
28
|
+
export declare const ErrorStatusSchema: z.ZodObject<{
|
|
29
|
+
active: z.ZodNullable<z.ZodBoolean>;
|
|
30
|
+
code: z.ZodNullable<z.ZodString>;
|
|
31
|
+
label: z.ZodNullable<z.ZodString>;
|
|
32
|
+
severity: z.ZodEnum<{
|
|
33
|
+
error: "error";
|
|
34
|
+
warning: "warning";
|
|
35
|
+
}>;
|
|
36
|
+
since: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
faults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
code: z.ZodString;
|
|
39
|
+
label: z.ZodString;
|
|
40
|
+
severity: z.ZodEnum<{
|
|
41
|
+
error: "error";
|
|
42
|
+
warning: "warning";
|
|
43
|
+
}>;
|
|
44
|
+
}, z.core.$strip>>>;
|
|
45
|
+
lastFetchedAt: z.ZodNumber;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type ErrorStatus = z.infer<typeof ErrorStatusSchema>;
|
|
48
|
+
/** The slice before the provider has read anything: unknown, not "fine". */
|
|
49
|
+
export declare const ERROR_STATUS_COLD: ErrorStatus;
|
|
50
|
+
export declare const errorCapability: {
|
|
51
|
+
readonly name: 'error';
|
|
52
|
+
readonly scope: 'device';
|
|
53
|
+
readonly deviceNative: true;
|
|
54
|
+
readonly mode: 'singleton';
|
|
55
|
+
readonly methods: {};
|
|
56
|
+
readonly status: {
|
|
57
|
+
readonly schema: z.ZodObject<{
|
|
58
|
+
active: z.ZodNullable<z.ZodBoolean>;
|
|
59
|
+
code: z.ZodNullable<z.ZodString>;
|
|
60
|
+
label: z.ZodNullable<z.ZodString>;
|
|
61
|
+
severity: z.ZodEnum<{
|
|
62
|
+
error: "error";
|
|
63
|
+
warning: "warning";
|
|
64
|
+
}>;
|
|
65
|
+
since: z.ZodNullable<z.ZodNumber>;
|
|
66
|
+
faults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
+
code: z.ZodString;
|
|
68
|
+
label: z.ZodString;
|
|
69
|
+
severity: z.ZodEnum<{
|
|
70
|
+
error: "error";
|
|
71
|
+
warning: "warning";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
lastFetchedAt: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
readonly kind: 'push';
|
|
77
|
+
readonly empty: {
|
|
78
|
+
active: boolean | null;
|
|
79
|
+
code: string | null;
|
|
80
|
+
label: string | null;
|
|
81
|
+
severity: "error" | "warning";
|
|
82
|
+
since: number | null;
|
|
83
|
+
faults?: {
|
|
84
|
+
code: string;
|
|
85
|
+
label: string;
|
|
86
|
+
severity: "error" | "warning";
|
|
87
|
+
}[] | undefined;
|
|
88
|
+
lastFetchedAt: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly runtimeState: z.ZodObject<{
|
|
92
|
+
active: z.ZodNullable<z.ZodBoolean>;
|
|
93
|
+
code: z.ZodNullable<z.ZodString>;
|
|
94
|
+
label: z.ZodNullable<z.ZodString>;
|
|
95
|
+
severity: z.ZodEnum<{
|
|
96
|
+
error: "error";
|
|
97
|
+
warning: "warning";
|
|
98
|
+
}>;
|
|
99
|
+
since: z.ZodNullable<z.ZodNumber>;
|
|
100
|
+
faults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
+
code: z.ZodString;
|
|
102
|
+
label: z.ZodString;
|
|
103
|
+
severity: z.ZodEnum<{
|
|
104
|
+
error: "error";
|
|
105
|
+
warning: "warning";
|
|
106
|
+
}>;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
lastFetchedAt: z.ZodNumber;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
/**
|
|
111
|
+
* Runtime-state durability: **restored** — the previous observation is what
|
|
112
|
+
* lets the first reading after a restart be a COMPARISON: a fault that was
|
|
113
|
+
* already open must not announce itself a second time.
|
|
114
|
+
*
|
|
115
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
116
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
117
|
+
*/
|
|
118
|
+
readonly durability: 'restored';
|
|
119
|
+
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
120
|
+
/** The fault itself is carried by the attention alerts; no series is recorded. */
|
|
121
|
+
readonly history: 'none';
|
|
122
|
+
readonly vocabulary: {
|
|
123
|
+
readonly noun: import("../index.js").VocabL10n;
|
|
124
|
+
readonly order: 5265;
|
|
125
|
+
readonly state: readonly [{
|
|
126
|
+
readonly kind: 'boolean';
|
|
127
|
+
readonly field: 'active';
|
|
128
|
+
readonly label: import("../index.js").VocabL10n;
|
|
129
|
+
readonly whenTrue: import("../index.js").VocabL10n;
|
|
130
|
+
readonly whenFalse: import("../index.js").VocabL10n;
|
|
131
|
+
readonly icon: 'triangle-alert';
|
|
132
|
+
}];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export type IErrorProvider = InferProvider<typeof errorCapability>;
|
|
@@ -168,6 +168,7 @@ export { ACTION_RUN_MAX_MS, ACTION_RUN_TIMEOUT_MS, ACTION_RUN_TRANSPORT_MARGIN_M
|
|
|
168
168
|
export { type ActionLinks, ActionLinksSchema, actionsCapability, type IActionsProvider, } from './actions.cap.js';
|
|
169
169
|
export { type AutomationControlStatus, AutomationControlStatusSchema, automationControlCapability, type IAutomationControlProvider, } from './automation-control.cap.js';
|
|
170
170
|
export { type BatteryStatus, BatteryStatusSchema, batteryCapability, type IBatteryProvider, } from './battery.cap.js';
|
|
171
|
+
export { type DeviceErrorSeverity, DeviceErrorSeveritySchema, type DeviceFault, DeviceFaultSchema, ERROR_STATUS_COLD, type ErrorStatus, ErrorStatusSchema, errorCapability, type IErrorProvider, } from './error.cap.js';
|
|
171
172
|
export { type BinaryStatus, BinaryStatusSchema, binaryCapability, type IBinaryProvider, } from './binary.cap.js';
|
|
172
173
|
export { type BrightnessStatus, BrightnessStatusSchema, brightnessCapability, type IBrightnessProvider, } from './brightness.cap.js';
|
|
173
174
|
export { FAN_CAPTURE_FIELDS, FAN_PRESETS_MAX, FAN_PRESETS_REFUSALS, type FanCaptureField, FanCaptureFieldSchema, type FanCaptureOmission, FanCaptureOmissionSchema, type FanPreset, type FanPresetApplyResult, FanPresetApplyResultSchema, type FanPresetAxis, FanPresetAxisSchema, type FanPresetCaptureResult, FanPresetCaptureResultSchema, type FanPresetFieldResult, FanPresetFieldResultSchema, FanPresetSchema, type FanPresetState, FanPresetStateSchema, type FanPresetsRefusal, FanPresetsRefusalSchema, type FanPresetsSetResult, FanPresetsSetResultSchema, type IFanPresetsProvider, fanPresetsCapability, } from './fan-presets.cap.js';
|
|
@@ -313,6 +314,7 @@ import type { schedulersCapability } from './schedulers.cap.js';
|
|
|
313
314
|
import type { automationControlCapability } from './automation-control.cap.js';
|
|
314
315
|
import type { backupCapability } from './backup.cap.js';
|
|
315
316
|
import type { batteryCapability } from './battery.cap.js';
|
|
317
|
+
import type { errorCapability } from './error.cap.js';
|
|
316
318
|
import type { binaryCapability } from './binary.cap.js';
|
|
317
319
|
import type { brightnessCapability } from './brightness.cap.js';
|
|
318
320
|
import type { brokerCapability } from './broker.cap.js';
|
|
@@ -496,6 +498,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
|
|
|
496
498
|
import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
|
|
497
499
|
import type { zoneRulesCapability } from './zone-rules.cap.js';
|
|
498
500
|
import type { zonesCapability } from './zones.cap.js';
|
|
499
|
-
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 migrationsCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof deviceRunsCapability | typeof deviceTransitionsCapability | typeof timedRunCapability | typeof doNotDisturbCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof nodeRemovalHookCapability | 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 boardKeySourceCapability | 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 runningStateCapability | typeof rebootCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof weatherStationCapability | typeof imageCapability | typeof lockControlCapability | typeof powerSourceCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof petFountainCapability | typeof pumpCycleCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof meterCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof actionSourceCapability | typeof actionsCapability | typeof schedulersCapability | 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 groupActiveCapability | typeof groupCommandsCapability | typeof groupStatusCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof heatPumpStatusCapability | typeof energySystemCapability | typeof heatPumpControlCapability | 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 clusterUpdateCapability | typeof integrationsCapability | typeof integrationInstancesCapability | typeof addonsCapability | typeof oauthIntegrationCapability | 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 irTransmitterCapability | typeof remoteCapability | typeof heroLayoutCapability | typeof fanPresetsCapability | typeof templateCapability | typeof remoteLayoutComponentsCapability | 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;
|
|
501
|
+
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 migrationsCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof deviceRunsCapability | typeof deviceTransitionsCapability | typeof timedRunCapability | typeof doNotDisturbCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof nodeRemovalHookCapability | 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 boardKeySourceCapability | 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 runningStateCapability | typeof rebootCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof weatherStationCapability | typeof imageCapability | typeof lockControlCapability | typeof powerSourceCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof petFountainCapability | typeof pumpCycleCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof meterCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof actionSourceCapability | typeof actionsCapability | typeof schedulersCapability | 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 groupActiveCapability | typeof groupCommandsCapability | typeof groupStatusCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof heatPumpStatusCapability | typeof energySystemCapability | typeof heatPumpControlCapability | 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 clusterUpdateCapability | typeof integrationsCapability | typeof integrationInstancesCapability | typeof addonsCapability | typeof oauthIntegrationCapability | 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 errorCapability | typeof networkLinkCapability | typeof buttonCapability | typeof irTransmitterCapability | typeof remoteCapability | typeof heroLayoutCapability | typeof fanPresetsCapability | typeof templateCapability | typeof remoteLayoutComponentsCapability | 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;
|
|
500
502
|
export type CapabilityName = AnyCapability['name'];
|
|
501
503
|
export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
|
package/dist/client.js
CHANGED
|
@@ -27690,6 +27690,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27690
27690
|
const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
|
|
27691
27691
|
const energySystemInterface = { getStatus: (input) => dispatch("energy-system", "energySystem", "getStatus", "query", input) };
|
|
27692
27692
|
const enumSensorInterface = { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) };
|
|
27693
|
+
const errorInterface = { getStatus: (input) => dispatch("error", "error", "getStatus", "query", input) };
|
|
27693
27694
|
const eventEmitterInterface = { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) };
|
|
27694
27695
|
const fanControlInterface = {
|
|
27695
27696
|
setPercentage: (input) => dispatch("fan-control", "fanControl", "setPercentage", "mutation", input),
|
|
@@ -28319,6 +28320,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28319
28320
|
doorbell: createSliceHandle(stateSource, binding.deviceId, "doorbell"),
|
|
28320
28321
|
energySystem: createSliceHandle(stateSource, binding.deviceId, "energy-system"),
|
|
28321
28322
|
enumSensor: createSliceHandle(stateSource, binding.deviceId, "enum-sensor"),
|
|
28323
|
+
error: createSliceHandle(stateSource, binding.deviceId, "error"),
|
|
28322
28324
|
eventEmitter: createSliceHandle(stateSource, binding.deviceId, "event-emitter"),
|
|
28323
28325
|
fanControl: createSliceHandle(stateSource, binding.deviceId, "fan-control"),
|
|
28324
28326
|
featureProbe: createSliceHandle(stateSource, binding.deviceId, "feature-probe"),
|
|
@@ -28416,6 +28418,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28416
28418
|
...bound("doorbell") ? { doorbell: doorbellInterface } : {},
|
|
28417
28419
|
...bound("energy-system") ? { energySystem: energySystemInterface } : {},
|
|
28418
28420
|
...bound("enum-sensor") ? { enumSensor: enumSensorInterface } : {},
|
|
28421
|
+
...bound("error") ? { error: errorInterface } : {},
|
|
28419
28422
|
...bound("event-emitter") ? { eventEmitter: eventEmitterInterface } : {},
|
|
28420
28423
|
...bound("fan-control") ? { fanControl: fanControlInterface } : {},
|
|
28421
28424
|
...bound("feature-probe") ? { featureProbe: featureProbeInterface } : {},
|
package/dist/client.mjs
CHANGED
|
@@ -27689,6 +27689,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27689
27689
|
const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
|
|
27690
27690
|
const energySystemInterface = { getStatus: (input) => dispatch("energy-system", "energySystem", "getStatus", "query", input) };
|
|
27691
27691
|
const enumSensorInterface = { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) };
|
|
27692
|
+
const errorInterface = { getStatus: (input) => dispatch("error", "error", "getStatus", "query", input) };
|
|
27692
27693
|
const eventEmitterInterface = { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) };
|
|
27693
27694
|
const fanControlInterface = {
|
|
27694
27695
|
setPercentage: (input) => dispatch("fan-control", "fanControl", "setPercentage", "mutation", input),
|
|
@@ -28318,6 +28319,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28318
28319
|
doorbell: createSliceHandle(stateSource, binding.deviceId, "doorbell"),
|
|
28319
28320
|
energySystem: createSliceHandle(stateSource, binding.deviceId, "energy-system"),
|
|
28320
28321
|
enumSensor: createSliceHandle(stateSource, binding.deviceId, "enum-sensor"),
|
|
28322
|
+
error: createSliceHandle(stateSource, binding.deviceId, "error"),
|
|
28321
28323
|
eventEmitter: createSliceHandle(stateSource, binding.deviceId, "event-emitter"),
|
|
28322
28324
|
fanControl: createSliceHandle(stateSource, binding.deviceId, "fan-control"),
|
|
28323
28325
|
featureProbe: createSliceHandle(stateSource, binding.deviceId, "feature-probe"),
|
|
@@ -28415,6 +28417,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28415
28417
|
...bound("doorbell") ? { doorbell: doorbellInterface } : {},
|
|
28416
28418
|
...bound("energy-system") ? { energySystem: energySystemInterface } : {},
|
|
28417
28419
|
...bound("enum-sensor") ? { enumSensor: enumSensorInterface } : {},
|
|
28420
|
+
...bound("error") ? { error: errorInterface } : {},
|
|
28418
28421
|
...bound("event-emitter") ? { eventEmitter: eventEmitterInterface } : {},
|
|
28419
28422
|
...bound("fan-control") ? { fanControl: fanControlInterface } : {},
|
|
28420
28423
|
...bound("feature-probe") ? { featureProbe: featureProbeInterface } : {},
|
|
@@ -8,6 +8,7 @@ import type { ConfigUISchemaWithValues } from '../interfaces/config-ui.js';
|
|
|
8
8
|
import type { CapabilityDefinition, InferRuntimeState } from '../capabilities/capability-definition.js';
|
|
9
9
|
import { type DeviceLocalState } from '../generated/device-local-state.js';
|
|
10
10
|
import { type SourceInfo } from './source-info.js';
|
|
11
|
+
import { type ErrorStatus } from '../capabilities/error.cap.js';
|
|
11
12
|
import type { CustomActionSpec } from '../capabilities/custom-actions.js';
|
|
12
13
|
export declare abstract class BaseDevice<T extends z.ZodObject<z.core.$ZodLooseShape> = z.ZodObject<z.ZodRawShape>> implements IDevice {
|
|
13
14
|
readonly id: number;
|
|
@@ -173,6 +174,20 @@ export declare abstract class BaseDevice<T extends z.ZodObject<z.core.$ZodLooseS
|
|
|
173
174
|
* device boot on a meta refresh.
|
|
174
175
|
*/
|
|
175
176
|
protected refreshFeatures(): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Declare that this device can report a fault (the `error` cap). The slice
|
|
179
|
+
* starts UNKNOWN — a restored slice is kept, so a fault that was open before
|
|
180
|
+
* a restart is compared, not announced again.
|
|
181
|
+
*/
|
|
182
|
+
protected registerErrorCap(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Publish the device's fault. The slice is written; on an EDGE (a fault
|
|
185
|
+
* starts, or one resolves) an attention episode opens or closes through the
|
|
186
|
+
* alerts cap, which the notification center announces as
|
|
187
|
+
* `device-attention-required` / `-resolved`. An unknown reading is never an
|
|
188
|
+
* edge. No rule exists by default: it notifies when the operator makes one.
|
|
189
|
+
*/
|
|
190
|
+
protected publishError(reading: ErrorStatus): Promise<void>;
|
|
176
191
|
/**
|
|
177
192
|
* Typed read-through to a cap-keyed runtime-state slice. Drivers
|
|
178
193
|
* call `this.getCapSlice(batteryCapability)` and the return type
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Alert } from '../capabilities/alerts.cap.js';
|
|
2
|
+
import type { ErrorStatus } from '../capabilities/error.cap.js';
|
|
3
|
+
/**
|
|
4
|
+
* The attention episode of a device fault.
|
|
5
|
+
*
|
|
6
|
+
* A fault that STARTS raises one alert whose source is the device; the
|
|
7
|
+
* notification center announces a device-sourced critical alert as
|
|
8
|
+
* `device-attention-required`, and its completion as `device-attention-resolved`
|
|
9
|
+
* (D911). No default rule listens: it notifies only when the operator makes one.
|
|
10
|
+
*/
|
|
11
|
+
export type DeviceErrorEdge = 'start' | 'resolve';
|
|
12
|
+
/**
|
|
13
|
+
* The edge between two readings, or `null` for no edge.
|
|
14
|
+
*
|
|
15
|
+
* - `null`/cold → `true` is a START (a fault already open at boot is one);
|
|
16
|
+
* - `true` → `false` is a RESOLVE;
|
|
17
|
+
* - an UNKNOWN reading (`active: null`) is never an edge, in either direction —
|
|
18
|
+
* a failed read must neither raise nor close an episode (D393, D49);
|
|
19
|
+
* - `true` → `true` is the same episode, whatever the code did.
|
|
20
|
+
*/
|
|
21
|
+
export declare function deviceErrorEdge(previous: Pick<ErrorStatus, 'active'> | null | undefined, next: Pick<ErrorStatus, 'active'>): DeviceErrorEdge | null;
|
|
22
|
+
export declare function deviceErrorAlertId(deviceId: number): string;
|
|
23
|
+
/** The alert that opens an episode. `since` is the fault's own start, else `now`. */
|
|
24
|
+
export declare function buildDeviceErrorAlert(deviceId: number, deviceName: string, status: ErrorStatus, now: number): Alert;
|
|
@@ -3928,6 +3928,20 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
3928
3928
|
meta: object;
|
|
3929
3929
|
}>;
|
|
3930
3930
|
}>>;
|
|
3931
|
+
error: TRPCBuiltRouter<{
|
|
3932
|
+
ctx: TrpcContext;
|
|
3933
|
+
meta: object;
|
|
3934
|
+
errorShape: AugmentedErrorShape;
|
|
3935
|
+
transformer: true;
|
|
3936
|
+
}, TRPCDecorateCreateRouterOptions<{
|
|
3937
|
+
getStatus: TRPCQueryProcedure<{
|
|
3938
|
+
input: {
|
|
3939
|
+
[x: string]: unknown;
|
|
3940
|
+
} & z.input<typeof DEVICE_STATUS_METHOD.getStatus.input>;
|
|
3941
|
+
output: z.infer<typeof DEVICE_STATUS_METHOD.getStatus.output>;
|
|
3942
|
+
meta: object;
|
|
3943
|
+
}>;
|
|
3944
|
+
}>>;
|
|
3931
3945
|
eventEmitter: TRPCBuiltRouter<{
|
|
3932
3946
|
ctx: TrpcContext;
|
|
3933
3947
|
meta: object;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `ALL_CAPABILITY_DEFINITIONS` (the whole Zod schema graph, ~+100 MB heap per
|
|
6
6
|
* runner). See docs/decisions/adr-0028.md.
|
|
7
7
|
*
|
|
8
|
-
* Coverage: 1 advance-derived caps,
|
|
8
|
+
* Coverage: 1 advance-derived caps, 86 caps with 436 state leaves, 15 caps with a declared method timeout.
|
|
9
9
|
*/
|
|
10
10
|
/** A bindable scalar in a capability's runtime state. */
|
|
11
11
|
export interface CapStateLeaf {
|
|
@@ -26,6 +26,7 @@ import type { DoNotDisturbStatusSchema } from '../capabilities/do-not-disturb.ca
|
|
|
26
26
|
import type { DoorbellStatusSchema } from '../capabilities/doorbell.cap.js';
|
|
27
27
|
import type { EnergySystemStatusSchema } from '../capabilities/energy-system.cap.js';
|
|
28
28
|
import type { EnumSensorStatusSchema } from '../capabilities/enum-sensor.cap.js';
|
|
29
|
+
import type { ErrorStatusSchema } from '../capabilities/error.cap.js';
|
|
29
30
|
import type { EventEmitterStatusSchema } from '../capabilities/event-emitter.cap.js';
|
|
30
31
|
import type { FanControlStatusSchema } from '../capabilities/fan-control.cap.js';
|
|
31
32
|
import type { FeatureProbeStatusSchema } from '../capabilities/feature-probe.cap.js';
|
|
@@ -117,6 +118,7 @@ export type CapStatusTypeMap = {
|
|
|
117
118
|
readonly 'doorbell': z.infer<typeof DoorbellStatusSchema>;
|
|
118
119
|
readonly 'energy-system': z.infer<typeof EnergySystemStatusSchema>;
|
|
119
120
|
readonly 'enum-sensor': z.infer<typeof EnumSensorStatusSchema>;
|
|
121
|
+
readonly 'error': z.infer<typeof ErrorStatusSchema>;
|
|
120
122
|
readonly 'event-emitter': z.infer<typeof EventEmitterStatusSchema>;
|
|
121
123
|
readonly 'fan-control': z.infer<typeof FanControlStatusSchema>;
|
|
122
124
|
readonly 'feature-probe': z.infer<typeof FeatureProbeStatusSchema>;
|
|
@@ -183,4 +185,4 @@ export type CapNameWithStatus = keyof CapStatusTypeMap;
|
|
|
183
185
|
* aggregator to enumerate caps whose `status` should be polled +
|
|
184
186
|
* streamed via `subscribeDeviceStatusAggregate`.
|
|
185
187
|
*/
|
|
186
|
-
export declare const CAP_NAMES_WITH_STATUS: readonly ["accessories", "air-quality-sensor", "alarm-panel", "ambient-light-sensor", "automation-control", "battery", "binary", "brightness", "broker", "camera-credentials", "carbon-monoxide", "climate-control", "color", "connectivity", "consumables", "contact", "control", "cover", "day-night", "device-adoption", "device-export", "device-status", "dishwasher", "do-not-disturb", "doorbell", "energy-system", "enum-sensor", "event-emitter", "fan-control", "feature-probe", "flood", "gas", "group-active", "group-commands", "group-status", "heat-pump-status", "heating-valve", "humidifier", "humidity-sensor", "image", "image-settings", "intercom", "lawn-mower-control", "lock-control", "media-player", "meter", "motion", "motion-trigger", "motion-zones", "mqtt-broker", "native-object-detection", "navigation", "network-link", "notifier", "numeric-sensor", "osd", "pet-feeder", "pet-fountain", "power-meter", "presence", "pressure-sensor", "privacy-mask", "ptz", "ptz-autotrack", "pump-cycle", "recording-archive", "recording-onboard", "recording-signal", "running-state", "scene-monitor", "script-runner", "smoke", "snapshot", "stream-params", "switch", "tamper", "temperature-sensor", "timed-run", "update", "vacuum-control", "valve", "vibration", "water-heater", "weather", "weather-station"];
|
|
188
|
+
export declare const CAP_NAMES_WITH_STATUS: readonly ["accessories", "air-quality-sensor", "alarm-panel", "ambient-light-sensor", "automation-control", "battery", "binary", "brightness", "broker", "camera-credentials", "carbon-monoxide", "climate-control", "color", "connectivity", "consumables", "contact", "control", "cover", "day-night", "device-adoption", "device-export", "device-status", "dishwasher", "do-not-disturb", "doorbell", "energy-system", "enum-sensor", "error", "event-emitter", "fan-control", "feature-probe", "flood", "gas", "group-active", "group-commands", "group-status", "heat-pump-status", "heating-valve", "humidifier", "humidity-sensor", "image", "image-settings", "intercom", "lawn-mower-control", "lock-control", "media-player", "meter", "motion", "motion-trigger", "motion-zones", "mqtt-broker", "native-object-detection", "navigation", "network-link", "notifier", "numeric-sensor", "osd", "pet-feeder", "pet-fountain", "power-meter", "presence", "pressure-sensor", "privacy-mask", "ptz", "ptz-autotrack", "pump-cycle", "recording-archive", "recording-onboard", "recording-signal", "running-state", "scene-monitor", "script-runner", "smoke", "snapshot", "stream-params", "switch", "tamper", "temperature-sensor", "timed-run", "update", "vacuum-control", "valve", "vibration", "water-heater", "weather", "weather-station"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CapVocabularyMap } from '../device/cap-vocabulary/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* THE cap vocabulary (D920), projected from the declarations of every
|
|
4
|
-
* `*.cap.ts` (D1050):
|
|
4
|
+
* `*.cap.ts` (D1050): 208 caps (107 device, 101 system).
|
|
5
5
|
* Device caps in their declared picker order, then system caps by name.
|
|
6
6
|
*/
|
|
7
7
|
export declare const CAP_VOCABULARY: CapVocabularyMap;
|
|
@@ -70,6 +70,7 @@ export { doorbellCapability } from '../capabilities/doorbell.cap.js';
|
|
|
70
70
|
export { embeddingEncoderCapability } from '../capabilities/embedding-encoder.cap.js';
|
|
71
71
|
export { energySystemCapability } from '../capabilities/energy-system.cap.js';
|
|
72
72
|
export { enumSensorCapability } from '../capabilities/enum-sensor.cap.js';
|
|
73
|
+
export { errorCapability } from '../capabilities/error.cap.js';
|
|
73
74
|
export { eventEmitterCapability } from '../capabilities/event-emitter.cap.js';
|
|
74
75
|
export { faceGalleryCapability } from '../capabilities/face-gallery.cap.js';
|
|
75
76
|
export { failureContributionCapability } from '../capabilities/failure-contribution.cap.js';
|
|
@@ -278,6 +279,7 @@ export declare const CAPABILITY_NAMES: {
|
|
|
278
279
|
readonly embeddingEncoder: 'embedding-encoder';
|
|
279
280
|
readonly energySystem: 'energy-system';
|
|
280
281
|
readonly enumSensor: 'enum-sensor';
|
|
282
|
+
readonly error: 'error';
|
|
281
283
|
readonly eventEmitter: 'event-emitter';
|
|
282
284
|
readonly faceGallery: 'face-gallery';
|
|
283
285
|
readonly failureContribution: 'failure-contribution';
|
|
@@ -499,6 +501,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
|
|
|
499
501
|
readonly embeddingEncoder: TRouter;
|
|
500
502
|
readonly energySystem: TRouter;
|
|
501
503
|
readonly enumSensor: TRouter;
|
|
504
|
+
readonly error: TRouter;
|
|
502
505
|
readonly eventEmitter: TRouter;
|
|
503
506
|
readonly faceGallery: TRouter;
|
|
504
507
|
readonly failureContribution: TRouter;
|
|
@@ -635,8 +638,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
|
|
|
635
638
|
readonly zoneRules: TRouter;
|
|
636
639
|
readonly zones: TRouter;
|
|
637
640
|
}
|
|
638
|
-
/** Capability names whose mode is `singleton` (
|
|
639
|
-
export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
|
|
641
|
+
/** Capability names whose mode is `singleton` (168 caps). */
|
|
642
|
+
export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'error', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
|
|
640
643
|
/** Union of singleton capability names (literal string union). */
|
|
641
644
|
export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
|
|
642
645
|
/** Capability names whose mode is `collection` (40 caps). */
|
|
@@ -23,6 +23,7 @@ import { doNotDisturbCapability } from '../capabilities/do-not-disturb.cap.js';
|
|
|
23
23
|
import { doorbellCapability } from '../capabilities/doorbell.cap.js';
|
|
24
24
|
import { energySystemCapability } from '../capabilities/energy-system.cap.js';
|
|
25
25
|
import { enumSensorCapability } from '../capabilities/enum-sensor.cap.js';
|
|
26
|
+
import { errorCapability } from '../capabilities/error.cap.js';
|
|
26
27
|
import { eventEmitterCapability } from '../capabilities/event-emitter.cap.js';
|
|
27
28
|
import { fanControlCapability } from '../capabilities/fan-control.cap.js';
|
|
28
29
|
import { featureProbeCapability } from '../capabilities/feature-probe.cap.js';
|
|
@@ -119,6 +120,7 @@ export interface DeviceLocalState {
|
|
|
119
120
|
doorbell: InferRuntimeState<typeof doorbellCapability>;
|
|
120
121
|
energySystem: InferRuntimeState<typeof energySystemCapability>;
|
|
121
122
|
enumSensor: InferRuntimeState<typeof enumSensorCapability>;
|
|
123
|
+
error: InferRuntimeState<typeof errorCapability>;
|
|
122
124
|
eventEmitter: InferRuntimeState<typeof eventEmitterCapability>;
|
|
123
125
|
fanControl: InferRuntimeState<typeof fanControlCapability>;
|
|
124
126
|
featureProbe: InferRuntimeState<typeof featureProbeCapability>;
|
|
@@ -225,6 +227,7 @@ export interface CapNameToRuntimeStateMap {
|
|
|
225
227
|
'doorbell': InferRuntimeState<typeof doorbellCapability>;
|
|
226
228
|
'energy-system': InferRuntimeState<typeof energySystemCapability>;
|
|
227
229
|
'enum-sensor': InferRuntimeState<typeof enumSensorCapability>;
|
|
230
|
+
'error': InferRuntimeState<typeof errorCapability>;
|
|
228
231
|
'event-emitter': InferRuntimeState<typeof eventEmitterCapability>;
|
|
229
232
|
'fan-control': InferRuntimeState<typeof fanControlCapability>;
|
|
230
233
|
'feature-probe': InferRuntimeState<typeof featureProbeCapability>;
|
|
@@ -38,6 +38,7 @@ import type { doNotDisturbCapability } from '../capabilities/do-not-disturb.cap.
|
|
|
38
38
|
import type { doorbellCapability } from '../capabilities/doorbell.cap.js';
|
|
39
39
|
import type { energySystemCapability } from '../capabilities/energy-system.cap.js';
|
|
40
40
|
import type { enumSensorCapability } from '../capabilities/enum-sensor.cap.js';
|
|
41
|
+
import type { errorCapability } from '../capabilities/error.cap.js';
|
|
41
42
|
import type { eventEmitterCapability } from '../capabilities/event-emitter.cap.js';
|
|
42
43
|
import type { fanControlCapability } from '../capabilities/fan-control.cap.js';
|
|
43
44
|
import type { featureProbeCapability } from '../capabilities/feature-probe.cap.js';
|
|
@@ -158,6 +159,7 @@ export interface DeviceProxyState {
|
|
|
158
159
|
readonly doorbell: SliceHandle<InferRuntimeState<typeof doorbellCapability>>;
|
|
159
160
|
readonly energySystem: SliceHandle<InferRuntimeState<typeof energySystemCapability>>;
|
|
160
161
|
readonly enumSensor: SliceHandle<InferRuntimeState<typeof enumSensorCapability>>;
|
|
162
|
+
readonly error: SliceHandle<InferRuntimeState<typeof errorCapability>>;
|
|
161
163
|
readonly eventEmitter: SliceHandle<InferRuntimeState<typeof eventEmitterCapability>>;
|
|
162
164
|
readonly fanControl: SliceHandle<InferRuntimeState<typeof fanControlCapability>>;
|
|
163
165
|
readonly featureProbe: SliceHandle<InferRuntimeState<typeof featureProbeCapability>>;
|
|
@@ -273,6 +275,7 @@ export interface DeviceProxy {
|
|
|
273
275
|
readonly doorbell?: InferDeviceProxyCap<typeof doorbellCapability>;
|
|
274
276
|
readonly energySystem?: InferDeviceProxyCap<typeof energySystemCapability>;
|
|
275
277
|
readonly enumSensor?: InferDeviceProxyCap<typeof enumSensorCapability>;
|
|
278
|
+
readonly error?: InferDeviceProxyCap<typeof errorCapability>;
|
|
276
279
|
readonly eventEmitter?: InferDeviceProxyCap<typeof eventEmitterCapability>;
|
|
277
280
|
readonly fanControl?: InferDeviceProxyCap<typeof fanControlCapability>;
|
|
278
281
|
readonly featureProbe?: InferDeviceProxyCap<typeof featureProbeCapability>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* can answer "may a rule actuate this?" without importing the schema barrel
|
|
6
6
|
* (~144MB RSS per runner, D28).
|
|
7
7
|
*
|
|
8
|
-
* Coverage:
|
|
8
|
+
* Coverage: 107 device-scoped capabilities.
|
|
9
9
|
*/
|
|
10
10
|
export declare const DEVICE_SCOPED_CAPS: ReadonlySet<string>;
|
|
11
11
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CapabilityHistoryField, CapabilityHistoryItems } from '../capabilities/capability-definition.js';
|
|
2
2
|
/**
|
|
3
3
|
* Cap history catalog, projected from every `*.cap.ts` `history` block.
|
|
4
|
-
* 45 caps with series (104 series),
|
|
4
|
+
* 45 caps with series (104 series), 39 caps answered `'none'`.
|
|
5
5
|
* Field keys are `runtimeState` paths (`a.b` into fixed objects only).
|
|
6
6
|
*/
|
|
7
7
|
export declare const HISTORY_CATALOG: Readonly<Record<string, Readonly<Record<string, CapabilityHistoryField>>>>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1493 method paths across 208 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { MethodRole } from '../auth/viewer-access.js';
|
|
12
12
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* system-scope cap that takes a deviceId was previously never device-filtered
|
|
7
7
|
* — see the generator header).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 623 methods carry a device reference, of which
|
|
10
10
|
* 196 are on SYSTEM-scope caps.
|
|
11
11
|
*
|
|
12
12
|
* Top-level fields, number arrays, and one-level arrays of objects carrying
|
|
@@ -16,7 +16,7 @@ export interface RuntimeStatePolicy {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
|
|
19
|
-
* `runtimeState`.
|
|
19
|
+
* `runtimeState`. 85 caps: 43 `restored`, 42 `session`.
|
|
20
20
|
*
|
|
21
21
|
* A cap absent from this map has no runtime-state slice at all. A cap PRESENT
|
|
22
22
|
* with `durability: 'session'` has one and has decided not to keep it.
|
package/dist/index.d.ts
CHANGED
|
@@ -275,6 +275,7 @@ export type { DeviceRestoreRetrySchedulerOptions, InitialRestoreFailure, Permane
|
|
|
275
275
|
export { DEVICE_RESTORE_RETRY_CONCURRENCY, DEVICE_RESTORE_RETRY_DELAYS_MS, DeviceRestoreRetryScheduler, } from './device/device-restore-retry.js';
|
|
276
276
|
export type { IDeviceRuntimeState, RuntimeStateWriteFailed, RuntimeStateWriter, } from './device/device-runtime-state.js';
|
|
277
277
|
export { DeviceRuntimeState } from './device/device-runtime-state.js';
|
|
278
|
+
export { buildDeviceErrorAlert, type DeviceErrorEdge, deviceErrorAlertId, deviceErrorEdge, } from './device/device-error-episode.js';
|
|
278
279
|
export type { SliceEventBus, SliceHandle, SliceHandleApi, SliceHandleSource, } from './device/device-state-handle.js';
|
|
279
280
|
export { createEventBusSliceSource, createLazyTrpcSource, createMirrorSource, createSliceHandle, } from './device/device-state-handle.js';
|
|
280
281
|
export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType, featuresOfBoundCaps, } from './device/device-type.js';
|