@camstack/system 1.2.330 → 1.2.331
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/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +3 -3
- package/dist/builtins/autotrack/index.mjs +3 -3
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +27 -8
- package/dist/builtins/composer/composer.addon.mjs +21 -3
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-bindings-store.d.ts +7 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +3 -0
- package/dist/builtins/device-manager/device-manager.addon.js +130 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +130 -3
- package/dist/builtins/device-manager/stale-wrapper-activations.d.ts +26 -0
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/shared/device-state-changed.d.ts +3 -4
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-C8uts1P4.js → child-cap-dispatch-93MfsaZL.js} +1 -0
- package/dist/{child-cap-dispatch-C2VINHu1.mjs → child-cap-dispatch-kLIiU1CG.mjs} +1 -0
- package/dist/{composition-sources-2XxNEet3.js → composition-sources-BXZorHDO.js} +1 -1
- package/dist/{composition-sources-Wj2kWund.mjs → composition-sources-aEEer5gE.mjs} +1 -1
- package/dist/{dist-Dp043AI0.mjs → dist-CoG8lY6H.mjs} +222 -374
- package/dist/{dist-Bx4zxM9N.js → dist-DRUzy1SF.js} +221 -421
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{retired-settings-keys-DR2WMe5d.js → retired-settings-keys-BY9H1I2b.js} +1 -1
- package/dist/{retired-settings-keys-Dxf9vELs.mjs → retired-settings-keys-BcJDpASY.mjs} +1 -1
- package/package.json +1 -16
- package/dist/builtins/doorbell/binding-mirror.d.ts +0 -110
- package/dist/builtins/doorbell/doorbell-composition-migration.d.ts +0 -47
- package/dist/builtins/doorbell/doorbell-extension-slot.d.ts +0 -67
- package/dist/builtins/doorbell/doorbell-settings.d.ts +0 -58
- package/dist/builtins/doorbell/index.d.ts +0 -2
- package/dist/builtins/doorbell/index.js +0 -8
- package/dist/builtins/doorbell/index.mjs +0 -2
- package/dist/builtins/doorbell/trigger-engine.d.ts +0 -92
- package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +0 -218
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +0 -1413
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +0 -1407
- package/dist/device-state-changed-Bk7cvTnz.js +0 -31
- package/dist/device-state-changed-DoBbkyEI.mjs +0 -20
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-DRUzy1SF.js");
|
|
4
4
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
5
5
|
require("./builtins/alerts/index.js");
|
|
6
6
|
const require_builtins_composer_composer_addon = require("./builtins/composer/composer.addon.js");
|
|
@@ -29,7 +29,7 @@ require("./builtins/system-config/index.js");
|
|
|
29
29
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
30
30
|
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-ey4mbofz.js");
|
|
31
31
|
const require_tls$1 = require("./tls-D_wUeOTD.js");
|
|
32
|
-
const require_child_cap_dispatch = require("./child-cap-dispatch-
|
|
32
|
+
const require_child_cap_dispatch = require("./child-cap-dispatch-93MfsaZL.js");
|
|
33
33
|
const require_resource_monitor = require("./resource-monitor-DzNn_IZK.js");
|
|
34
34
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
35
35
|
let zod = require("zod");
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $n as
|
|
2
|
+
import { $n as createEvent, At as isArrayOutputSchema, C as LOG_LEVEL_RANK, E as METHOD_ACCESS_MAP, Ft as kebabToCamel, Gn as DEVICE_SETTINGS_CONTRIBUTION_METHODS, H as addonSettingsCapability, Hn as errMsg$1, Ht as logLevelAtMost, Jn as ReadinessTimeoutError, Kn as DEVICE_STATUS_METHOD, Nt as isObjectInput, Pt as isVoidInput, Qn as asString$1, Qt as objectInputDeclaresRequiredDeviceId, Rt as lifecycleJobSchema, Tt as extractNestedAddonId, Ut as looseSchema, Wn as DATAPLANE_SECRET_HEADER$1, Xn as asJsonObject$1, Zn as asNumber, Zt as objectInputDeclaresAddonId, cn as resolveMethodAuth, cr as parseJsonUnknown, dn as scopesAllowDeviceCap, dr as scopeKey, er as emitDownForOwnedCaps, j as RUNTIME_DEFAULTS, jt as isCollectionArrayMethod, lr as readinessKey, mr as EventCategory$1, nn as procedureAuthKey, nr as expandCapMethods, qn as ReadinessRegistry, sr as parseJsonObject, t as ALL_CAPABILITY_DEFINITIONS, un as scopesAllowAddon, ur as resolveCapMount } from "./dist-CoG8lY6H.mjs";
|
|
3
3
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
4
4
|
import "./builtins/alerts/index.mjs";
|
|
5
5
|
import { ComposerAddon } from "./builtins/composer/composer.addon.mjs";
|
|
@@ -28,7 +28,7 @@ import "./builtins/system-config/index.mjs";
|
|
|
28
28
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
29
29
|
import { _ as ensureModel, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, g as downloadModel, h as downloadFile, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as deleteModelFromDisk, n as STALL_TICK_MS, o as contentTypeFor, p as collectModelFiles, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as fetchJson, x as isModelDownloaded, y as getModelFilePath } from "./event-loop-stall-monitor-EXjzIxDz.mjs";
|
|
30
30
|
import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-IM-v7JV4.mjs";
|
|
31
|
-
import { $ as classifyCapRoute, $n as EMPTY_CAP_ACTION_READING, $t as RUNNER_RSS_BUDGET_ENV, A as resolveHwAccel, An as OUTBOUND_QUEUE_SUSTAIN_MS, At as DeviceRegistry, B as udsChildLogToWorkerEntry, Bn as createSocketPlaneMeter, Bt as hostNodeIdOf, C as getBrokerEventBus, Cn as HEAP_SPACE_REPORT_MIN_MB, Ct as capActionName, D as subscribePassthrough, Dn as readHeapSpaces, Dt as parseCapAction, E as setNodeEventInterest, En as heapSpaceField, Et as capServiceName, F as ipcParentLink, Fn as createMeshQueueReader, Ft as resolveAddonClass, G as UDS_NO_ROUTE_PREFIX, Gn as EMPTY_SOCKET_DIRECTION, Gt as HEAP_WATCH_INTERVAL_MS, H as createUdsLoggerWithControl, Hn as diffSocketPlane, Ht as HEAP_RECLAIM_MIN_INTERVAL_MS, I as localProviderLink, In as formatMeshQueue, It as buildNpmChildEnv, J as deviceOfGetStatus, Jn as sampleSocketDirection, Jt as HUB_MAIN_RSS_BUDGET_MB, K as GET_STATUS_METHOD, Kn as createSocketDirectionCounters, Kt as HEAP_WATCH_WARN_RATIO, L as createParentUnownedCallHandler, Ln as EMPTY_SOCKET_PLANE_BASELINE, Lt as resolveNpmInvocation, M as brokerTransportLink, Mn as createOutboundQueueGate, Mt as CapabilityUnavailableError, N as buildLinkChain, Nn as formatOutboundQueueVerdict, Nt as copyBundledNativeModules, O as AddonDepsManager, On as selectReportedSpaces, Ot as deserializeTypedArrays, P as deviceCapResolverLink, Pn as MESH_QUEUE_TOP_N, Pt as installManifestNativeDeps, Q as CapRouteError, Qn as CAP_ACTION_UNLABELLED, Qt as RUNNER_HEAP_WATCH_INTERVAL_MS, R as createUdsEventBridge, Rn as SOCKET_PLANE_TOP_N, Rt as runNpm, S as clusterEventTopic, Sn as DECISIVE_HEAP_SPACES, St as NATIVE_PROVIDER_SERVICE_INFIX, T as registerEventBusService, Tn as formatHeapSpaces, Tt as capBareAction, U as LocalChildClient, Un as formatSocketPlane, Ut as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, V as createUdsLogger, Vn as createSocketPlaneReader, Vt as createAddonDataPlaneFacility, W as LocalChildRegistry, Wn as readSocketQueues, Wt as HEAP_RECLAIM_TRIGGER_MB, X as AGENT_CAP_FWD_SERVICE, Xn as socketDirectionMessages, Xt as RSS_BUDGET_REANNOUNCE_MIN_MS, Y as AGENT_CAP_FWD_ACTION, Yn as socketDirectionBytes, Yt as HUB_RSS_BUDGET_ENV, Z as CapRouteResolver, Zn as CAP_ACTION_OVERFLOW_LABEL, Zt as RSS_BUDGET_RELEASE_RATIO, _ as getWorkerDeviceRegistry, _n as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, a as reapProcessGroup, an as describeRss, ar as createEventPlaneMeter, at as getCapUsageRegistry, b as setHubConnected, bn as formatArrayBufferCensus, bt as createAddonService, c as runnerOwnsProcessGroup, cn as parseRssBudgetMb, cr as formatEventPlane, ct as UdsLocalTransportServer, d as summarizeMembers, dn as startHeapWatch, dt as localEndpointPath, en as ZERO_LOOP_DELAY, er as MAX_CAP_ACTIONS_PER_PEER, et as callWithServiceDiscovery, f as installManifestSystemDeps, fn as startRunnerHeapWatch, ft as FrameDecoder, g as createUdsAddonContext, gn as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, h as createAddonContext, hn as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ht as createBrokerDeviceManagerApi, in as createV8Reclaimer, ir as EVENT_PLANE_TOP_N, it as __resetCapUsageRegistryForTests, j as brokerCallForCap, jn as OUTBOUND_QUEUE_THRESHOLD_BYTES, jt as CapabilityHandle, k as createKernelHwAccel, kn as OUTBOUND_QUEUE_COOLDOWN_MS, kt as serializeTypedArrays, l as signalAllRunnerGroups, ln as reclaimIntervalMs, lt as SocketChannel, m as adaptBrokerToCluster, mn as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, mt as buildNativeCapProxy, nn as createDeferredHeapWatchSink, nr as createCapActionCensus, nt as CapUsageRegistry, o as registerRunnerGroup, on as hubMainRssBudget, or as createEventPlaneReader, ot as createLocalTransport, p as installManifestPythonDeps, pn as strandedMb, pt as encodeFrame, q as answerClaimedGetStatus, qn as recordSocketFrame, qt as HUB_MAIN_HEAP_WATCH_LABEL, r as defaultProcessGroupOps, rn as createLoopDelayMeter, rr as diffCapActionCensus, rt as PARENT_ROUTED_PROVIDER_ADDON_ID, s as releaseRunnerGroup, sn as nextRssBudgetState, sr as diffEventPlane, st as UdsLocalTransportClient, t as CAP_METHOD_NOT_IMPLEMENTED, tn as buildHeapSample, tr as capActionLabel, tt as readMoleculerFanoutMode, un as shouldReclaim, ut as PeerAnsweredError, v as getOrInitReadinessRegistry, vn as createArrayBufferCensusGate, vt as mountNativeCapService, w as getMoleculerEventStats, wn as emitHeapDiagnosticReport, wt as capActionSuffix, x as EVENT_TOPIC_PREFIX, xn as isArrayBufferCensusReport, xt as validateProviderRegistrations, y as getOrInitReadinessRegistryForClient, yn as createInspectorArrayBufferCensus, z as createUdsEventBus, zn as SOCKET_QUEUE_TOP_N, zt as createAddonPeerBytesFacility } from "./child-cap-dispatch-
|
|
31
|
+
import { $ as classifyCapRoute, $n as EMPTY_CAP_ACTION_READING, $t as RUNNER_RSS_BUDGET_ENV, A as resolveHwAccel, An as OUTBOUND_QUEUE_SUSTAIN_MS, At as DeviceRegistry, B as udsChildLogToWorkerEntry, Bn as createSocketPlaneMeter, Bt as hostNodeIdOf, C as getBrokerEventBus, Cn as HEAP_SPACE_REPORT_MIN_MB, Ct as capActionName, D as subscribePassthrough, Dn as readHeapSpaces, Dt as parseCapAction, E as setNodeEventInterest, En as heapSpaceField, Et as capServiceName, F as ipcParentLink, Fn as createMeshQueueReader, Ft as resolveAddonClass, G as UDS_NO_ROUTE_PREFIX, Gn as EMPTY_SOCKET_DIRECTION, Gt as HEAP_WATCH_INTERVAL_MS, H as createUdsLoggerWithControl, Hn as diffSocketPlane, Ht as HEAP_RECLAIM_MIN_INTERVAL_MS, I as localProviderLink, In as formatMeshQueue, It as buildNpmChildEnv, J as deviceOfGetStatus, Jn as sampleSocketDirection, Jt as HUB_MAIN_RSS_BUDGET_MB, K as GET_STATUS_METHOD, Kn as createSocketDirectionCounters, Kt as HEAP_WATCH_WARN_RATIO, L as createParentUnownedCallHandler, Ln as EMPTY_SOCKET_PLANE_BASELINE, Lt as resolveNpmInvocation, M as brokerTransportLink, Mn as createOutboundQueueGate, Mt as CapabilityUnavailableError, N as buildLinkChain, Nn as formatOutboundQueueVerdict, Nt as copyBundledNativeModules, O as AddonDepsManager, On as selectReportedSpaces, Ot as deserializeTypedArrays, P as deviceCapResolverLink, Pn as MESH_QUEUE_TOP_N, Pt as installManifestNativeDeps, Q as CapRouteError, Qn as CAP_ACTION_UNLABELLED, Qt as RUNNER_HEAP_WATCH_INTERVAL_MS, R as createUdsEventBridge, Rn as SOCKET_PLANE_TOP_N, Rt as runNpm, S as clusterEventTopic, Sn as DECISIVE_HEAP_SPACES, St as NATIVE_PROVIDER_SERVICE_INFIX, T as registerEventBusService, Tn as formatHeapSpaces, Tt as capBareAction, U as LocalChildClient, Un as formatSocketPlane, Ut as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, V as createUdsLogger, Vn as createSocketPlaneReader, Vt as createAddonDataPlaneFacility, W as LocalChildRegistry, Wn as readSocketQueues, Wt as HEAP_RECLAIM_TRIGGER_MB, X as AGENT_CAP_FWD_SERVICE, Xn as socketDirectionMessages, Xt as RSS_BUDGET_REANNOUNCE_MIN_MS, Y as AGENT_CAP_FWD_ACTION, Yn as socketDirectionBytes, Yt as HUB_RSS_BUDGET_ENV, Z as CapRouteResolver, Zn as CAP_ACTION_OVERFLOW_LABEL, Zt as RSS_BUDGET_RELEASE_RATIO, _ as getWorkerDeviceRegistry, _n as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, a as reapProcessGroup, an as describeRss, ar as createEventPlaneMeter, at as getCapUsageRegistry, b as setHubConnected, bn as formatArrayBufferCensus, bt as createAddonService, c as runnerOwnsProcessGroup, cn as parseRssBudgetMb, cr as formatEventPlane, ct as UdsLocalTransportServer, d as summarizeMembers, dn as startHeapWatch, dt as localEndpointPath, en as ZERO_LOOP_DELAY, er as MAX_CAP_ACTIONS_PER_PEER, et as callWithServiceDiscovery, f as installManifestSystemDeps, fn as startRunnerHeapWatch, ft as FrameDecoder, g as createUdsAddonContext, gn as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, h as createAddonContext, hn as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ht as createBrokerDeviceManagerApi, in as createV8Reclaimer, ir as EVENT_PLANE_TOP_N, it as __resetCapUsageRegistryForTests, j as brokerCallForCap, jn as OUTBOUND_QUEUE_THRESHOLD_BYTES, jt as CapabilityHandle, k as createKernelHwAccel, kn as OUTBOUND_QUEUE_COOLDOWN_MS, kt as serializeTypedArrays, l as signalAllRunnerGroups, ln as reclaimIntervalMs, lt as SocketChannel, m as adaptBrokerToCluster, mn as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, mt as buildNativeCapProxy, nn as createDeferredHeapWatchSink, nr as createCapActionCensus, nt as CapUsageRegistry, o as registerRunnerGroup, on as hubMainRssBudget, or as createEventPlaneReader, ot as createLocalTransport, p as installManifestPythonDeps, pn as strandedMb, pt as encodeFrame, q as answerClaimedGetStatus, qn as recordSocketFrame, qt as HUB_MAIN_HEAP_WATCH_LABEL, r as defaultProcessGroupOps, rn as createLoopDelayMeter, rr as diffCapActionCensus, rt as PARENT_ROUTED_PROVIDER_ADDON_ID, s as releaseRunnerGroup, sn as nextRssBudgetState, sr as diffEventPlane, st as UdsLocalTransportClient, t as CAP_METHOD_NOT_IMPLEMENTED, tn as buildHeapSample, tr as capActionLabel, tt as readMoleculerFanoutMode, un as shouldReclaim, ut as PeerAnsweredError, v as getOrInitReadinessRegistry, vn as createArrayBufferCensusGate, vt as mountNativeCapService, w as getMoleculerEventStats, wn as emitHeapDiagnosticReport, wt as capActionSuffix, x as EVENT_TOPIC_PREFIX, xn as isArrayBufferCensusReport, xt as validateProviderRegistrations, y as getOrInitReadinessRegistryForClient, yn as createInspectorArrayBufferCensus, z as createUdsEventBus, zn as SOCKET_QUEUE_TOP_N, zt as createAddonPeerBytesFacility } from "./child-cap-dispatch-kLIiU1CG.mjs";
|
|
32
32
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-B1v6E07R.mjs";
|
|
33
33
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
34
34
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.331",
|
|
4
4
|
"description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -190,21 +190,6 @@
|
|
|
190
190
|
}
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
|
-
{
|
|
194
|
-
"id": "virtual-doorbell",
|
|
195
|
-
"category": "system",
|
|
196
|
-
"name": "Virtual Doorbell",
|
|
197
|
-
"description": "Wrapper over the `doorbell` cap — turns any binary sensor or switch (contact, motion, flood/gas/CO/smoke, vibration, tamper, or a switch) into a per-camera doorbell. Operator binds it per camera and picks the trigger devices from a searchable list in the camera's general settings; the reaction is automatic (sensor active / switch on).",
|
|
198
|
-
"entry": "./dist/builtins/doorbell/index.js",
|
|
199
|
-
"capabilities": [
|
|
200
|
-
{
|
|
201
|
-
"name": "doorbell"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"name": "device-extension"
|
|
205
|
-
}
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
193
|
{
|
|
209
194
|
"id": "autotrack",
|
|
210
195
|
"category": "system",
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { WrapperActivationRead } from '@camstack/types';
|
|
2
|
-
/**
|
|
3
|
-
* `bound` — a read saw the wrapper's activation.
|
|
4
|
-
* `unbind-pending` — one read did not; NOT yet believed, still rings.
|
|
5
|
-
* `unbound` — two consecutive reads did not; believed, silences the camera.
|
|
6
|
-
*/
|
|
7
|
-
export type DoorbellBindingState = 'bound' | 'unbind-pending' | 'unbound';
|
|
8
|
-
/**
|
|
9
|
-
* Fold one SUCCESSFUL bindings read into the mirror. A read that failed must
|
|
10
|
-
* never reach this function — an unanswerable store carries no information
|
|
11
|
-
* and must leave the mirror exactly as it was.
|
|
12
|
-
*/
|
|
13
|
-
export declare function nextBindingState(previous: DoorbellBindingState | undefined, boundNow: boolean): DoorbellBindingState;
|
|
14
|
-
/**
|
|
15
|
-
* May a ring proceed on the mirror STATE alone? Only a corroborated unbind
|
|
16
|
-
* stops one. {@link needsDurableRead} adds the served-elsewhere case on top.
|
|
17
|
-
*/
|
|
18
|
-
export declare function allowsRing(state: DoorbellBindingState | undefined): boolean;
|
|
19
|
-
/** True only when a read has positively confirmed the binding. */
|
|
20
|
-
export declare function hasConfirmedBinding(state: DoorbellBindingState | undefined): boolean;
|
|
21
|
-
/** The fields of a `DeviceBindingEntry` this module reasons about. */
|
|
22
|
-
export interface BindingEntryView {
|
|
23
|
-
readonly capName: string;
|
|
24
|
-
readonly kind: string;
|
|
25
|
-
readonly providerAddonId: string;
|
|
26
|
-
readonly nativeAddonId?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Does this list of binding entries name `ownAddonId` as the ACTIVE WRAPPER
|
|
30
|
-
* of `capName`?
|
|
31
|
-
*
|
|
32
|
-
* `isSameAddonId` is the whole point: `ownAddonId` is an `AddonContext.id`,
|
|
33
|
-
* which is prefixed (`addon:…`) in hub-main and bare in a forked runner,
|
|
34
|
-
* while `providerAddonId` is always bare. A raw `===` here is the D72 bug.
|
|
35
|
-
*/
|
|
36
|
-
export declare function entriesBindWrapper(entries: ReadonlyArray<BindingEntryView>, capName: string, ownAddonId: string): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Render binding entries for a log line. A systematic wrong answer and a
|
|
39
|
-
* one-off blip produce the same VERDICT; only the entries themselves tell
|
|
40
|
-
* them apart, so a negative read never gets to report just its conclusion.
|
|
41
|
-
*/
|
|
42
|
-
export declare function summariseEntries(entries: ReadonlyArray<BindingEntryView>): string[];
|
|
43
|
-
/**
|
|
44
|
-
* `bound` / `unbound` — the durable store answered, and this is its answer.
|
|
45
|
-
* `unreadable` — the store could not be read, or answered from an empty
|
|
46
|
-
* snapshot (D44). It carries NO information and must never destroy work.
|
|
47
|
-
*/
|
|
48
|
-
export type DurableBindingVerdict = 'bound' | 'unbound' | 'unreadable';
|
|
49
|
-
/**
|
|
50
|
-
* The durable verdict for `ownAddonId`, from device-manager's STORED
|
|
51
|
-
* activation of this cap on this device (`deviceManager.getWrapperActivation`).
|
|
52
|
-
*
|
|
53
|
-
* - `value` naming this wrapper → `bound`.
|
|
54
|
-
* - `value` naming another wrapper, or `null` — the operator's explicit "off"
|
|
55
|
-
* marker (D62) — → `unbound`.
|
|
56
|
-
* - `missing` → `unbound`: the store ANSWERED and holds no activation, and the
|
|
57
|
-
* doorbell cap is `defaultActive: false`, so a wrapper nobody activated is
|
|
58
|
-
* not bound.
|
|
59
|
-
* - `failed` → `unreadable`: it carries no information and destroys nothing.
|
|
60
|
-
*/
|
|
61
|
-
export declare function durableVerdictOf(read: WrapperActivationRead, ownAddonId: string): DurableBindingVerdict;
|
|
62
|
-
/**
|
|
63
|
-
* Who, other than this wrapper, the derived view says serves `capName` —
|
|
64
|
-
* `composer` on a camera whose doorbell was migrated to a composition (D671).
|
|
65
|
-
* Non-empty means a press this wrapper does not ring is still somebody's ring.
|
|
66
|
-
*/
|
|
67
|
-
export declare function otherProvidersOf(entries: ReadonlyArray<BindingEntryView>, capName: string, ownAddonId: string): string[];
|
|
68
|
-
/**
|
|
69
|
-
* What a press on this camera would do right now.
|
|
70
|
-
*
|
|
71
|
-
* `rings` — the binding is confirmed (mirror `bound`, or the durable store
|
|
72
|
-
* rescued an `unbound` mirror). `rings-pending` — one negative read, not yet
|
|
73
|
-
* believed. `rings-unconfirmed` — no read has happened yet; the ring path errs
|
|
74
|
-
* open. `unknown` — the mirror says unbound but the durable store could not
|
|
75
|
-
* be read: a press RINGS (an unanswerable store never destroys a one-shot
|
|
76
|
-
* press), and nobody can say whether that is right. `silent` — the durable
|
|
77
|
-
* store agrees with an unbound mirror: the only verdict that drops a press.
|
|
78
|
-
*/
|
|
79
|
-
export type RingVerdict = 'rings' | 'rings-pending' | 'rings-unconfirmed' | 'unknown' | 'silent';
|
|
80
|
-
/**
|
|
81
|
-
* What the ring gate and the card know about one camera without I/O: the
|
|
82
|
-
* mirror's state, and which OTHER providers the last successful bindings read
|
|
83
|
-
* said serve `doorbell` there (empty when none, or when no read has answered).
|
|
84
|
-
*/
|
|
85
|
-
export interface DoorbellMirrorRead {
|
|
86
|
-
readonly state: DoorbellBindingState | undefined;
|
|
87
|
-
readonly servedBy: readonly string[];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Does this camera need the durable authority before a verdict?
|
|
91
|
-
*
|
|
92
|
-
* An `unbound` mirror does (D72). So does any mirror short of `bound` on a
|
|
93
|
-
* camera whose doorbell another provider serves — the D671 cutover, where
|
|
94
|
-
* erring open means ringing ON TOP of the composer: after every restart the
|
|
95
|
-
* mirror starts `undefined` and spends a reload cycle at `unbind-pending`, and
|
|
96
|
-
* each press in that window was a duplicate ring. Two independent reads
|
|
97
|
-
* agreeing — the derived view naming another provider, the store naming no
|
|
98
|
-
* wrapper — is the D49 "second read agrees"; an unreadable store still rings.
|
|
99
|
-
*/
|
|
100
|
-
export declare function needsDurableRead(mirror: DoorbellMirrorRead): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* THE decision — the ring gate (`fireDoorbell` / `ringsAfterDurableRead`)
|
|
103
|
-
* and the Extensions card's activation both call it, so what the card says
|
|
104
|
-
* and what a press does cannot disagree. `durable` is `null` when it was not
|
|
105
|
-
* read, which {@link needsDurableRead} allows only where it says so.
|
|
106
|
-
* Pure: it reads nothing and writes nothing.
|
|
107
|
-
*/
|
|
108
|
-
export declare function ringVerdict(mirror: DoorbellMirrorRead, durable: DurableBindingVerdict | null): RingVerdict;
|
|
109
|
-
/** Whether a press proceeds under this verdict. */
|
|
110
|
-
export declare function verdictRings(verdict: RingVerdict): boolean;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { DeviceType, ICoreBlocksProvider, IScopedLogger } from '@camstack/types';
|
|
2
|
-
import { BindingEntryView } from './binding-mirror.js';
|
|
3
|
-
import { DoorbellSource } from './doorbell-settings.js';
|
|
4
|
-
export declare const DOORBELL_COMPOSITION_MIGRATION_STATE_KEY = "doorbell-source-composition-migration-v1";
|
|
5
|
-
export declare const DOORBELL_COMPOSITION_MIGRATION_CALLER: {
|
|
6
|
-
readonly userId: "system:doorbell-source-migration";
|
|
7
|
-
readonly isAdmin: true;
|
|
8
|
-
};
|
|
9
|
-
export interface DoorbellMigrationDevice {
|
|
10
|
-
readonly id: number;
|
|
11
|
-
readonly addonId: string;
|
|
12
|
-
readonly stableId: string;
|
|
13
|
-
readonly type: DeviceType;
|
|
14
|
-
}
|
|
15
|
-
export interface DoorbellMigrationBindingRow {
|
|
16
|
-
readonly deviceId: number;
|
|
17
|
-
readonly entries: readonly BindingEntryView[];
|
|
18
|
-
}
|
|
19
|
-
export interface DoorbellCompositionMigrationDeps {
|
|
20
|
-
readonly logger: IScopedLogger;
|
|
21
|
-
readonly listCameras: () => Promise<readonly DoorbellMigrationDevice[]>;
|
|
22
|
-
readonly listSourceDevices: (deviceIds: readonly number[]) => Promise<readonly DoorbellMigrationDevice[]>;
|
|
23
|
-
readonly readSources: (cameraId: number) => Promise<readonly DoorbellSource[]>;
|
|
24
|
-
readonly getBindingsBatch: (deviceIds: readonly number[]) => Promise<readonly DoorbellMigrationBindingRow[]>;
|
|
25
|
-
readonly coreBlocks: () => ICoreBlocksProvider | null;
|
|
26
|
-
readonly setWrapperActive: (input: {
|
|
27
|
-
readonly deviceId: number;
|
|
28
|
-
readonly capName: 'doorbell';
|
|
29
|
-
readonly wrapperAddonId: 'virtual-doorbell';
|
|
30
|
-
readonly active: false;
|
|
31
|
-
}) => Promise<void>;
|
|
32
|
-
readonly isComplete: () => Promise<boolean>;
|
|
33
|
-
readonly markComplete: () => Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
export declare class DoorbellCompositionMigration {
|
|
36
|
-
private readonly deps;
|
|
37
|
-
private rerunRequested;
|
|
38
|
-
private inFlight;
|
|
39
|
-
private stopped;
|
|
40
|
-
constructor(deps: DoorbellCompositionMigrationDeps);
|
|
41
|
-
request(reason: string): void;
|
|
42
|
-
waitForIdle(): Promise<void>;
|
|
43
|
-
shutdown(): void;
|
|
44
|
-
private runUntilQuiet;
|
|
45
|
-
private runAttempt;
|
|
46
|
-
private warnCamera;
|
|
47
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ExtensionSlotActivation, IDeviceExtensionProvider, IScopedLogger } from '@camstack/types';
|
|
2
|
-
import { DoorbellMirrorRead, DurableBindingVerdict, RingVerdict } from './binding-mirror.js';
|
|
3
|
-
import { DoorbellSource } from './doorbell-settings.js';
|
|
4
|
-
/** The routing prefix of this owner's `slotRef`s. */
|
|
5
|
-
export declare const VIRTUAL_DOORBELL_EXTENSION_SOURCE = "virtual-doorbell";
|
|
6
|
-
/** The store the slot reads and writes, named (D62). */
|
|
7
|
-
export declare const DOORBELL_SOURCES_AUTHORITY = "virtual-doorbell:doorbellSources";
|
|
8
|
-
/** The authority that decides whether the wrapper serves a camera at all. */
|
|
9
|
-
export declare const WRAPPER_ACTIVATION_AUTHORITY = "device-manager:setWrapperActive";
|
|
10
|
-
/** The compact device row this slot needs from the device manager. */
|
|
11
|
-
export interface DoorbellSlotDevice {
|
|
12
|
-
readonly id: number;
|
|
13
|
-
readonly name: string;
|
|
14
|
-
readonly type: string;
|
|
15
|
-
readonly location: string | null;
|
|
16
|
-
readonly parentDeviceId: number | null;
|
|
17
|
-
}
|
|
18
|
-
/** What the slot needs from the addon — its store, its mirror, and the fleet's reads. */
|
|
19
|
-
export interface DoorbellSlotDeps {
|
|
20
|
-
readonly ownAddonId: string;
|
|
21
|
-
readonly logger: IScopedLogger;
|
|
22
|
-
readonly readSources: (deviceId: number) => Promise<readonly DoorbellSource[]>;
|
|
23
|
-
/** The addon's own settings-save path (normalise, store, invalidate). */
|
|
24
|
-
readonly persistSources: (deviceId: number, deviceIds: readonly number[]) => Promise<void>;
|
|
25
|
-
/** The host's own row — ONE read, for its type. */
|
|
26
|
-
readonly getDevice: (deviceId: number) => Promise<DoorbellSlotDevice | null>;
|
|
27
|
-
/** Several devices in ONE read. Ids no device has are simply absent. */
|
|
28
|
-
readonly listDevices: (deviceIds: readonly number[]) => Promise<readonly DoorbellSlotDevice[]>;
|
|
29
|
-
/** The D49 mirror's verdict for this camera, or undefined when it has none. */
|
|
30
|
-
readonly readBindingMirror: (deviceId: number) => DoorbellMirrorRead;
|
|
31
|
-
/**
|
|
32
|
-
* The DURABLE authority, read-only — the same read the ring gate makes
|
|
33
|
-
* before it drops a press. Never throws: a store that cannot answer is
|
|
34
|
-
* `unreadable`, which carries no information.
|
|
35
|
-
*/
|
|
36
|
-
readonly readDurableBinding: (deviceId: number) => Promise<DurableBindingVerdict>;
|
|
37
|
-
readonly sourceCapableDeviceIds: () => Promise<readonly number[]>;
|
|
38
|
-
readonly listFleet: () => Promise<readonly DoorbellSlotDevice[]>;
|
|
39
|
-
}
|
|
40
|
-
/** How the card SAYS a verdict. The verdict itself is `ringVerdict`'s, never the card's. */
|
|
41
|
-
export declare function activationFromVerdict(verdict: RingVerdict): ExtensionSlotActivation;
|
|
42
|
-
/**
|
|
43
|
-
* The card's activation — READ-ONLY (D648 fix round 3).
|
|
44
|
-
*
|
|
45
|
-
* The verdict is `ringVerdict`, the function the ring gate decides with, fed
|
|
46
|
-
* the addon's mirror as it stands. The card never refreshes the mirror and
|
|
47
|
-
* never writes it: the mirror gates the ring, and a view that could move it
|
|
48
|
-
* would let a page refetch during a store blip silence a doorbell. The only
|
|
49
|
-
* read the card may make is the durable authority, and only where the ring
|
|
50
|
-
* gate would make it too (`needsDurableRead`: an `unbound` mirror, or one
|
|
51
|
-
* short of `bound` whose doorbell another provider serves). A camera
|
|
52
|
-
* the mirror has never seen costs nothing — the ring path errs open there and
|
|
53
|
-
* so does the card.
|
|
54
|
-
*/
|
|
55
|
-
/** The card's durable read for one camera, shared by every view asking at once. */
|
|
56
|
-
type DurableReader = (deviceId: number) => Promise<DurableBindingVerdict>;
|
|
57
|
-
/**
|
|
58
|
-
* Concurrent card views of the same `unbound` camera share ONE durable read,
|
|
59
|
-
* per camera, for as long as it is in flight — a page with several viewers
|
|
60
|
-
* (or a refetch storm) must not multiply the store round trip. Only the
|
|
61
|
-
* CARD's reads are shared: the ring gate calls the addon's
|
|
62
|
-
* `readDurableAuthority` on its own path and never waits behind a card.
|
|
63
|
-
*/
|
|
64
|
-
export declare function shareDurableReads(read: DurableReader): DurableReader;
|
|
65
|
-
/** Build the `device-extension` provider the virtual doorbell registers. */
|
|
66
|
-
export declare function createDoorbellExtensionProvider(deps: DoorbellSlotDeps): IDeviceExtensionProvider;
|
|
67
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure per-camera settings parsing/normalization for the virtual-doorbell
|
|
3
|
-
* builtin. Kept separate from the addon class (and the runtime trigger
|
|
4
|
-
* engine) so the persisted-shape handling — including tolerant migration of
|
|
5
|
-
* the legacy single-source blob — is unit-testable in isolation.
|
|
6
|
-
*
|
|
7
|
-
* PERSISTED SHAPE (extensible by design):
|
|
8
|
-
* doorbellSources: Array<{ deviceId: number }>
|
|
9
|
-
*
|
|
10
|
-
* The source is an OBJECT rather than a bare id so future per-source options
|
|
11
|
-
* (a custom trigger override, an event-type match, a per-source debounce)
|
|
12
|
-
* can be added without another migration. Today only `deviceId` is stored;
|
|
13
|
-
* the reaction is DERIVED at runtime from the source device's cap (see
|
|
14
|
-
* `trigger-engine.ts`).
|
|
15
|
-
*/
|
|
16
|
-
/** Device-store key holding the source list. */
|
|
17
|
-
export declare const KEY_SOURCES = "doorbellSources";
|
|
18
|
-
/**
|
|
19
|
-
* Legacy device-store keys from the pre-simplification shape (single source
|
|
20
|
-
* device + explicit trigger + event type). Retained ONLY for tolerant
|
|
21
|
-
* migration on read and cleanup on write — never written afresh.
|
|
22
|
-
*/
|
|
23
|
-
export declare const LEGACY_KEY_SOURCE = "doorbellSourceDeviceId";
|
|
24
|
-
export declare const LEGACY_KEY_TRIGGER = "doorbellTrigger";
|
|
25
|
-
export declare const LEGACY_KEY_EVENT_TYPE = "doorbellEventType";
|
|
26
|
-
/**
|
|
27
|
-
* One source device driving a camera's virtual doorbell. Intentionally an
|
|
28
|
-
* object so it can grow (custom trigger, event type) without a migration.
|
|
29
|
-
*/
|
|
30
|
-
export interface DoorbellSource {
|
|
31
|
-
readonly deviceId: number;
|
|
32
|
-
}
|
|
33
|
-
/** Coerce a persisted / form-supplied id (number or numeric string) to a
|
|
34
|
-
* positive integer device id, or null when it is not a usable id. */
|
|
35
|
-
export declare function coerceDeviceId(value: unknown): number | null;
|
|
36
|
-
/**
|
|
37
|
-
* Parse the persisted doorbell sources for one camera. Tolerant of BOTH:
|
|
38
|
-
* - the new `doorbellSources: [{deviceId}]` shape (ids may arrive as
|
|
39
|
-
* numbers, numeric strings, or `{deviceId}` records); and
|
|
40
|
-
* - the legacy single `doorbellSourceDeviceId` scalar, mapped onto one
|
|
41
|
-
* source (the old trigger/eventType are dropped — the reaction is now
|
|
42
|
-
* derived at runtime).
|
|
43
|
-
*
|
|
44
|
-
* Never throws on malformed data — unknown entries are skipped.
|
|
45
|
-
*/
|
|
46
|
-
export declare function parseDoorbellSources(blob: Record<string, unknown>): readonly DoorbellSource[];
|
|
47
|
-
/**
|
|
48
|
-
* Normalize a settings-patch value for the `doorbellSources` multiselect
|
|
49
|
-
* (a `string[]` of device ids from the form, or an already-shaped
|
|
50
|
-
* `{deviceId}[]` / `number[]`) into the persisted extensible shape.
|
|
51
|
-
*/
|
|
52
|
-
export declare function normalizeDoorbellSources(value: unknown): DoorbellSource[];
|
|
53
|
-
/**
|
|
54
|
-
* Produce the next device-store blob after applying a doorbell-sources
|
|
55
|
-
* patch: writes the normalized new shape and strips every legacy key so a
|
|
56
|
-
* migrated camera never carries stale single-source fields.
|
|
57
|
-
*/
|
|
58
|
-
export declare function applyDoorbellSourcesPatch(current: Record<string, unknown>, patchValue: unknown): Record<string, unknown>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_builtins_doorbell_virtual_doorbell_addon = require("./virtual-doorbell.addon.js");
|
|
7
|
-
exports.VirtualDoorbellAddon = require_builtins_doorbell_virtual_doorbell_addon.VirtualDoorbellAddon;
|
|
8
|
-
exports.default = require_builtins_doorbell_virtual_doorbell_addon.VirtualDoorbellAddon;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, isSourceCap, SOURCE_CAP_ACTIVE_FIELD, SOURCE_CAP_CHANGED_AT_FIELD, SOURCE_CAPS, SOURCE_DEVICE_TYPES, SensorEdgeIgnoreReason } from '@camstack/types';
|
|
2
|
-
export { DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, isSourceCap, SOURCE_CAP_ACTIVE_FIELD, SOURCE_CAP_CHANGED_AT_FIELD, SOURCE_CAPS, SOURCE_DEVICE_TYPES, };
|
|
3
|
-
/**
|
|
4
|
-
* Why a slice produced no ring. Every value names a DROPPED evaluation, so
|
|
5
|
-
* the addon can log the ones that may have cost a real press instead of
|
|
6
|
-
* returning an empty array that reads as "nothing happened".
|
|
7
|
-
*
|
|
8
|
-
* It is {@link SensorEdgeIgnoreReason} plus ONE value the pure evaluator
|
|
9
|
-
* cannot know: `no-assignment` is a real rise that no camera is wired to, and
|
|
10
|
-
* that is a fact about the doorbell's wiring, not about the sensor.
|
|
11
|
-
*/
|
|
12
|
-
export type DoorbellIgnoreReason = SensorEdgeIgnoreReason
|
|
13
|
-
/** A real rise, but no camera is wired to this source. */
|
|
14
|
-
| 'no-assignment';
|
|
15
|
-
/**
|
|
16
|
-
* The outcome of feeding one slice. `fired` is what rings; `debounced` and
|
|
17
|
-
* `ignored` exist so that no suppression is invisible.
|
|
18
|
-
*/
|
|
19
|
-
export interface DoorbellTriggerResult {
|
|
20
|
-
/** Cameras to ring now. */
|
|
21
|
-
readonly fired: readonly number[];
|
|
22
|
-
/** Cameras that WOULD have rung but are inside their debounce window. */
|
|
23
|
-
readonly debounced: readonly number[];
|
|
24
|
-
/** Set when the slice carried no ring at all; null once a rise was matched. */
|
|
25
|
-
readonly ignored: DoorbellIgnoreReason | null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* One camera's virtual-doorbell wiring: a source device that rings it. A
|
|
29
|
-
* camera with several sources produces several assignments (one per source).
|
|
30
|
-
*/
|
|
31
|
-
export interface DoorbellAssignment {
|
|
32
|
-
readonly cameraId: number;
|
|
33
|
-
readonly sourceDeviceId: number;
|
|
34
|
-
}
|
|
35
|
-
/** Debounce window guarding against sensor chatter (reed-switch bounce,
|
|
36
|
-
* duplicate HA state pushes). One ring per camera per window. */
|
|
37
|
-
export declare const DEFAULT_DEBOUNCE_MS = 2000;
|
|
38
|
-
/**
|
|
39
|
-
* Stateful (but side-effect-free towards the outside) trigger engine.
|
|
40
|
-
*
|
|
41
|
-
* Tracks the last observed binary value per (sourceDevice, cap) so a
|
|
42
|
-
* `DeviceStateChanged` re-emission (the slice's `lastChangedAt` moves while
|
|
43
|
-
* the binary value does not) never double-fires.
|
|
44
|
-
*
|
|
45
|
-
* FIRST SIGHTINGS. Seeding the baseline and never firing was wrong for the
|
|
46
|
-
* one case that matters: a momentary source (a button wired to a Home
|
|
47
|
-
* Assistant switch) is NOT re-pushed in its resting `off` state after a hub
|
|
48
|
-
* restart, so after every restart — several a day — the first slice the
|
|
49
|
-
* engine ever sees for it is the PRESS ITSELF, already active. That press
|
|
50
|
-
* was eaten whole; a real one on 2026-08-05 left no trace anywhere.
|
|
51
|
-
*
|
|
52
|
-
* The discriminator is the source's own transition timestamp. A first
|
|
53
|
-
* sighting that is already active rings only when its transition can be
|
|
54
|
-
* proved to have happened AFTER this engine started watching AND within
|
|
55
|
-
* `firstSightingFreshnessMs`. Both halves earn their keep: freshness alone
|
|
56
|
-
* would ring on a boot hydration of a state that flipped seconds before the
|
|
57
|
-
* restart, and "after we started" alone would ring, on a long-lived
|
|
58
|
-
* process, for a source adopted today whose state flipped yesterday. An
|
|
59
|
-
* undateable first sighting (no timestamp, or a zero sentinel) does NOT
|
|
60
|
-
* ring — the ambiguous case errs towards silence, but reports
|
|
61
|
-
* `baseline-seeded-stale-active` so the caller can say so out loud.
|
|
62
|
-
*/
|
|
63
|
-
export declare class DoorbellTriggerEngine {
|
|
64
|
-
private assignments;
|
|
65
|
-
/** Last observed binary value keyed by `${deviceId}:${capName}`. */
|
|
66
|
-
private readonly lastValues;
|
|
67
|
-
/** Last fire timestamp per camera — debounce bookkeeping. */
|
|
68
|
-
private readonly lastFiredAt;
|
|
69
|
-
private readonly debounceMs;
|
|
70
|
-
private readonly now;
|
|
71
|
-
private readonly firstSightingFreshnessMs;
|
|
72
|
-
/** When this engine started watching — the floor for a first-sighting rise. */
|
|
73
|
-
private readonly startedAt;
|
|
74
|
-
constructor(options?: {
|
|
75
|
-
readonly debounceMs?: number;
|
|
76
|
-
readonly now?: () => number;
|
|
77
|
-
readonly firstSightingFreshnessMs?: number;
|
|
78
|
-
});
|
|
79
|
-
/** Replace the full assignment set (rebuilt whenever settings change). */
|
|
80
|
-
setAssignments(assignments: readonly DoorbellAssignment[]): void;
|
|
81
|
-
getAssignments(): readonly DoorbellAssignment[];
|
|
82
|
-
/** True when any assignment references `deviceId` as its source. */
|
|
83
|
-
hasSource(deviceId: number): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Feed one `DeviceStateChanged` slice. Reports which cameras should ring,
|
|
86
|
-
* which were suppressed by the debounce window, and — when nothing was
|
|
87
|
-
* matched at all — WHY. Only a rise to active on a recognised source cap
|
|
88
|
-
* can ring; re-emissions and the falling edge never do.
|
|
89
|
-
*/
|
|
90
|
-
onStateSlice(deviceId: number, capName: string, slice: Record<string, unknown>): DoorbellTriggerResult;
|
|
91
|
-
private matchAndDebounce;
|
|
92
|
-
}
|