@camstack/addon-provider-reolink 1.2.254 → 1.2.255
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/addon.js +472 -15
- package/dist/addon.mjs +472 -15
- package/i18n/en.json +3 -0
- package/i18n/it.json +3 -0
- package/package.json +2 -2
package/dist/addon.js
CHANGED
|
@@ -100698,7 +100698,7 @@ function parseBaichuanWebhookObject(mess) {
|
|
|
100698
100698
|
return parsed;
|
|
100699
100699
|
}
|
|
100700
100700
|
//#endregion
|
|
100701
|
-
//#region ../types/dist/event-category-
|
|
100701
|
+
//#region ../types/dist/event-category-BEsBTS72.mjs
|
|
100702
100702
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
100703
100703
|
EventCategory["SystemBoot"] = "system.boot";
|
|
100704
100704
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -101145,6 +101145,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
101145
101145
|
*/
|
|
101146
101146
|
EventCategory["StreamBrokerOnRequestStreamSourceRefresh"] = "stream-broker.onRequestStreamSourceRefresh";
|
|
101147
101147
|
/**
|
|
101148
|
+
* A broker RE-DIALED its source (every dial after the first). A consumer that
|
|
101149
|
+
* reads the broker over a transport that does not announce the cut — the
|
|
101150
|
+
* recorder's ffmpeg writer — learns here instead of through its idle clock.
|
|
101151
|
+
* Telemetry: a dropped event only means the idle clock recovers it later.
|
|
101152
|
+
* Payload: `{ deviceId, camStreamId, brokerId, reason }`.
|
|
101153
|
+
*/
|
|
101154
|
+
EventCategory["StreamBrokerOnSourceRestart"] = "stream-broker.onSourceRestart";
|
|
101155
|
+
/**
|
|
101148
101156
|
* A camera provider changed a device's stream parameters (codec /
|
|
101149
101157
|
* resolution / bitrate / a stream added or removed). A LOW-LATENCY NUDGE
|
|
101150
101158
|
* for the stream-broker's catalog reconcile: it carries NO authoritative
|
|
@@ -106821,7 +106829,7 @@ var ZodIssueCode = {
|
|
|
106821
106829
|
var ZodFirstPartyTypeKind;
|
|
106822
106830
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
106823
106831
|
//#endregion
|
|
106824
|
-
//#region ../types/dist/runtime-capabilities-
|
|
106832
|
+
//#region ../types/dist/runtime-capabilities-CG61dYnO.mjs
|
|
106825
106833
|
/**
|
|
106826
106834
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
106827
106835
|
* window to float samples (D455).
|
|
@@ -111687,6 +111695,15 @@ var CameraStreamSchema = object({
|
|
|
111687
111695
|
*/
|
|
111688
111696
|
autoEligible: boolean().optional(),
|
|
111689
111697
|
/**
|
|
111698
|
+
* The longest continuous session the SOURCE will keep open, in ms, declared by
|
|
111699
|
+
* the provider that knows it (a hub that cuts every child's session on a
|
|
111700
|
+
* timer). Absent = no limit. The broker re-dials a live source a little
|
|
111701
|
+
* BEFORE this elapses, on its own terms and announced to consumers, so the
|
|
111702
|
+
* source's cut never lands mid-recording. Declare slightly under what was
|
|
111703
|
+
* observed.
|
|
111704
|
+
*/
|
|
111705
|
+
maxSessionMs: number$1().int().positive().optional(),
|
|
111706
|
+
/**
|
|
111690
111707
|
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
111691
111708
|
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
111692
111709
|
* stream. Consulted by the broker's automatic ranking
|
|
@@ -127382,7 +127399,7 @@ function e(group, en, it, flags = {}) {
|
|
|
127382
127399
|
};
|
|
127383
127400
|
}
|
|
127384
127401
|
var N = { noise: true };
|
|
127385
|
-
EventCategory.SystemBoot, e("system", "System booted", "Sistema avviato"), EventCategory.SystemAddonsReady, e("system", "Addons ready", "Addon pronti"), EventCategory.SystemRestarting, e("system", "System restarting", "Sistema in riavvio"), EventCategory.SystemRestartCompleted, e("system", "Restart completed", "Riavvio completato"), EventCategory.SystemTlsCertChanged, e("system", "TLS certificate changed", "Certificato TLS cambiato"), EventCategory.UpdateAvailable, e("system", "Update available", "Aggiornamento disponibile"), EventCategory.SystemReadyState, e("system", "Readiness changed", "Stato di prontezza cambiato"), EventCategory.AddonStarted, e("addons", "Addon started", "Addon avviato"), EventCategory.AddonStopped, e("addons", "Addon stopped", "Addon fermato"), EventCategory.AddonRestarted, e("addons", "Addon restarted", "Addon riavviato"), EventCategory.AddonUpdated, e("addons", "Addon updated", "Addon aggiornato"), EventCategory.AddonInstalled, e("addons", "Addon installed", "Addon installato"), EventCategory.AddonUninstalled, e("addons", "Addon uninstalled", "Addon disinstallato"), EventCategory.AddonCrashed, e("addons", "Addon crashed", "Addon in errore fatale"), EventCategory.AddonRunnerFailed, e("addons", "Runner failed for good", "Runner fallito definitivamente"), EventCategory.AddonRunnerRefused, e("addons", "Runner refused", "Runner rifiutato"), EventCategory.ProcessStateChanged, e("addons", "Process state changed", "Stato del processo cambiato"), EventCategory.SystemRunnerCheck, e("system", "Runner check", "Verifica dei runner"), EventCategory.AlertEpisode, e("system", "Alert episode", "Episodio di allarme"), EventCategory.AddonError, e("addons", "Addon error", "Errore di un addon"), EventCategory.AddonPageReady, e("addons", "Addon page ready", "Pagina addon pronta"), EventCategory.AddonWidgetReady, e("addons", "Addon widget ready", "Widget addon pronto"), EventCategory.AddonLoadFailed, e("addons", "Addon failed to load", "Caricamento addon fallito"), EventCategory.KeychainChanged, e("system", "Keychain changed", "Portachiavi modificato"), EventCategory.AddonLoadRecovered, e("addons", "Addon load recovered", "Caricamento addon ripristinato"), EventCategory.AddonUnsupportedVersion, e("addons", "Addon version unsupported", "Versione addon non supportata"), EventCategory.AddonUnsupportedResolved, e("addons", "Unsupported addon resolved", "Addon non supportato risolto"), EventCategory.AddonRetryScheduled, e("addons", "Addon retry scheduled", "Nuovo tentativo addon pianificato"), EventCategory.SystemLivenessFailed, e("system", "Liveness check failed", "Controllo di attività fallito"), EventCategory.SystemLivenessRecovered, e("system", "Liveness recovered", "Controllo di attività ripristinato"), EventCategory.AddonRetryAttempting, e("addons", "Addon retry running", "Nuovo tentativo addon in corso"), EventCategory.DeviceRegistered, e("devices", "Device registered", "Dispositivo registrato"), EventCategory.DeviceUnregistered, e("devices", "Device removed", "Dispositivo rimosso"), EventCategory.DeviceEnabled, e("devices", "Device enabled", "Dispositivo abilitato"), EventCategory.DeviceDisabled, e("devices", "Device disabled", "Dispositivo disabilitato"), EventCategory.DeviceSettingsUpdated, e("devices", "Device settings updated", "Impostazioni dispositivo aggiornate"), EventCategory.DeviceBindingsChanged, e("devices", "Device bindings changed", "Collegamenti dispositivo cambiati"), EventCategory.DeviceMetaChanged, e("devices", "Device details changed", "Dettagli dispositivo cambiati"), EventCategory.DeviceSourceInfoChanged, e("devices", "Device source info changed", "Info sorgente dispositivo cambiate"), EventCategory.DeviceStreamsRegistered, e("streams", "Device streams registered", "Stream del dispositivo registrati"), EventCategory.DeviceProvisioned, e("devices", "Device provisioned", "Dispositivo configurato"), EventCategory.DeviceReady, e("devices", "Device ready", "Dispositivo pronto"), EventCategory.IdentityLinkCreated, e("integrations", "Identity linked", "Identità collegata"), EventCategory.IdentityLinkLost, e("integrations", "Identity link lost", "Collegamento identità perso"), EventCategory.IntegrationEnabled, e("integrations", "Integration enabled", "Integrazione abilitata"), EventCategory.IntegrationDisabled, e("integrations", "Integration disabled", "Integrazione disabilitata"), EventCategory.IntegrationDeleted, e("integrations", "Integration deleted", "Integrazione eliminata"), EventCategory.BrokerStatusChanged, e("integrations", "Broker status changed", "Stato del broker cambiato"), EventCategory.BrokerMessage, e("integrations", "Broker message", "Messaggio del broker", N), EventCategory.ProviderStarted, e("integrations", "Provider started", "Provider avviato"), EventCategory.ProviderStopped, e("integrations", "Provider stopped", "Provider fermato"), EventCategory.ProcessCrashed, e("addons", "Process crashed", "Processo andato in crash"), EventCategory.ProcessRestartScheduled, e("addons", "Process restart scheduled", "Riavvio del processo pianificato"), EventCategory.ProcessRestarted, e("addons", "Process restarted", "Processo riavviato"), EventCategory.StorageLocationsChanged, e("storage", "Storage locations changed", "Posizioni di archiviazione cambiate"), EventCategory.RecordingStarted, e("recording", "Recording started", "Registrazione avviata"), EventCategory.RecordingStopped, e("recording", "Recording stopped", "Registrazione fermata"), EventCategory.RecordingError, e("recording", "Recording error", "Errore di registrazione"), EventCategory.RecordingHealthDegraded, e("recording", "Recording degraded", "Registrazione degradata"), EventCategory.RecordingHealthStalled, e("recording", "Recording stalled", "Registrazione bloccata"), EventCategory.RecordingHealthOk, e("recording", "Recording healthy", "Registrazione regolare"), EventCategory.RecordingStorageCritical, e("recording", "Recording storage critical", "Spazio di registrazione critico"), EventCategory.StorageLocationLow, e("storage", "Storage location low", "Spazio in esaurimento"), EventCategory.StorageLocationCritical, e("storage", "Storage location critical", "Spazio critico"), EventCategory.StorageLocationOk, e("storage", "Storage location recovered", "Spazio tornato regolare"), EventCategory.StorageDrainProgress, e("storage", "Drain progress", "Avanzamento dello svuotamento"), EventCategory.StorageDrainComplete, e("storage", "Drain complete", "Svuotamento completato"), EventCategory.RecordingSegmentWritten, e("recording", "Segment written", "Segmento scritto"), EventCategory.RecordingPolicyFallback, e("recording", "Recording policy fallback", "Politica di registrazione di ripiego"), EventCategory.RecordingRetentionCompleted, e("recording", "Retention completed", "Pulizia completata"), EventCategory.RecordingExportProgress, e("recording", "Export progress", "Avanzamento esportazione"), EventCategory.RecordingExportCompleted, e("recording", "Export completed", "Esportazione completata"), EventCategory.RecordingExportFailed, e("recording", "Export failed", "Esportazione fallita"), EventCategory.DetectionEvent, e("detection", "Detection", "Rilevamento"), EventCategory.SessionTrackNew, e("detection", "Session track started", "Nuova traccia di sessione"), EventCategory.SessionTrackExpired, e("detection", "Session track expired", "Traccia di sessione scaduta"), EventCategory.BenchmarkProgress, e("metrics", "Benchmark progress", "Avanzamento benchmark", N), EventCategory.PlatformProbePhase, e("metrics", "Platform probe phase", "Fase di analisi piattaforma", N), EventCategory.PipelineProgress, e("pipeline", "Pipeline progress", "Avanzamento pipeline", N), EventCategory.PipelineTrace, e("pipeline", "Pipeline trace", "Traccia pipeline", N), EventCategory.PipelineInferenceResult, e("pipeline", "Inference result", "Risultato di inferenza", N), EventCategory.PipelineCameraAssigned, e("pipeline", "Camera assigned to pipeline", "Camera assegnata alla pipeline"), EventCategory.PipelineCameraUnassigned, e("pipeline", "Camera unassigned from pipeline", "Camera rimossa dalla pipeline"), EventCategory.PipelineNodeInferenceUnavailable, e("pipeline", "Node inference unavailable", "Inferenza del nodo non disponibile"), EventCategory.PipelineDetectionBlind, e("pipeline", "Detection blind", "Rilevamento cieco"), EventCategory.PipelineMotionNoisy, e("pipeline", "Motion too noisy", "Movimento troppo disturbato"), EventCategory.PipelineMotionCalm, e("pipeline", "Motion calm again", "Movimento di nuovo calmo"), EventCategory.PipelinePackageLlmSilent, e("pipeline", "Package check silent", "Verifica pacchi senza risposta"), EventCategory.PipelinePackageLlmAnswered, e("pipeline", "Package check answered", "Verifica pacchi con risposta"), EventCategory.PipelineCameraUpdated, e("pipeline", "Pipeline camera updated", "Camera della pipeline aggiornata"), EventCategory.PipelineIngestOwnerChanged, e("pipeline", "Ingest owner changed", "Responsabile dell’acquisizione cambiato"), EventCategory.PipelineRunnerLoadSnapshot, e("metrics", "Runner load snapshot", "Carico dei runner", N), EventCategory.PipelineCameraMetricsSnapshot, e("metrics", "Camera metrics snapshot", "Metriche delle camere", N), EventCategory.StreamBrokerMetricsSnapshot, e("metrics", "Stream broker metrics", "Metriche dello stream broker", N), EventCategory.StreamBrokerOnCamStreamDemand, e("streams", "Stream requested", "Stream richiesto"), EventCategory.StreamBrokerOnCamStreamIdle, e("streams", "Stream idle", "Stream inattivo"), EventCategory.StreamBrokerOnRequestStreamSourceRefresh, e("streams", "Stream source refresh requested", "Aggiornamento sorgente stream richiesto"), EventCategory.StreamParamsChanged, e("streams", "Stream parameters changed", "Parametri dello stream cambiati"), EventCategory.DeviceStateChanged, e("devices", "Device state changed", "Stato dispositivo cambiato"), EventCategory.DeviceCommandSettled, e("devices", "Device command settled", "Comando al dispositivo concluso"), EventCategory.DeviceNativeShadowChanged, e("devices", "Device native state changed", "Stato nativo del dispositivo cambiato"), EventCategory.ZoneAnalyticsOccupancyChanged, e("detection", "Zone occupancy changed", "Occupazione zona cambiata"), EventCategory.BatteryOnStatusChanged, e("devices", "Battery status changed", "Stato batteria cambiato"), EventCategory.NetworkLinkOnStatusChanged, e("devices", "Network link status changed", "Stato del collegamento di rete cambiato"), EventCategory.BatteryOnWakeStarted, e("devices", "Battery device woke up", "Dispositivo a batteria attivato"), EventCategory.DoorbellOnPressed, e("devices", "Doorbell pressed", "Campanello premuto"), EventCategory.RunningStarted, e("devices", "Run started", "Esecuzione avviata"), EventCategory.RunningFinished, e("devices", "Run finished", "Esecuzione terminata"), EventCategory.WorkloadStarted, e("devices", "Workload started", "Carico di lavoro avviato"), EventCategory.WorkloadStopped, e("devices", "Workload stopped", "Carico di lavoro fermato"), EventCategory.WorkloadCrashed, e("devices", "Workload crashed", "Carico di lavoro in crash"), EventCategory.WorkloadRecovered, e("devices", "Workload recovered", "Carico di lavoro ripristinato"), EventCategory.DeviceRunOpened, e("devices", "Device run opened", "Ciclo del dispositivo aperto"), EventCategory.DeviceRunClosed, e("devices", "Device run closed", "Ciclo del dispositivo chiuso"), EventCategory.EventEmitted, e("devices", "Device event", "Evento del dispositivo"), EventCategory.PipelineEngineMetricsSnapshot, e("metrics", "Engine metrics snapshot", "Metriche dei motori", N), EventCategory.PipelineEngineProvisioning, e("pipeline", "Engine provisioning", "Preparazione del motore"), EventCategory.ClusterTopologySnapshot, e("metrics", "Cluster topology snapshot", "Topologia del cluster", N), EventCategory.MetricsNodeResourcesSnapshot, e("metrics", "Node resources snapshot", "Risorse dei nodi", N), EventCategory.MetricsNodeProcessesSnapshot, e("metrics", "Node processes snapshot", "Processi dei nodi", N), EventCategory.CapabilityBindingChanged, e("system", "Capability binding changed", "Collegamento di capability cambiato", N), EventCategory.ModelDownloadProgress, e("pipeline", "Model download progress", "Avanzamento download modello", N), EventCategory.AgentRegistered, e("agents", "Agent registered", "Agent registrato"), EventCategory.AgentUnregistered, e("agents", "Agent removed", "Agent rimosso"), EventCategory.AgentOnline, e("agents", "Agent online", "Agent online"), EventCategory.AgentOffline, e("agents", "Agent offline", "Agent offline"), EventCategory.WorkerOnline, e("agents", "Worker online", "Worker online"), EventCategory.WorkerOffline, e("agents", "Worker offline", "Worker offline"), EventCategory.AgentTaskDispatched, e("agents", "Agent task dispatched", "Attività inviata a un agent"), EventCategory.AgentTaskAssigned, e("agents", "Agent task assigned", "Attività assegnata a un agent"), EventCategory.AgentTrpcConnected, e("agents", "Agent API connected", "API dell’agent connessa"), EventCategory.AgentWsConnected, e("agents", "Agent socket connected", "Socket dell’agent connesso"), EventCategory.AgentWsDisconnected, e("agents", "Agent socket disconnected", "Socket dell’agent disconnesso"), EventCategory.AgentBackupActivated, e("agents", "Agent backup activated", "Backup dell’agent attivato"), EventCategory.OrchestrationSettingsUpdated, e("pipeline", "Orchestration settings updated", "Impostazioni di orchestrazione aggiornate"), EventCategory.MotionAnalysis, e("detection", "Motion analysis", "Analisi del movimento", N), EventCategory.MotionZonesRaw, e("detection", "Raw motion zones", "Zone di movimento grezze", N), EventCategory.MotionOnMotionChanged, e("detection", "Motion changed", "Movimento cambiato", N), EventCategory.DetectionResult, e("detection", "Detection result", "Risultato del rilevamento", N), EventCategory.DetectionRaw, e("detection", "Raw detection", "Rilevamento grezzo"), EventCategory.DetectionCameraNative, e("detection", "Camera native detection", "Rilevamento nativo della camera"), EventCategory.PipelineAudioInferenceResult, e("pipeline", "Audio inference result", "Risultato di inferenza audio", N), EventCategory.DetectionPhaseTransition, e("detection", "Detection phase changed", "Fase di rilevamento cambiata"), EventCategory.ProviderMotion, e("detection", "Camera raw motion", "Movimento grezzo della camera", N), EventCategory.ProviderDetection, e("detection", "Camera onboard detection", "Rilevamento a bordo camera"), EventCategory.EnrichmentEmbeddingStored, e("enrichment", "Embedding stored", "Embedding salvato"), EventCategory.EnrichmentSceneStateChanged, e("enrichment", "Scene state changed", "Stato della scena cambiato"), EventCategory.EnrichmentActivitySummary, e("enrichment", "Activity summary", "Riepilogo dell’attività"), EventCategory.PipelineAnalyticsTrackLifecycle, e("detection", "Track lifecycle", "Ciclo di vita della traccia"), EventCategory.PipelineAnalyticsTrackStarted, e("detection", "Track started", "Traccia iniziata", {
|
|
127402
|
+
EventCategory.SystemBoot, e("system", "System booted", "Sistema avviato"), EventCategory.SystemAddonsReady, e("system", "Addons ready", "Addon pronti"), EventCategory.SystemRestarting, e("system", "System restarting", "Sistema in riavvio"), EventCategory.SystemRestartCompleted, e("system", "Restart completed", "Riavvio completato"), EventCategory.SystemTlsCertChanged, e("system", "TLS certificate changed", "Certificato TLS cambiato"), EventCategory.UpdateAvailable, e("system", "Update available", "Aggiornamento disponibile"), EventCategory.SystemReadyState, e("system", "Readiness changed", "Stato di prontezza cambiato"), EventCategory.AddonStarted, e("addons", "Addon started", "Addon avviato"), EventCategory.AddonStopped, e("addons", "Addon stopped", "Addon fermato"), EventCategory.AddonRestarted, e("addons", "Addon restarted", "Addon riavviato"), EventCategory.AddonUpdated, e("addons", "Addon updated", "Addon aggiornato"), EventCategory.AddonInstalled, e("addons", "Addon installed", "Addon installato"), EventCategory.AddonUninstalled, e("addons", "Addon uninstalled", "Addon disinstallato"), EventCategory.AddonCrashed, e("addons", "Addon crashed", "Addon in errore fatale"), EventCategory.AddonRunnerFailed, e("addons", "Runner failed for good", "Runner fallito definitivamente"), EventCategory.AddonRunnerRefused, e("addons", "Runner refused", "Runner rifiutato"), EventCategory.ProcessStateChanged, e("addons", "Process state changed", "Stato del processo cambiato"), EventCategory.SystemRunnerCheck, e("system", "Runner check", "Verifica dei runner"), EventCategory.AlertEpisode, e("system", "Alert episode", "Episodio di allarme"), EventCategory.AddonError, e("addons", "Addon error", "Errore di un addon"), EventCategory.AddonPageReady, e("addons", "Addon page ready", "Pagina addon pronta"), EventCategory.AddonWidgetReady, e("addons", "Addon widget ready", "Widget addon pronto"), EventCategory.AddonLoadFailed, e("addons", "Addon failed to load", "Caricamento addon fallito"), EventCategory.KeychainChanged, e("system", "Keychain changed", "Portachiavi modificato"), EventCategory.AddonLoadRecovered, e("addons", "Addon load recovered", "Caricamento addon ripristinato"), EventCategory.AddonUnsupportedVersion, e("addons", "Addon version unsupported", "Versione addon non supportata"), EventCategory.AddonUnsupportedResolved, e("addons", "Unsupported addon resolved", "Addon non supportato risolto"), EventCategory.AddonRetryScheduled, e("addons", "Addon retry scheduled", "Nuovo tentativo addon pianificato"), EventCategory.SystemLivenessFailed, e("system", "Liveness check failed", "Controllo di attività fallito"), EventCategory.SystemLivenessRecovered, e("system", "Liveness recovered", "Controllo di attività ripristinato"), EventCategory.AddonRetryAttempting, e("addons", "Addon retry running", "Nuovo tentativo addon in corso"), EventCategory.DeviceRegistered, e("devices", "Device registered", "Dispositivo registrato"), EventCategory.DeviceUnregistered, e("devices", "Device removed", "Dispositivo rimosso"), EventCategory.DeviceEnabled, e("devices", "Device enabled", "Dispositivo abilitato"), EventCategory.DeviceDisabled, e("devices", "Device disabled", "Dispositivo disabilitato"), EventCategory.DeviceSettingsUpdated, e("devices", "Device settings updated", "Impostazioni dispositivo aggiornate"), EventCategory.DeviceBindingsChanged, e("devices", "Device bindings changed", "Collegamenti dispositivo cambiati"), EventCategory.DeviceMetaChanged, e("devices", "Device details changed", "Dettagli dispositivo cambiati"), EventCategory.DeviceSourceInfoChanged, e("devices", "Device source info changed", "Info sorgente dispositivo cambiate"), EventCategory.DeviceStreamsRegistered, e("streams", "Device streams registered", "Stream del dispositivo registrati"), EventCategory.DeviceProvisioned, e("devices", "Device provisioned", "Dispositivo configurato"), EventCategory.DeviceReady, e("devices", "Device ready", "Dispositivo pronto"), EventCategory.IdentityLinkCreated, e("integrations", "Identity linked", "Identità collegata"), EventCategory.IdentityLinkLost, e("integrations", "Identity link lost", "Collegamento identità perso"), EventCategory.IntegrationEnabled, e("integrations", "Integration enabled", "Integrazione abilitata"), EventCategory.IntegrationDisabled, e("integrations", "Integration disabled", "Integrazione disabilitata"), EventCategory.IntegrationDeleted, e("integrations", "Integration deleted", "Integrazione eliminata"), EventCategory.BrokerStatusChanged, e("integrations", "Broker status changed", "Stato del broker cambiato"), EventCategory.BrokerMessage, e("integrations", "Broker message", "Messaggio del broker", N), EventCategory.ProviderStarted, e("integrations", "Provider started", "Provider avviato"), EventCategory.ProviderStopped, e("integrations", "Provider stopped", "Provider fermato"), EventCategory.ProcessCrashed, e("addons", "Process crashed", "Processo andato in crash"), EventCategory.ProcessRestartScheduled, e("addons", "Process restart scheduled", "Riavvio del processo pianificato"), EventCategory.ProcessRestarted, e("addons", "Process restarted", "Processo riavviato"), EventCategory.StorageLocationsChanged, e("storage", "Storage locations changed", "Posizioni di archiviazione cambiate"), EventCategory.RecordingStarted, e("recording", "Recording started", "Registrazione avviata"), EventCategory.RecordingStopped, e("recording", "Recording stopped", "Registrazione fermata"), EventCategory.RecordingError, e("recording", "Recording error", "Errore di registrazione"), EventCategory.RecordingHealthDegraded, e("recording", "Recording degraded", "Registrazione degradata"), EventCategory.RecordingHealthStalled, e("recording", "Recording stalled", "Registrazione bloccata"), EventCategory.RecordingHealthOk, e("recording", "Recording healthy", "Registrazione regolare"), EventCategory.RecordingStorageCritical, e("recording", "Recording storage critical", "Spazio di registrazione critico"), EventCategory.StorageLocationLow, e("storage", "Storage location low", "Spazio in esaurimento"), EventCategory.StorageLocationCritical, e("storage", "Storage location critical", "Spazio critico"), EventCategory.StorageLocationOk, e("storage", "Storage location recovered", "Spazio tornato regolare"), EventCategory.StorageDrainProgress, e("storage", "Drain progress", "Avanzamento dello svuotamento"), EventCategory.StorageDrainComplete, e("storage", "Drain complete", "Svuotamento completato"), EventCategory.RecordingSegmentWritten, e("recording", "Segment written", "Segmento scritto"), EventCategory.RecordingPolicyFallback, e("recording", "Recording policy fallback", "Politica di registrazione di ripiego"), EventCategory.RecordingRetentionCompleted, e("recording", "Retention completed", "Pulizia completata"), EventCategory.RecordingExportProgress, e("recording", "Export progress", "Avanzamento esportazione"), EventCategory.RecordingExportCompleted, e("recording", "Export completed", "Esportazione completata"), EventCategory.RecordingExportFailed, e("recording", "Export failed", "Esportazione fallita"), EventCategory.DetectionEvent, e("detection", "Detection", "Rilevamento"), EventCategory.SessionTrackNew, e("detection", "Session track started", "Nuova traccia di sessione"), EventCategory.SessionTrackExpired, e("detection", "Session track expired", "Traccia di sessione scaduta"), EventCategory.BenchmarkProgress, e("metrics", "Benchmark progress", "Avanzamento benchmark", N), EventCategory.PlatformProbePhase, e("metrics", "Platform probe phase", "Fase di analisi piattaforma", N), EventCategory.PipelineProgress, e("pipeline", "Pipeline progress", "Avanzamento pipeline", N), EventCategory.PipelineTrace, e("pipeline", "Pipeline trace", "Traccia pipeline", N), EventCategory.PipelineInferenceResult, e("pipeline", "Inference result", "Risultato di inferenza", N), EventCategory.PipelineCameraAssigned, e("pipeline", "Camera assigned to pipeline", "Camera assegnata alla pipeline"), EventCategory.PipelineCameraUnassigned, e("pipeline", "Camera unassigned from pipeline", "Camera rimossa dalla pipeline"), EventCategory.PipelineNodeInferenceUnavailable, e("pipeline", "Node inference unavailable", "Inferenza del nodo non disponibile"), EventCategory.PipelineDetectionBlind, e("pipeline", "Detection blind", "Rilevamento cieco"), EventCategory.PipelineMotionNoisy, e("pipeline", "Motion too noisy", "Movimento troppo disturbato"), EventCategory.PipelineMotionCalm, e("pipeline", "Motion calm again", "Movimento di nuovo calmo"), EventCategory.PipelinePackageLlmSilent, e("pipeline", "Package check silent", "Verifica pacchi senza risposta"), EventCategory.PipelinePackageLlmAnswered, e("pipeline", "Package check answered", "Verifica pacchi con risposta"), EventCategory.PipelineCameraUpdated, e("pipeline", "Pipeline camera updated", "Camera della pipeline aggiornata"), EventCategory.PipelineIngestOwnerChanged, e("pipeline", "Ingest owner changed", "Responsabile dell’acquisizione cambiato"), EventCategory.PipelineRunnerLoadSnapshot, e("metrics", "Runner load snapshot", "Carico dei runner", N), EventCategory.PipelineCameraMetricsSnapshot, e("metrics", "Camera metrics snapshot", "Metriche delle camere", N), EventCategory.StreamBrokerMetricsSnapshot, e("metrics", "Stream broker metrics", "Metriche dello stream broker", N), EventCategory.StreamBrokerOnCamStreamDemand, e("streams", "Stream requested", "Stream richiesto"), EventCategory.StreamBrokerOnCamStreamIdle, e("streams", "Stream idle", "Stream inattivo"), EventCategory.StreamBrokerOnRequestStreamSourceRefresh, e("streams", "Stream source refresh requested", "Aggiornamento sorgente stream richiesto"), EventCategory.StreamBrokerOnSourceRestart, e("streams", "Stream source restarted", "Sorgente stream riavviata"), EventCategory.StreamParamsChanged, e("streams", "Stream parameters changed", "Parametri dello stream cambiati"), EventCategory.DeviceStateChanged, e("devices", "Device state changed", "Stato dispositivo cambiato"), EventCategory.DeviceCommandSettled, e("devices", "Device command settled", "Comando al dispositivo concluso"), EventCategory.DeviceNativeShadowChanged, e("devices", "Device native state changed", "Stato nativo del dispositivo cambiato"), EventCategory.ZoneAnalyticsOccupancyChanged, e("detection", "Zone occupancy changed", "Occupazione zona cambiata"), EventCategory.BatteryOnStatusChanged, e("devices", "Battery status changed", "Stato batteria cambiato"), EventCategory.NetworkLinkOnStatusChanged, e("devices", "Network link status changed", "Stato del collegamento di rete cambiato"), EventCategory.BatteryOnWakeStarted, e("devices", "Battery device woke up", "Dispositivo a batteria attivato"), EventCategory.DoorbellOnPressed, e("devices", "Doorbell pressed", "Campanello premuto"), EventCategory.RunningStarted, e("devices", "Run started", "Esecuzione avviata"), EventCategory.RunningFinished, e("devices", "Run finished", "Esecuzione terminata"), EventCategory.WorkloadStarted, e("devices", "Workload started", "Carico di lavoro avviato"), EventCategory.WorkloadStopped, e("devices", "Workload stopped", "Carico di lavoro fermato"), EventCategory.WorkloadCrashed, e("devices", "Workload crashed", "Carico di lavoro in crash"), EventCategory.WorkloadRecovered, e("devices", "Workload recovered", "Carico di lavoro ripristinato"), EventCategory.DeviceRunOpened, e("devices", "Device run opened", "Ciclo del dispositivo aperto"), EventCategory.DeviceRunClosed, e("devices", "Device run closed", "Ciclo del dispositivo chiuso"), EventCategory.EventEmitted, e("devices", "Device event", "Evento del dispositivo"), EventCategory.PipelineEngineMetricsSnapshot, e("metrics", "Engine metrics snapshot", "Metriche dei motori", N), EventCategory.PipelineEngineProvisioning, e("pipeline", "Engine provisioning", "Preparazione del motore"), EventCategory.ClusterTopologySnapshot, e("metrics", "Cluster topology snapshot", "Topologia del cluster", N), EventCategory.MetricsNodeResourcesSnapshot, e("metrics", "Node resources snapshot", "Risorse dei nodi", N), EventCategory.MetricsNodeProcessesSnapshot, e("metrics", "Node processes snapshot", "Processi dei nodi", N), EventCategory.CapabilityBindingChanged, e("system", "Capability binding changed", "Collegamento di capability cambiato", N), EventCategory.ModelDownloadProgress, e("pipeline", "Model download progress", "Avanzamento download modello", N), EventCategory.AgentRegistered, e("agents", "Agent registered", "Agent registrato"), EventCategory.AgentUnregistered, e("agents", "Agent removed", "Agent rimosso"), EventCategory.AgentOnline, e("agents", "Agent online", "Agent online"), EventCategory.AgentOffline, e("agents", "Agent offline", "Agent offline"), EventCategory.WorkerOnline, e("agents", "Worker online", "Worker online"), EventCategory.WorkerOffline, e("agents", "Worker offline", "Worker offline"), EventCategory.AgentTaskDispatched, e("agents", "Agent task dispatched", "Attività inviata a un agent"), EventCategory.AgentTaskAssigned, e("agents", "Agent task assigned", "Attività assegnata a un agent"), EventCategory.AgentTrpcConnected, e("agents", "Agent API connected", "API dell’agent connessa"), EventCategory.AgentWsConnected, e("agents", "Agent socket connected", "Socket dell’agent connesso"), EventCategory.AgentWsDisconnected, e("agents", "Agent socket disconnected", "Socket dell’agent disconnesso"), EventCategory.AgentBackupActivated, e("agents", "Agent backup activated", "Backup dell’agent attivato"), EventCategory.OrchestrationSettingsUpdated, e("pipeline", "Orchestration settings updated", "Impostazioni di orchestrazione aggiornate"), EventCategory.MotionAnalysis, e("detection", "Motion analysis", "Analisi del movimento", N), EventCategory.MotionZonesRaw, e("detection", "Raw motion zones", "Zone di movimento grezze", N), EventCategory.MotionOnMotionChanged, e("detection", "Motion changed", "Movimento cambiato", N), EventCategory.DetectionResult, e("detection", "Detection result", "Risultato del rilevamento", N), EventCategory.DetectionRaw, e("detection", "Raw detection", "Rilevamento grezzo"), EventCategory.DetectionCameraNative, e("detection", "Camera native detection", "Rilevamento nativo della camera"), EventCategory.PipelineAudioInferenceResult, e("pipeline", "Audio inference result", "Risultato di inferenza audio", N), EventCategory.DetectionPhaseTransition, e("detection", "Detection phase changed", "Fase di rilevamento cambiata"), EventCategory.ProviderMotion, e("detection", "Camera raw motion", "Movimento grezzo della camera", N), EventCategory.ProviderDetection, e("detection", "Camera onboard detection", "Rilevamento a bordo camera"), EventCategory.EnrichmentEmbeddingStored, e("enrichment", "Embedding stored", "Embedding salvato"), EventCategory.EnrichmentSceneStateChanged, e("enrichment", "Scene state changed", "Stato della scena cambiato"), EventCategory.EnrichmentActivitySummary, e("enrichment", "Activity summary", "Riepilogo dell’attività"), EventCategory.PipelineAnalyticsTrackLifecycle, e("detection", "Track lifecycle", "Ciclo di vita della traccia"), EventCategory.PipelineAnalyticsTrackStarted, e("detection", "Track started", "Traccia iniziata", {
|
|
127386
127403
|
noise: true,
|
|
127387
127404
|
deprecated: true
|
|
127388
127405
|
}), EventCategory.PipelineAnalyticsTrackEnded, e("detection", "Track ended", "Traccia terminata", {
|
|
@@ -154130,8 +154147,15 @@ function convertLegacyWhen(half) {
|
|
|
154130
154147
|
/** The longest one `wait` step lasts. It is cut by a restart of the run and does not survive a hub restart. */
|
|
154131
154148
|
var WAIT_MAX_SECONDS = 3600;
|
|
154132
154149
|
var WAIT_TOO_LONG = `a wait is at most one hour (${WAIT_MAX_SECONDS} s)`;
|
|
154150
|
+
/**
|
|
154151
|
+
* Every step kind may be switched off without deleting it: `enabled: false`
|
|
154152
|
+
* skips the step (and, for a block step, its whole subtree), traced `disabled`.
|
|
154153
|
+
* Absent means enabled.
|
|
154154
|
+
*/
|
|
154155
|
+
var stepEnabledShape = { enabled: boolean().optional() };
|
|
154133
154156
|
var AutomationWaitStepSchema = object({
|
|
154134
154157
|
kind: literal("wait"),
|
|
154158
|
+
...stepEnabledShape,
|
|
154135
154159
|
seconds: number$1().min(0).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG)
|
|
154136
154160
|
});
|
|
154137
154161
|
/**
|
|
@@ -154140,6 +154164,7 @@ var AutomationWaitStepSchema = object({
|
|
|
154140
154164
|
*/
|
|
154141
154165
|
var AutomationCommandStepBaseSchema = object({
|
|
154142
154166
|
kind: literal("command"),
|
|
154167
|
+
...stepEnabledShape,
|
|
154143
154168
|
/** WHO the step acts on. */
|
|
154144
154169
|
target: ActionTargetSchema,
|
|
154145
154170
|
/** The vocabulary action this step performs (`cover.open`). */
|
|
@@ -154215,6 +154240,7 @@ var AutomationGuardedCommandStepSchema = AutomationCommandStepBaseSchema.extend(
|
|
|
154215
154240
|
/** End the run here, on purpose. `reason` may carry `{{vars.x}}` slots. */
|
|
154216
154241
|
var AutomationStopStepSchema = object({
|
|
154217
154242
|
kind: literal("stop"),
|
|
154243
|
+
...stepEnabledShape,
|
|
154218
154244
|
reason: string().min(1, "a stop needs a reason: it is what the run trace shows").max(200),
|
|
154219
154245
|
/** `ok`: the run ends as a success. `failed`: it ends as a failure, with the reason. */
|
|
154220
154246
|
outcome: _enum(["ok", "failed"]),
|
|
@@ -154234,6 +154260,7 @@ var RESERVED_RUN_VARS = [
|
|
|
154234
154260
|
*/
|
|
154235
154261
|
var AutomationSetStepSchema = object({
|
|
154236
154262
|
kind: literal("set"),
|
|
154263
|
+
...stepEnabledShape,
|
|
154237
154264
|
vars: record(string(), union([
|
|
154238
154265
|
string().max(500),
|
|
154239
154266
|
number$1(),
|
|
@@ -154242,8 +154269,25 @@ var AutomationSetStepSchema = object({
|
|
|
154242
154269
|
/** Set only when this reads true; false or unknown leaves the bag as it is. */
|
|
154243
154270
|
if: AutomationWhenSchema.optional()
|
|
154244
154271
|
});
|
|
154272
|
+
var NOTIFY_BODY_MAX = 2e3;
|
|
154273
|
+
/**
|
|
154274
|
+
* Send a notification through one notification target (the same targets the
|
|
154275
|
+
* notification centre addresses). Title and body may carry `{{vars.x}}` slots.
|
|
154276
|
+
* Not a device command: a notification target is an instance of the
|
|
154277
|
+
* `notification-output` cap, not a device.
|
|
154278
|
+
*/
|
|
154279
|
+
var AutomationNotifyStepSchema = object({
|
|
154280
|
+
kind: literal("notify"),
|
|
154281
|
+
...stepEnabledShape,
|
|
154282
|
+
/** The notification target (an instance id of `notification-output`). */
|
|
154283
|
+
targetId: string().min(1, "pick the notification target"),
|
|
154284
|
+
title: string().max(200).optional(),
|
|
154285
|
+
body: string().min(1, "a notification needs a message").max(NOTIFY_BODY_MAX),
|
|
154286
|
+
...continueOnErrorShape
|
|
154287
|
+
});
|
|
154245
154288
|
var AutomationRunActionStepSchema = object({
|
|
154246
154289
|
kind: literal("action"),
|
|
154290
|
+
...stepEnabledShape,
|
|
154247
154291
|
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
154248
154292
|
actionId: string().min(1),
|
|
154249
154293
|
/** Values for the action's declared variables; the others take their default. */
|
|
@@ -154269,6 +154313,7 @@ var WAIT_UNTIL_TIMEOUT_MAX_S = 21600;
|
|
|
154269
154313
|
*/
|
|
154270
154314
|
var AutomationWaitUntilStepSchema = object({
|
|
154271
154315
|
kind: literal("wait-until"),
|
|
154316
|
+
...stepEnabledShape,
|
|
154272
154317
|
when: AutomationWhenSchema,
|
|
154273
154318
|
timeoutS: number$1().int().min(1, "a wait needs a timeout of at least one second").max(WAIT_UNTIL_TIMEOUT_MAX_S, `a wait for a condition is at most six hours (${WAIT_UNTIL_TIMEOUT_MAX_S} s)`),
|
|
154274
154319
|
onTimeout: _enum(["continue", "stop"])
|
|
@@ -154294,7 +154339,8 @@ var plainStepSchemas = [
|
|
|
154294
154339
|
AutomationCommandStepBaseSchema.extend(continueOnErrorShape).strict().superRefine(refineKnownAction),
|
|
154295
154340
|
AutomationStopStepSchema.omit({ if: true }).strict(),
|
|
154296
154341
|
AutomationSetStepSchema.omit({ if: true }).strict(),
|
|
154297
|
-
AutomationRunActionStepSchema.strict()
|
|
154342
|
+
AutomationRunActionStepSchema.strict(),
|
|
154343
|
+
AutomationNotifyStepSchema.strict()
|
|
154298
154344
|
];
|
|
154299
154345
|
/**
|
|
154300
154346
|
* A plain step: a flow step with no condition of its own and no step inside
|
|
@@ -154302,7 +154348,7 @@ var plainStepSchemas = [
|
|
|
154302
154348
|
*/
|
|
154303
154349
|
var AutomationBranchStepSchema = discriminatedUnion("kind", plainStepSchemas, { error: nestTooDeep });
|
|
154304
154350
|
/** A step that can run beside others: it writes no variable and does not end the run. */
|
|
154305
|
-
var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) => step.kind === "command" || step.kind === "action" || step.kind === "wait", "a parallel holds device commands, actions and waits only: a set or a stop beside other steps has no order");
|
|
154351
|
+
var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) => step.kind === "command" || step.kind === "action" || step.kind === "notify" || step.kind === "wait", "a parallel holds device commands, actions and waits only: a set or a stop beside other steps has no order");
|
|
154306
154352
|
/**
|
|
154307
154353
|
* Several steps at once (#500): all are started together and all are awaited.
|
|
154308
154354
|
* A failure fails the run once the others finished, as in a sequence; a member
|
|
@@ -154310,6 +154356,7 @@ var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) =>
|
|
|
154310
154356
|
*/
|
|
154311
154357
|
var AutomationParallelStepSchema = object({
|
|
154312
154358
|
kind: literal("parallel"),
|
|
154359
|
+
...stepEnabledShape,
|
|
154313
154360
|
steps: array(AutomationParallelMemberSchema).min(2, "a parallel needs at least two steps").max(5, `a parallel takes at most 5 steps`)
|
|
154314
154361
|
}).strict();
|
|
154315
154362
|
var REPEAT_NEEDS_MAX = "a repeat on a condition needs a maximum number of iterations";
|
|
@@ -154350,6 +154397,7 @@ var AutomationRepeatLoopSchema = discriminatedUnion("by", [
|
|
|
154350
154397
|
function repeatSchemaOf(step) {
|
|
154351
154398
|
return object({
|
|
154352
154399
|
kind: literal("repeat"),
|
|
154400
|
+
...stepEnabledShape,
|
|
154353
154401
|
loop: AutomationRepeatLoopSchema,
|
|
154354
154402
|
steps: array(step).min(1, "a repeat needs at least one step").max(10, `a repeat takes at most 10 steps`)
|
|
154355
154403
|
}).strict();
|
|
@@ -154365,6 +154413,7 @@ function chooseSchemaOf(step) {
|
|
|
154365
154413
|
const steps = array(step).max(10);
|
|
154366
154414
|
return object({
|
|
154367
154415
|
kind: literal("choose"),
|
|
154416
|
+
...stepEnabledShape,
|
|
154368
154417
|
branches: array(object({
|
|
154369
154418
|
if: AutomationWhenSchema,
|
|
154370
154419
|
steps: steps.min(1, "a branch needs at least one step")
|
|
@@ -154390,8 +154439,10 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
154390
154439
|
AutomationParallelStepSchema,
|
|
154391
154440
|
AutomationRepeatStepSchema,
|
|
154392
154441
|
AutomationRunActionStepSchema,
|
|
154442
|
+
AutomationNotifyStepSchema,
|
|
154393
154443
|
object({
|
|
154394
154444
|
kind: literal("code"),
|
|
154445
|
+
...stepEnabledShape,
|
|
154395
154446
|
/** Compiled into the automation's OWN block by esbuild — not a third
|
|
154396
154447
|
* runtime, not a `vm`, and not dynamically evaluated. */
|
|
154397
154448
|
code: string().min(1).max(2e4)
|
|
@@ -159391,6 +159442,8 @@ method(object({
|
|
|
159391
159442
|
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
159392
159443
|
profileHint: CamProfileSchema.optional(),
|
|
159393
159444
|
metadata: record(string(), unknown()).optional(),
|
|
159445
|
+
/** The longest session the source keeps open (ms) — see `CameraStreamSchema.maxSessionMs`. */
|
|
159446
|
+
maxSessionMs: number$1().int().positive().optional(),
|
|
159394
159447
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
159395
159448
|
* derived broker reads its encoded plane from.
|
|
159396
159449
|
* The runtime guard (broker manager, Task 10) enforces presence for
|
|
@@ -159609,6 +159662,11 @@ method(object({
|
|
|
159609
159662
|
deviceId: number$1().int().nonnegative(),
|
|
159610
159663
|
camStreamId: string(),
|
|
159611
159664
|
brokerId: string()
|
|
159665
|
+
})), event(object({
|
|
159666
|
+
deviceId: number$1().int().nonnegative(),
|
|
159667
|
+
camStreamId: string(),
|
|
159668
|
+
brokerId: string(),
|
|
159669
|
+
reason: string()
|
|
159612
159670
|
})), NOT_A_DEVICE.PIPELINE;
|
|
159613
159671
|
var StreamCodecSchema = _enum([
|
|
159614
159672
|
"h264",
|
|
@@ -169151,6 +169209,15 @@ var DeviceFaultSchema = object({
|
|
|
169151
169209
|
label: string(),
|
|
169152
169210
|
severity: DeviceErrorSeveritySchema
|
|
169153
169211
|
});
|
|
169212
|
+
/** One kind of fault a device CAN raise: the integration's own declared catalog entry. */
|
|
169213
|
+
var DeviceFaultTypeSchema = DeviceFaultSchema;
|
|
169214
|
+
/**
|
|
169215
|
+
* The fault catalog of a device, declared by its integration at runtime (never a
|
|
169216
|
+
* code enum). A fault outside the catalog is still published and still matches
|
|
169217
|
+
* a rule that names no code.
|
|
169218
|
+
*/
|
|
169219
|
+
var ListFaultTypesInputSchema = object({ deviceId: number$1().int().nonnegative() });
|
|
169220
|
+
var FaultTypesSchema = object({ types: array(DeviceFaultTypeSchema) });
|
|
169154
169221
|
/**
|
|
169155
169222
|
* The fault a device reports right now. One slice per device.
|
|
169156
169223
|
*
|
|
@@ -169188,7 +169255,12 @@ var errorCapability = {
|
|
|
169188
169255
|
scope: "device",
|
|
169189
169256
|
deviceNative: true,
|
|
169190
169257
|
mode: "singleton",
|
|
169191
|
-
methods: {
|
|
169258
|
+
methods: {
|
|
169259
|
+
/** The fault codes this device's integration can raise; `[]` when it declares none. */
|
|
169260
|
+
listFaultTypes: method(ListFaultTypesInputSchema, FaultTypesSchema, {
|
|
169261
|
+
kind: "query",
|
|
169262
|
+
auth: "protected"
|
|
169263
|
+
}) },
|
|
169192
169264
|
status: {
|
|
169193
169265
|
schema: ErrorStatusSchema,
|
|
169194
169266
|
kind: "push",
|
|
@@ -184157,6 +184229,13 @@ var NcSystemEventConditionSchema = object({
|
|
|
184157
184229
|
* pick from. The hub refuses an id the action index does not know.
|
|
184158
184230
|
*/
|
|
184159
184231
|
commandActions: array(string().min(1)).min(1).optional(),
|
|
184232
|
+
/**
|
|
184233
|
+
* `device-attention-*` only: the fault CODES this rule speaks about (the
|
|
184234
|
+
* integration declares them through `error.listFaultTypes`; free text is
|
|
184235
|
+
* accepted too). Absent or empty = any fault. The rule matches when any
|
|
184236
|
+
* fault of the episode is in the list.
|
|
184237
|
+
*/
|
|
184238
|
+
faultCodes: array(string().min(1)).optional(),
|
|
184160
184239
|
/** `device-command` only: how the command settled. A device's own change is not a command. */
|
|
184161
184240
|
commandOutcomes: array(_enum([
|
|
184162
184241
|
"confirmed",
|
|
@@ -196082,7 +196161,16 @@ var CamStreamDescriptorSchema = object({
|
|
|
196082
196161
|
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
196083
196162
|
profileHint: CamProfileSchema.optional(),
|
|
196084
196163
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
196085
|
-
metadata: record(string(), unknown()).optional()
|
|
196164
|
+
metadata: record(string(), unknown()).optional(),
|
|
196165
|
+
/**
|
|
196166
|
+
* The longest continuous session the SOURCE will keep open, in ms, declared by
|
|
196167
|
+
* the provider that knows it (a hub that cuts every child's session on a
|
|
196168
|
+
* timer). Absent = no limit. The broker re-dials a live source a little
|
|
196169
|
+
* BEFORE this elapses, on its own terms and announced to consumers, so the
|
|
196170
|
+
* source's cut never lands mid-recording. Declare slightly under what was
|
|
196171
|
+
* observed.
|
|
196172
|
+
*/
|
|
196173
|
+
maxSessionMs: number$1().int().positive().optional()
|
|
196086
196174
|
});
|
|
196087
196175
|
/**
|
|
196088
196176
|
* `stream-catalog` — device-scoped, provider-implemented. The pull counterpart
|
|
@@ -202990,6 +203078,20 @@ function deviceErrorEdge(previous, next) {
|
|
|
202990
203078
|
function deviceErrorAlertId(deviceId) {
|
|
202991
203079
|
return `device-error:${String(deviceId)}`;
|
|
202992
203080
|
}
|
|
203081
|
+
/** Every active fault, the principal first; a status that lists none still names its principal. */
|
|
203082
|
+
function activeFaults(status) {
|
|
203083
|
+
if (status.faults !== void 0 && status.faults.length > 0) return status.faults.map(({ code, label, severity }) => ({
|
|
203084
|
+
code,
|
|
203085
|
+
label,
|
|
203086
|
+
severity
|
|
203087
|
+
}));
|
|
203088
|
+
if (status.code === null) return [];
|
|
203089
|
+
return [{
|
|
203090
|
+
code: status.code,
|
|
203091
|
+
label: status.label ?? status.code,
|
|
203092
|
+
severity: status.severity
|
|
203093
|
+
}];
|
|
203094
|
+
}
|
|
202993
203095
|
/** The alert that opens an episode. `since` is the fault's own start, else `now`. */
|
|
202994
203096
|
function buildDeviceErrorAlert(deviceId, deviceName, status, now) {
|
|
202995
203097
|
const label = status.label ?? status.code ?? "Fault";
|
|
@@ -203017,7 +203119,9 @@ function buildDeviceErrorAlert(deviceId, deviceName, status, now) {
|
|
|
203017
203119
|
metadata: {
|
|
203018
203120
|
episodeId: `${alertId}@${String(startedAt)}`,
|
|
203019
203121
|
code: status.code,
|
|
203020
|
-
deviceSeverity: status.severity
|
|
203122
|
+
deviceSeverity: status.severity,
|
|
203123
|
+
label: status.label,
|
|
203124
|
+
faults: activeFaults(status)
|
|
203021
203125
|
}
|
|
203022
203126
|
};
|
|
203023
203127
|
}
|
|
@@ -203027,6 +203131,8 @@ var BaseDevice = class {
|
|
|
203027
203131
|
type;
|
|
203028
203132
|
/** True when another process owns the base slices (`options.deviceStatus: 'external'`). */
|
|
203029
203133
|
statusIsExternal;
|
|
203134
|
+
/** The fault catalog the integration declared; `[]` until it does. */
|
|
203135
|
+
faultTypes = [];
|
|
203030
203136
|
name;
|
|
203031
203137
|
parentDeviceId;
|
|
203032
203138
|
role;
|
|
@@ -203364,10 +203470,19 @@ var BaseDevice = class {
|
|
|
203364
203470
|
* a restart is compared, not announced again.
|
|
203365
203471
|
*/
|
|
203366
203472
|
registerErrorCap() {
|
|
203367
|
-
this.ctx.registerNativeCap?.(errorCapability, {});
|
|
203473
|
+
this.ctx.registerNativeCap?.(errorCapability, { listFaultTypes: async () => ({ types: [...this.faultTypes] }) });
|
|
203368
203474
|
if (this.runtimeState.getCapState(errorCapability.name) === void 0) this.setCapSlice(errorCapability, ERROR_STATUS_COLD);
|
|
203369
203475
|
}
|
|
203370
203476
|
/**
|
|
203477
|
+
* Declare the fault kinds this device's integration can raise (code, label,
|
|
203478
|
+
* severity), served by `error.listFaultTypes` so a rule's code picker is
|
|
203479
|
+
* offered the integration's own words. The default is `[]`; a fault outside
|
|
203480
|
+
* the catalog is still published. Call it before or after `registerErrorCap`.
|
|
203481
|
+
*/
|
|
203482
|
+
declareFaultTypes(types) {
|
|
203483
|
+
this.faultTypes = types.map((type) => ({ ...type }));
|
|
203484
|
+
}
|
|
203485
|
+
/**
|
|
203371
203486
|
* Publish the device's fault. The slice is written; on an EDGE (a fault
|
|
203372
203487
|
* starts, or one resolves) an attention episode opens or closes through the
|
|
203373
203488
|
* alerts cap, which the notification center announces as
|
|
@@ -210344,6 +210459,13 @@ Object.freeze({
|
|
|
210344
210459
|
access: "view",
|
|
210345
210460
|
role: "viewer"
|
|
210346
210461
|
},
|
|
210462
|
+
"error.listFaultTypes": {
|
|
210463
|
+
capName: "error",
|
|
210464
|
+
capScope: "device",
|
|
210465
|
+
addonId: null,
|
|
210466
|
+
access: "view",
|
|
210467
|
+
role: "viewer"
|
|
210468
|
+
},
|
|
210347
210469
|
"eventEmitter.getStatus": {
|
|
210348
210470
|
capName: "event-emitter",
|
|
210349
210471
|
capScope: "device",
|
|
@@ -218967,6 +219089,11 @@ Object.freeze({
|
|
|
218967
219089
|
form: "single",
|
|
218968
219090
|
optional: false
|
|
218969
219091
|
}],
|
|
219092
|
+
"error.listFaultTypes": [{
|
|
219093
|
+
name: "deviceId",
|
|
219094
|
+
form: "single",
|
|
219095
|
+
optional: false
|
|
219096
|
+
}],
|
|
218970
219097
|
"eventEmitter.getStatus": [{
|
|
218971
219098
|
name: "deviceId",
|
|
218972
219099
|
form: "single",
|
|
@@ -221299,7 +221426,8 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
|
221299
221426
|
"consumableLowPercent",
|
|
221300
221427
|
"commandActions",
|
|
221301
221428
|
"commandOutcomes",
|
|
221302
|
-
"commandActorKinds"
|
|
221429
|
+
"commandActorKinds",
|
|
221430
|
+
"faultCodes"
|
|
221303
221431
|
];
|
|
221304
221432
|
new Map(Object.entries({
|
|
221305
221433
|
"device-online": "device-events",
|
|
@@ -221670,6 +221798,8 @@ object({
|
|
|
221670
221798
|
nodeId: string().optional(),
|
|
221671
221799
|
/** The alert's own action link (where the operator acts on it), when it has one. */
|
|
221672
221800
|
actionUrl: string().optional(),
|
|
221801
|
+
/** A device fault episode: every active fault (`metadata.faults`), principal first. */
|
|
221802
|
+
faults: array(DeviceFaultSchema).optional(),
|
|
221673
221803
|
at: number$1()
|
|
221674
221804
|
});
|
|
221675
221805
|
var RULE_BODY_ONLY = ["body"];
|
|
@@ -221954,6 +222084,9 @@ var STATE_SUMMARY_VARS = [
|
|
|
221954
222084
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
221955
222085
|
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
221956
222086
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
222087
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
222088
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
222089
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
221957
222090
|
[...RULE_TEXT],
|
|
221958
222091
|
[...RULE_TEXT],
|
|
221959
222092
|
[...RULE_TEXT],
|
|
@@ -223644,6 +223777,16 @@ var reolinkCameraSchema = object({
|
|
|
223644
223777
|
*/
|
|
223645
223778
|
webhookUrlGeneration: number$1().int().optional(),
|
|
223646
223779
|
/**
|
|
223780
|
+
* "Auto-configure event push on add": right after the camera is added, arm its local event push
|
|
223781
|
+
* (HaCfg webhook for a standalone battery camera, else the camera mailbox). Default on.
|
|
223782
|
+
*/
|
|
223783
|
+
autoConfigureEventPush: boolean().optional(),
|
|
223784
|
+
/**
|
|
223785
|
+
* What the one-time add-time run did (`configured:<mechanism>` | `skipped` | `failed`). Present
|
|
223786
|
+
* means the run happened: a restart never writes the camera again.
|
|
223787
|
+
*/
|
|
223788
|
+
eventPushAutoConfigured: string().optional(),
|
|
223789
|
+
/**
|
|
223647
223790
|
* On-camera motion detection master switch + sensitivity.
|
|
223648
223791
|
* Pushed via `setMotionAlarm` (cmdId=47). The Reolink mobile
|
|
223649
223792
|
* app + camera web UI use 1..50 (1 = least sensitive,
|
|
@@ -231789,6 +231932,22 @@ var SLEEP_HYSTERESIS_MS = 5e3;
|
|
|
231789
231932
|
* exactly its recovery role.
|
|
231790
231933
|
*/
|
|
231791
231934
|
var HUB_SUMMARY_SLEEP_GRACE_MS = 18e4;
|
|
231935
|
+
/**
|
|
231936
|
+
* How recent the last video packet must be for the stream to count as
|
|
231937
|
+
* flowing. A camera that is delivering video is awake, whatever a second-hand
|
|
231938
|
+
* claim says: a Home Hub child on DC power was marked sleeping every 28 min
|
|
231939
|
+
* (and by the lagging hub summary) while its RTP was running, which froze the
|
|
231940
|
+
* snapshot tile on "sleeping".
|
|
231941
|
+
*/
|
|
231942
|
+
var VIDEO_FLOW_FRESH_MS = 5e3;
|
|
231943
|
+
/**
|
|
231944
|
+
* A source that is not the camera's own reading of itself: the parent's
|
|
231945
|
+
* summaries, and a pushed `simple-event` (the Home Hub's session cut arrives
|
|
231946
|
+
* as one).
|
|
231947
|
+
*/
|
|
231948
|
+
function isSecondHand(source) {
|
|
231949
|
+
return source === "hub-summary" || source === "hub-reconcile" || source === "simple-event";
|
|
231950
|
+
}
|
|
231792
231951
|
/** A source whose verdict comes from the parent NVR's channel summary. */
|
|
231793
231952
|
function isSummarySourced(source) {
|
|
231794
231953
|
return source === "hub-summary" || source === "hub-reconcile";
|
|
@@ -231809,8 +231968,23 @@ function isSummarySourced(source) {
|
|
|
231809
231968
|
* observation inside the grace says otherwise.
|
|
231810
231969
|
*/
|
|
231811
231970
|
function decideSleepCommit(input) {
|
|
231812
|
-
const { current, next, source, lastFirstHandCommitAt, nowMs } = input;
|
|
231971
|
+
const { current, next, source, lastFirstHandCommitAt, nowMs, videoFlowing, wired } = input;
|
|
231813
231972
|
if (current === next) return { kind: "unchanged" };
|
|
231973
|
+
if (next === true && isSecondHand(source)) {
|
|
231974
|
+
const sinceMs = nowMs - lastFirstHandCommitAt;
|
|
231975
|
+
if (wired) return {
|
|
231976
|
+
kind: "refused",
|
|
231977
|
+
reason: "wired",
|
|
231978
|
+
windowMs: 0,
|
|
231979
|
+
sinceLastChangeMs: sinceMs
|
|
231980
|
+
};
|
|
231981
|
+
if (videoFlowing) return {
|
|
231982
|
+
kind: "refused",
|
|
231983
|
+
reason: "video-flowing",
|
|
231984
|
+
windowMs: VIDEO_FLOW_FRESH_MS,
|
|
231985
|
+
sinceLastChangeMs: sinceMs
|
|
231986
|
+
};
|
|
231987
|
+
}
|
|
231814
231988
|
const summarySourced = isSummarySourced(source);
|
|
231815
231989
|
const firstHandWake = source === "confirmed-wake" && next === false;
|
|
231816
231990
|
const sinceLastChangeMs = nowMs - lastFirstHandCommitAt;
|
|
@@ -231835,6 +232009,58 @@ function decideSleepCommit(input) {
|
|
|
231835
232009
|
};
|
|
231836
232010
|
}
|
|
231837
232011
|
//#endregion
|
|
232012
|
+
//#region src/session-limit.ts
|
|
232013
|
+
/**
|
|
232014
|
+
* How long the broker lets a Home Hub child's session run before it re-dials on
|
|
232015
|
+
* its own terms.
|
|
232016
|
+
*
|
|
232017
|
+
* Observed 2026-11-20 on two DC-powered children of one Home Hub: the hub cut
|
|
232018
|
+
* BOTH sessions at the same second, every 28 min 07 s (16:16:36, then 16:44:43),
|
|
232019
|
+
* which is a hub session limit, not the camera. Declared a minute under that so
|
|
232020
|
+
* the planned re-dial always wins the race against the hub's cut and the
|
|
232021
|
+
* recording rolls over at a time of our choosing.
|
|
232022
|
+
*/
|
|
232023
|
+
var HOME_HUB_SESSION_LIMIT_MS = 27 * 6e4;
|
|
232024
|
+
/**
|
|
232025
|
+
* Stamp the descriptors with the session limit the broker acts on. Only a
|
|
232026
|
+
* battery child of a hub gets one: a standalone camera has no such cut, and
|
|
232027
|
+
* declaring one there would re-dial a healthy stream for nothing.
|
|
232028
|
+
*/
|
|
232029
|
+
function withSessionLimit(descriptors, input) {
|
|
232030
|
+
if (!input.isHubChild || !input.isBattery) return [...descriptors];
|
|
232031
|
+
return descriptors.map((d) => ({
|
|
232032
|
+
...d,
|
|
232033
|
+
maxSessionMs: HOME_HUB_SESSION_LIMIT_MS
|
|
232034
|
+
}));
|
|
232035
|
+
}
|
|
232036
|
+
//#endregion
|
|
232037
|
+
//#region src/video-flow.ts
|
|
232038
|
+
/**
|
|
232039
|
+
* Report every video packet a stream server produces. The three stream kinds
|
|
232040
|
+
* the server can sit on name the same event differently (`videoFrame` for the
|
|
232041
|
+
* native and composite streams, `videoAccessUnit` for the always-on one), so
|
|
232042
|
+
* the kind is narrowed by class, not asserted.
|
|
232043
|
+
*
|
|
232044
|
+
* Returns the unsubscribe. A stream kind this does not know is reported
|
|
232045
|
+
* through `onUnknown` and never watched — silence would read as "no video".
|
|
232046
|
+
*/
|
|
232047
|
+
function watchVideoFlow(stream, onFlow, onUnknown) {
|
|
232048
|
+
if (stream instanceof require_chunk_LXENEW4N.BaichuanVideoStream || stream instanceof CompositeStream) {
|
|
232049
|
+
stream.on("videoFrame", onFlow);
|
|
232050
|
+
return () => {
|
|
232051
|
+
stream.off("videoFrame", onFlow);
|
|
232052
|
+
};
|
|
232053
|
+
}
|
|
232054
|
+
if (stream instanceof ContinuousVideoStream) {
|
|
232055
|
+
stream.on("videoAccessUnit", onFlow);
|
|
232056
|
+
return () => {
|
|
232057
|
+
stream.off("videoAccessUnit", onFlow);
|
|
232058
|
+
};
|
|
232059
|
+
}
|
|
232060
|
+
onUnknown();
|
|
232061
|
+
return () => {};
|
|
232062
|
+
}
|
|
232063
|
+
//#endregion
|
|
231838
232064
|
//#region src/snapshot-wake-gate.ts
|
|
231839
232065
|
/**
|
|
231840
232066
|
* Decide whether a snapshot read may reach the camera's socket.
|
|
@@ -231858,6 +232084,74 @@ function decideSnapshotCameraAccess(input) {
|
|
|
231858
232084
|
};
|
|
231859
232085
|
}
|
|
231860
232086
|
//#endregion
|
|
232087
|
+
//#region src/event-push-on-add.ts
|
|
232088
|
+
function reasonOf(err) {
|
|
232089
|
+
return err instanceof Error ? err.message : String(err);
|
|
232090
|
+
}
|
|
232091
|
+
async function decide(ports) {
|
|
232092
|
+
if (!ports.enabled()) return {
|
|
232093
|
+
status: "skipped",
|
|
232094
|
+
reason: "auto-configure event push on add is switched off"
|
|
232095
|
+
};
|
|
232096
|
+
if (!ports.isEligible()) return {
|
|
232097
|
+
status: "skipped",
|
|
232098
|
+
reason: "hub-attached camera: the hub owns its event push, no email or webhook is written"
|
|
232099
|
+
};
|
|
232100
|
+
const method = ports.method();
|
|
232101
|
+
const webhookPossible = ports.isBattery() && method !== "email";
|
|
232102
|
+
const failures = [];
|
|
232103
|
+
if (webhookPossible) try {
|
|
232104
|
+
await ports.configureWebhook();
|
|
232105
|
+
return {
|
|
232106
|
+
status: "configured",
|
|
232107
|
+
mechanism: "webhook"
|
|
232108
|
+
};
|
|
232109
|
+
} catch (err) {
|
|
232110
|
+
failures.push(`webhook: ${reasonOf(err)}`);
|
|
232111
|
+
if (method === "webhook") return {
|
|
232112
|
+
status: "failed",
|
|
232113
|
+
reason: failures.join("; ")
|
|
232114
|
+
};
|
|
232115
|
+
}
|
|
232116
|
+
else if (method === "webhook") return {
|
|
232117
|
+
status: "skipped",
|
|
232118
|
+
reason: "the webhook needs a standalone battery camera and this one is not"
|
|
232119
|
+
};
|
|
232120
|
+
try {
|
|
232121
|
+
await ports.configureEmail();
|
|
232122
|
+
return {
|
|
232123
|
+
status: "configured",
|
|
232124
|
+
mechanism: "email"
|
|
232125
|
+
};
|
|
232126
|
+
} catch (err) {
|
|
232127
|
+
failures.push(`email: ${reasonOf(err)}`);
|
|
232128
|
+
return {
|
|
232129
|
+
status: "failed",
|
|
232130
|
+
reason: failures.join("; ")
|
|
232131
|
+
};
|
|
232132
|
+
}
|
|
232133
|
+
}
|
|
232134
|
+
/**
|
|
232135
|
+
* Arm a camera's local event push ONCE, right after it is added. A failure is an outcome, never
|
|
232136
|
+
* a throw: it must not block the add. The outcome is logged and recorded, and a recorded camera
|
|
232137
|
+
* is never written again. Battery cameras prefer the webhook (it works while asleep) and fall back
|
|
232138
|
+
* to the camera mailbox; only one path is armed, so events are not delivered twice.
|
|
232139
|
+
*/
|
|
232140
|
+
async function autoConfigureEventPushOnce(ports) {
|
|
232141
|
+
if (ports.recordedOutcome() !== void 0) return "already-ran";
|
|
232142
|
+
const outcome = await decide(ports);
|
|
232143
|
+
ports.log(outcome);
|
|
232144
|
+
try {
|
|
232145
|
+
await ports.record(outcome);
|
|
232146
|
+
} catch (err) {
|
|
232147
|
+
ports.log({
|
|
232148
|
+
status: "failed",
|
|
232149
|
+
reason: `could not record the run: ${reasonOf(err)}`
|
|
232150
|
+
});
|
|
232151
|
+
}
|
|
232152
|
+
return outcome;
|
|
232153
|
+
}
|
|
232154
|
+
//#endregion
|
|
231861
232155
|
//#region src/webhook-generation.ts
|
|
231862
232156
|
/**
|
|
231863
232157
|
* Point a battery camera's webhook at the data-plane URL ONCE per URL generation.
|
|
@@ -234570,6 +234864,7 @@ function buildPowerSourceSettingsSection(input) {
|
|
|
234570
234864
|
label: "Power source",
|
|
234571
234865
|
labelKey: "provider-reolink:schema.s_power-source.powerSource.label",
|
|
234572
234866
|
default: source,
|
|
234867
|
+
required: true,
|
|
234573
234868
|
options: [{
|
|
234574
234869
|
value: "adapter",
|
|
234575
234870
|
label: "Wired power",
|
|
@@ -234595,6 +234890,58 @@ async function applyPowerSourceSetting(target, value) {
|
|
|
234595
234890
|
if (!outcome.applied) throw new Error(`The camera did not take the power source switch (it reports ${outcome.after})`);
|
|
234596
234891
|
}
|
|
234597
234892
|
//#endregion
|
|
234893
|
+
//#region src/keep-awake-loop.ts
|
|
234894
|
+
/**
|
|
234895
|
+
* Stream-scoped keep-awake for a battery camera. While at least one stream
|
|
234896
|
+
* consumer is attached, a periodic wake keeps the firmware from entering
|
|
234897
|
+
* standby (which would stop the video). One timer per camera; started when the
|
|
234898
|
+
* first consumer attaches, stopped when the last one leaves.
|
|
234899
|
+
*
|
|
234900
|
+
* Pure: the timer and the wake call are injected so the loop is testable.
|
|
234901
|
+
*/
|
|
234902
|
+
var KEEP_AWAKE_INTERVAL_MS = 2e4;
|
|
234903
|
+
function createKeepAwakeLoop(deps) {
|
|
234904
|
+
let handle = null;
|
|
234905
|
+
let failing = false;
|
|
234906
|
+
const tick = () => {
|
|
234907
|
+
deps.wake().then(() => {
|
|
234908
|
+
failing = false;
|
|
234909
|
+
}).catch((err) => {
|
|
234910
|
+
const first = !failing;
|
|
234911
|
+
failing = true;
|
|
234912
|
+
try {
|
|
234913
|
+
deps.onFailure(err, first);
|
|
234914
|
+
} catch {}
|
|
234915
|
+
});
|
|
234916
|
+
};
|
|
234917
|
+
const arm = () => {
|
|
234918
|
+
handle = deps.setTimer(() => {
|
|
234919
|
+
if (handle === null) return;
|
|
234920
|
+
tick();
|
|
234921
|
+
arm();
|
|
234922
|
+
}, deps.intervalMs);
|
|
234923
|
+
};
|
|
234924
|
+
const halt = (activeStreams) => {
|
|
234925
|
+
if (handle === null) return;
|
|
234926
|
+
deps.clearTimer(handle);
|
|
234927
|
+
handle = null;
|
|
234928
|
+
failing = false;
|
|
234929
|
+
deps.onStop(activeStreams);
|
|
234930
|
+
};
|
|
234931
|
+
return {
|
|
234932
|
+
sync: (activeStreams) => {
|
|
234933
|
+
if (!deps.isBattery()) return;
|
|
234934
|
+
if (activeStreams > 0) {
|
|
234935
|
+
if (handle !== null) return;
|
|
234936
|
+
arm();
|
|
234937
|
+
deps.onStart(activeStreams);
|
|
234938
|
+
} else halt(activeStreams);
|
|
234939
|
+
},
|
|
234940
|
+
stop: () => halt(0),
|
|
234941
|
+
running: () => handle !== null
|
|
234942
|
+
};
|
|
234943
|
+
}
|
|
234944
|
+
//#endregion
|
|
234598
234945
|
//#region src/ptz-zoom.ts
|
|
234599
234946
|
/**
|
|
234600
234947
|
* Fraction of total zoom travel moved by ONE press. ~8 presses to cross
|
|
@@ -235706,8 +236053,44 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
235706
236053
|
nextEventHealthCheckAt = 0;
|
|
235707
236054
|
/** Active video streams keyed by camStreamId. */
|
|
235708
236055
|
active = /* @__PURE__ */ new Map();
|
|
236056
|
+
/**
|
|
236057
|
+
* Stream-scoped keep-awake (battery only): while a consumer holds a stream,
|
|
236058
|
+
* a periodic wake stops the firmware from entering standby. Reconciled with
|
|
236059
|
+
* `this.active` through `syncKeepAwake()` after every mutation of the map.
|
|
236060
|
+
*/
|
|
236061
|
+
keepAwake = createKeepAwakeLoop({
|
|
236062
|
+
intervalMs: KEEP_AWAKE_INTERVAL_MS,
|
|
236063
|
+
isBattery: () => this.isBattery,
|
|
236064
|
+
wake: async () => {
|
|
236065
|
+
await (await this.ensureApi()).wakeUp(this.getChannel(), {
|
|
236066
|
+
attempts: 1,
|
|
236067
|
+
waitAfterWakeMs: 0
|
|
236068
|
+
});
|
|
236069
|
+
},
|
|
236070
|
+
setTimer: (fn, ms) => setTimeout(fn, ms),
|
|
236071
|
+
clearTimer: (h) => clearTimeout(h),
|
|
236072
|
+
onStart: (activeStreams) => this.ctx.logger.info("keep-awake: started", {
|
|
236073
|
+
tags: { deviceId: this.id },
|
|
236074
|
+
meta: { activeStreams }
|
|
236075
|
+
}),
|
|
236076
|
+
onStop: (activeStreams) => this.ctx.logger.info("keep-awake: stopped", {
|
|
236077
|
+
tags: { deviceId: this.id },
|
|
236078
|
+
meta: { activeStreams }
|
|
236079
|
+
}),
|
|
236080
|
+
onFailure: (err, first) => {
|
|
236081
|
+
(first ? this.ctx.logger.info.bind(this.ctx.logger) : this.ctx.logger.debug.bind(this.ctx.logger))("keep-awake: wake failed", {
|
|
236082
|
+
tags: { deviceId: this.id },
|
|
236083
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
236084
|
+
});
|
|
236085
|
+
}
|
|
236086
|
+
});
|
|
236087
|
+
syncKeepAwake() {
|
|
236088
|
+
this.keepAwake.sync(this.active.size);
|
|
236089
|
+
}
|
|
235709
236090
|
/** Login lock — concurrent demand events must not race the login flow. */
|
|
235710
236091
|
loginPromise = null;
|
|
236092
|
+
/** Wall-clock ms of the last video packet the stream server produced; 0 = none yet. */
|
|
236093
|
+
lastVideoFlowAt = 0;
|
|
235711
236094
|
/** True once we've discovered (via getBatteryInfo) that this is a battery cam. */
|
|
235712
236095
|
isBattery = false;
|
|
235713
236096
|
/**
|
|
@@ -236791,6 +237174,39 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
236791
237174
|
});
|
|
236792
237175
|
}
|
|
236793
237176
|
/**
|
|
237177
|
+
* Arm this camera's local event push ONCE, right after it is added (the provider's
|
|
237178
|
+
* `onAfterCreate`). Reuses `autoConfigureBaichuanWebhook` / `autoConfigureEmailPush` as they
|
|
237179
|
+
* are; the outcome is logged and recorded, and never throws: it must not block the add.
|
|
237180
|
+
*/
|
|
237181
|
+
async autoConfigureEventPushOnAdd() {
|
|
237182
|
+
return await autoConfigureEventPushOnce({
|
|
237183
|
+
enabled: () => this.config.get("autoConfigureEventPush") !== false,
|
|
237184
|
+
recordedOutcome: () => this.config.get("eventPushAutoConfigured"),
|
|
237185
|
+
isEligible: () => this.isEmailPushEligible,
|
|
237186
|
+
isBattery: () => this.isBattery,
|
|
237187
|
+
method: () => this.config.get("batterySleepPushMethod") ?? "auto",
|
|
237188
|
+
configureWebhook: async () => await this.autoConfigureBaichuanWebhook(),
|
|
237189
|
+
configureEmail: async () => await this.autoConfigureEmailPush(),
|
|
237190
|
+
record: async (outcome) => {
|
|
237191
|
+
await this.config.setAll({ eventPushAutoConfigured: outcome.status === "configured" ? `configured:${outcome.mechanism}` : outcome.status });
|
|
237192
|
+
},
|
|
237193
|
+
log: (outcome) => {
|
|
237194
|
+
if (outcome.status === "configured") this.ctx.logger.info("event-push: auto-configured on add", {
|
|
237195
|
+
tags: { deviceId: this.id },
|
|
237196
|
+
meta: { mechanism: outcome.mechanism }
|
|
237197
|
+
});
|
|
237198
|
+
else if (outcome.status === "skipped") this.ctx.logger.info("event-push: auto-configure on add skipped", {
|
|
237199
|
+
tags: { deviceId: this.id },
|
|
237200
|
+
meta: { reason: outcome.reason }
|
|
237201
|
+
});
|
|
237202
|
+
else this.ctx.logger.warn("event-push: auto-configure on add failed", {
|
|
237203
|
+
tags: { deviceId: this.id },
|
|
237204
|
+
meta: { reason: outcome.reason }
|
|
237205
|
+
});
|
|
237206
|
+
}
|
|
237207
|
+
});
|
|
237208
|
+
}
|
|
237209
|
+
/**
|
|
236794
237210
|
* Move this battery camera's HaCfg webhook to the addon's data-plane URL, once, on the first
|
|
236795
237211
|
* Baichuan contact after the upgrade (the camera is awake: this costs no wake). Only a camera
|
|
236796
237212
|
* that is armed is touched; a failure is logged and retried at the next contact.
|
|
@@ -237276,17 +237692,20 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
237276
237692
|
next,
|
|
237277
237693
|
source,
|
|
237278
237694
|
lastFirstHandCommitAt: this.sleepStateChangedAt,
|
|
237279
|
-
nowMs: Date.now()
|
|
237695
|
+
nowMs: Date.now(),
|
|
237696
|
+
videoFlowing: Date.now() - this.lastVideoFlowAt < VIDEO_FLOW_FRESH_MS,
|
|
237697
|
+
wired: this.config.get("deviceCache")?.powerSourceSnapshot?.source === "adapter"
|
|
237280
237698
|
});
|
|
237281
237699
|
if (decision.kind === "unchanged") return false;
|
|
237282
237700
|
if (decision.kind === "refused") {
|
|
237283
|
-
this.ctx.logger.debug(decision.reason === "hysteresis" ? "ignoring sleep inference flap within hysteresis window" : "hub-summary sleep flip refused — fresher first-hand state inside grace", {
|
|
237701
|
+
(decision.reason === "video-flowing" || decision.reason === "wired" ? this.ctx.logger.info.bind(this.ctx.logger) : this.ctx.logger.debug.bind(this.ctx.logger))(decision.reason === "hysteresis" ? "ignoring sleep inference flap within hysteresis window" : decision.reason === "video-flowing" ? "sleep claim refused — video is flowing" : decision.reason === "wired" ? "sleep claim refused — camera is on a wired power source" : "hub-summary sleep flip refused — fresher first-hand state inside grace", {
|
|
237284
237702
|
tags: { deviceId: this.id },
|
|
237285
237703
|
meta: {
|
|
237286
237704
|
next,
|
|
237287
237705
|
source,
|
|
237288
237706
|
windowMs: decision.windowMs,
|
|
237289
|
-
sinceLastChangeMs: decision.sinceLastChangeMs
|
|
237707
|
+
sinceLastChangeMs: decision.sinceLastChangeMs,
|
|
237708
|
+
reason: decision.reason
|
|
237290
237709
|
}
|
|
237291
237710
|
});
|
|
237292
237711
|
return false;
|
|
@@ -240274,7 +240693,10 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240274
240693
|
* See `native-sdp-overlay.ts`.
|
|
240275
240694
|
*/
|
|
240276
240695
|
withLiveNativeSdp(descriptors) {
|
|
240277
|
-
return overlayLiveNativeRfc4571Sdp(descriptors,
|
|
240696
|
+
return overlayLiveNativeRfc4571Sdp(withSessionLimit(descriptors, {
|
|
240697
|
+
isHubChild: this.isHubChild(),
|
|
240698
|
+
isBattery: this.isBattery
|
|
240699
|
+
}), (camStreamId) => {
|
|
240278
240700
|
const server = this.active.get(camStreamId)?.server;
|
|
240279
240701
|
if (!server?.server?.listening) return null;
|
|
240280
240702
|
return {
|
|
@@ -240576,6 +240998,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240576
240998
|
...entry.fps !== void 0 ? { fps: entry.fps } : {},
|
|
240577
240999
|
...entry.codec !== void 0 ? { codec: entry.codec } : {},
|
|
240578
241000
|
...entry.metadata ? { metadata: entry.metadata } : {},
|
|
241001
|
+
...entry.maxSessionMs !== void 0 ? { maxSessionMs: entry.maxSessionMs } : {},
|
|
240579
241002
|
deviceFeatures: entry.deviceFeatures ?? [...this.features],
|
|
240580
241003
|
autoEligible: entry.autoEligible ?? true
|
|
240581
241004
|
});
|
|
@@ -240655,6 +241078,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240655
241078
|
this.stopBatteryUpdatePolling();
|
|
240656
241079
|
this.stopAlignAuxPolling();
|
|
240657
241080
|
this.stopWatchdogs();
|
|
241081
|
+
this.keepAwake.stop();
|
|
240658
241082
|
this.detachFromHubSession();
|
|
240659
241083
|
if (this.reconnectTimer) {
|
|
240660
241084
|
clearTimeout(this.reconnectTimer);
|
|
@@ -240700,6 +241124,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240700
241124
|
await existing.server.close("recreate");
|
|
240701
241125
|
} catch {}
|
|
240702
241126
|
this.active.delete(camStreamId);
|
|
241127
|
+
this.syncKeepAwake();
|
|
240703
241128
|
}
|
|
240704
241129
|
let api;
|
|
240705
241130
|
try {
|
|
@@ -240747,9 +241172,18 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240747
241172
|
server
|
|
240748
241173
|
};
|
|
240749
241174
|
this.active.set(camStreamId, entry);
|
|
241175
|
+
this.syncKeepAwake();
|
|
241176
|
+
const stopVideoWatch = watchVideoFlow(server.videoStream, () => {
|
|
241177
|
+
this.lastVideoFlowAt = Date.now();
|
|
241178
|
+
}, () => this.ctx.logger.warn("rfc4571: unknown video stream kind — video flow not observed", { tags: {
|
|
241179
|
+
deviceId: this.id,
|
|
241180
|
+
camStreamId
|
|
241181
|
+
} }));
|
|
240750
241182
|
server.server.once("close", () => {
|
|
241183
|
+
stopVideoWatch();
|
|
240751
241184
|
if (this.active.get(camStreamId)?.server === server) {
|
|
240752
241185
|
this.active.delete(camStreamId);
|
|
241186
|
+
this.syncKeepAwake();
|
|
240753
241187
|
this.ctx.logger.debug("rfc4571: server closed — evicting cache entry", { tags: {
|
|
240754
241188
|
deviceId: this.id,
|
|
240755
241189
|
camStreamId
|
|
@@ -240804,6 +241238,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240804
241238
|
async closeActiveStreams(reason) {
|
|
240805
241239
|
const entries = [...this.active.values()];
|
|
240806
241240
|
this.active.clear();
|
|
241241
|
+
this.keepAwake.stop();
|
|
240807
241242
|
if (entries.length === 0) return;
|
|
240808
241243
|
this.ctx.logger.debug("Closing active RFC 4571 servers", {
|
|
240809
241244
|
tags: { deviceId: this.id },
|
|
@@ -241487,6 +241922,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241487
241922
|
this.stopWatchdogs();
|
|
241488
241923
|
const entries = [...this.active.values()];
|
|
241489
241924
|
this.active.clear();
|
|
241925
|
+
this.keepAwake.stop();
|
|
241490
241926
|
for (const entry of entries) try {
|
|
241491
241927
|
await entry.server.close("disconnect-all");
|
|
241492
241928
|
} catch {}
|
|
@@ -243921,6 +244357,21 @@ function buildCreationFormSchema() {
|
|
|
243921
244357
|
}
|
|
243922
244358
|
}
|
|
243923
244359
|
]
|
|
244360
|
+
},
|
|
244361
|
+
{
|
|
244362
|
+
id: "events",
|
|
244363
|
+
title: "Events",
|
|
244364
|
+
titleKey: "provider-reolink:creation.s_events.title",
|
|
244365
|
+
columns: 1,
|
|
244366
|
+
fields: [{
|
|
244367
|
+
type: "boolean",
|
|
244368
|
+
key: "autoConfigureEventPush",
|
|
244369
|
+
label: "Auto-configure event push on add",
|
|
244370
|
+
labelKey: "provider-reolink:creation.s_events.autoConfigureEventPush.label",
|
|
244371
|
+
description: "Once, right after the camera is added, set up its local push (webhook or camera mailbox) so motion and AI events reach CamStack.",
|
|
244372
|
+
descriptionKey: "provider-reolink:creation.s_events.autoConfigureEventPush.description",
|
|
244373
|
+
default: true
|
|
244374
|
+
}]
|
|
243924
244375
|
}
|
|
243925
244376
|
] };
|
|
243926
244377
|
}
|
|
@@ -246726,6 +247177,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
246726
247177
|
const emailBridge = this.ensureEmailBridge();
|
|
246727
247178
|
device.setEmailPushParamsResolver(() => emailBridge.buildCameraSetupParams(device));
|
|
246728
247179
|
device.setBaichuanWebhookParamsResolver(() => this.buildWebhookParams(device));
|
|
247180
|
+
device.autoConfigureEventPushOnAdd().catch((err) => {
|
|
247181
|
+
ctx.logger.warn("event-push: auto-configure on add threw", {
|
|
247182
|
+
tags: { deviceId: device.id },
|
|
247183
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
247184
|
+
});
|
|
247185
|
+
});
|
|
246729
247186
|
}
|
|
246730
247187
|
ctx.api?.pipelineOrchestrator?.applyDeviceSettingsPatch?.mutate({
|
|
246731
247188
|
deviceId: device.id,
|