@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.mjs
CHANGED
|
@@ -100690,7 +100690,7 @@ function parseBaichuanWebhookObject(mess) {
|
|
|
100690
100690
|
return parsed;
|
|
100691
100691
|
}
|
|
100692
100692
|
//#endregion
|
|
100693
|
-
//#region ../types/dist/event-category-
|
|
100693
|
+
//#region ../types/dist/event-category-BEsBTS72.mjs
|
|
100694
100694
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
100695
100695
|
EventCategory["SystemBoot"] = "system.boot";
|
|
100696
100696
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -101137,6 +101137,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
101137
101137
|
*/
|
|
101138
101138
|
EventCategory["StreamBrokerOnRequestStreamSourceRefresh"] = "stream-broker.onRequestStreamSourceRefresh";
|
|
101139
101139
|
/**
|
|
101140
|
+
* A broker RE-DIALED its source (every dial after the first). A consumer that
|
|
101141
|
+
* reads the broker over a transport that does not announce the cut — the
|
|
101142
|
+
* recorder's ffmpeg writer — learns here instead of through its idle clock.
|
|
101143
|
+
* Telemetry: a dropped event only means the idle clock recovers it later.
|
|
101144
|
+
* Payload: `{ deviceId, camStreamId, brokerId, reason }`.
|
|
101145
|
+
*/
|
|
101146
|
+
EventCategory["StreamBrokerOnSourceRestart"] = "stream-broker.onSourceRestart";
|
|
101147
|
+
/**
|
|
101140
101148
|
* A camera provider changed a device's stream parameters (codec /
|
|
101141
101149
|
* resolution / bitrate / a stream added or removed). A LOW-LATENCY NUDGE
|
|
101142
101150
|
* for the stream-broker's catalog reconcile: it carries NO authoritative
|
|
@@ -106813,7 +106821,7 @@ var ZodIssueCode = {
|
|
|
106813
106821
|
var ZodFirstPartyTypeKind;
|
|
106814
106822
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
106815
106823
|
//#endregion
|
|
106816
|
-
//#region ../types/dist/runtime-capabilities-
|
|
106824
|
+
//#region ../types/dist/runtime-capabilities-CG61dYnO.mjs
|
|
106817
106825
|
/**
|
|
106818
106826
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
106819
106827
|
* window to float samples (D455).
|
|
@@ -111679,6 +111687,15 @@ var CameraStreamSchema = object({
|
|
|
111679
111687
|
*/
|
|
111680
111688
|
autoEligible: boolean().optional(),
|
|
111681
111689
|
/**
|
|
111690
|
+
* The longest continuous session the SOURCE will keep open, in ms, declared by
|
|
111691
|
+
* the provider that knows it (a hub that cuts every child's session on a
|
|
111692
|
+
* timer). Absent = no limit. The broker re-dials a live source a little
|
|
111693
|
+
* BEFORE this elapses, on its own terms and announced to consumers, so the
|
|
111694
|
+
* source's cut never lands mid-recording. Declare slightly under what was
|
|
111695
|
+
* observed.
|
|
111696
|
+
*/
|
|
111697
|
+
maxSessionMs: number$1().int().positive().optional(),
|
|
111698
|
+
/**
|
|
111682
111699
|
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
111683
111700
|
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
111684
111701
|
* stream. Consulted by the broker's automatic ranking
|
|
@@ -127374,7 +127391,7 @@ function e(group, en, it, flags = {}) {
|
|
|
127374
127391
|
};
|
|
127375
127392
|
}
|
|
127376
127393
|
var N = { noise: true };
|
|
127377
|
-
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", {
|
|
127394
|
+
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", {
|
|
127378
127395
|
noise: true,
|
|
127379
127396
|
deprecated: true
|
|
127380
127397
|
}), EventCategory.PipelineAnalyticsTrackEnded, e("detection", "Track ended", "Traccia terminata", {
|
|
@@ -154122,8 +154139,15 @@ function convertLegacyWhen(half) {
|
|
|
154122
154139
|
/** The longest one `wait` step lasts. It is cut by a restart of the run and does not survive a hub restart. */
|
|
154123
154140
|
var WAIT_MAX_SECONDS = 3600;
|
|
154124
154141
|
var WAIT_TOO_LONG = `a wait is at most one hour (${WAIT_MAX_SECONDS} s)`;
|
|
154142
|
+
/**
|
|
154143
|
+
* Every step kind may be switched off without deleting it: `enabled: false`
|
|
154144
|
+
* skips the step (and, for a block step, its whole subtree), traced `disabled`.
|
|
154145
|
+
* Absent means enabled.
|
|
154146
|
+
*/
|
|
154147
|
+
var stepEnabledShape = { enabled: boolean().optional() };
|
|
154125
154148
|
var AutomationWaitStepSchema = object({
|
|
154126
154149
|
kind: literal("wait"),
|
|
154150
|
+
...stepEnabledShape,
|
|
154127
154151
|
seconds: number$1().min(0).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG)
|
|
154128
154152
|
});
|
|
154129
154153
|
/**
|
|
@@ -154132,6 +154156,7 @@ var AutomationWaitStepSchema = object({
|
|
|
154132
154156
|
*/
|
|
154133
154157
|
var AutomationCommandStepBaseSchema = object({
|
|
154134
154158
|
kind: literal("command"),
|
|
154159
|
+
...stepEnabledShape,
|
|
154135
154160
|
/** WHO the step acts on. */
|
|
154136
154161
|
target: ActionTargetSchema,
|
|
154137
154162
|
/** The vocabulary action this step performs (`cover.open`). */
|
|
@@ -154207,6 +154232,7 @@ var AutomationGuardedCommandStepSchema = AutomationCommandStepBaseSchema.extend(
|
|
|
154207
154232
|
/** End the run here, on purpose. `reason` may carry `{{vars.x}}` slots. */
|
|
154208
154233
|
var AutomationStopStepSchema = object({
|
|
154209
154234
|
kind: literal("stop"),
|
|
154235
|
+
...stepEnabledShape,
|
|
154210
154236
|
reason: string().min(1, "a stop needs a reason: it is what the run trace shows").max(200),
|
|
154211
154237
|
/** `ok`: the run ends as a success. `failed`: it ends as a failure, with the reason. */
|
|
154212
154238
|
outcome: _enum(["ok", "failed"]),
|
|
@@ -154226,6 +154252,7 @@ var RESERVED_RUN_VARS = [
|
|
|
154226
154252
|
*/
|
|
154227
154253
|
var AutomationSetStepSchema = object({
|
|
154228
154254
|
kind: literal("set"),
|
|
154255
|
+
...stepEnabledShape,
|
|
154229
154256
|
vars: record(string(), union([
|
|
154230
154257
|
string().max(500),
|
|
154231
154258
|
number$1(),
|
|
@@ -154234,8 +154261,25 @@ var AutomationSetStepSchema = object({
|
|
|
154234
154261
|
/** Set only when this reads true; false or unknown leaves the bag as it is. */
|
|
154235
154262
|
if: AutomationWhenSchema.optional()
|
|
154236
154263
|
});
|
|
154264
|
+
var NOTIFY_BODY_MAX = 2e3;
|
|
154265
|
+
/**
|
|
154266
|
+
* Send a notification through one notification target (the same targets the
|
|
154267
|
+
* notification centre addresses). Title and body may carry `{{vars.x}}` slots.
|
|
154268
|
+
* Not a device command: a notification target is an instance of the
|
|
154269
|
+
* `notification-output` cap, not a device.
|
|
154270
|
+
*/
|
|
154271
|
+
var AutomationNotifyStepSchema = object({
|
|
154272
|
+
kind: literal("notify"),
|
|
154273
|
+
...stepEnabledShape,
|
|
154274
|
+
/** The notification target (an instance id of `notification-output`). */
|
|
154275
|
+
targetId: string().min(1, "pick the notification target"),
|
|
154276
|
+
title: string().max(200).optional(),
|
|
154277
|
+
body: string().min(1, "a notification needs a message").max(NOTIFY_BODY_MAX),
|
|
154278
|
+
...continueOnErrorShape
|
|
154279
|
+
});
|
|
154237
154280
|
var AutomationRunActionStepSchema = object({
|
|
154238
154281
|
kind: literal("action"),
|
|
154282
|
+
...stepEnabledShape,
|
|
154239
154283
|
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
154240
154284
|
actionId: string().min(1),
|
|
154241
154285
|
/** Values for the action's declared variables; the others take their default. */
|
|
@@ -154261,6 +154305,7 @@ var WAIT_UNTIL_TIMEOUT_MAX_S = 21600;
|
|
|
154261
154305
|
*/
|
|
154262
154306
|
var AutomationWaitUntilStepSchema = object({
|
|
154263
154307
|
kind: literal("wait-until"),
|
|
154308
|
+
...stepEnabledShape,
|
|
154264
154309
|
when: AutomationWhenSchema,
|
|
154265
154310
|
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)`),
|
|
154266
154311
|
onTimeout: _enum(["continue", "stop"])
|
|
@@ -154286,7 +154331,8 @@ var plainStepSchemas = [
|
|
|
154286
154331
|
AutomationCommandStepBaseSchema.extend(continueOnErrorShape).strict().superRefine(refineKnownAction),
|
|
154287
154332
|
AutomationStopStepSchema.omit({ if: true }).strict(),
|
|
154288
154333
|
AutomationSetStepSchema.omit({ if: true }).strict(),
|
|
154289
|
-
AutomationRunActionStepSchema.strict()
|
|
154334
|
+
AutomationRunActionStepSchema.strict(),
|
|
154335
|
+
AutomationNotifyStepSchema.strict()
|
|
154290
154336
|
];
|
|
154291
154337
|
/**
|
|
154292
154338
|
* A plain step: a flow step with no condition of its own and no step inside
|
|
@@ -154294,7 +154340,7 @@ var plainStepSchemas = [
|
|
|
154294
154340
|
*/
|
|
154295
154341
|
var AutomationBranchStepSchema = discriminatedUnion("kind", plainStepSchemas, { error: nestTooDeep });
|
|
154296
154342
|
/** A step that can run beside others: it writes no variable and does not end the run. */
|
|
154297
|
-
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");
|
|
154343
|
+
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");
|
|
154298
154344
|
/**
|
|
154299
154345
|
* Several steps at once (#500): all are started together and all are awaited.
|
|
154300
154346
|
* A failure fails the run once the others finished, as in a sequence; a member
|
|
@@ -154302,6 +154348,7 @@ var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) =>
|
|
|
154302
154348
|
*/
|
|
154303
154349
|
var AutomationParallelStepSchema = object({
|
|
154304
154350
|
kind: literal("parallel"),
|
|
154351
|
+
...stepEnabledShape,
|
|
154305
154352
|
steps: array(AutomationParallelMemberSchema).min(2, "a parallel needs at least two steps").max(5, `a parallel takes at most 5 steps`)
|
|
154306
154353
|
}).strict();
|
|
154307
154354
|
var REPEAT_NEEDS_MAX = "a repeat on a condition needs a maximum number of iterations";
|
|
@@ -154342,6 +154389,7 @@ var AutomationRepeatLoopSchema = discriminatedUnion("by", [
|
|
|
154342
154389
|
function repeatSchemaOf(step) {
|
|
154343
154390
|
return object({
|
|
154344
154391
|
kind: literal("repeat"),
|
|
154392
|
+
...stepEnabledShape,
|
|
154345
154393
|
loop: AutomationRepeatLoopSchema,
|
|
154346
154394
|
steps: array(step).min(1, "a repeat needs at least one step").max(10, `a repeat takes at most 10 steps`)
|
|
154347
154395
|
}).strict();
|
|
@@ -154357,6 +154405,7 @@ function chooseSchemaOf(step) {
|
|
|
154357
154405
|
const steps = array(step).max(10);
|
|
154358
154406
|
return object({
|
|
154359
154407
|
kind: literal("choose"),
|
|
154408
|
+
...stepEnabledShape,
|
|
154360
154409
|
branches: array(object({
|
|
154361
154410
|
if: AutomationWhenSchema,
|
|
154362
154411
|
steps: steps.min(1, "a branch needs at least one step")
|
|
@@ -154382,8 +154431,10 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
154382
154431
|
AutomationParallelStepSchema,
|
|
154383
154432
|
AutomationRepeatStepSchema,
|
|
154384
154433
|
AutomationRunActionStepSchema,
|
|
154434
|
+
AutomationNotifyStepSchema,
|
|
154385
154435
|
object({
|
|
154386
154436
|
kind: literal("code"),
|
|
154437
|
+
...stepEnabledShape,
|
|
154387
154438
|
/** Compiled into the automation's OWN block by esbuild — not a third
|
|
154388
154439
|
* runtime, not a `vm`, and not dynamically evaluated. */
|
|
154389
154440
|
code: string().min(1).max(2e4)
|
|
@@ -159383,6 +159434,8 @@ method(object({
|
|
|
159383
159434
|
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
159384
159435
|
profileHint: CamProfileSchema.optional(),
|
|
159385
159436
|
metadata: record(string(), unknown()).optional(),
|
|
159437
|
+
/** The longest session the source keeps open (ms) — see `CameraStreamSchema.maxSessionMs`. */
|
|
159438
|
+
maxSessionMs: number$1().int().positive().optional(),
|
|
159386
159439
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
159387
159440
|
* derived broker reads its encoded plane from.
|
|
159388
159441
|
* The runtime guard (broker manager, Task 10) enforces presence for
|
|
@@ -159601,6 +159654,11 @@ method(object({
|
|
|
159601
159654
|
deviceId: number$1().int().nonnegative(),
|
|
159602
159655
|
camStreamId: string(),
|
|
159603
159656
|
brokerId: string()
|
|
159657
|
+
})), event(object({
|
|
159658
|
+
deviceId: number$1().int().nonnegative(),
|
|
159659
|
+
camStreamId: string(),
|
|
159660
|
+
brokerId: string(),
|
|
159661
|
+
reason: string()
|
|
159604
159662
|
})), NOT_A_DEVICE.PIPELINE;
|
|
159605
159663
|
var StreamCodecSchema = _enum([
|
|
159606
159664
|
"h264",
|
|
@@ -169143,6 +169201,15 @@ var DeviceFaultSchema = object({
|
|
|
169143
169201
|
label: string(),
|
|
169144
169202
|
severity: DeviceErrorSeveritySchema
|
|
169145
169203
|
});
|
|
169204
|
+
/** One kind of fault a device CAN raise: the integration's own declared catalog entry. */
|
|
169205
|
+
var DeviceFaultTypeSchema = DeviceFaultSchema;
|
|
169206
|
+
/**
|
|
169207
|
+
* The fault catalog of a device, declared by its integration at runtime (never a
|
|
169208
|
+
* code enum). A fault outside the catalog is still published and still matches
|
|
169209
|
+
* a rule that names no code.
|
|
169210
|
+
*/
|
|
169211
|
+
var ListFaultTypesInputSchema = object({ deviceId: number$1().int().nonnegative() });
|
|
169212
|
+
var FaultTypesSchema = object({ types: array(DeviceFaultTypeSchema) });
|
|
169146
169213
|
/**
|
|
169147
169214
|
* The fault a device reports right now. One slice per device.
|
|
169148
169215
|
*
|
|
@@ -169180,7 +169247,12 @@ var errorCapability = {
|
|
|
169180
169247
|
scope: "device",
|
|
169181
169248
|
deviceNative: true,
|
|
169182
169249
|
mode: "singleton",
|
|
169183
|
-
methods: {
|
|
169250
|
+
methods: {
|
|
169251
|
+
/** The fault codes this device's integration can raise; `[]` when it declares none. */
|
|
169252
|
+
listFaultTypes: method(ListFaultTypesInputSchema, FaultTypesSchema, {
|
|
169253
|
+
kind: "query",
|
|
169254
|
+
auth: "protected"
|
|
169255
|
+
}) },
|
|
169184
169256
|
status: {
|
|
169185
169257
|
schema: ErrorStatusSchema,
|
|
169186
169258
|
kind: "push",
|
|
@@ -184149,6 +184221,13 @@ var NcSystemEventConditionSchema = object({
|
|
|
184149
184221
|
* pick from. The hub refuses an id the action index does not know.
|
|
184150
184222
|
*/
|
|
184151
184223
|
commandActions: array(string().min(1)).min(1).optional(),
|
|
184224
|
+
/**
|
|
184225
|
+
* `device-attention-*` only: the fault CODES this rule speaks about (the
|
|
184226
|
+
* integration declares them through `error.listFaultTypes`; free text is
|
|
184227
|
+
* accepted too). Absent or empty = any fault. The rule matches when any
|
|
184228
|
+
* fault of the episode is in the list.
|
|
184229
|
+
*/
|
|
184230
|
+
faultCodes: array(string().min(1)).optional(),
|
|
184152
184231
|
/** `device-command` only: how the command settled. A device's own change is not a command. */
|
|
184153
184232
|
commandOutcomes: array(_enum([
|
|
184154
184233
|
"confirmed",
|
|
@@ -196074,7 +196153,16 @@ var CamStreamDescriptorSchema = object({
|
|
|
196074
196153
|
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
196075
196154
|
profileHint: CamProfileSchema.optional(),
|
|
196076
196155
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
196077
|
-
metadata: record(string(), unknown()).optional()
|
|
196156
|
+
metadata: record(string(), unknown()).optional(),
|
|
196157
|
+
/**
|
|
196158
|
+
* The longest continuous session the SOURCE will keep open, in ms, declared by
|
|
196159
|
+
* the provider that knows it (a hub that cuts every child's session on a
|
|
196160
|
+
* timer). Absent = no limit. The broker re-dials a live source a little
|
|
196161
|
+
* BEFORE this elapses, on its own terms and announced to consumers, so the
|
|
196162
|
+
* source's cut never lands mid-recording. Declare slightly under what was
|
|
196163
|
+
* observed.
|
|
196164
|
+
*/
|
|
196165
|
+
maxSessionMs: number$1().int().positive().optional()
|
|
196078
196166
|
});
|
|
196079
196167
|
/**
|
|
196080
196168
|
* `stream-catalog` — device-scoped, provider-implemented. The pull counterpart
|
|
@@ -202982,6 +203070,20 @@ function deviceErrorEdge(previous, next) {
|
|
|
202982
203070
|
function deviceErrorAlertId(deviceId) {
|
|
202983
203071
|
return `device-error:${String(deviceId)}`;
|
|
202984
203072
|
}
|
|
203073
|
+
/** Every active fault, the principal first; a status that lists none still names its principal. */
|
|
203074
|
+
function activeFaults(status) {
|
|
203075
|
+
if (status.faults !== void 0 && status.faults.length > 0) return status.faults.map(({ code, label, severity }) => ({
|
|
203076
|
+
code,
|
|
203077
|
+
label,
|
|
203078
|
+
severity
|
|
203079
|
+
}));
|
|
203080
|
+
if (status.code === null) return [];
|
|
203081
|
+
return [{
|
|
203082
|
+
code: status.code,
|
|
203083
|
+
label: status.label ?? status.code,
|
|
203084
|
+
severity: status.severity
|
|
203085
|
+
}];
|
|
203086
|
+
}
|
|
202985
203087
|
/** The alert that opens an episode. `since` is the fault's own start, else `now`. */
|
|
202986
203088
|
function buildDeviceErrorAlert(deviceId, deviceName, status, now) {
|
|
202987
203089
|
const label = status.label ?? status.code ?? "Fault";
|
|
@@ -203009,7 +203111,9 @@ function buildDeviceErrorAlert(deviceId, deviceName, status, now) {
|
|
|
203009
203111
|
metadata: {
|
|
203010
203112
|
episodeId: `${alertId}@${String(startedAt)}`,
|
|
203011
203113
|
code: status.code,
|
|
203012
|
-
deviceSeverity: status.severity
|
|
203114
|
+
deviceSeverity: status.severity,
|
|
203115
|
+
label: status.label,
|
|
203116
|
+
faults: activeFaults(status)
|
|
203013
203117
|
}
|
|
203014
203118
|
};
|
|
203015
203119
|
}
|
|
@@ -203019,6 +203123,8 @@ var BaseDevice = class {
|
|
|
203019
203123
|
type;
|
|
203020
203124
|
/** True when another process owns the base slices (`options.deviceStatus: 'external'`). */
|
|
203021
203125
|
statusIsExternal;
|
|
203126
|
+
/** The fault catalog the integration declared; `[]` until it does. */
|
|
203127
|
+
faultTypes = [];
|
|
203022
203128
|
name;
|
|
203023
203129
|
parentDeviceId;
|
|
203024
203130
|
role;
|
|
@@ -203356,10 +203462,19 @@ var BaseDevice = class {
|
|
|
203356
203462
|
* a restart is compared, not announced again.
|
|
203357
203463
|
*/
|
|
203358
203464
|
registerErrorCap() {
|
|
203359
|
-
this.ctx.registerNativeCap?.(errorCapability, {});
|
|
203465
|
+
this.ctx.registerNativeCap?.(errorCapability, { listFaultTypes: async () => ({ types: [...this.faultTypes] }) });
|
|
203360
203466
|
if (this.runtimeState.getCapState(errorCapability.name) === void 0) this.setCapSlice(errorCapability, ERROR_STATUS_COLD);
|
|
203361
203467
|
}
|
|
203362
203468
|
/**
|
|
203469
|
+
* Declare the fault kinds this device's integration can raise (code, label,
|
|
203470
|
+
* severity), served by `error.listFaultTypes` so a rule's code picker is
|
|
203471
|
+
* offered the integration's own words. The default is `[]`; a fault outside
|
|
203472
|
+
* the catalog is still published. Call it before or after `registerErrorCap`.
|
|
203473
|
+
*/
|
|
203474
|
+
declareFaultTypes(types) {
|
|
203475
|
+
this.faultTypes = types.map((type) => ({ ...type }));
|
|
203476
|
+
}
|
|
203477
|
+
/**
|
|
203363
203478
|
* Publish the device's fault. The slice is written; on an EDGE (a fault
|
|
203364
203479
|
* starts, or one resolves) an attention episode opens or closes through the
|
|
203365
203480
|
* alerts cap, which the notification center announces as
|
|
@@ -210336,6 +210451,13 @@ Object.freeze({
|
|
|
210336
210451
|
access: "view",
|
|
210337
210452
|
role: "viewer"
|
|
210338
210453
|
},
|
|
210454
|
+
"error.listFaultTypes": {
|
|
210455
|
+
capName: "error",
|
|
210456
|
+
capScope: "device",
|
|
210457
|
+
addonId: null,
|
|
210458
|
+
access: "view",
|
|
210459
|
+
role: "viewer"
|
|
210460
|
+
},
|
|
210339
210461
|
"eventEmitter.getStatus": {
|
|
210340
210462
|
capName: "event-emitter",
|
|
210341
210463
|
capScope: "device",
|
|
@@ -218959,6 +219081,11 @@ Object.freeze({
|
|
|
218959
219081
|
form: "single",
|
|
218960
219082
|
optional: false
|
|
218961
219083
|
}],
|
|
219084
|
+
"error.listFaultTypes": [{
|
|
219085
|
+
name: "deviceId",
|
|
219086
|
+
form: "single",
|
|
219087
|
+
optional: false
|
|
219088
|
+
}],
|
|
218962
219089
|
"eventEmitter.getStatus": [{
|
|
218963
219090
|
name: "deviceId",
|
|
218964
219091
|
form: "single",
|
|
@@ -221291,7 +221418,8 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
|
221291
221418
|
"consumableLowPercent",
|
|
221292
221419
|
"commandActions",
|
|
221293
221420
|
"commandOutcomes",
|
|
221294
|
-
"commandActorKinds"
|
|
221421
|
+
"commandActorKinds",
|
|
221422
|
+
"faultCodes"
|
|
221295
221423
|
];
|
|
221296
221424
|
new Map(Object.entries({
|
|
221297
221425
|
"device-online": "device-events",
|
|
@@ -221662,6 +221790,8 @@ object({
|
|
|
221662
221790
|
nodeId: string().optional(),
|
|
221663
221791
|
/** The alert's own action link (where the operator acts on it), when it has one. */
|
|
221664
221792
|
actionUrl: string().optional(),
|
|
221793
|
+
/** A device fault episode: every active fault (`metadata.faults`), principal first. */
|
|
221794
|
+
faults: array(DeviceFaultSchema).optional(),
|
|
221665
221795
|
at: number$1()
|
|
221666
221796
|
});
|
|
221667
221797
|
var RULE_BODY_ONLY = ["body"];
|
|
@@ -221946,6 +222076,9 @@ var STATE_SUMMARY_VARS = [
|
|
|
221946
222076
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
221947
222077
|
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
221948
222078
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
222079
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
222080
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
222081
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION]),
|
|
221949
222082
|
[...RULE_TEXT],
|
|
221950
222083
|
[...RULE_TEXT],
|
|
221951
222084
|
[...RULE_TEXT],
|
|
@@ -223636,6 +223769,16 @@ var reolinkCameraSchema = object({
|
|
|
223636
223769
|
*/
|
|
223637
223770
|
webhookUrlGeneration: number$1().int().optional(),
|
|
223638
223771
|
/**
|
|
223772
|
+
* "Auto-configure event push on add": right after the camera is added, arm its local event push
|
|
223773
|
+
* (HaCfg webhook for a standalone battery camera, else the camera mailbox). Default on.
|
|
223774
|
+
*/
|
|
223775
|
+
autoConfigureEventPush: boolean().optional(),
|
|
223776
|
+
/**
|
|
223777
|
+
* What the one-time add-time run did (`configured:<mechanism>` | `skipped` | `failed`). Present
|
|
223778
|
+
* means the run happened: a restart never writes the camera again.
|
|
223779
|
+
*/
|
|
223780
|
+
eventPushAutoConfigured: string().optional(),
|
|
223781
|
+
/**
|
|
223639
223782
|
* On-camera motion detection master switch + sensitivity.
|
|
223640
223783
|
* Pushed via `setMotionAlarm` (cmdId=47). The Reolink mobile
|
|
223641
223784
|
* app + camera web UI use 1..50 (1 = least sensitive,
|
|
@@ -231781,6 +231924,22 @@ var SLEEP_HYSTERESIS_MS = 5e3;
|
|
|
231781
231924
|
* exactly its recovery role.
|
|
231782
231925
|
*/
|
|
231783
231926
|
var HUB_SUMMARY_SLEEP_GRACE_MS = 18e4;
|
|
231927
|
+
/**
|
|
231928
|
+
* How recent the last video packet must be for the stream to count as
|
|
231929
|
+
* flowing. A camera that is delivering video is awake, whatever a second-hand
|
|
231930
|
+
* claim says: a Home Hub child on DC power was marked sleeping every 28 min
|
|
231931
|
+
* (and by the lagging hub summary) while its RTP was running, which froze the
|
|
231932
|
+
* snapshot tile on "sleeping".
|
|
231933
|
+
*/
|
|
231934
|
+
var VIDEO_FLOW_FRESH_MS = 5e3;
|
|
231935
|
+
/**
|
|
231936
|
+
* A source that is not the camera's own reading of itself: the parent's
|
|
231937
|
+
* summaries, and a pushed `simple-event` (the Home Hub's session cut arrives
|
|
231938
|
+
* as one).
|
|
231939
|
+
*/
|
|
231940
|
+
function isSecondHand(source) {
|
|
231941
|
+
return source === "hub-summary" || source === "hub-reconcile" || source === "simple-event";
|
|
231942
|
+
}
|
|
231784
231943
|
/** A source whose verdict comes from the parent NVR's channel summary. */
|
|
231785
231944
|
function isSummarySourced(source) {
|
|
231786
231945
|
return source === "hub-summary" || source === "hub-reconcile";
|
|
@@ -231801,8 +231960,23 @@ function isSummarySourced(source) {
|
|
|
231801
231960
|
* observation inside the grace says otherwise.
|
|
231802
231961
|
*/
|
|
231803
231962
|
function decideSleepCommit(input) {
|
|
231804
|
-
const { current, next, source, lastFirstHandCommitAt, nowMs } = input;
|
|
231963
|
+
const { current, next, source, lastFirstHandCommitAt, nowMs, videoFlowing, wired } = input;
|
|
231805
231964
|
if (current === next) return { kind: "unchanged" };
|
|
231965
|
+
if (next === true && isSecondHand(source)) {
|
|
231966
|
+
const sinceMs = nowMs - lastFirstHandCommitAt;
|
|
231967
|
+
if (wired) return {
|
|
231968
|
+
kind: "refused",
|
|
231969
|
+
reason: "wired",
|
|
231970
|
+
windowMs: 0,
|
|
231971
|
+
sinceLastChangeMs: sinceMs
|
|
231972
|
+
};
|
|
231973
|
+
if (videoFlowing) return {
|
|
231974
|
+
kind: "refused",
|
|
231975
|
+
reason: "video-flowing",
|
|
231976
|
+
windowMs: VIDEO_FLOW_FRESH_MS,
|
|
231977
|
+
sinceLastChangeMs: sinceMs
|
|
231978
|
+
};
|
|
231979
|
+
}
|
|
231806
231980
|
const summarySourced = isSummarySourced(source);
|
|
231807
231981
|
const firstHandWake = source === "confirmed-wake" && next === false;
|
|
231808
231982
|
const sinceLastChangeMs = nowMs - lastFirstHandCommitAt;
|
|
@@ -231827,6 +232001,58 @@ function decideSleepCommit(input) {
|
|
|
231827
232001
|
};
|
|
231828
232002
|
}
|
|
231829
232003
|
//#endregion
|
|
232004
|
+
//#region src/session-limit.ts
|
|
232005
|
+
/**
|
|
232006
|
+
* How long the broker lets a Home Hub child's session run before it re-dials on
|
|
232007
|
+
* its own terms.
|
|
232008
|
+
*
|
|
232009
|
+
* Observed 2026-11-20 on two DC-powered children of one Home Hub: the hub cut
|
|
232010
|
+
* BOTH sessions at the same second, every 28 min 07 s (16:16:36, then 16:44:43),
|
|
232011
|
+
* which is a hub session limit, not the camera. Declared a minute under that so
|
|
232012
|
+
* the planned re-dial always wins the race against the hub's cut and the
|
|
232013
|
+
* recording rolls over at a time of our choosing.
|
|
232014
|
+
*/
|
|
232015
|
+
var HOME_HUB_SESSION_LIMIT_MS = 27 * 6e4;
|
|
232016
|
+
/**
|
|
232017
|
+
* Stamp the descriptors with the session limit the broker acts on. Only a
|
|
232018
|
+
* battery child of a hub gets one: a standalone camera has no such cut, and
|
|
232019
|
+
* declaring one there would re-dial a healthy stream for nothing.
|
|
232020
|
+
*/
|
|
232021
|
+
function withSessionLimit(descriptors, input) {
|
|
232022
|
+
if (!input.isHubChild || !input.isBattery) return [...descriptors];
|
|
232023
|
+
return descriptors.map((d) => ({
|
|
232024
|
+
...d,
|
|
232025
|
+
maxSessionMs: HOME_HUB_SESSION_LIMIT_MS
|
|
232026
|
+
}));
|
|
232027
|
+
}
|
|
232028
|
+
//#endregion
|
|
232029
|
+
//#region src/video-flow.ts
|
|
232030
|
+
/**
|
|
232031
|
+
* Report every video packet a stream server produces. The three stream kinds
|
|
232032
|
+
* the server can sit on name the same event differently (`videoFrame` for the
|
|
232033
|
+
* native and composite streams, `videoAccessUnit` for the always-on one), so
|
|
232034
|
+
* the kind is narrowed by class, not asserted.
|
|
232035
|
+
*
|
|
232036
|
+
* Returns the unsubscribe. A stream kind this does not know is reported
|
|
232037
|
+
* through `onUnknown` and never watched — silence would read as "no video".
|
|
232038
|
+
*/
|
|
232039
|
+
function watchVideoFlow(stream, onFlow, onUnknown) {
|
|
232040
|
+
if (stream instanceof BaichuanVideoStream || stream instanceof CompositeStream) {
|
|
232041
|
+
stream.on("videoFrame", onFlow);
|
|
232042
|
+
return () => {
|
|
232043
|
+
stream.off("videoFrame", onFlow);
|
|
232044
|
+
};
|
|
232045
|
+
}
|
|
232046
|
+
if (stream instanceof ContinuousVideoStream) {
|
|
232047
|
+
stream.on("videoAccessUnit", onFlow);
|
|
232048
|
+
return () => {
|
|
232049
|
+
stream.off("videoAccessUnit", onFlow);
|
|
232050
|
+
};
|
|
232051
|
+
}
|
|
232052
|
+
onUnknown();
|
|
232053
|
+
return () => {};
|
|
232054
|
+
}
|
|
232055
|
+
//#endregion
|
|
231830
232056
|
//#region src/snapshot-wake-gate.ts
|
|
231831
232057
|
/**
|
|
231832
232058
|
* Decide whether a snapshot read may reach the camera's socket.
|
|
@@ -231850,6 +232076,74 @@ function decideSnapshotCameraAccess(input) {
|
|
|
231850
232076
|
};
|
|
231851
232077
|
}
|
|
231852
232078
|
//#endregion
|
|
232079
|
+
//#region src/event-push-on-add.ts
|
|
232080
|
+
function reasonOf(err) {
|
|
232081
|
+
return err instanceof Error ? err.message : String(err);
|
|
232082
|
+
}
|
|
232083
|
+
async function decide(ports) {
|
|
232084
|
+
if (!ports.enabled()) return {
|
|
232085
|
+
status: "skipped",
|
|
232086
|
+
reason: "auto-configure event push on add is switched off"
|
|
232087
|
+
};
|
|
232088
|
+
if (!ports.isEligible()) return {
|
|
232089
|
+
status: "skipped",
|
|
232090
|
+
reason: "hub-attached camera: the hub owns its event push, no email or webhook is written"
|
|
232091
|
+
};
|
|
232092
|
+
const method = ports.method();
|
|
232093
|
+
const webhookPossible = ports.isBattery() && method !== "email";
|
|
232094
|
+
const failures = [];
|
|
232095
|
+
if (webhookPossible) try {
|
|
232096
|
+
await ports.configureWebhook();
|
|
232097
|
+
return {
|
|
232098
|
+
status: "configured",
|
|
232099
|
+
mechanism: "webhook"
|
|
232100
|
+
};
|
|
232101
|
+
} catch (err) {
|
|
232102
|
+
failures.push(`webhook: ${reasonOf(err)}`);
|
|
232103
|
+
if (method === "webhook") return {
|
|
232104
|
+
status: "failed",
|
|
232105
|
+
reason: failures.join("; ")
|
|
232106
|
+
};
|
|
232107
|
+
}
|
|
232108
|
+
else if (method === "webhook") return {
|
|
232109
|
+
status: "skipped",
|
|
232110
|
+
reason: "the webhook needs a standalone battery camera and this one is not"
|
|
232111
|
+
};
|
|
232112
|
+
try {
|
|
232113
|
+
await ports.configureEmail();
|
|
232114
|
+
return {
|
|
232115
|
+
status: "configured",
|
|
232116
|
+
mechanism: "email"
|
|
232117
|
+
};
|
|
232118
|
+
} catch (err) {
|
|
232119
|
+
failures.push(`email: ${reasonOf(err)}`);
|
|
232120
|
+
return {
|
|
232121
|
+
status: "failed",
|
|
232122
|
+
reason: failures.join("; ")
|
|
232123
|
+
};
|
|
232124
|
+
}
|
|
232125
|
+
}
|
|
232126
|
+
/**
|
|
232127
|
+
* Arm a camera's local event push ONCE, right after it is added. A failure is an outcome, never
|
|
232128
|
+
* a throw: it must not block the add. The outcome is logged and recorded, and a recorded camera
|
|
232129
|
+
* is never written again. Battery cameras prefer the webhook (it works while asleep) and fall back
|
|
232130
|
+
* to the camera mailbox; only one path is armed, so events are not delivered twice.
|
|
232131
|
+
*/
|
|
232132
|
+
async function autoConfigureEventPushOnce(ports) {
|
|
232133
|
+
if (ports.recordedOutcome() !== void 0) return "already-ran";
|
|
232134
|
+
const outcome = await decide(ports);
|
|
232135
|
+
ports.log(outcome);
|
|
232136
|
+
try {
|
|
232137
|
+
await ports.record(outcome);
|
|
232138
|
+
} catch (err) {
|
|
232139
|
+
ports.log({
|
|
232140
|
+
status: "failed",
|
|
232141
|
+
reason: `could not record the run: ${reasonOf(err)}`
|
|
232142
|
+
});
|
|
232143
|
+
}
|
|
232144
|
+
return outcome;
|
|
232145
|
+
}
|
|
232146
|
+
//#endregion
|
|
231853
232147
|
//#region src/webhook-generation.ts
|
|
231854
232148
|
/**
|
|
231855
232149
|
* Point a battery camera's webhook at the data-plane URL ONCE per URL generation.
|
|
@@ -234562,6 +234856,7 @@ function buildPowerSourceSettingsSection(input) {
|
|
|
234562
234856
|
label: "Power source",
|
|
234563
234857
|
labelKey: "provider-reolink:schema.s_power-source.powerSource.label",
|
|
234564
234858
|
default: source,
|
|
234859
|
+
required: true,
|
|
234565
234860
|
options: [{
|
|
234566
234861
|
value: "adapter",
|
|
234567
234862
|
label: "Wired power",
|
|
@@ -234587,6 +234882,58 @@ async function applyPowerSourceSetting(target, value) {
|
|
|
234587
234882
|
if (!outcome.applied) throw new Error(`The camera did not take the power source switch (it reports ${outcome.after})`);
|
|
234588
234883
|
}
|
|
234589
234884
|
//#endregion
|
|
234885
|
+
//#region src/keep-awake-loop.ts
|
|
234886
|
+
/**
|
|
234887
|
+
* Stream-scoped keep-awake for a battery camera. While at least one stream
|
|
234888
|
+
* consumer is attached, a periodic wake keeps the firmware from entering
|
|
234889
|
+
* standby (which would stop the video). One timer per camera; started when the
|
|
234890
|
+
* first consumer attaches, stopped when the last one leaves.
|
|
234891
|
+
*
|
|
234892
|
+
* Pure: the timer and the wake call are injected so the loop is testable.
|
|
234893
|
+
*/
|
|
234894
|
+
var KEEP_AWAKE_INTERVAL_MS = 2e4;
|
|
234895
|
+
function createKeepAwakeLoop(deps) {
|
|
234896
|
+
let handle = null;
|
|
234897
|
+
let failing = false;
|
|
234898
|
+
const tick = () => {
|
|
234899
|
+
deps.wake().then(() => {
|
|
234900
|
+
failing = false;
|
|
234901
|
+
}).catch((err) => {
|
|
234902
|
+
const first = !failing;
|
|
234903
|
+
failing = true;
|
|
234904
|
+
try {
|
|
234905
|
+
deps.onFailure(err, first);
|
|
234906
|
+
} catch {}
|
|
234907
|
+
});
|
|
234908
|
+
};
|
|
234909
|
+
const arm = () => {
|
|
234910
|
+
handle = deps.setTimer(() => {
|
|
234911
|
+
if (handle === null) return;
|
|
234912
|
+
tick();
|
|
234913
|
+
arm();
|
|
234914
|
+
}, deps.intervalMs);
|
|
234915
|
+
};
|
|
234916
|
+
const halt = (activeStreams) => {
|
|
234917
|
+
if (handle === null) return;
|
|
234918
|
+
deps.clearTimer(handle);
|
|
234919
|
+
handle = null;
|
|
234920
|
+
failing = false;
|
|
234921
|
+
deps.onStop(activeStreams);
|
|
234922
|
+
};
|
|
234923
|
+
return {
|
|
234924
|
+
sync: (activeStreams) => {
|
|
234925
|
+
if (!deps.isBattery()) return;
|
|
234926
|
+
if (activeStreams > 0) {
|
|
234927
|
+
if (handle !== null) return;
|
|
234928
|
+
arm();
|
|
234929
|
+
deps.onStart(activeStreams);
|
|
234930
|
+
} else halt(activeStreams);
|
|
234931
|
+
},
|
|
234932
|
+
stop: () => halt(0),
|
|
234933
|
+
running: () => handle !== null
|
|
234934
|
+
};
|
|
234935
|
+
}
|
|
234936
|
+
//#endregion
|
|
234590
234937
|
//#region src/ptz-zoom.ts
|
|
234591
234938
|
/**
|
|
234592
234939
|
* Fraction of total zoom travel moved by ONE press. ~8 presses to cross
|
|
@@ -235698,8 +236045,44 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
235698
236045
|
nextEventHealthCheckAt = 0;
|
|
235699
236046
|
/** Active video streams keyed by camStreamId. */
|
|
235700
236047
|
active = /* @__PURE__ */ new Map();
|
|
236048
|
+
/**
|
|
236049
|
+
* Stream-scoped keep-awake (battery only): while a consumer holds a stream,
|
|
236050
|
+
* a periodic wake stops the firmware from entering standby. Reconciled with
|
|
236051
|
+
* `this.active` through `syncKeepAwake()` after every mutation of the map.
|
|
236052
|
+
*/
|
|
236053
|
+
keepAwake = createKeepAwakeLoop({
|
|
236054
|
+
intervalMs: KEEP_AWAKE_INTERVAL_MS,
|
|
236055
|
+
isBattery: () => this.isBattery,
|
|
236056
|
+
wake: async () => {
|
|
236057
|
+
await (await this.ensureApi()).wakeUp(this.getChannel(), {
|
|
236058
|
+
attempts: 1,
|
|
236059
|
+
waitAfterWakeMs: 0
|
|
236060
|
+
});
|
|
236061
|
+
},
|
|
236062
|
+
setTimer: (fn, ms) => setTimeout(fn, ms),
|
|
236063
|
+
clearTimer: (h) => clearTimeout(h),
|
|
236064
|
+
onStart: (activeStreams) => this.ctx.logger.info("keep-awake: started", {
|
|
236065
|
+
tags: { deviceId: this.id },
|
|
236066
|
+
meta: { activeStreams }
|
|
236067
|
+
}),
|
|
236068
|
+
onStop: (activeStreams) => this.ctx.logger.info("keep-awake: stopped", {
|
|
236069
|
+
tags: { deviceId: this.id },
|
|
236070
|
+
meta: { activeStreams }
|
|
236071
|
+
}),
|
|
236072
|
+
onFailure: (err, first) => {
|
|
236073
|
+
(first ? this.ctx.logger.info.bind(this.ctx.logger) : this.ctx.logger.debug.bind(this.ctx.logger))("keep-awake: wake failed", {
|
|
236074
|
+
tags: { deviceId: this.id },
|
|
236075
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
236076
|
+
});
|
|
236077
|
+
}
|
|
236078
|
+
});
|
|
236079
|
+
syncKeepAwake() {
|
|
236080
|
+
this.keepAwake.sync(this.active.size);
|
|
236081
|
+
}
|
|
235701
236082
|
/** Login lock — concurrent demand events must not race the login flow. */
|
|
235702
236083
|
loginPromise = null;
|
|
236084
|
+
/** Wall-clock ms of the last video packet the stream server produced; 0 = none yet. */
|
|
236085
|
+
lastVideoFlowAt = 0;
|
|
235703
236086
|
/** True once we've discovered (via getBatteryInfo) that this is a battery cam. */
|
|
235704
236087
|
isBattery = false;
|
|
235705
236088
|
/**
|
|
@@ -236783,6 +237166,39 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
236783
237166
|
});
|
|
236784
237167
|
}
|
|
236785
237168
|
/**
|
|
237169
|
+
* Arm this camera's local event push ONCE, right after it is added (the provider's
|
|
237170
|
+
* `onAfterCreate`). Reuses `autoConfigureBaichuanWebhook` / `autoConfigureEmailPush` as they
|
|
237171
|
+
* are; the outcome is logged and recorded, and never throws: it must not block the add.
|
|
237172
|
+
*/
|
|
237173
|
+
async autoConfigureEventPushOnAdd() {
|
|
237174
|
+
return await autoConfigureEventPushOnce({
|
|
237175
|
+
enabled: () => this.config.get("autoConfigureEventPush") !== false,
|
|
237176
|
+
recordedOutcome: () => this.config.get("eventPushAutoConfigured"),
|
|
237177
|
+
isEligible: () => this.isEmailPushEligible,
|
|
237178
|
+
isBattery: () => this.isBattery,
|
|
237179
|
+
method: () => this.config.get("batterySleepPushMethod") ?? "auto",
|
|
237180
|
+
configureWebhook: async () => await this.autoConfigureBaichuanWebhook(),
|
|
237181
|
+
configureEmail: async () => await this.autoConfigureEmailPush(),
|
|
237182
|
+
record: async (outcome) => {
|
|
237183
|
+
await this.config.setAll({ eventPushAutoConfigured: outcome.status === "configured" ? `configured:${outcome.mechanism}` : outcome.status });
|
|
237184
|
+
},
|
|
237185
|
+
log: (outcome) => {
|
|
237186
|
+
if (outcome.status === "configured") this.ctx.logger.info("event-push: auto-configured on add", {
|
|
237187
|
+
tags: { deviceId: this.id },
|
|
237188
|
+
meta: { mechanism: outcome.mechanism }
|
|
237189
|
+
});
|
|
237190
|
+
else if (outcome.status === "skipped") this.ctx.logger.info("event-push: auto-configure on add skipped", {
|
|
237191
|
+
tags: { deviceId: this.id },
|
|
237192
|
+
meta: { reason: outcome.reason }
|
|
237193
|
+
});
|
|
237194
|
+
else this.ctx.logger.warn("event-push: auto-configure on add failed", {
|
|
237195
|
+
tags: { deviceId: this.id },
|
|
237196
|
+
meta: { reason: outcome.reason }
|
|
237197
|
+
});
|
|
237198
|
+
}
|
|
237199
|
+
});
|
|
237200
|
+
}
|
|
237201
|
+
/**
|
|
236786
237202
|
* Move this battery camera's HaCfg webhook to the addon's data-plane URL, once, on the first
|
|
236787
237203
|
* Baichuan contact after the upgrade (the camera is awake: this costs no wake). Only a camera
|
|
236788
237204
|
* that is armed is touched; a failure is logged and retried at the next contact.
|
|
@@ -237268,17 +237684,20 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
237268
237684
|
next,
|
|
237269
237685
|
source,
|
|
237270
237686
|
lastFirstHandCommitAt: this.sleepStateChangedAt,
|
|
237271
|
-
nowMs: Date.now()
|
|
237687
|
+
nowMs: Date.now(),
|
|
237688
|
+
videoFlowing: Date.now() - this.lastVideoFlowAt < VIDEO_FLOW_FRESH_MS,
|
|
237689
|
+
wired: this.config.get("deviceCache")?.powerSourceSnapshot?.source === "adapter"
|
|
237272
237690
|
});
|
|
237273
237691
|
if (decision.kind === "unchanged") return false;
|
|
237274
237692
|
if (decision.kind === "refused") {
|
|
237275
|
-
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", {
|
|
237693
|
+
(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", {
|
|
237276
237694
|
tags: { deviceId: this.id },
|
|
237277
237695
|
meta: {
|
|
237278
237696
|
next,
|
|
237279
237697
|
source,
|
|
237280
237698
|
windowMs: decision.windowMs,
|
|
237281
|
-
sinceLastChangeMs: decision.sinceLastChangeMs
|
|
237699
|
+
sinceLastChangeMs: decision.sinceLastChangeMs,
|
|
237700
|
+
reason: decision.reason
|
|
237282
237701
|
}
|
|
237283
237702
|
});
|
|
237284
237703
|
return false;
|
|
@@ -240266,7 +240685,10 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240266
240685
|
* See `native-sdp-overlay.ts`.
|
|
240267
240686
|
*/
|
|
240268
240687
|
withLiveNativeSdp(descriptors) {
|
|
240269
|
-
return overlayLiveNativeRfc4571Sdp(descriptors,
|
|
240688
|
+
return overlayLiveNativeRfc4571Sdp(withSessionLimit(descriptors, {
|
|
240689
|
+
isHubChild: this.isHubChild(),
|
|
240690
|
+
isBattery: this.isBattery
|
|
240691
|
+
}), (camStreamId) => {
|
|
240270
240692
|
const server = this.active.get(camStreamId)?.server;
|
|
240271
240693
|
if (!server?.server?.listening) return null;
|
|
240272
240694
|
return {
|
|
@@ -240568,6 +240990,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240568
240990
|
...entry.fps !== void 0 ? { fps: entry.fps } : {},
|
|
240569
240991
|
...entry.codec !== void 0 ? { codec: entry.codec } : {},
|
|
240570
240992
|
...entry.metadata ? { metadata: entry.metadata } : {},
|
|
240993
|
+
...entry.maxSessionMs !== void 0 ? { maxSessionMs: entry.maxSessionMs } : {},
|
|
240571
240994
|
deviceFeatures: entry.deviceFeatures ?? [...this.features],
|
|
240572
240995
|
autoEligible: entry.autoEligible ?? true
|
|
240573
240996
|
});
|
|
@@ -240647,6 +241070,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240647
241070
|
this.stopBatteryUpdatePolling();
|
|
240648
241071
|
this.stopAlignAuxPolling();
|
|
240649
241072
|
this.stopWatchdogs();
|
|
241073
|
+
this.keepAwake.stop();
|
|
240650
241074
|
this.detachFromHubSession();
|
|
240651
241075
|
if (this.reconnectTimer) {
|
|
240652
241076
|
clearTimeout(this.reconnectTimer);
|
|
@@ -240692,6 +241116,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240692
241116
|
await existing.server.close("recreate");
|
|
240693
241117
|
} catch {}
|
|
240694
241118
|
this.active.delete(camStreamId);
|
|
241119
|
+
this.syncKeepAwake();
|
|
240695
241120
|
}
|
|
240696
241121
|
let api;
|
|
240697
241122
|
try {
|
|
@@ -240739,9 +241164,18 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240739
241164
|
server
|
|
240740
241165
|
};
|
|
240741
241166
|
this.active.set(camStreamId, entry);
|
|
241167
|
+
this.syncKeepAwake();
|
|
241168
|
+
const stopVideoWatch = watchVideoFlow(server.videoStream, () => {
|
|
241169
|
+
this.lastVideoFlowAt = Date.now();
|
|
241170
|
+
}, () => this.ctx.logger.warn("rfc4571: unknown video stream kind — video flow not observed", { tags: {
|
|
241171
|
+
deviceId: this.id,
|
|
241172
|
+
camStreamId
|
|
241173
|
+
} }));
|
|
240742
241174
|
server.server.once("close", () => {
|
|
241175
|
+
stopVideoWatch();
|
|
240743
241176
|
if (this.active.get(camStreamId)?.server === server) {
|
|
240744
241177
|
this.active.delete(camStreamId);
|
|
241178
|
+
this.syncKeepAwake();
|
|
240745
241179
|
this.ctx.logger.debug("rfc4571: server closed — evicting cache entry", { tags: {
|
|
240746
241180
|
deviceId: this.id,
|
|
240747
241181
|
camStreamId
|
|
@@ -240796,6 +241230,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
240796
241230
|
async closeActiveStreams(reason) {
|
|
240797
241231
|
const entries = [...this.active.values()];
|
|
240798
241232
|
this.active.clear();
|
|
241233
|
+
this.keepAwake.stop();
|
|
240799
241234
|
if (entries.length === 0) return;
|
|
240800
241235
|
this.ctx.logger.debug("Closing active RFC 4571 servers", {
|
|
240801
241236
|
tags: { deviceId: this.id },
|
|
@@ -241479,6 +241914,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241479
241914
|
this.stopWatchdogs();
|
|
241480
241915
|
const entries = [...this.active.values()];
|
|
241481
241916
|
this.active.clear();
|
|
241917
|
+
this.keepAwake.stop();
|
|
241482
241918
|
for (const entry of entries) try {
|
|
241483
241919
|
await entry.server.close("disconnect-all");
|
|
241484
241920
|
} catch {}
|
|
@@ -243913,6 +244349,21 @@ function buildCreationFormSchema() {
|
|
|
243913
244349
|
}
|
|
243914
244350
|
}
|
|
243915
244351
|
]
|
|
244352
|
+
},
|
|
244353
|
+
{
|
|
244354
|
+
id: "events",
|
|
244355
|
+
title: "Events",
|
|
244356
|
+
titleKey: "provider-reolink:creation.s_events.title",
|
|
244357
|
+
columns: 1,
|
|
244358
|
+
fields: [{
|
|
244359
|
+
type: "boolean",
|
|
244360
|
+
key: "autoConfigureEventPush",
|
|
244361
|
+
label: "Auto-configure event push on add",
|
|
244362
|
+
labelKey: "provider-reolink:creation.s_events.autoConfigureEventPush.label",
|
|
244363
|
+
description: "Once, right after the camera is added, set up its local push (webhook or camera mailbox) so motion and AI events reach CamStack.",
|
|
244364
|
+
descriptionKey: "provider-reolink:creation.s_events.autoConfigureEventPush.description",
|
|
244365
|
+
default: true
|
|
244366
|
+
}]
|
|
243916
244367
|
}
|
|
243917
244368
|
] };
|
|
243918
244369
|
}
|
|
@@ -246718,6 +247169,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
246718
247169
|
const emailBridge = this.ensureEmailBridge();
|
|
246719
247170
|
device.setEmailPushParamsResolver(() => emailBridge.buildCameraSetupParams(device));
|
|
246720
247171
|
device.setBaichuanWebhookParamsResolver(() => this.buildWebhookParams(device));
|
|
247172
|
+
device.autoConfigureEventPushOnAdd().catch((err) => {
|
|
247173
|
+
ctx.logger.warn("event-push: auto-configure on add threw", {
|
|
247174
|
+
tags: { deviceId: device.id },
|
|
247175
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
247176
|
+
});
|
|
247177
|
+
});
|
|
246721
247178
|
}
|
|
246722
247179
|
ctx.api?.pipelineOrchestrator?.applyDeviceSettingsPatch?.mutate({
|
|
246723
247180
|
deviceId: device.id,
|