@camstack/types 1.2.584 → 1.2.585
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 +9 -0
- package/dist/addon/instance-link.d.ts +3 -1
- package/dist/addon.d.ts +3 -2
- package/dist/addon.js +3 -1
- package/dist/addon.mjs +2 -2
- package/dist/audit/command-origin-claim.d.ts +33 -0
- package/dist/audit/device-transition.d.ts +35 -2
- package/dist/capabilities/capability-definition.d.ts +2 -1
- package/dist/capabilities/device-transitions.cap.d.ts +44 -0
- package/dist/capabilities/index.d.ts +4 -1
- package/dist/capabilities/siren-duration.d.ts +15 -0
- package/dist/capabilities/siren.cap.d.ts +175 -0
- package/dist/client.js +621 -613
- package/dist/client.mjs +621 -613
- package/dist/generated/addon-api.d.ts +36 -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/helpers/trpc-leaf.d.ts +4 -3
- package/dist/index.js +280 -7
- package/dist/index.mjs +269 -8
- package/dist/{sleep-DnhxKL99.mjs → sleep-Ch7Q7UtE.mjs} +728 -620
- package/dist/{sleep-Coq9CYAH.js → sleep-DwRtgB2i.js} +739 -619
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.585] - 2026-11-16
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A kind that does not say whether it can be tested now follows its own provider, so Calendar, Alexa, Matter and Home Assistant integration rows no longer offer a Test that answered 'no connection test'
|
|
15
|
+
- Device Interactions can record which ecosystem principal an exporter acted for.
|
|
16
|
+
- A device proxy command accepts an optional call origin, so an exporter can state who it acted for.
|
|
17
|
+
- New timed siren capability: sound a siren for a chosen duration and read until when it sounds
|
|
18
|
+
|
|
10
19
|
## [1.2.584] - 2026-11-16
|
|
11
20
|
|
|
12
21
|
### Changed
|
|
@@ -12,7 +12,7 @@ import type { DefinedRecordKind } from '../records/record-kind.js';
|
|
|
12
12
|
import type { RecordsAccess } from '../records/records-access.js';
|
|
13
13
|
import type { InstanceUserFinder } from './instance-in-use.js';
|
|
14
14
|
import { linkField, linksOfKind, optionalLinkField, type KindLink, type LinkTarget } from './instance-link-meta.js';
|
|
15
|
-
import { type InstanceBody, type InstanceChange, RecordIntegrationInstances } from './record-integration-instances.js';
|
|
15
|
+
import { type InstanceBody, type InstanceChange, RecordIntegrationInstances, type RecordIntegrationInstancesHooks } from './record-integration-instances.js';
|
|
16
16
|
export { linkField, linksOfKind, optionalLinkField };
|
|
17
17
|
export type { KindLink, LinkTarget };
|
|
18
18
|
type FormSections = ConfigUISchema['sections'];
|
|
@@ -74,6 +74,8 @@ export interface LinkedInstancesSpec<TBody extends InstanceBody> {
|
|
|
74
74
|
* a field of the kind's own that has no sensible empty value.
|
|
75
75
|
*/
|
|
76
76
|
readonly alsoConfigured?: (body: TBody) => boolean;
|
|
77
|
+
/** The kind's Test (draft values in, one verdict out); absent: the kind is not testable. */
|
|
78
|
+
readonly test?: RecordIntegrationInstancesHooks<TBody>['test'];
|
|
77
79
|
/** The id of a new instance when the caller sent none; absent refuses such a create. */
|
|
78
80
|
readonly mintId?: (input: {
|
|
79
81
|
readonly name: string;
|
package/dist/addon.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ export { MIGRATION_API_VERSION } from './migrations/api/migration-api-version.js
|
|
|
22
22
|
export { ErrorI18nPayloadSchema, readErrorI18n } from './i18n/camstack-error.js';
|
|
23
23
|
export type { ErrorI18nPayload } from './i18n/camstack-error.js';
|
|
24
24
|
export { commandOrigin, nodePin, readCommandOrigin, readNodePin } from './cap-call-context.js';
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
25
|
+
export type { CommandOriginRequestOptions } from './cap-call-context.js';
|
|
26
|
+
export { CommandOriginClaimSchema, OnBehalfSchema, OnBehalfSourceSchema, RuleFireOriginSchema, ruleFireOfClaim, } from './audit/command-origin-claim.js';
|
|
27
|
+
export type { CommandOriginClaim, OnBehalf, OnBehalfSource, RuleFireOrigin, } from './audit/command-origin-claim.js';
|
|
27
28
|
export { isCommand } from './device/cap-vocabulary/command-catalog.js';
|
|
28
29
|
export { nodeIdOfScopedKey, resolveDeviceSettings, resolvedValues, SCOPED_SETTINGS_SCOPES, } from './addon/scoped-settings.js';
|
|
29
30
|
export type { DeviceSettingsLayers, ResolvedSetting, ResolvedSettings, ScopedSettings, ScopedSettingsDeclaration, ScopedSettingsScope, SettingSource, } from './addon/scoped-settings.js';
|
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-DwRtgB2i.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
|
|
@@ -572,6 +572,8 @@ exports.MIGRATION_API_VERSION = require_sleep.MIGRATION_API_VERSION;
|
|
|
572
572
|
exports.MIN_SCRUBBED_LENGTH = require_sleep.MIN_SCRUBBED_LENGTH;
|
|
573
573
|
exports.MODEL_FORMATS = require_sleep.MODEL_FORMATS;
|
|
574
574
|
exports.NoCallerError = require_sleep.NoCallerError;
|
|
575
|
+
exports.OnBehalfSchema = require_sleep.OnBehalfSchema;
|
|
576
|
+
exports.OnBehalfSourceSchema = require_sleep.OnBehalfSourceSchema;
|
|
575
577
|
exports.PEER_BYTES_CHUNK_BYTES = require_sleep.PEER_BYTES_CHUNK_BYTES;
|
|
576
578
|
exports.PEER_BYTES_MAX_OUTSTANDING = require_sleep.PEER_BYTES_MAX_OUTSTANDING;
|
|
577
579
|
exports.PEER_BYTES_STALL_MS = require_sleep.PEER_BYTES_STALL_MS;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DEVICE_CHILDREN_BATCH_MAX, $
|
|
1
|
+
import { $ as DEVICE_CHILDREN_BATCH_MAX, $r as recordArrayItemPath, A as CAP_ADVANCE_FIELDS, Ai as FilterRequiredError, An as scrubKnownSecrets, Bi as RecordsError, Bn as DisposerChain, Ci as normalizeSecretOwner, Cn as REVALIDATE_AFTER_MS, Cr as BaseAddon, Dn as forgetKnownSecret, En as clearKnownSecrets, Er as normalizeAddonInitResult, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RECORDS_ERROR_CODES, Fn as PEER_BYTES_TICKET_TTL_MS, G as readNodePin, Gi as asRecordsError, Gn as RecordIndexSchema, H as commandOrigin, Hi as TransactRefusedError, Hn as entryBody, I as customAction, Ii as RecordNotFoundError, Ir as SCOPED_SETTINGS_SCOPES, J as PipelineRunResultBridge, Jn as RecordRetentionSchema, Jr as secretViewsOf, Ki as recordsErrorFromMessage, Kn as RecordKindDeclarationSchema, L as defineCustomActions, Li as RecordSecretUnavailableError, Ln as CALLER_USERNAME_HEADER, Lr as nodeIdOfScopedKey, Mi as InvalidRecordError, Mn as PEER_BYTES_CHUNK_BYTES, N as CAP_STATE_LEAVES, Ni as NoCallerError, Nn as PEER_BYTES_MAX_OUTSTANDING, O as HF_REPO, Oa as AddonMigrationsBlockedError, Oi as BatchTooLargeError, On as knownSecretCount, P as CALLER_STAMPED_CAPABILITIES, Pi as PlaintextSecretError, Pn as PEER_BYTES_STALL_MS, Q as deviceOpsCapability, Qn as defineRecordKinds, Qr as parseSecretPath, R as describeCustomActions, Ri as RecordTooLargeError, Rn as DATAPLANE_SECRET_HEADER, Rr as resolveDeviceSettings, Si as isSecretRef, Sn as resolveSecretViewsIn, T as isCommand, Tn as MIN_SCRUBBED_LENGTH, U as nodePin, Ui as UnindexedFilterError, Un as EntryDescriptorSchema, Vi as RevConflictError, Vn as defineEntryKind, W as readCommandOrigin, Wi as UnknownRecordKindError, Wn as RecordFieldPathSchema, X as MIGRATION_API_VERSION, Xn as assertValidDeclaration, Xr as collectSecretLeaves, Y as PipelineStepInputSchema, Yn as StoredRecordKindDeclarationSchema, Yr as REMOVE_LEAF, Zn as declarationsOf, Zr as mapSecretLeaves, _a as isSecretMarker, _i as SECRET_REF_SCHEME, _n as RuleFireOriginSchema, ai as RECORD_CLASSES, ba as toSecretFieldView, bi as formatSecretScope, bn as createRecordsAccess, c as asString, ci as RECORD_DELETE_BATCH, d as parseJsonUnknown, di as RECORD_MAX_INDEXES, ei as recordSecretCollection, er as collectZodSecretPaths, et as adminUiCapability, f as hfModelUrl, fi as RECORD_MAX_INDEX_FIELDS, g as createDeviceProxy, ga as isSecretFieldView, gi as RECORD_SWEEP_INTERVAL_MS, gn as OnBehalfSourceSchema, h as isDeviceScopedCap, ha as isSecretClear, hi as RECORD_SETTINGS_MAX_ROWS, hn as OnBehalfSchema, ht as ReadinessTimeoutError, ii as RECORD_BATCH_MAX_BYTES, j as CAP_METHOD_TIMEOUTS_MS, ji as ForeignSecretMarkerError, jn as shortSecretRefHash, ka as findMigrationsBlocked, ki as DeclarationRefusedError, kn as registerKnownSecret, li as RECORD_ID_MAX_LENGTH, lr as expandCapMethods, m as DEVICE_SCOPED_CAPS, ma as classifySecretWrite, mi as RECORD_SECRET_COLLECTION_PREFIX, mn as CommandOriginClaimSchema, mt as ReadinessRegistry, na as createEvent, ni as secretArrayPrefixes, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_DATABASES, p as BOOT_RECOVERY_BACKOFF_MS, pa as SECRET_CLEAR, pi as RECORD_QUERY_MAX, pt as MODEL_FORMATS, q as viewerUiCapability, qn as RecordKindNameSchema, r as maskUrlCredentials, ra as emitReadiness, ri as RECORD_BATCH_MAX, si as RECORD_DEFAULT_MAX_DATA_BYTES, t as sleep, ti as recordSecretRef, tr as isZodSecret, ui as RECORD_MAX_DATA_BYTES, v as addonSliceHandleApi, va as isSecretMarkerLike, vi as arrayItemFieldPath, vn as ruleFireOfClaim, vr as ErrorI18nPayloadSchema, vt as scopeKey, wi as parseSecretRef, wn as createSecretsAccess, xi as globalSecretScope, xn as assertTransactScope, xr as readErrorI18n, y as createEventBusSliceSource, ya as makeSecretMarker, yi as buildSecretRef, yn as makeInMemoryRecords, zi as RecordUniqueViolationError, zr as resolvedValues } from "./sleep-Ch7Q7UtE.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
|
|
@@ -541,4 +541,4 @@ function isProviderOptionalMethodName(capName, method) {
|
|
|
541
541
|
return methods !== void 0 && methods.includes(method);
|
|
542
542
|
}
|
|
543
543
|
//#endregion
|
|
544
|
-
export { AddonMigrationsBlockedError, BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CALLER_USERNAME_HEADER, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_METHOD_TIMEOUTS_MS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, COMPOSED_DEVICE_STABLE_ID_PREFIX, CommandOriginClaimSchema, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIGRATION_API_VERSION, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PipelineRunResultBridge, PipelineStepInputSchema, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, RuleFireOriginSchema, SCOPED_SETTINGS_SCOPES, SECRET_CLEAR, SECRET_REF_SCHEME, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonPagesSourceCapability, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, commandOrigin, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, customAction, declarationsOf, defineCustomActions, defineEntryKind, defineRecordKinds, describeCustomActions, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, findMigrationsBlocked, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCollectionArrayMethodName, isCommand, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodeIdOfScopedKey, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readCommandOrigin, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveDeviceSettings, resolveSecretViewsIn, resolvedValues, ruleFireOfClaim, scopeKey, scrubKnownSecrets, secretArrayPrefixes, secretViewsOf, shortSecretRefHash, sleep, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
|
|
544
|
+
export { AddonMigrationsBlockedError, BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CALLER_USERNAME_HEADER, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_METHOD_TIMEOUTS_MS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, COMPOSED_DEVICE_STABLE_ID_PREFIX, CommandOriginClaimSchema, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIGRATION_API_VERSION, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, OnBehalfSchema, OnBehalfSourceSchema, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PipelineRunResultBridge, PipelineStepInputSchema, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, RuleFireOriginSchema, SCOPED_SETTINGS_SCOPES, SECRET_CLEAR, SECRET_REF_SCHEME, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonPagesSourceCapability, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, commandOrigin, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, customAction, declarationsOf, defineCustomActions, defineEntryKind, defineRecordKinds, describeCustomActions, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, findMigrationsBlocked, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCollectionArrayMethodName, isCommand, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodeIdOfScopedKey, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readCommandOrigin, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveDeviceSettings, resolveSecretViewsIn, resolvedValues, ruleFireOfClaim, scopeKey, scrubKnownSecrets, secretArrayPrefixes, secretViewsOf, shortSecretRefHash, sleep, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
|
|
@@ -28,6 +28,28 @@ export declare const RuleFireOriginSchema: z.ZodObject<{
|
|
|
28
28
|
}, z.core.$strip>>>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
30
|
export type RuleFireOrigin = z.infer<typeof RuleFireOriginSchema>;
|
|
31
|
+
/** The ecosystems an exporter speaks for. */
|
|
32
|
+
export declare const OnBehalfSourceSchema: z.ZodEnum<{
|
|
33
|
+
alexa: "alexa";
|
|
34
|
+
google: "google";
|
|
35
|
+
homeassistant: "homeassistant";
|
|
36
|
+
homekit: "homekit";
|
|
37
|
+
matter: "matter";
|
|
38
|
+
}>;
|
|
39
|
+
export type OnBehalfSource = z.infer<typeof OnBehalfSourceSchema>;
|
|
40
|
+
/** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
|
|
41
|
+
export declare const OnBehalfSchema: z.ZodObject<{
|
|
42
|
+
source: z.ZodEnum<{
|
|
43
|
+
alexa: "alexa";
|
|
44
|
+
google: "google";
|
|
45
|
+
homeassistant: "homeassistant";
|
|
46
|
+
homekit: "homekit";
|
|
47
|
+
matter: "matter";
|
|
48
|
+
}>;
|
|
49
|
+
principalId: z.ZodString;
|
|
50
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type OnBehalf = z.infer<typeof OnBehalfSchema>;
|
|
31
53
|
/** Where a command's origin claim comes from: an addon states WHY it called, never WHO it is. */
|
|
32
54
|
export declare const CommandOriginClaimSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
55
|
kind: z.ZodLiteral<"action">;
|
|
@@ -85,6 +107,17 @@ export declare const CommandOriginClaimSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
85
107
|
cameraId: z.ZodNumber;
|
|
86
108
|
}, z.core.$strip>>>;
|
|
87
109
|
}, z.core.$strip>;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
source: z.ZodEnum<{
|
|
112
|
+
alexa: "alexa";
|
|
113
|
+
google: "google";
|
|
114
|
+
homeassistant: "homeassistant";
|
|
115
|
+
homekit: "homekit";
|
|
116
|
+
matter: "matter";
|
|
117
|
+
}>;
|
|
118
|
+
principalId: z.ZodString;
|
|
119
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
120
|
+
kind: z.ZodLiteral<"on-behalf">;
|
|
88
121
|
}, z.core.$strip>], "kind">;
|
|
89
122
|
export type CommandOriginClaim = z.infer<typeof CommandOriginClaimSchema>;
|
|
90
123
|
/** The rule fire a claim carries, if it carries one. */
|
|
@@ -27,6 +27,17 @@ export declare const TransitionActorSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
27
27
|
kind: z.ZodLiteral<"addon">;
|
|
28
28
|
addonId: z.ZodString;
|
|
29
29
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
source: z.ZodEnum<{
|
|
32
|
+
alexa: "alexa";
|
|
33
|
+
google: "google";
|
|
34
|
+
homeassistant: "homeassistant";
|
|
35
|
+
homekit: "homekit";
|
|
36
|
+
matter: "matter";
|
|
37
|
+
}>;
|
|
38
|
+
principalId: z.ZodString;
|
|
39
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>>;
|
|
30
41
|
}, z.core.$strip>, z.ZodObject<{
|
|
31
42
|
kind: z.ZodLiteral<"action">;
|
|
32
43
|
addonId: z.ZodString;
|
|
@@ -105,6 +116,17 @@ export declare const DeviceTransitionSchema: z.ZodObject<{
|
|
|
105
116
|
kind: z.ZodLiteral<"addon">;
|
|
106
117
|
addonId: z.ZodString;
|
|
107
118
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
119
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
source: z.ZodEnum<{
|
|
121
|
+
alexa: "alexa";
|
|
122
|
+
google: "google";
|
|
123
|
+
homeassistant: "homeassistant";
|
|
124
|
+
homekit: "homekit";
|
|
125
|
+
matter: "matter";
|
|
126
|
+
}>;
|
|
127
|
+
principalId: z.ZodString;
|
|
128
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
108
130
|
}, z.core.$strip>, z.ZodObject<{
|
|
109
131
|
kind: z.ZodLiteral<"action">;
|
|
110
132
|
addonId: z.ZodString;
|
|
@@ -165,6 +187,17 @@ export declare const DeviceCommandSettledEventSchema: z.ZodObject<{
|
|
|
165
187
|
kind: z.ZodLiteral<"addon">;
|
|
166
188
|
addonId: z.ZodString;
|
|
167
189
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
190
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
source: z.ZodEnum<{
|
|
192
|
+
alexa: "alexa";
|
|
193
|
+
google: "google";
|
|
194
|
+
homeassistant: "homeassistant";
|
|
195
|
+
homekit: "homekit";
|
|
196
|
+
matter: "matter";
|
|
197
|
+
}>;
|
|
198
|
+
principalId: z.ZodString;
|
|
199
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
168
201
|
}, z.core.$strip>, z.ZodObject<{
|
|
169
202
|
kind: z.ZodLiteral<"action">;
|
|
170
203
|
addonId: z.ZodString;
|
|
@@ -187,8 +220,8 @@ export declare const DeviceCommandSettledEventSchema: z.ZodObject<{
|
|
|
187
220
|
at: z.ZodNumber;
|
|
188
221
|
}, z.core.$strip>;
|
|
189
222
|
export type DeviceCommandSettledEvent = z.infer<typeof DeviceCommandSettledEventSchema>;
|
|
190
|
-
export { CommandOriginClaimSchema, RuleFireOriginSchema, ruleFireOfClaim, } from './command-origin-claim.js';
|
|
191
|
-
export type { CommandOriginClaim, RuleFireOrigin } from './command-origin-claim.js';
|
|
223
|
+
export { CommandOriginClaimSchema, OnBehalfSchema, OnBehalfSourceSchema, RuleFireOriginSchema, ruleFireOfClaim, } from './command-origin-claim.js';
|
|
224
|
+
export type { CommandOriginClaim, OnBehalf, OnBehalfSource, RuleFireOrigin, } from './command-origin-claim.js';
|
|
192
225
|
/** The actor of a command: every kind but `device`, which is what nobody asked for. */
|
|
193
226
|
export type CommandActor = Exclude<TransitionActor, {
|
|
194
227
|
readonly kind: 'device';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { z } from 'zod';
|
|
15
15
|
import { type DeviceRole, DeviceType } from '../device/device-type.js';
|
|
16
|
+
import type { CommandOriginRequestOptions } from '../cap-call-context.js';
|
|
16
17
|
import type { ConfigUISchemaWithValues } from '../interfaces/config-ui.js';
|
|
17
18
|
import type { ExtensionSlotDescriptor } from '../device-extension/slot-descriptor.js';
|
|
18
19
|
import type { MethodRoleDecl } from '../auth/viewer-access.js';
|
|
@@ -1213,7 +1214,7 @@ export type InferEvents<T extends CapabilityDefinition> = T['events'] extends Re
|
|
|
1213
1214
|
* the push-based shape, without `deviceId` in the input payload.
|
|
1214
1215
|
*/
|
|
1215
1216
|
export type InferDeviceProxyCap<T extends CapabilityDefinition> = {
|
|
1216
|
-
readonly [K in keyof T['methods']]: T['methods'][K] extends CapabilityMethodSchema<infer TIn, infer TOut> ? T['methods'][K]['kind'] extends 'subscription' ? (input: Omit<z.infer<TIn>, 'deviceId'>, push: (value: z.infer<TOut>) => void) => (() => void) | void : (input: Omit<z.infer<TIn>, 'deviceId'
|
|
1217
|
+
readonly [K in keyof T['methods']]: T['methods'][K] extends CapabilityMethodSchema<infer TIn, infer TOut> ? T['methods'][K]['kind'] extends 'subscription' ? (input: Omit<z.infer<TIn>, 'deviceId'>, push: (value: z.infer<TOut>) => void) => (() => void) | void : (input: Omit<z.infer<TIn>, 'deviceId'>, options?: CommandOriginRequestOptions) => Promise<z.infer<TOut>> : never;
|
|
1217
1218
|
} & (T['status'] extends {
|
|
1218
1219
|
schema: infer S;
|
|
1219
1220
|
} ? {
|
|
@@ -106,6 +106,17 @@ export declare const deviceTransitionsCapability: {
|
|
|
106
106
|
kind: z.ZodLiteral<"addon">;
|
|
107
107
|
addonId: z.ZodString;
|
|
108
108
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
109
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
source: z.ZodEnum<{
|
|
111
|
+
alexa: "alexa";
|
|
112
|
+
google: "google";
|
|
113
|
+
homeassistant: "homeassistant";
|
|
114
|
+
homekit: "homekit";
|
|
115
|
+
matter: "matter";
|
|
116
|
+
}>;
|
|
117
|
+
principalId: z.ZodString;
|
|
118
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
109
120
|
}, z.core.$strip>, z.ZodObject<{
|
|
110
121
|
kind: z.ZodLiteral<"action">;
|
|
111
122
|
addonId: z.ZodString;
|
|
@@ -168,6 +179,17 @@ export declare const deviceTransitionsCapability: {
|
|
|
168
179
|
kind: z.ZodLiteral<"addon">;
|
|
169
180
|
addonId: z.ZodString;
|
|
170
181
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
source: z.ZodEnum<{
|
|
184
|
+
alexa: "alexa";
|
|
185
|
+
google: "google";
|
|
186
|
+
homeassistant: "homeassistant";
|
|
187
|
+
homekit: "homekit";
|
|
188
|
+
matter: "matter";
|
|
189
|
+
}>;
|
|
190
|
+
principalId: z.ZodString;
|
|
191
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
171
193
|
}, z.core.$strip>, z.ZodObject<{
|
|
172
194
|
kind: z.ZodLiteral<"action">;
|
|
173
195
|
addonId: z.ZodString;
|
|
@@ -248,6 +270,17 @@ export declare const deviceTransitionsCapability: {
|
|
|
248
270
|
kind: z.ZodLiteral<"addon">;
|
|
249
271
|
addonId: z.ZodString;
|
|
250
272
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
source: z.ZodEnum<{
|
|
275
|
+
alexa: "alexa";
|
|
276
|
+
google: "google";
|
|
277
|
+
homeassistant: "homeassistant";
|
|
278
|
+
homekit: "homekit";
|
|
279
|
+
matter: "matter";
|
|
280
|
+
}>;
|
|
281
|
+
principalId: z.ZodString;
|
|
282
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strip>>;
|
|
251
284
|
}, z.core.$strip>, z.ZodObject<{
|
|
252
285
|
kind: z.ZodLiteral<"action">;
|
|
253
286
|
addonId: z.ZodString;
|
|
@@ -311,6 +344,17 @@ export declare const deviceTransitionsCapability: {
|
|
|
311
344
|
kind: z.ZodLiteral<"addon">;
|
|
312
345
|
addonId: z.ZodString;
|
|
313
346
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
347
|
+
onBehalf: z.ZodOptional<z.ZodObject<{
|
|
348
|
+
source: z.ZodEnum<{
|
|
349
|
+
alexa: "alexa";
|
|
350
|
+
google: "google";
|
|
351
|
+
homeassistant: "homeassistant";
|
|
352
|
+
homekit: "homekit";
|
|
353
|
+
matter: "matter";
|
|
354
|
+
}>;
|
|
355
|
+
principalId: z.ZodString;
|
|
356
|
+
principalName: z.ZodOptional<z.ZodString>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
314
358
|
}, z.core.$strip>, z.ZodObject<{
|
|
315
359
|
kind: z.ZodLiteral<"action">;
|
|
316
360
|
addonId: z.ZodString;
|
|
@@ -230,6 +230,8 @@ export { type MeterStatus, MeterStatusSchema, meterCapability, type IMeterProvid
|
|
|
230
230
|
export { type IMediaPlayerProvider, type MediaInfo, type MediaPlayerRepeat, MediaPlayerRepeatSchema, type MediaPlayerState, MediaPlayerStateSchema, type MediaPlayerStateSource, MediaPlayerStateSourceSchema, MediaPlayerAssumedFieldSchema, type MediaPlayerAssumedField, type MediaPlayerStatus, MediaPlayerStatusSchema, mediaPlayerCapability, MEDIA_PLAYER_MAX_STEPS, } from './media-player.cap.js';
|
|
231
231
|
export { type IMeshNetworkProvider, type MeshEndpoint, type MeshPeer, MeshPeerSchema, type MeshStatus, MeshStatusSchema, meshNetworkCapability, } from './mesh-network.cap.js';
|
|
232
232
|
export { type IMotionProvider, MOTION_CLOSE_AFTER_MS, MOTION_SPAN_TIMEOUT_MS, type MotionOnMotionChangedData, MotionOnMotionChangedDataSchema, type MotionStatus, MotionStatusSchema, motionCapability, } from './motion.cap.js';
|
|
233
|
+
export { resolveSirenSeconds, sirenIdleStatus, sirenTriggeredStatus } from './siren-duration.js';
|
|
234
|
+
export { type ISirenProvider, type SirenDurationRange, SirenDurationRangeSchema, SirenDurationUnit, type SirenDurationUnitValue, type SirenOptions, SirenOptionsSchema, SirenOptionsSource, type SirenOptionsSourceValue, type SirenRuntimeState, SirenRuntimeStateSchema, type SirenStatus, SirenStatusSchema, sirenCapability, } from './siren.cap.js';
|
|
233
235
|
export { type IMotionTriggerProvider, type MotionTriggerRuntimeState, MotionTriggerRuntimeStateSchema, type MotionTriggerStatus, MotionTriggerStatusSchema, motionTriggerCapability, } from './motion-trigger.cap.js';
|
|
234
236
|
export { type IMotionZonesProvider, type MotionZoneOptions, MotionZoneOptionsSchema, type MotionZonePatch, MotionZonePatchSchema, type MotionZoneRegion, MotionZoneRegionSchema, type MotionZoneStatus, MotionZoneStatusSchema, motionZonesCapability, } from './motion-zones.cap.js';
|
|
235
237
|
export { type INativeObjectDetectionProvider, type NativeDetection, NativeDetectionSchema, type NativeObjectClass, NativeObjectClassEnum, type NativeObjectDetectionOptions, NativeObjectDetectionOptionsSchema, type NativeObjectDetectionRuntimeState, NativeObjectDetectionRuntimeStateSchema, type NativeObjectDetectionSettingsPatch, NativeObjectDetectionSettingsPatchSchema, type NativeObjectDetectionStatus, NativeObjectDetectionStatusSchema, type NativeObjectGeometry, NativeObjectGeometryEnum, nativeObjectDetectionCapability, } from './native-object-detection.cap.js';
|
|
@@ -418,6 +420,7 @@ import type { modelDistributorCapability } from './model-distributor.cap.js';
|
|
|
418
420
|
import type { motionCapability } from './motion.cap.js';
|
|
419
421
|
import type { motionDetectionCapability } from './motion-detection.cap.js';
|
|
420
422
|
import type { motionTriggerCapability } from './motion-trigger.cap.js';
|
|
423
|
+
import type { sirenCapability } from './siren.cap.js';
|
|
421
424
|
import type { motionZonesCapability } from './motion-zones.cap.js';
|
|
422
425
|
import type { mqttBrokerCapability } from './mqtt-broker.cap.js';
|
|
423
426
|
import type { nativeObjectDetectionCapability } from './native-object-detection.cap.js';
|
|
@@ -500,6 +503,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
|
|
|
500
503
|
import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
|
|
501
504
|
import type { zoneRulesCapability } from './zone-rules.cap.js';
|
|
502
505
|
import type { zonesCapability } from './zones.cap.js';
|
|
503
|
-
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 tagsCapability | 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;
|
|
506
|
+
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 sirenCapability | 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 tagsCapability | 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;
|
|
504
507
|
export type CapabilityName = AnyCapability['name'];
|
|
505
508
|
export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SirenOptions, SirenStatus } from './siren.cap.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pure duration maths for the `siren` cap, shared by every provider so a
|
|
4
|
+
* trigger and the countdown it publishes mean the same thing everywhere.
|
|
5
|
+
*/
|
|
6
|
+
/** The state of a siren that is not sounding. Keeps the last activation's facts. */
|
|
7
|
+
export declare function sirenIdleStatus(previous: SirenStatus | undefined): SirenStatus;
|
|
8
|
+
/** The state right after a timed trigger: sounding until `now + seconds`. */
|
|
9
|
+
export declare function sirenTriggeredStatus(nowMs: number, seconds: number): SirenStatus;
|
|
10
|
+
/**
|
|
11
|
+
* The duration a trigger will really use: the request (or the camera default)
|
|
12
|
+
* snapped to what the camera allows — the nearest listed value, or clamped and
|
|
13
|
+
* stepped inside the range. Never longer or shorter than the camera can play.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveSirenSeconds(options: SirenOptions, requested: number | undefined): number;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
import { DeviceType } from '../device/device-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* Timed siren: trigger the siren for a duration and know until when it sounds.
|
|
6
|
+
*
|
|
7
|
+
* The plain on/off `switch` of a siren stays as it is (HomeKit / Alexa see a
|
|
8
|
+
* switch); this cap adds the part a switch cannot say — HOW LONG, and the
|
|
9
|
+
* moment the siren is expected to fall silent (`activeUntil`, epoch ms), so a
|
|
10
|
+
* UI can show the activation with a countdown.
|
|
11
|
+
*
|
|
12
|
+
* The allowed durations are never hardcoded: `getOptions` answers what the
|
|
13
|
+
* CAMERA reports (a discrete list or `{min,max,step}`), the default, and the
|
|
14
|
+
* unit truth — a camera that counts plays rather than seconds says so, with the
|
|
15
|
+
* seconds-per-play factor used to convert, and whether that factor was read
|
|
16
|
+
* from the camera or is an estimate.
|
|
17
|
+
*/
|
|
18
|
+
/** What the camera counts natively. */
|
|
19
|
+
export declare const SirenDurationUnit: {
|
|
20
|
+
readonly Seconds: 'seconds';
|
|
21
|
+
readonly Plays: 'plays';
|
|
22
|
+
};
|
|
23
|
+
export type SirenDurationUnitValue = (typeof SirenDurationUnit)[keyof typeof SirenDurationUnit];
|
|
24
|
+
/** Where the numbers of an options answer come from. */
|
|
25
|
+
export declare const SirenOptionsSource: {
|
|
26
|
+
/** Read from the camera by this fetch. */
|
|
27
|
+
readonly Camera: 'camera';
|
|
28
|
+
/** The camera did not answer or does not advertise it; a documented fallback. */
|
|
29
|
+
readonly Fallback: 'fallback';
|
|
30
|
+
};
|
|
31
|
+
export type SirenOptionsSourceValue = (typeof SirenOptionsSource)[keyof typeof SirenOptionsSource];
|
|
32
|
+
export declare const SirenDurationRangeSchema: z.ZodObject<{
|
|
33
|
+
min: z.ZodNumber;
|
|
34
|
+
max: z.ZodNumber;
|
|
35
|
+
step: z.ZodNumber;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type SirenDurationRange = z.infer<typeof SirenDurationRangeSchema>;
|
|
38
|
+
export declare const SirenOptionsSchema: z.ZodObject<{
|
|
39
|
+
allowedSeconds: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
|
|
40
|
+
rangeSeconds: z.ZodNullable<z.ZodObject<{
|
|
41
|
+
min: z.ZodNumber;
|
|
42
|
+
max: z.ZodNumber;
|
|
43
|
+
step: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
defaultSeconds: z.ZodNumber;
|
|
46
|
+
unit: z.ZodEnum<{
|
|
47
|
+
plays: "plays";
|
|
48
|
+
seconds: "seconds";
|
|
49
|
+
}>;
|
|
50
|
+
secondsPerPlay: z.ZodNullable<z.ZodNumber>;
|
|
51
|
+
source: z.ZodEnum<{
|
|
52
|
+
camera: "camera";
|
|
53
|
+
fallback: "fallback";
|
|
54
|
+
}>;
|
|
55
|
+
fetchedAt: z.ZodNumber;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type SirenOptions = z.infer<typeof SirenOptionsSchema>;
|
|
58
|
+
export declare const SirenStatusSchema: z.ZodObject<{
|
|
59
|
+
active: z.ZodBoolean;
|
|
60
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
61
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
62
|
+
lastTriggeredAt: z.ZodNumber;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type SirenStatus = z.infer<typeof SirenStatusSchema>;
|
|
65
|
+
export declare const SirenRuntimeStateSchema: z.ZodObject<{
|
|
66
|
+
active: z.ZodBoolean;
|
|
67
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
68
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
lastTriggeredAt: z.ZodNumber;
|
|
70
|
+
lastFetchedAt: z.ZodNumber;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type SirenRuntimeState = z.infer<typeof SirenRuntimeStateSchema>;
|
|
73
|
+
export declare const sirenCapability: {
|
|
74
|
+
readonly name: 'siren';
|
|
75
|
+
readonly scope: 'device';
|
|
76
|
+
readonly deviceNative: true;
|
|
77
|
+
readonly mode: 'singleton';
|
|
78
|
+
readonly deviceTypes: readonly [DeviceType.Siren];
|
|
79
|
+
readonly methods: {
|
|
80
|
+
/** The durations the camera allows, read from the camera. */
|
|
81
|
+
readonly getOptions: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
82
|
+
deviceId: z.ZodNumber;
|
|
83
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
84
|
+
allowedSeconds: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
|
|
85
|
+
rangeSeconds: z.ZodNullable<z.ZodObject<{
|
|
86
|
+
min: z.ZodNumber;
|
|
87
|
+
max: z.ZodNumber;
|
|
88
|
+
step: z.ZodNumber;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
defaultSeconds: z.ZodNumber;
|
|
91
|
+
unit: z.ZodEnum<{
|
|
92
|
+
plays: "plays";
|
|
93
|
+
seconds: "seconds";
|
|
94
|
+
}>;
|
|
95
|
+
secondsPerPlay: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
source: z.ZodEnum<{
|
|
97
|
+
camera: "camera";
|
|
98
|
+
fallback: "fallback";
|
|
99
|
+
}>;
|
|
100
|
+
fetchedAt: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>, "query">;
|
|
102
|
+
/**
|
|
103
|
+
* Sound the siren. Without `durationSeconds` the camera default applies.
|
|
104
|
+
* Answers the state at the moment of the trigger (`activeUntil` included).
|
|
105
|
+
*/
|
|
106
|
+
readonly trigger: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
107
|
+
deviceId: z.ZodNumber;
|
|
108
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
active: z.ZodBoolean;
|
|
111
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
112
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
lastTriggeredAt: z.ZodNumber;
|
|
114
|
+
}, z.core.$strip>, "mutation">;
|
|
115
|
+
/** Silence the siren now. */
|
|
116
|
+
readonly stop: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
117
|
+
deviceId: z.ZodNumber;
|
|
118
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
119
|
+
active: z.ZodBoolean;
|
|
120
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
121
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
lastTriggeredAt: z.ZodNumber;
|
|
123
|
+
}, z.core.$strip>, "mutation">;
|
|
124
|
+
};
|
|
125
|
+
readonly events: {
|
|
126
|
+
readonly onSirenChanged: {
|
|
127
|
+
readonly data: z.ZodObject<{
|
|
128
|
+
deviceId: z.ZodNumber;
|
|
129
|
+
active: z.ZodBoolean;
|
|
130
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
readonly notOperatorFacing: 'the `active` state trigger phrases both edges of this change';
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly status: {
|
|
136
|
+
readonly schema: z.ZodObject<{
|
|
137
|
+
active: z.ZodBoolean;
|
|
138
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
139
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
140
|
+
lastTriggeredAt: z.ZodNumber;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
readonly kind: 'command-driven';
|
|
143
|
+
};
|
|
144
|
+
readonly runtimeState: z.ZodObject<{
|
|
145
|
+
active: z.ZodBoolean;
|
|
146
|
+
activeUntil: z.ZodNullable<z.ZodNumber>;
|
|
147
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
148
|
+
lastTriggeredAt: z.ZodNumber;
|
|
149
|
+
lastFetchedAt: z.ZodNumber;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
/**
|
|
152
|
+
* Runtime-state durability: **session** — a siren activation is a moment, not a fact to restore after a restart.
|
|
153
|
+
*
|
|
154
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
155
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
156
|
+
*/
|
|
157
|
+
readonly durability: 'session';
|
|
158
|
+
/**
|
|
159
|
+
* History (D850): none — an activation is already recorded by the switch / alarm events.
|
|
160
|
+
*/
|
|
161
|
+
readonly history: 'none';
|
|
162
|
+
readonly vocabulary: {
|
|
163
|
+
readonly noun: import("../index.js").VocabL10n;
|
|
164
|
+
readonly order: 1170;
|
|
165
|
+
readonly state: readonly [{
|
|
166
|
+
readonly kind: 'boolean';
|
|
167
|
+
readonly field: 'active';
|
|
168
|
+
readonly label: import("../index.js").VocabL10n;
|
|
169
|
+
readonly whenTrue: import("../index.js").VocabL10n;
|
|
170
|
+
readonly whenFalse: import("../index.js").VocabL10n;
|
|
171
|
+
readonly icon: 'siren';
|
|
172
|
+
}];
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
export type ISirenProvider = InferProvider<typeof sirenCapability>;
|