@camstack/types 1.2.591 → 1.2.593
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 +15 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/device-state-refresh.cap.d.ts +58 -0
- package/dist/capabilities/device-state.cap.d.ts +4 -1
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/client.js +53 -0
- package/dist/client.mjs +53 -0
- package/dist/device/cap-vocabulary/command-catalog.d.ts +34 -1
- package/dist/device/cap-vocabulary/declaration.d.ts +21 -1
- package/dist/device/cap-vocabulary/hold-limits.d.ts +8 -0
- package/dist/device/cap-vocabulary/index.d.ts +3 -2
- package/dist/device/cap-vocabulary/types.d.ts +68 -0
- package/dist/device/command-hold.d.ts +60 -0
- package/dist/device/device-context.d.ts +5 -2
- package/dist/device/state-refresh.d.ts +51 -0
- package/dist/generated/addon-api.d.ts +22 -0
- package/dist/generated/cap-vocabulary.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/device-proxy.d.ts +2 -0
- package/dist/generated/device-scoped-caps.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/index.d.ts +6 -2
- package/dist/index.js +457 -10
- package/dist/index.mjs +439 -11
- package/dist/{sleep-BA_SIc0O.js → sleep-BOK28JE0.js} +429 -45
- package/dist/{sleep-BT1bLgPq.mjs → sleep-DO-ayTnk.mjs} +406 -46
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.593] - 2026-11-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- New device-state-refresh capability and state-refresh policy types: a provider declares how its devices are read, the hub decides when (D1062).
|
|
15
|
+
|
|
16
|
+
## [1.2.592] - 2026-11-18
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- A command's vocabulary names every field it sets (a fan speed set in a preset also leaves the preset; a thermostat's fan mode, preset and range), and a device provider can say at registration that a command is never held, or held for another time.
|
|
21
|
+
- Media players, pet feeders, pet fountains, pump cycles, scripts and automations declare the state each command leads to, a toggle leads to the opposite of what was shown, and a number set through a slider is confirmed within its step.
|
|
22
|
+
- Lock and alarm commands are held as locking/arming (not the final state); Feed and Run are held as feeding/running for 10 s so a double tap sends one command.
|
|
23
|
+
- A pump run or rest time set in minutes is held as the seconds the device reports, so two quick + taps make two steps.
|
|
24
|
+
|
|
10
25
|
## [1.2.591] - 2026-11-17
|
|
11
26
|
|
|
12
27
|
### Changed
|
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-BOK28JE0.js");
|
|
3
3
|
const require_event_category = require("./event-category-BKxXXxnV.js");
|
|
4
4
|
const require_composed_stable_id = require("./composed-stable-id-BdeYe5dD.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as viewerUiCapability, $i as asRecordsError, $n as RecordIndexSchema, Ai as isSecretRef, An as resolveSecretViewsIn, B as CALLER_STAMPED_CAPABILITIES, Bi as InvalidRecordError, Bn as PEER_BYTES_CHUNK_BYTES, Ca as isSecretClear, Ci as RECORD_SETTINGS_MAX_ROWS, Cn as OnBehalfSchema, Ct as ReadinessTimeoutError, Da as makeSecretMarker, Di as buildSecretRef, Dn as makeInMemoryRecords, Ea as isSecretMarkerLike, Ei as arrayItemFieldPath, En as ruleFireOfClaim, Er as ErrorI18nPayloadSchema, Et as scopeKey, F as CAP_METHOD_TIMEOUTS_MS, Fn as forgetKnownSecret, Gi as RecordSecretUnavailableError, Gn as CALLER_USERNAME_HEADER, Gr as nodeIdOfScopedKey, H as customAction, Hi as PlaintextSecretError, Hn as PEER_BYTES_STALL_MS, Ia as AddonMigrationsBlockedError, Ii as BatchTooLargeError, In as knownSecretCount, J as commandOrigin, Ji as RecordsError, Jn as DisposerChain, Ki as RecordTooLargeError, Kn as DATAPLANE_SECRET_HEADER, Kr as resolveDeviceSettings, L as CAP_STATE_LEAVES, La as findMigrationsBlocked, Li as DeclarationRefusedError, Ln as registerKnownSecret, M as HF_REPO, Mi as parseSecretRef, Mn as createSecretsAccess, Nn as MIN_SCRUBBED_LENGTH, O as isCommand, Oa as toSecretFieldView, Oi as formatSecretScope, On as createRecordsAccess, P as CAP_ADVANCE_FIELDS, Pn as clearKnownSecrets, Pr as normalizeAddonInitResult, Pt as createDebugEmitter, Qi as UnknownRecordKindError, Qn as RecordFieldPathSchema, R as CAP_METHOD_NOT_IMPLEMENTED, Ri as FilterRequiredError, Rn as scrubKnownSecrets, Sa as classifySecretWrite, Si as RECORD_SECRET_COLLECTION_PREFIX, Sn as CommandOriginClaimSchema, St as ReadinessRegistry, Ta as isSecretMarker, Ti as SECRET_REF_SCHEME, Tn as RuleFireOriginSchema, U as defineCustomActions, Ui as RECORDS_ERROR_CODES, Un as PEER_BYTES_TICKET_TTL_MS, V as withoutCallerStamp, Vi as NoCallerError, Vn as PEER_BYTES_MAX_OUTSTANDING, W as describeCustomActions, Wi as RecordNotFoundError, Wr as SCOPED_SETTINGS_SCOPES, X as readCommandOrigin, Xi as TransactRefusedError, Xn as entryBody, Y as nodePin, Yi as RevConflictError, Yn as defineEntryKind, Z as readNodePin, Zi as UnindexedFilterError, Zn as EntryDescriptorSchema, _i as RECORD_ID_MAX_LENGTH, _r as expandCapMethods, ai as mapSecretLeaves, ar as declarationsOf, bi as RECORD_MAX_INDEX_FIELDS, c as asString, ci as recordSecretCollection, cr as collectZodSecretPaths, ct as adminUiCapability, d as parseJsonUnknown, da as emitReadiness, di as RECORD_BATCH_MAX, ea as recordsErrorFromMessage, er as RecordKindDeclarationSchema, et as SWITCH_SETTABLE_GATE, f as hfModelUrl, fi as RECORD_BATCH_MAX_BYTES, g as createDeviceProxy, gi as RECORD_DELETE_BATCH, h as isDeviceScopedCap, hi as RECORD_DEFAULT_MAX_DATA_BYTES, ii as collectSecretLeaves, ir as assertValidDeclaration, it as MIGRATION_API_VERSION, ji as normalizeSecretOwner, jn as REVALIDATE_AFTER_MS, jr as BaseAddon, ki as globalSecretScope, kn as assertTransactScope, kr as readErrorI18n, li as recordSecretRef, lr as isZodSecret, m as DEVICE_SCOPED_CAPS, mi as RECORD_DATABASES, ni as secretViewsOf, nr as RecordRetentionSchema, nt as PipelineRunResultBridge, o as asJsonObject, oi as parseSecretPath, or as defineRecordKinds, ot as deviceOpsCapability, p as BOOT_RECOVERY_BACKOFF_MS, pi as RECORD_CLASSES, qi as RecordUniqueViolationError, qr as resolvedValues, r as maskUrlCredentials, ri as REMOVE_LEAF, rr as StoredRecordKindDeclarationSchema, rt as PipelineStepInputSchema, si as recordArrayItemPath, st as DEVICE_CHILDREN_BATCH_MAX, t as sleep, tr as RecordKindNameSchema, tt as switchRefusesSetState, ua as createEvent, ui as secretArrayPrefixes, ut as addonPagesSourceCapability, v as addonSliceHandleApi, vi as RECORD_MAX_DATA_BYTES, wa as isSecretFieldView, wi as RECORD_SWEEP_INTERVAL_MS, wn as OnBehalfSourceSchema, xa as SECRET_CLEAR, xi as RECORD_QUERY_MAX, xt as MODEL_FORMATS, y as createEventBusSliceSource, yi as RECORD_MAX_INDEXES, z as isCapMethodAbsent, zi as ForeignSecretMarkerError, zn as shortSecretRefHash } from "./sleep-DO-ayTnk.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-CY27-fF0.mjs";
|
|
3
3
|
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-BNTaDZEh.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
/**
|
|
4
|
+
* device-state-refresh — the HOW of a device's state refresh, called by the
|
|
5
|
+
* core, which owns the WHEN (D1062).
|
|
6
|
+
*
|
|
7
|
+
* The provider registers it per device with its policy
|
|
8
|
+
* (`registerNativeCap(cap, provider, { stateRefresh })`). The hub's scheduler
|
|
9
|
+
* calls `refresh` on the schedule, after a command and in the burst that
|
|
10
|
+
* follows it, and `resubscribe` when a push integration fell silent. The
|
|
11
|
+
* provider re-reads and writes the slices it already writes; nothing is
|
|
12
|
+
* returned but completion.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DeviceStateRefreshInputSchema: z.ZodObject<{
|
|
15
|
+
deviceId: z.ZodNumber;
|
|
16
|
+
deviceIds: z.ZodArray<z.ZodNumber>;
|
|
17
|
+
reason: z.ZodEnum<{
|
|
18
|
+
burst: "burst";
|
|
19
|
+
command: "command";
|
|
20
|
+
schedule: "schedule";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type DeviceStateRefreshInput = z.infer<typeof DeviceStateRefreshInputSchema>;
|
|
24
|
+
export declare const DeviceStateResubscribeInputSchema: z.ZodObject<{
|
|
25
|
+
deviceId: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const DeviceStateRefreshResultSchema: z.ZodObject<{
|
|
28
|
+
ok: z.ZodLiteral<true>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const deviceStateRefreshCapability: {
|
|
31
|
+
readonly name: 'device-state-refresh';
|
|
32
|
+
readonly scope: 'device';
|
|
33
|
+
readonly deviceNative: true;
|
|
34
|
+
readonly mode: 'singleton';
|
|
35
|
+
readonly methods: {
|
|
36
|
+
readonly refresh: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
37
|
+
deviceId: z.ZodNumber;
|
|
38
|
+
deviceIds: z.ZodArray<z.ZodNumber>;
|
|
39
|
+
reason: z.ZodEnum<{
|
|
40
|
+
burst: "burst";
|
|
41
|
+
command: "command";
|
|
42
|
+
schedule: "schedule";
|
|
43
|
+
}>;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
ok: z.ZodLiteral<true>;
|
|
46
|
+
}, z.core.$strip>, "mutation">;
|
|
47
|
+
readonly resubscribe: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
48
|
+
deviceId: z.ZodNumber;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
ok: z.ZodLiteral<true>;
|
|
51
|
+
}, z.core.$strip>, "mutation">;
|
|
52
|
+
};
|
|
53
|
+
readonly vocabulary: {
|
|
54
|
+
readonly noun: import("../index.js").VocabL10n;
|
|
55
|
+
readonly order: 3247;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export type IDeviceStateRefreshProvider = InferProvider<typeof deviceStateRefreshCapability>;
|
|
@@ -106,6 +106,7 @@ export declare const deviceStateCapability: {
|
|
|
106
106
|
readonly getCapSlice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
107
107
|
deviceId: z.ZodNumber;
|
|
108
108
|
capName: z.ZodString;
|
|
109
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
109
110
|
}, z.core.$strip>, z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
110
111
|
/**
|
|
111
112
|
* Whole-system snapshot — every device's full state in one
|
|
@@ -114,7 +115,9 @@ export declare const deviceStateCapability: {
|
|
|
114
115
|
* `sm.getDeviceById(id).state.<cap>.value` is sync. Empty inner
|
|
115
116
|
* record for devices that haven't emitted any slice yet.
|
|
116
117
|
*/
|
|
117
|
-
readonly getAllSnapshots: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
118
|
+
readonly getAllSnapshots: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
119
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
118
121
|
/**
|
|
119
122
|
* Canonical cross-layer WRITE for one cap-keyed slice. Used by
|
|
120
123
|
* everyone who needs to publish runtime state for a device:
|
|
@@ -261,6 +261,7 @@ export { type IRunningStateProvider, type RunningStateSource, RunningStateSource
|
|
|
261
261
|
export { type IRebootProvider, rebootCapability } from './reboot.cap.js';
|
|
262
262
|
export { type ILowPowerSleepProvider, type LowPowerSleepStatus, LowPowerSleepStatusSchema, lowPowerSleepCapability, } from './low-power-sleep.cap.js';
|
|
263
263
|
export { type IResyncProvider, ResyncDeviceInputSchema, resyncCapability } from './resync.cap.js';
|
|
264
|
+
export { type DeviceStateRefreshInput, DeviceStateRefreshInputSchema, DeviceStateRefreshResultSchema, DeviceStateResubscribeInputSchema, deviceStateRefreshCapability, type IDeviceStateRefreshProvider, } from './device-state-refresh.cap.js';
|
|
264
265
|
export { type IRecordingProvider, RECORDING_SOURCE_CAMSTACK, RECORDING_SOURCE_CAMSTACK_ADDON, type RecordingAvailability, RecordingAvailabilitySchema, type RecordingDays, RecordingDaysSchema, type RecordingManifest, RecordingManifestSchema, type RecordingPlayback, RecordingPlaybackSchema, RecordingRangeSchema, type RecordingRead, RecordingReadSchema, type RecordingSource, type RecordingSourceAvailability, RecordingSourceAvailabilitySchema, type RecordingSourceOptions, RecordingSourceOptionsSchema, RecordingSourceSchema, recordingCapability, } from './recording.cap.js';
|
|
265
266
|
export { type IRecordingArchiveProvider, type LocateSegmentResult, LocateSegmentResultSchema, RECORDING_TIMELINE_BATCH_MAX, type ReadGopBytesResult, ReadGopBytesResultSchema, type ReadSegmentBytesResult, ReadSegmentBytesResultSchema, type ReadWindowBytesResult, ReadWindowBytesResultSchema, type RecordingAvailabilityForDevice, RecordingAvailabilityForDeviceSchema, type RecordingDaysForDevice, RecordingDaysForDeviceSchema, type RecordingDeviceUsage, RecordingDeviceUsageSchema, type RecordingLocationUsage, RecordingLocationUsageSchema, type RecordingRebalanceInput, RecordingRebalanceInputSchema, type RecordingRebalanceMove, RecordingRebalanceMoveSchema, type RecordingRebalancePlan, RecordingRebalancePlanSchema, type RecordingRebalanceSkip, type RecordingRebalanceSkipReason, RecordingRebalanceSkipReasonSchema, RecordingRebalanceSkipSchema, type RecordingStatus, RecordingStatusSchema, type RecordingStorageUsage, RecordingStorageUsageSchema, recordingArchiveCapability, } from './recording-archive.cap.js';
|
|
266
267
|
export { type ClipExportFailure, ClipExportFailureSchema, clipExportFailure, clipExportFailureOf, EXPORT_DENSE_MAX_RANGES, type ExportBytes, ExportBytesSchema, type ExportClipSubject, ExportClipSubjectSchema, type ExportDense, type ExportDenseRange, ExportDenseRangeSchema, ExportDenseSchema, type ExportDownload, ExportDownloadSchema, type ExportFootageSubject, ExportFootageSubjectSchema, type ExportOptions, ExportOptionsSchema, type ExportRecord, ExportRecordSchema, ExportSpeedSchema, type ExportState, ExportStateSchema, type ExportSubject, ExportSubjectSchema, ExportTimelapseSchema, exportSubjectOf, type IRecordingExportProvider, RECORDING_EXPORT_MAX_READ_BYTES, recordingExportCapability, resolveCreateExportSubject, resolveExportProfiles, } from './recording-export.cap.js';
|
|
@@ -463,6 +464,7 @@ import type { runningStateCapability } from './running-state.cap.js';
|
|
|
463
464
|
import type { rebootCapability } from './reboot.cap.js';
|
|
464
465
|
import type { lowPowerSleepCapability } from './low-power-sleep.cap.js';
|
|
465
466
|
import type { resyncCapability } from './resync.cap.js';
|
|
467
|
+
import type { deviceStateRefreshCapability } from './device-state-refresh.cap.js';
|
|
466
468
|
import type { recordingCapability } from './recording.cap.js';
|
|
467
469
|
import type { recordingArchiveCapability } from './recording-archive.cap.js';
|
|
468
470
|
import type { recordingExportCapability } from './recording-export.cap.js';
|
|
@@ -511,6 +513,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
|
|
|
511
513
|
import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
|
|
512
514
|
import type { zoneRulesCapability } from './zone-rules.cap.js';
|
|
513
515
|
import type { zonesCapability } from './zones.cap.js';
|
|
514
|
-
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 lowPowerSleepCapability | typeof resyncCapability | 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 workloadCapability | 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;
|
|
516
|
+
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 lowPowerSleepCapability | typeof resyncCapability | typeof deviceStateRefreshCapability | 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 workloadCapability | 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;
|
|
515
517
|
export type CapabilityName = AnyCapability['name'];
|
|
516
518
|
export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
|
package/dist/client.js
CHANGED
|
@@ -21904,6 +21904,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21904
21904
|
field: "state",
|
|
21905
21905
|
value: "disarmed"
|
|
21906
21906
|
},
|
|
21907
|
+
hold: { effects: [{
|
|
21908
|
+
field: "state",
|
|
21909
|
+
value: "disarming",
|
|
21910
|
+
when: {
|
|
21911
|
+
field: "state",
|
|
21912
|
+
notIn: ["disarmed"]
|
|
21913
|
+
}
|
|
21914
|
+
}] },
|
|
21907
21915
|
openArgs: [{
|
|
21908
21916
|
key: "code",
|
|
21909
21917
|
label: t("PIN code", "Codice PIN"),
|
|
@@ -21933,6 +21941,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21933
21941
|
field: "state",
|
|
21934
21942
|
value: "armed_home"
|
|
21935
21943
|
},
|
|
21944
|
+
hold: { effects: [{
|
|
21945
|
+
field: "state",
|
|
21946
|
+
value: "arming",
|
|
21947
|
+
when: {
|
|
21948
|
+
field: "state",
|
|
21949
|
+
notIn: ["armed_home"]
|
|
21950
|
+
}
|
|
21951
|
+
}] },
|
|
21936
21952
|
args: { mode: "home" },
|
|
21937
21953
|
openArgs: [{
|
|
21938
21954
|
key: "code",
|
|
@@ -21953,6 +21969,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21953
21969
|
field: "state",
|
|
21954
21970
|
value: "armed_away"
|
|
21955
21971
|
},
|
|
21972
|
+
hold: { effects: [{
|
|
21973
|
+
field: "state",
|
|
21974
|
+
value: "arming",
|
|
21975
|
+
when: {
|
|
21976
|
+
field: "state",
|
|
21977
|
+
notIn: ["armed_away"]
|
|
21978
|
+
}
|
|
21979
|
+
}] },
|
|
21956
21980
|
args: { mode: "away" },
|
|
21957
21981
|
openArgs: [{
|
|
21958
21982
|
key: "code",
|
|
@@ -21973,6 +21997,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21973
21997
|
field: "state",
|
|
21974
21998
|
value: "armed_night"
|
|
21975
21999
|
},
|
|
22000
|
+
hold: { effects: [{
|
|
22001
|
+
field: "state",
|
|
22002
|
+
value: "arming",
|
|
22003
|
+
when: {
|
|
22004
|
+
field: "state",
|
|
22005
|
+
notIn: ["armed_night"]
|
|
22006
|
+
}
|
|
22007
|
+
}] },
|
|
21976
22008
|
args: { mode: "night" },
|
|
21977
22009
|
openArgs: [{
|
|
21978
22010
|
key: "code",
|
|
@@ -21993,6 +22025,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21993
22025
|
field: "state",
|
|
21994
22026
|
value: "armed_vacation"
|
|
21995
22027
|
},
|
|
22028
|
+
hold: { effects: [{
|
|
22029
|
+
field: "state",
|
|
22030
|
+
value: "arming",
|
|
22031
|
+
when: {
|
|
22032
|
+
field: "state",
|
|
22033
|
+
notIn: ["armed_vacation"]
|
|
22034
|
+
}
|
|
22035
|
+
}] },
|
|
21996
22036
|
args: { mode: "vacation" },
|
|
21997
22037
|
openArgs: [{
|
|
21998
22038
|
key: "code",
|
|
@@ -22013,6 +22053,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
22013
22053
|
field: "state",
|
|
22014
22054
|
value: "armed_custom_bypass"
|
|
22015
22055
|
},
|
|
22056
|
+
hold: { effects: [{
|
|
22057
|
+
field: "state",
|
|
22058
|
+
value: "arming",
|
|
22059
|
+
when: {
|
|
22060
|
+
field: "state",
|
|
22061
|
+
notIn: ["armed_custom_bypass"]
|
|
22062
|
+
}
|
|
22063
|
+
}] },
|
|
22016
22064
|
args: { mode: "custom_bypass" },
|
|
22017
22065
|
openArgs: [{
|
|
22018
22066
|
key: "code",
|
|
@@ -27751,6 +27799,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27751
27799
|
getRun: (input, options) => dispatch("device-runs", "deviceRuns", "getRun", "query", input, void 0, options),
|
|
27752
27800
|
getCurrentRun: (input, options) => dispatch("device-runs", "deviceRuns", "getCurrentRun", "query", input, void 0, options)
|
|
27753
27801
|
};
|
|
27802
|
+
const deviceStateRefreshInterface = {
|
|
27803
|
+
refresh: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "refresh", "mutation", input, void 0, options),
|
|
27804
|
+
resubscribe: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "resubscribe", "mutation", input, void 0, options)
|
|
27805
|
+
};
|
|
27754
27806
|
const deviceStatusInterface = { getStatus: (input, options) => dispatch("device-status", "deviceStatus", "getStatus", "query", input, void 0, options) };
|
|
27755
27807
|
const deviceTransitionsInterface = {
|
|
27756
27808
|
listTransitions: (input, options) => dispatch("device-transitions", "deviceTransitions", "listTransitions", "query", input, void 0, options),
|
|
@@ -28534,6 +28586,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28534
28586
|
...bound("device-extension") ? { deviceExtension: deviceExtensionInterface } : {},
|
|
28535
28587
|
...bound("device-ops") ? { deviceOps: deviceOpsInterface } : {},
|
|
28536
28588
|
...bound("device-runs") ? { deviceRuns: deviceRunsInterface } : {},
|
|
28589
|
+
...bound("device-state-refresh") ? { deviceStateRefresh: deviceStateRefreshInterface } : {},
|
|
28537
28590
|
...bound("device-status") ? { deviceStatus: deviceStatusInterface } : {},
|
|
28538
28591
|
...bound("device-transitions") ? { deviceTransitions: deviceTransitionsInterface } : {},
|
|
28539
28592
|
...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
|
package/dist/client.mjs
CHANGED
|
@@ -21903,6 +21903,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
21903
21903
|
field: "state",
|
|
21904
21904
|
value: "disarmed"
|
|
21905
21905
|
},
|
|
21906
|
+
hold: { effects: [{
|
|
21907
|
+
field: "state",
|
|
21908
|
+
value: "disarming",
|
|
21909
|
+
when: {
|
|
21910
|
+
field: "state",
|
|
21911
|
+
notIn: ["disarmed"]
|
|
21912
|
+
}
|
|
21913
|
+
}] },
|
|
21906
21914
|
openArgs: [{
|
|
21907
21915
|
key: "code",
|
|
21908
21916
|
label: t("PIN code", "Codice PIN"),
|
|
@@ -21932,6 +21940,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
21932
21940
|
field: "state",
|
|
21933
21941
|
value: "armed_home"
|
|
21934
21942
|
},
|
|
21943
|
+
hold: { effects: [{
|
|
21944
|
+
field: "state",
|
|
21945
|
+
value: "arming",
|
|
21946
|
+
when: {
|
|
21947
|
+
field: "state",
|
|
21948
|
+
notIn: ["armed_home"]
|
|
21949
|
+
}
|
|
21950
|
+
}] },
|
|
21935
21951
|
args: { mode: "home" },
|
|
21936
21952
|
openArgs: [{
|
|
21937
21953
|
key: "code",
|
|
@@ -21952,6 +21968,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
21952
21968
|
field: "state",
|
|
21953
21969
|
value: "armed_away"
|
|
21954
21970
|
},
|
|
21971
|
+
hold: { effects: [{
|
|
21972
|
+
field: "state",
|
|
21973
|
+
value: "arming",
|
|
21974
|
+
when: {
|
|
21975
|
+
field: "state",
|
|
21976
|
+
notIn: ["armed_away"]
|
|
21977
|
+
}
|
|
21978
|
+
}] },
|
|
21955
21979
|
args: { mode: "away" },
|
|
21956
21980
|
openArgs: [{
|
|
21957
21981
|
key: "code",
|
|
@@ -21972,6 +21996,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
21972
21996
|
field: "state",
|
|
21973
21997
|
value: "armed_night"
|
|
21974
21998
|
},
|
|
21999
|
+
hold: { effects: [{
|
|
22000
|
+
field: "state",
|
|
22001
|
+
value: "arming",
|
|
22002
|
+
when: {
|
|
22003
|
+
field: "state",
|
|
22004
|
+
notIn: ["armed_night"]
|
|
22005
|
+
}
|
|
22006
|
+
}] },
|
|
21975
22007
|
args: { mode: "night" },
|
|
21976
22008
|
openArgs: [{
|
|
21977
22009
|
key: "code",
|
|
@@ -21992,6 +22024,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
21992
22024
|
field: "state",
|
|
21993
22025
|
value: "armed_vacation"
|
|
21994
22026
|
},
|
|
22027
|
+
hold: { effects: [{
|
|
22028
|
+
field: "state",
|
|
22029
|
+
value: "arming",
|
|
22030
|
+
when: {
|
|
22031
|
+
field: "state",
|
|
22032
|
+
notIn: ["armed_vacation"]
|
|
22033
|
+
}
|
|
22034
|
+
}] },
|
|
21995
22035
|
args: { mode: "vacation" },
|
|
21996
22036
|
openArgs: [{
|
|
21997
22037
|
key: "code",
|
|
@@ -22012,6 +22052,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
|
|
|
22012
22052
|
field: "state",
|
|
22013
22053
|
value: "armed_custom_bypass"
|
|
22014
22054
|
},
|
|
22055
|
+
hold: { effects: [{
|
|
22056
|
+
field: "state",
|
|
22057
|
+
value: "arming",
|
|
22058
|
+
when: {
|
|
22059
|
+
field: "state",
|
|
22060
|
+
notIn: ["armed_custom_bypass"]
|
|
22061
|
+
}
|
|
22062
|
+
}] },
|
|
22015
22063
|
args: { mode: "custom_bypass" },
|
|
22016
22064
|
openArgs: [{
|
|
22017
22065
|
key: "code",
|
|
@@ -27750,6 +27798,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27750
27798
|
getRun: (input, options) => dispatch("device-runs", "deviceRuns", "getRun", "query", input, void 0, options),
|
|
27751
27799
|
getCurrentRun: (input, options) => dispatch("device-runs", "deviceRuns", "getCurrentRun", "query", input, void 0, options)
|
|
27752
27800
|
};
|
|
27801
|
+
const deviceStateRefreshInterface = {
|
|
27802
|
+
refresh: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "refresh", "mutation", input, void 0, options),
|
|
27803
|
+
resubscribe: (input, options) => dispatch("device-state-refresh", "deviceStateRefresh", "resubscribe", "mutation", input, void 0, options)
|
|
27804
|
+
};
|
|
27753
27805
|
const deviceStatusInterface = { getStatus: (input, options) => dispatch("device-status", "deviceStatus", "getStatus", "query", input, void 0, options) };
|
|
27754
27806
|
const deviceTransitionsInterface = {
|
|
27755
27807
|
listTransitions: (input, options) => dispatch("device-transitions", "deviceTransitions", "listTransitions", "query", input, void 0, options),
|
|
@@ -28533,6 +28585,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28533
28585
|
...bound("device-extension") ? { deviceExtension: deviceExtensionInterface } : {},
|
|
28534
28586
|
...bound("device-ops") ? { deviceOps: deviceOpsInterface } : {},
|
|
28535
28587
|
...bound("device-runs") ? { deviceRuns: deviceRunsInterface } : {},
|
|
28588
|
+
...bound("device-state-refresh") ? { deviceStateRefresh: deviceStateRefreshInterface } : {},
|
|
28536
28589
|
...bound("device-status") ? { deviceStatus: deviceStatusInterface } : {},
|
|
28537
28590
|
...bound("device-transitions") ? { deviceTransitions: deviceTransitionsInterface } : {},
|
|
28538
28591
|
...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { VocabEffectValue } from './types.js';
|
|
1
|
+
import type { LooseVocabOpenArg, LooseVocabSideEffect, VocabEffectCondition, VocabEffectValue } from './types.js';
|
|
2
2
|
/** The state a command leads to: a cap status field and the value it should hold. */
|
|
3
3
|
export interface CommandEffect {
|
|
4
4
|
readonly field: string;
|
|
5
5
|
readonly value: VocabEffectValue;
|
|
6
|
+
/**
|
|
7
|
+
* How far a numeric reading may sit from `value` and still confirm it (D1061):
|
|
8
|
+
* the step of the number arg the value was copied from (brightness 1, a
|
|
9
|
+
* temperature target 0.5). Absent = the reading must equal the value.
|
|
10
|
+
*/
|
|
11
|
+
readonly tolerance?: number;
|
|
6
12
|
}
|
|
7
13
|
/** Is `cap.method` a vocabulary action of a device-scope cap? */
|
|
8
14
|
export declare function isCommand(cap: string, method: string): boolean;
|
|
@@ -14,3 +20,30 @@ export declare function isCommand(cap: string, method: string): boolean;
|
|
|
14
20
|
export declare function commandEffect(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): CommandEffect | null;
|
|
15
21
|
/** The status fields of `cap` whose changes are recorded as transitions. */
|
|
16
22
|
export declare function auditedFields(cap: string): ReadonlySet<string>;
|
|
23
|
+
/** The current slice of the command's cap, as a condition reads it. */
|
|
24
|
+
export type CommandSlice = Readonly<Record<string, unknown>> | undefined;
|
|
25
|
+
/** Does `slice` meet `when`? A field the slice lacks is in no list. */
|
|
26
|
+
export declare function effectConditionHolds(when: VocabEffectCondition | undefined, slice: CommandSlice): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* One side effect resolved against the args and the slice the command acts
|
|
29
|
+
* on: `null` when the arg carrying its value is missing, or a `negate` names a
|
|
30
|
+
* field the slice holds no boolean in. `openArgs` lends a copied number its
|
|
31
|
+
* step as the tolerance.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveSideEffect(side: LooseVocabSideEffect, args: Readonly<Record<string, unknown>> | undefined, shown?: CommandSlice, openArgs?: readonly LooseVocabOpenArg[]): CommandEffect | null;
|
|
34
|
+
/**
|
|
35
|
+
* The hold limit the vocabulary declares for `cap.method(args)` (its action's
|
|
36
|
+
* `hold.holdMs`), or `undefined` for the default.
|
|
37
|
+
*/
|
|
38
|
+
export declare function commandHoldMs(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): number | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* EVERY state the command `cap.method(args)` leads to (D1061): its `effect`
|
|
41
|
+
* first, then each side effect whose condition holds on `current` (the cap's
|
|
42
|
+
* slice the device reported when the command arrived). Empty when it leads to
|
|
43
|
+
* none. One field is named once — the first entry for it wins. A `negate`
|
|
44
|
+
* side effect flips what `shown` (the slice the person saw, held values
|
|
45
|
+
* included) holds, so a second toggle before the first is confirmed undoes it.
|
|
46
|
+
* An action that declares `hold.effects` is held as THOSE instead (a lock
|
|
47
|
+
* holds `locking`, not `locked`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function commandEffects(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined, current: CommandSlice, shown?: CommandSlice): readonly CommandEffect[];
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* every one of those names against the cap definition, and
|
|
25
25
|
* `check-cap-vocabulary` checks values against the Zod schemas.
|
|
26
26
|
*/
|
|
27
|
-
import type { LooseVocabActionGate, L10n, LooseVocabEffect, LooseVocabOffer, LooseVocabOverrides, LooseVocabStateTrigger, VocabEffectValue, VocabEventTrigger, VocabIcon } from './types.js';
|
|
27
|
+
import type { LooseVocabActionGate, L10n, LooseVocabEffect, LooseVocabOffer, LooseVocabActionHold, LooseVocabSideEffect, LooseVocabOverrides, LooseVocabStateTrigger, VocabEffectCondition, VocabEffectValue, VocabEventTrigger, VocabIcon } from './types.js';
|
|
28
28
|
/** The operator-supplied keys of a method input (`deviceId` is the target). */
|
|
29
29
|
export type MethodActionArgs<TInput> = TInput extends object ? Omit<TInput, 'deviceId'> : Record<never, never>;
|
|
30
30
|
/** An open arg of a method action, keyed by the method's own input. */
|
|
@@ -42,6 +42,7 @@ export type MethodActionEffect<TKey extends string = string> = {
|
|
|
42
42
|
} | {
|
|
43
43
|
readonly field: string;
|
|
44
44
|
readonly fromArg: TKey;
|
|
45
|
+
readonly scale?: number;
|
|
45
46
|
};
|
|
46
47
|
/**
|
|
47
48
|
* When a device is offered an action: a read method of the same cap, and the
|
|
@@ -70,6 +71,23 @@ export interface MethodActionDecl<TInput = Readonly<Record<string, unknown>>> {
|
|
|
70
71
|
readonly openArgs?: readonly MethodActionOpenArg<keyof MethodActionArgs<TInput> & string>[];
|
|
71
72
|
/** The state this action leads to, when it is one. */
|
|
72
73
|
readonly effect?: MethodActionEffect<keyof MethodActionArgs<TInput> & string>;
|
|
74
|
+
/** Further states the command leads to, each under an optional condition on the current slice (D1061). */
|
|
75
|
+
readonly sideEffects?: readonly ((MethodActionEffect<keyof MethodActionArgs<TInput> & string> | {
|
|
76
|
+
readonly field: string;
|
|
77
|
+
readonly negate: true;
|
|
78
|
+
}) & {
|
|
79
|
+
readonly when?: VocabEffectCondition;
|
|
80
|
+
})[];
|
|
81
|
+
/** How the hub holds the command before the device answers (D1061, {@link LooseVocabActionHold}). */
|
|
82
|
+
readonly hold?: {
|
|
83
|
+
readonly effects?: readonly ((MethodActionEffect<keyof MethodActionArgs<TInput> & string> | {
|
|
84
|
+
readonly field: string;
|
|
85
|
+
readonly negate: true;
|
|
86
|
+
}) & {
|
|
87
|
+
readonly when?: VocabEffectCondition;
|
|
88
|
+
})[];
|
|
89
|
+
readonly holdMs?: number;
|
|
90
|
+
};
|
|
73
91
|
/** When the device is offered it at all — absent = always ({@link MethodActionGate}). */
|
|
74
92
|
readonly offeredWhen?: MethodActionGate;
|
|
75
93
|
}
|
|
@@ -82,6 +100,8 @@ export interface LooseMethodActionDecl {
|
|
|
82
100
|
readonly args?: Readonly<Record<string, unknown>>;
|
|
83
101
|
readonly openArgs?: readonly MethodActionOpenArg[];
|
|
84
102
|
readonly effect?: LooseVocabEffect;
|
|
103
|
+
readonly sideEffects?: readonly LooseVocabSideEffect[];
|
|
104
|
+
readonly hold?: LooseVocabActionHold;
|
|
85
105
|
readonly offeredWhen?: MethodActionGate;
|
|
86
106
|
}
|
|
87
107
|
/** What a declared cap event is to an automation: a trigger, or an excuse. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hold limits a cap's vocabulary may declare on an action (D1061).
|
|
3
|
+
*
|
|
4
|
+
* A one-shot command (feed, run a script) has no lasting state to confirm; it
|
|
5
|
+
* holds its in-progress flag just long enough that a second tap, before the
|
|
6
|
+
* device reports, is seen as "already running" and refused.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ONE_SHOT_HOLD_MS = 10000;
|
|
@@ -7,9 +7,10 @@ export { actionGateAnswerFrom, actionOfferedWith, actionsForDevice, deviceOffers
|
|
|
7
7
|
export type { ActionEffect, IndexedVocabAction, VocabActionRefusal, VocabCall, } from './action-index.js';
|
|
8
8
|
export { actionEffect, allVocabActions, assertDeviceOffers, findVocabAction, VocabActionError, vocabActionIdFor, vocabCall, } from './action-index.js';
|
|
9
9
|
export type { CommandEffect } from './command-catalog.js';
|
|
10
|
-
export { auditedFields, commandEffect, isCommand } from './command-catalog.js';
|
|
10
|
+
export { auditedFields, commandEffect, commandEffects, commandHoldMs, effectConditionHolds, isCommand, resolveSideEffect, } from './command-catalog.js';
|
|
11
|
+
export type { CommandSlice } from './command-catalog.js';
|
|
11
12
|
export { VOCAB_TEMPLATES } from './templates.js';
|
|
12
|
-
export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapNestedNumericPath, CapStatusField, CapVocabularyEntry, CapVocabularyMap, DeviceCapVocabulary, DeviceVocabCapName, DynamicOffer, EnumOffer, EnumStateValue, L10n, LooseCapVocabularyEntry, LooseDynamicOffer, LooseVocabAction, LooseVocabActionGate, LooseVocabEffect, LooseVocabOffer, LooseVocabOpenArg, LooseVocabStateTrigger, NumberOffer, SystemCapVocabulary, SystemVocabCapName, TextOffer, VocabAction, VocabCapName, VocabChoice, VocabEffectFor, VocabEffectValue, VocabEventTrigger, VocabIcon, VocabLocale, VocabOffer, VocabOpenArg, VocabStateTrigger, } from './types.js';
|
|
13
|
+
export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapNestedNumericPath, CapStatusField, CapVocabularyEntry, CapVocabularyMap, DeviceCapVocabulary, DeviceVocabCapName, DynamicOffer, EnumOffer, EnumStateValue, L10n, LooseCapVocabularyEntry, LooseDynamicOffer, LooseVocabAction, LooseVocabActionGate, LooseVocabEffect, LooseVocabActionHold, LooseVocabSideEffect, VocabEffectCondition, LooseVocabOffer, LooseVocabOpenArg, LooseVocabStateTrigger, NumberOffer, SystemCapVocabulary, SystemVocabCapName, TextOffer, VocabAction, VocabCapName, VocabChoice, VocabEffectFor, VocabEffectValue, VocabEventTrigger, VocabIcon, VocabLocale, VocabOffer, VocabOpenArg, VocabStateTrigger, } from './types.js';
|
|
13
14
|
export { CAP_VOCABULARY, CAP_VOCABULARY_BY_NAME } from './vocabulary.js';
|
|
14
15
|
export type { CapVocabularyDecl, DeviceCapVocabularyDecl, EventVocabularyDecl, LooseMethodActionDecl, MethodActionArgs, MethodActionDecl, MethodActionEffect, MethodActionGate, MethodActionOpenArg, SystemCapVocabularyDecl, } from './declaration.js';
|
|
15
16
|
export { NOT_A_DEVICE } from './system-reasons.js';
|
|
@@ -196,7 +196,56 @@ export type VocabEffectFor<C extends VocabCapName, M extends CapMethodName<C>> =
|
|
|
196
196
|
} | {
|
|
197
197
|
readonly field: CapStatusField<C>;
|
|
198
198
|
readonly fromArg: ActionArgKey<C, M>;
|
|
199
|
+
/**
|
|
200
|
+
* A number arg in another unit than the field (minutes → seconds): the
|
|
201
|
+
* field holds `arg × scale`. Only on a number arg.
|
|
202
|
+
*/
|
|
203
|
+
readonly scale?: number;
|
|
199
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* A condition on the CURRENT slice of the action's cap (D1061): the side effect
|
|
207
|
+
* applies only when `field` holds one of `in`, or none of `notIn`. A field the
|
|
208
|
+
* slice lacks matches `notIn` and never matches `in`.
|
|
209
|
+
*/
|
|
210
|
+
export type VocabEffectCondition = {
|
|
211
|
+
readonly field: string;
|
|
212
|
+
readonly in: readonly VocabEffectValue[];
|
|
213
|
+
} | {
|
|
214
|
+
readonly field: string;
|
|
215
|
+
readonly notIn: readonly VocabEffectValue[];
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* A further state a command leads to (D1061), beside its `effect`: setting a
|
|
219
|
+
* fan's speed while a preset runs also clears the preset. `negate` flips the
|
|
220
|
+
* boolean the person saw (`switch.toggle` → `on = !on`). Read by the core's
|
|
221
|
+
* command hold; never by a scheduler, which holds only `effect`.
|
|
222
|
+
*/
|
|
223
|
+
export type VocabSideEffectFor<C extends VocabCapName, M extends CapMethodName<C>> = (VocabEffectFor<C, M> | {
|
|
224
|
+
readonly field: CapStatusField<C>;
|
|
225
|
+
readonly negate: true;
|
|
226
|
+
}) & {
|
|
227
|
+
readonly when?: {
|
|
228
|
+
readonly field: CapStatusField<C>;
|
|
229
|
+
readonly in: readonly VocabEffectValue[];
|
|
230
|
+
} | {
|
|
231
|
+
readonly field: CapStatusField<C>;
|
|
232
|
+
readonly notIn: readonly VocabEffectValue[];
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* How the hub holds an action's command (D1061) when its `effect` is not what
|
|
237
|
+
* to show before the device answers.
|
|
238
|
+
*/
|
|
239
|
+
export interface VocabActionHoldFor<C extends VocabCapName, M extends CapMethodName<C>> {
|
|
240
|
+
/**
|
|
241
|
+
* Held INSTEAD of `effect` and `sideEffects`. A lock holds `locking`, never
|
|
242
|
+
* `locked`: a bolt that did not throw must never read as locked. A one-shot
|
|
243
|
+
* (feed, run) holds its in-progress flag, so a second tap is refused.
|
|
244
|
+
*/
|
|
245
|
+
readonly effects?: readonly VocabSideEffectFor<C, M>[];
|
|
246
|
+
/** The hold's limit in ms (default 30 s). A one-shot is held only long enough to refuse a double tap. */
|
|
247
|
+
readonly holdMs?: number;
|
|
248
|
+
}
|
|
200
249
|
/** One operator-facing action: a cap method call with a phrase. */
|
|
201
250
|
export interface VocabActionFor<C extends VocabCapName, M extends CapMethodName<C>> {
|
|
202
251
|
/** Stable id — persisted by pickers as a select value (`switch.on`). */
|
|
@@ -216,6 +265,10 @@ export interface VocabActionFor<C extends VocabCapName, M extends CapMethodName<
|
|
|
216
265
|
readonly openArgs?: readonly VocabOpenArg<C, ActionArgKey<C, M>>[];
|
|
217
266
|
/** The state this action leads to, when it is one (see {@link VocabEffectFor}). */
|
|
218
267
|
readonly effect?: VocabEffectFor<C, M>;
|
|
268
|
+
/** Further states the command leads to, each under an optional condition (see {@link VocabSideEffectFor}). */
|
|
269
|
+
readonly sideEffects?: readonly VocabSideEffectFor<C, M>[];
|
|
270
|
+
/** How the hub holds this command while the device has not answered (see {@link VocabActionHoldFor}). */
|
|
271
|
+
readonly hold?: VocabActionHoldFor<C, M>;
|
|
219
272
|
/** When a device is offered it at all: a read of this cap answering `false` at `field` withdraws it. */
|
|
220
273
|
readonly offeredWhen?: {
|
|
221
274
|
readonly method: CapMethodName<C>;
|
|
@@ -405,6 +458,14 @@ export type LooseVocabEffect = {
|
|
|
405
458
|
} | {
|
|
406
459
|
readonly field: string;
|
|
407
460
|
readonly fromArg: string;
|
|
461
|
+
readonly scale?: number;
|
|
462
|
+
};
|
|
463
|
+
/** A side effect as a consumer reads it (see {@link VocabSideEffectFor}). */
|
|
464
|
+
export type LooseVocabSideEffect = (LooseVocabEffect | {
|
|
465
|
+
readonly field: string;
|
|
466
|
+
readonly negate: true;
|
|
467
|
+
}) & {
|
|
468
|
+
readonly when?: VocabEffectCondition;
|
|
408
469
|
};
|
|
409
470
|
/** An action as a consumer reads it. */
|
|
410
471
|
export interface LooseVocabAction {
|
|
@@ -416,8 +477,15 @@ export interface LooseVocabAction {
|
|
|
416
477
|
readonly args?: Readonly<Record<string, unknown>>;
|
|
417
478
|
readonly openArgs?: readonly LooseVocabOpenArg[];
|
|
418
479
|
readonly effect?: LooseVocabEffect;
|
|
480
|
+
readonly sideEffects?: readonly LooseVocabSideEffect[];
|
|
481
|
+
readonly hold?: LooseVocabActionHold;
|
|
419
482
|
readonly offeredWhen?: LooseVocabActionGate;
|
|
420
483
|
}
|
|
484
|
+
/** An action's hold as a consumer reads it (see {@link VocabActionHoldFor}). */
|
|
485
|
+
export interface LooseVocabActionHold {
|
|
486
|
+
readonly effects?: readonly LooseVocabSideEffect[];
|
|
487
|
+
readonly holdMs?: number;
|
|
488
|
+
}
|
|
421
489
|
/** When a device is offered an action, string-keyed (`MethodActionGate`). */
|
|
422
490
|
export interface LooseVocabActionGate {
|
|
423
491
|
readonly method: string;
|