@trillboards/edge-sdk 0.2.42 → 0.2.52

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.
Files changed (66) hide show
  1. package/README.md +76 -0
  2. package/deploy/docker/connector-entrypoint.sh +1 -1
  3. package/dist/AudioOnsetDetector.d.ts +211 -0
  4. package/dist/AudioOnsetDetector.d.ts.map +1 -0
  5. package/dist/AudioOnsetDetector.js +286 -0
  6. package/dist/AudioOnsetDetector.js.map +1 -0
  7. package/dist/CloudSensingManager.d.ts +67 -0
  8. package/dist/CloudSensingManager.d.ts.map +1 -1
  9. package/dist/CloudSensingManager.js +185 -17
  10. package/dist/CloudSensingManager.js.map +1 -1
  11. package/dist/DurableVlmCandidateSpool.d.ts +99 -0
  12. package/dist/DurableVlmCandidateSpool.d.ts.map +1 -0
  13. package/dist/DurableVlmCandidateSpool.js +522 -0
  14. package/dist/DurableVlmCandidateSpool.js.map +1 -0
  15. package/dist/EdgeAgent.d.ts.map +1 -1
  16. package/dist/EdgeAgent.js +20 -2
  17. package/dist/EdgeAgent.js.map +1 -1
  18. package/dist/LiteRtVlmProvider.d.ts +66 -1
  19. package/dist/LiteRtVlmProvider.d.ts.map +1 -1
  20. package/dist/LiteRtVlmProvider.js +132 -0
  21. package/dist/LiteRtVlmProvider.js.map +1 -1
  22. package/dist/SceneChangeDetector.d.ts +62 -6
  23. package/dist/SceneChangeDetector.d.ts.map +1 -1
  24. package/dist/SceneChangeDetector.js +61 -5
  25. package/dist/SceneChangeDetector.js.map +1 -1
  26. package/dist/VlmAdmissionGate.d.ts +63 -0
  27. package/dist/VlmAdmissionGate.d.ts.map +1 -1
  28. package/dist/VlmAdmissionGate.js +64 -0
  29. package/dist/VlmAdmissionGate.js.map +1 -1
  30. package/dist/VlmCandidateBuffer.d.ts +17 -0
  31. package/dist/VlmCandidateBuffer.d.ts.map +1 -1
  32. package/dist/VlmCandidateBuffer.js +6 -0
  33. package/dist/VlmCandidateBuffer.js.map +1 -1
  34. package/dist/attachAudioOnset.d.ts +87 -0
  35. package/dist/attachAudioOnset.d.ts.map +1 -0
  36. package/dist/attachAudioOnset.js +87 -0
  37. package/dist/attachAudioOnset.js.map +1 -0
  38. package/dist/config.d.ts +83 -4
  39. package/dist/config.d.ts.map +1 -1
  40. package/dist/config.js.map +1 -1
  41. package/dist/connectorCadence.d.ts +193 -8
  42. package/dist/connectorCadence.d.ts.map +1 -1
  43. package/dist/connectorCadence.js +225 -10
  44. package/dist/connectorCadence.js.map +1 -1
  45. package/dist/deployedCadence.d.ts +18 -5
  46. package/dist/deployedCadence.d.ts.map +1 -1
  47. package/dist/deployedCadence.js +50 -13
  48. package/dist/deployedCadence.js.map +1 -1
  49. package/dist/diagnose.d.ts +1 -1
  50. package/dist/diagnose.js +1 -1
  51. package/dist/index.d.ts +7 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +18 -1
  54. package/dist/index.js.map +1 -1
  55. package/dist/sensingCatchRate.d.ts +105 -3
  56. package/dist/sensingCatchRate.d.ts.map +1 -1
  57. package/dist/sensingCatchRate.js +98 -10
  58. package/dist/sensingCatchRate.js.map +1 -1
  59. package/dist/sensingRunMode.d.ts.map +1 -1
  60. package/dist/sensingRunMode.js +100 -4
  61. package/dist/sensingRunMode.js.map +1 -1
  62. package/dist/wavEncode.d.ts +29 -0
  63. package/dist/wavEncode.d.ts.map +1 -0
  64. package/dist/wavEncode.js +63 -0
  65. package/dist/wavEncode.js.map +1 -0
  66. package/package.json +1 -1
@@ -5,8 +5,10 @@ import { type LocalNetworkVerdict } from './localNetworkAccess';
5
5
  import { SharedFrameSource } from './MosaicSource';
6
6
  import type { EdgeAgentConfig, MosaicTile, RecorderIdentity } from './config';
7
7
  import { type VlmAdmissionStats } from './VlmAdmissionGate';
8
+ import { type AudioSensingOptions } from './attachAudioOnset';
8
9
  import { type MotionGateOptions, type MotionGateReason } from './SceneChangeDetector';
9
10
  import { type VlmCandidateBufferOptions, type VlmCandidateBufferStats } from './VlmCandidateBuffer';
11
+ import { type DurableVlmCandidateSpoolOptions } from './DurableVlmCandidateSpool';
10
12
  import type { DeployedCadence } from './deployedCadence';
11
13
  import type { LiteRtAccelerator, LiteRtAcceleratorHealth } from './LiteRtVlmProvider';
12
14
  export declare function classifyRtspFailureClass(err: unknown): CameraHealthFailureClass;
@@ -111,10 +113,24 @@ export interface SensingLoopDeps {
111
113
  name: string;
112
114
  camera: CameraProvider;
113
115
  client: SensingClient;
116
+ /**
117
+ * RTSP URL for this feed's AUDIO pull, when it has one. Separate from the
118
+ * camera provider because audio is a long-lived session on its own bounded
119
+ * per-recorder lane, not a frame pull — see `RTSPAudioProvider`. Absent ⇒ no
120
+ * audio for this feed, which is the common case and not an error.
121
+ */
122
+ audioRtspUrl?: string;
114
123
  }
115
124
  export interface CloudSensingManagerOptions {
116
125
  /** Per-feed capture loops. */
117
126
  loops: SensingLoopDeps[];
127
+ /**
128
+ * Acoustic sensing. DISABLED unless `enabled: true` — that default is a
129
+ * consent position, not a rollout setting (see `attachAudioOnset`). When on,
130
+ * each feed opens ONE long-lived audio session per physical recorder and its
131
+ * onsets carry frames the motion cascade would have dropped.
132
+ */
133
+ audioSensing?: AudioSensingOptions;
118
134
  /** Capture interval (ms) when NO faces. Default: 300000. */
119
135
  periodicIntervalMs?: number;
120
136
  /** Capture interval (ms) when faces ARE detected. Default: 30000. */
@@ -239,6 +255,15 @@ export interface CloudSensingManagerOptions {
239
255
  * freed — and two knobs for one question drift apart.
240
256
  */
241
257
  pumpIntervalMs?: number;
258
+ /**
259
+ * Durable evidence hold. Local sensing enables this by default at its
260
+ * config directory; cloud sensing leaves it off. The disk limits replace
261
+ * the small RAM limits because queued items retain only metadata in memory.
262
+ */
263
+ diskSpool?: (Partial<DurableVlmCandidateSpoolOptions> & {
264
+ enabled?: boolean;
265
+ directory?: string;
266
+ });
242
267
  };
243
268
  /**
244
269
  * Let the motion verdict drive the periodic/face-triggered cadence switch —
@@ -319,6 +344,9 @@ export declare class CloudSensingManager extends EventEmitter {
319
344
  private candidatePumpTimer;
320
345
  private readonly motionDrivesCadence;
321
346
  /** Retained so a cadence change can rebuild each feed's gate heartbeat. */
347
+ private readonly audioSensingOptions;
348
+ /** Live audio attachments, keyed by feed name. Empty unless audio is enabled. */
349
+ private audioAttachments;
322
350
  private motionGateOptions;
323
351
  /** Look-rate for a still feed when the cascade is on. null ⇒ cascade off. */
324
352
  private motionScanIntervalMs;
@@ -476,6 +504,7 @@ export declare class CloudSensingManager extends EventEmitter {
476
504
  */
477
505
  candidateBuffer: {
478
506
  enabled: boolean;
507
+ storage: 'memory' | 'disk';
479
508
  /** Held right now. */
480
509
  buffered: number;
481
510
  bytes: number;
@@ -490,6 +519,13 @@ export declare class CloudSensingManager extends EventEmitter {
490
519
  /** How long the oldest waiting candidate has been waiting. */
491
520
  oldestAgeMs: number | null;
492
521
  perFeed: VlmCandidateBufferStats['perFeed'];
522
+ recovered: number;
523
+ completed: number;
524
+ retried: number;
525
+ inFlight: number;
526
+ writeFailed: number;
527
+ readFailed: number;
528
+ deleteFailed: number;
493
529
  };
494
530
  /**
495
531
  * WHICH litert-lm delegate the on-device runtime is actually running, and
@@ -532,6 +568,37 @@ export declare class CloudSensingManager extends EventEmitter {
532
568
  start(opts?: {
533
569
  healthOnly?: boolean;
534
570
  }): Promise<void>;
571
+ /**
572
+ * Open one audio session per feed that has a URL and a gate. Sequential
573
+ * rather than parallel: the per-recorder audio lane is capacity 1 by default,
574
+ * so racing N channels of one NVR would just produce N-1 admission refusals
575
+ * in a nondeterministic order.
576
+ */
577
+ private attachAudioSensing;
578
+ /**
579
+ * What acoustic config this manager RECEIVED — as opposed to what is live.
580
+ *
581
+ * Exists so "did the config key arrive?" is answerable WITHOUT starting the
582
+ * loops (starting opens real RTSP cameras). That question needs its own
583
+ * answer because the failure it guards against is silent: in
584
+ * `sensingRunMode.ts`, `minScanIntervalMs` is documented in config.ts,
585
+ * promised here, and dropped in between — vocabulary agreeing on both sides
586
+ * while the value never arrives. Asserting the option TYPE exists cannot see
587
+ * that; asserting the VALUE landed can.
588
+ */
589
+ getAudioSensingConfig(): {
590
+ enabled: boolean;
591
+ sampleRate?: number;
592
+ maxAudioSessionsPerSource?: number;
593
+ transport?: 'tcp' | 'udp';
594
+ onset?: unknown;
595
+ } | null;
596
+ /** Live acoustic attachments, for health/diagnostics. */
597
+ getAudioSensingStats(): Array<{
598
+ feed: string;
599
+ onsets: number;
600
+ calibrating: boolean;
601
+ }>;
535
602
  /** Stop all loops and close cameras. */
536
603
  stop(): Promise<void>;
537
604
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CloudSensingManager.d.ts","sourceRoot":"","sources":["../src/CloudSensingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AAErE,OAAO,KAAK,EAAoB,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEhG,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,uB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Y,EAAE,CA4EpE"}
@@ -11,8 +11,11 @@ const MosaicSource_1 = require("./MosaicSource");
11
11
  const runtimePaths_1 = require("./runtimePaths");
12
12
  const legacyRecorderProfile_1 = require("./legacyRecorderProfile");
13
13
  const VlmAdmissionGate_1 = require("./VlmAdmissionGate");
14
+ const attachAudioOnset_1 = require("./attachAudioOnset");
14
15
  const SceneChangeDetector_1 = require("./SceneChangeDetector");
15
16
  const VlmCandidateBuffer_1 = require("./VlmCandidateBuffer");
17
+ const DurableVlmCandidateSpool_1 = require("./DurableVlmCandidateSpool");
18
+ const connectorCadence_1 = require("./connectorCadence");
16
19
  /**
17
20
  * Thin cloud-sensing run mode.
18
21
  *
@@ -233,7 +236,8 @@ class CloudSensingManager extends events_1.EventEmitter {
233
236
  this.localNetworkVerdict = null;
234
237
  this.localNetworkProbeInFlight = false;
235
238
  this.candidatePumpTimer = null;
236
- /** Retained so a cadence change can rebuild each feed's gate heartbeat. */
239
+ /** Live audio attachments, keyed by feed name. Empty unless audio is enabled. */
240
+ this.audioAttachments = [];
237
241
  this.motionGateOptions = null;
238
242
  /** Look-rate for a still feed when the cascade is on. null ⇒ cascade off. */
239
243
  this.motionScanIntervalMs = null;
@@ -319,6 +323,10 @@ class CloudSensingManager extends events_1.EventEmitter {
319
323
  this.admissionGate = new VlmAdmissionGate_1.VlmAdmissionGate({
320
324
  maxInFlight: Math.max(1, Math.trunc(options.maxConcurrentAnalyses ?? this.loops.length)),
321
325
  maxInFlightMs: options.maxAnalysisInFlightMs,
326
+ // Fairness only matters when feeds actually compete, which is exactly the
327
+ // single-slot local path. With a slot per loop nobody is starved and the
328
+ // policy would only add a hold window for nothing.
329
+ fairShareAcrossFeeds: Math.max(1, Math.trunc(options.maxConcurrentAnalyses ?? this.loops.length)) < this.loops.length,
322
330
  now: this.now,
323
331
  });
324
332
  this.admissionRetryDelayMs = Math.max(1, Math.trunc(options.admissionRetryDelayMs ??
@@ -327,12 +335,31 @@ class CloudSensingManager extends events_1.EventEmitter {
327
335
  const gateOptions = options.motionGate;
328
336
  // STAGE 1 — decimation. Never look faster than the floor (Frigate's
329
337
  // 5 fps), and say so when a config asked to.
330
- const requested = Math.max(1, Math.trunc(gateOptions.scanIntervalMs ?? this.faceTriggeredIntervalMs));
338
+ //
339
+ // The default is `lookIntervalMsForFeedCount` — ONE opinion about the look
340
+ // cadence, derived in connectorCadence from the catch-rate corpus and from
341
+ // the measured cost of a grab, for THIS connector's feed count. It read
342
+ // `this.faceTriggeredIntervalMs` until 2026-08-18, which made the look
343
+ // cadence an accident of the ANALYZE knob: they were both 30 s, so nothing
344
+ // distinguished them and the 30 s look cadence that caught 8.3% of Instant
345
+ // events looked deliberate.
346
+ const requested = Math.max(1, Math.trunc(gateOptions.scanIntervalMs
347
+ ?? (0, connectorCadence_1.lookIntervalMsForFeedCount)(this.loops.length)
348
+ ?? connectorCadence_1.LOOK_INTERVAL_MS));
331
349
  this.motionScanFloorMs = Math.max(0, Math.trunc(gateOptions.minScanIntervalMs ?? DEFAULT_MIN_MOTION_SCAN_INTERVAL_MS));
332
350
  this.motionScanRequestedMs = requested;
333
351
  this.motionScanIntervalMs = Math.max(this.motionScanFloorMs, requested);
334
352
  this.motionScanClamped = this.motionScanIntervalMs !== requested;
335
353
  this.motionGateOptions = gateOptions;
354
+ // A frame COUNT cannot be honoured without knowing the look cadence, and
355
+ // this is the only place that knows both. A config that still carries the
356
+ // retired `stationaryReanalyzeEvery` is converted here, once, into the
357
+ // duration it actually meant on this connector — rather than being passed
358
+ // to a gate that would have to guess a cadence to interpret it.
359
+ const stationaryAfterMs = gateOptions.stationaryReanalyzeAfterMs
360
+ ?? (gateOptions.stationaryReanalyzeEvery !== undefined
361
+ ? Math.max(0, Math.trunc(gateOptions.stationaryReanalyzeEvery)) * this.motionScanIntervalMs
362
+ : undefined);
336
363
  for (const s of this.loops) {
337
364
  s.motionGate = new SceneChangeDetector_1.MotionGate({
338
365
  ...gateOptions,
@@ -341,6 +368,9 @@ class CloudSensingManager extends events_1.EventEmitter {
341
368
  // can never analyze faster than the face-triggered cadence.
342
369
  heartbeatIntervalMs: gateOptions.heartbeatIntervalMs ?? this.periodicIntervalMs,
343
370
  minAnalyzeIntervalMs: gateOptions.minAnalyzeIntervalMs ?? this.faceTriggeredIntervalMs,
371
+ ...(stationaryAfterMs !== undefined
372
+ ? { stationaryReanalyzeAfterMs: stationaryAfterMs }
373
+ : {}),
344
374
  now: this.now,
345
375
  });
346
376
  }
@@ -349,10 +379,18 @@ class CloudSensingManager extends events_1.EventEmitter {
349
379
  // can turn it OFF where it would otherwise run; it can never turn it on
350
380
  // without a classifier, because that is the queue the gate refuses.
351
381
  const candidateBufferEnabled = motionGateEnabled && options.candidateBuffer?.enabled !== false;
352
- this.candidates = candidateBufferEnabled
353
- ? new VlmCandidateBuffer_1.VlmCandidateBuffer({ ...options.candidateBuffer, now: this.now })
354
- : null;
382
+ const diskSpool = options.candidateBuffer?.diskSpool;
383
+ this.candidates = !candidateBufferEnabled
384
+ ? null
385
+ : diskSpool?.enabled !== false && diskSpool?.directory
386
+ ? new DurableVlmCandidateSpool_1.DurableVlmCandidateSpool({
387
+ ...diskSpool,
388
+ directory: diskSpool.directory,
389
+ now: this.now,
390
+ })
391
+ : new VlmCandidateBuffer_1.VlmCandidateBuffer({ ...options.candidateBuffer, now: this.now });
355
392
  this.candidatePumpIntervalMs = Math.max(1, Math.trunc(options.candidateBuffer?.pumpIntervalMs ?? this.admissionRetryDelayMs));
393
+ this.audioSensingOptions = options.audioSensing;
356
394
  this.motionDrivesCadence = options.motionDrivesCadence ?? motionGateEnabled;
357
395
  this.cadenceSource = options.cadenceSource;
358
396
  this.cadenceRefreshIntervalMs = Math.max(1000, Math.trunc(options.cadenceRefreshIntervalMs ?? DEFAULT_CADENCE_REFRESH_MS));
@@ -524,6 +562,7 @@ class CloudSensingManager extends events_1.EventEmitter {
524
562
  },
525
563
  candidateBuffer: {
526
564
  enabled: this.candidates !== null,
565
+ storage: candidateStats?.storage ?? 'memory',
527
566
  buffered: candidateStats?.buffered ?? 0,
528
567
  bytes: candidateStats?.bytes ?? 0,
529
568
  maxFrames: candidateStats?.maxFrames ?? 0,
@@ -536,6 +575,13 @@ class CloudSensingManager extends events_1.EventEmitter {
536
575
  expired: candidateStats?.expired ?? 0,
537
576
  oldestAgeMs: candidateStats?.oldestAgeMs ?? null,
538
577
  perFeed: candidateStats?.perFeed ?? [],
578
+ recovered: candidateStats?.recovered ?? 0,
579
+ completed: candidateStats?.completed ?? 0,
580
+ retried: candidateStats?.retried ?? 0,
581
+ inFlight: candidateStats?.inFlight ?? 0,
582
+ writeFailed: candidateStats?.writeFailed ?? 0,
583
+ readFailed: candidateStats?.readFailed ?? 0,
584
+ deleteFailed: candidateStats?.deleteFailed ?? 0,
539
585
  },
540
586
  accelerator: foldAcceleratorHealth(this.loops.map((s) => acceleratorHealthFor(s)).filter((a) => a !== null)),
541
587
  perFeed: this.loops.map((s, i) => ({
@@ -563,6 +609,10 @@ class CloudSensingManager extends events_1.EventEmitter {
563
609
  async start(opts = {}) {
564
610
  if (this.running)
565
611
  return;
612
+ // Recover durable evidence BEFORE camera loops can offer new frames. The
613
+ // in-memory implementation resets here, preserving its historical clean
614
+ // stop/start semantics.
615
+ this.candidates?.startRun();
566
616
  this.healthOnlyMode = opts.healthOnly === true;
567
617
  this.running = true;
568
618
  this.runStartedAtMs = this.now();
@@ -579,10 +629,11 @@ class CloudSensingManager extends events_1.EventEmitter {
579
629
  s.runMotionSkipped = 0;
580
630
  void this.startLoop(s, generation).catch((err) => this.emitLoopError(s, err));
581
631
  }
582
- // A candidate held across a stop()/start() cycle is a frame from a run
583
- // whose cameras may now be pointing somewhere else — the same reason the
584
- // motion gate re-seeds above.
585
- this.candidates?.reset();
632
+ // Acoustic sensing, when the operator has turned it on. Attaching is
633
+ // best-effort and fire-and-forget: `attachAudioOnset` never throws, returns
634
+ // null for a feed with no audio, and nothing here may delay or fail the
635
+ // capture loops that already started above.
636
+ void this.attachAudioSensing();
586
637
  this.scheduleCandidatePump(generation);
587
638
  // Ask once at startup so a connector picks up its deployed cadence on boot
588
639
  // rather than after a full refresh period, then keep asking. Both are
@@ -598,6 +649,72 @@ class CloudSensingManager extends events_1.EventEmitter {
598
649
  this.cadenceTimer.unref();
599
650
  }
600
651
  }
652
+ /**
653
+ * Open one audio session per feed that has a URL and a gate. Sequential
654
+ * rather than parallel: the per-recorder audio lane is capacity 1 by default,
655
+ * so racing N channels of one NVR would just produce N-1 admission refusals
656
+ * in a nondeterministic order.
657
+ */
658
+ async attachAudioSensing() {
659
+ if (this.audioSensingOptions?.enabled !== true)
660
+ return;
661
+ // HEALTH-ONLY IS NOT SENSING. In this mode the manager is proving the camera
662
+ // is alive while inference is unavailable (`idleSensingState()` reports
663
+ // exactly that), so opening a LONG-LIVED audio session would hold the
664
+ // recorder's audio slot — capacity 1 per host:port — for a run that is not
665
+ // going to analyse anything, and would deny it to a connector that is.
666
+ // Audio attaches when sensing does, and `start()` is called again with the
667
+ // full mode when capacity returns.
668
+ if (this.healthOnlyMode)
669
+ return;
670
+ for (const s of this.loops) {
671
+ if (!this.running)
672
+ return;
673
+ const rtspUrl = s.deps.audioRtspUrl;
674
+ if (!rtspUrl || !s.motionGate)
675
+ continue;
676
+ const attachment = await (0, attachAudioOnset_1.attachAudioOnset)({
677
+ feedName: s.deps.name,
678
+ rtspUrl,
679
+ gate: s.motionGate,
680
+ options: this.audioSensingOptions,
681
+ now: this.now,
682
+ });
683
+ if (attachment)
684
+ this.audioAttachments.push(attachment);
685
+ }
686
+ }
687
+ /**
688
+ * What acoustic config this manager RECEIVED — as opposed to what is live.
689
+ *
690
+ * Exists so "did the config key arrive?" is answerable WITHOUT starting the
691
+ * loops (starting opens real RTSP cameras). That question needs its own
692
+ * answer because the failure it guards against is silent: in
693
+ * `sensingRunMode.ts`, `minScanIntervalMs` is documented in config.ts,
694
+ * promised here, and dropped in between — vocabulary agreeing on both sides
695
+ * while the value never arrives. Asserting the option TYPE exists cannot see
696
+ * that; asserting the VALUE landed can.
697
+ */
698
+ getAudioSensingConfig() {
699
+ const o = this.audioSensingOptions;
700
+ if (!o)
701
+ return null;
702
+ return {
703
+ enabled: o.enabled === true,
704
+ sampleRate: o.sampleRate,
705
+ maxAudioSessionsPerSource: o.maxAudioSessionsPerSource,
706
+ transport: o.transport,
707
+ onset: o.onset,
708
+ };
709
+ }
710
+ /** Live acoustic attachments, for health/diagnostics. */
711
+ getAudioSensingStats() {
712
+ return this.audioAttachments.map((a) => ({
713
+ feed: a.feedName,
714
+ onsets: a.onsetCount(),
715
+ calibrating: a.detectorStats().calibrating,
716
+ }));
717
+ }
601
718
  /** Stop all loops and close cameras. */
602
719
  async stop() {
603
720
  this.running = false;
@@ -611,8 +728,16 @@ class CloudSensingManager extends events_1.EventEmitter {
611
728
  clearTimeout(this.candidatePumpTimer);
612
729
  this.candidatePumpTimer = null;
613
730
  }
614
- // Held frames belong to the run that captured them.
615
- this.candidates?.reset();
731
+ // Memory holds are cleared; durable evidence remains for a later accepted
732
+ // analysis or the documented retention/quota limit.
733
+ this.candidates?.stopRun();
734
+ // Close audio sessions so the recorder's audio lane is freed for the next
735
+ // run — a leaked session would deny audio to this same feed on restart.
736
+ const audio = this.audioAttachments;
737
+ this.audioAttachments = [];
738
+ for (const a of audio) {
739
+ void a.close().catch(() => undefined);
740
+ }
616
741
  if (this.cadenceTimer) {
617
742
  clearInterval(this.cadenceTimer);
618
743
  this.cadenceTimer = null;
@@ -797,9 +922,25 @@ class CloudSensingManager extends events_1.EventEmitter {
797
922
  // heartbeat, which is exactly the clock the portal ages a feed against.
798
923
  if (this.healthOnlyMode)
799
924
  return this.cameraHealthHeartbeatIntervalMs;
925
+ const scan = this.motionScanIntervalMs;
926
+ if (scan !== null) {
927
+ // Cascade on: LOOKING is the cheap stage and the scan cadence governs it
928
+ // in BOTH states. `faceTriggeredIntervalMs` is an ANALYZE knob here — it
929
+ // is what the gate takes as `minAnalyzeIntervalMs` — and honouring it as a
930
+ // LOOK cadence on a live feed makes the connector look SLOWER the moment
931
+ // something happens.
932
+ //
933
+ // That inversion was dormant, not absent: both values were 30 s, so
934
+ // `faceDetected` changed nothing. At a 2 s scan against a 30 s
935
+ // face-triggered interval it would cost 15x the look coverage on exactly
936
+ // the moving scenes the faster cadence is FOR — the Instant and Brief
937
+ // shapes — so the replayed catch rate would describe a sampler the fleet
938
+ // never runs.
939
+ return s.faceDetected ? Math.min(scan, this.faceTriggeredIntervalMs) : scan;
940
+ }
800
941
  if (s.faceDetected)
801
942
  return this.faceTriggeredIntervalMs;
802
- return this.motionScanIntervalMs ?? this.periodicIntervalMs;
943
+ return this.periodicIntervalMs;
803
944
  }
804
945
  /**
805
946
  * What to report as the AI state when the camera is up but nothing has been
@@ -824,7 +965,24 @@ class CloudSensingManager extends events_1.EventEmitter {
824
965
  staggerStepMs() {
825
966
  if (this.feedStaggerMs <= 0 || this.loops.length <= 1)
826
967
  return 0;
827
- const window = Math.min(this.maxFeedStaggerMs, this.periodicIntervalMs, this.faceTriggeredIntervalMs);
968
+ // The window must include EVERY cadence a loop can re-arm at, because the
969
+ // invariant is "the spread never exceeds one capture period" — a spread
970
+ // longer than the period re-aliases and feeds start sharing a phase, which
971
+ // is the multi-camera stampede this whole mechanism exists to prevent.
972
+ //
973
+ // `motionScanIntervalMs` was omitted until 2026-08-18. That was invisible
974
+ // rather than harmless: it equalled `faceTriggeredIntervalMs` (both 30 s),
975
+ // so the missing term never changed the answer. At a 2 s look cadence it
976
+ // becomes the FASTEST cadence and therefore the only one that matters —
977
+ // without it 16 feeds take a 937 ms step across a 2 000 ms period, so the
978
+ // spread is 14 055 ms over a 2 000 ms period and the phases collapse.
979
+ const window = Math.min(this.maxFeedStaggerMs, this.periodicIntervalMs, this.faceTriggeredIntervalMs,
980
+ // Only when the cascade is actually driving looks. A health-only run
981
+ // re-arms on `cameraHealthHeartbeatIntervalMs` and never on the scan
982
+ // interval, so folding a 2 s scan in there would shrink a 16-feed spread
983
+ // from 15 s to 2 s against a 60 s period — strictly MORE bunched, which is
984
+ // the opposite of what this function is for.
985
+ this.healthOnlyMode ? Number.POSITIVE_INFINITY : (this.motionScanIntervalMs ?? Number.POSITIVE_INFINITY));
828
986
  if (window <= 0)
829
987
  return 0;
830
988
  return Math.max(1, Math.min(this.feedStaggerMs, Math.floor(window / this.loops.length)));
@@ -1438,7 +1596,7 @@ class CloudSensingManager extends events_1.EventEmitter {
1438
1596
  // screen). Bounded because it is operator-facing log output, not data.
1439
1597
  detail: typeof response.rawBody === 'string' ? response.rawBody.slice(0, 200) : null,
1440
1598
  });
1441
- return;
1599
+ return false;
1442
1600
  }
1443
1601
  s.runAnalyses++;
1444
1602
  // Stamp the heartbeat AND the stationary baseline only once the call
@@ -1448,6 +1606,7 @@ class CloudSensingManager extends events_1.EventEmitter {
1448
1606
  s.motionGate?.markAnalyzed(undefined, signature);
1449
1607
  this.reportCameraOpen(s, { sensingState: 'active' });
1450
1608
  this.emit('analyzed', { name: s.deps.name, response });
1609
+ return true;
1451
1610
  }
1452
1611
  /**
1453
1612
  * Arm the candidate pump for ONE run of the manager.
@@ -1510,7 +1669,9 @@ class CloudSensingManager extends events_1.EventEmitter {
1510
1669
  // lands in the buffer's `served` counter, which would be a lie, and a
1511
1670
  // quiet lie in the accounting is the exact defect this buffer exists to
1512
1671
  // remove; the event is what makes it findable.
1513
- buffer.take();
1672
+ const dropped = buffer.take();
1673
+ if (dropped)
1674
+ buffer.complete?.(dropped);
1514
1675
  this.emit('error', {
1515
1676
  name: next.name,
1516
1677
  error: new Error(`CloudSensingManager: held candidate for unknown feed "${next.name}" — dropped`),
@@ -1548,8 +1709,12 @@ class CloudSensingManager extends events_1.EventEmitter {
1548
1709
  this.reportCameraOpen(s, { sensingState: 'unavailable' });
1549
1710
  throw err;
1550
1711
  }
1551
- this.recordAnalysis(s, response, candidate.signature);
1552
- if (this.isCurrentStart(generation)) {
1712
+ const accepted = this.recordAnalysis(s, response, candidate.signature);
1713
+ if (accepted)
1714
+ this.candidates?.complete?.(candidate);
1715
+ else
1716
+ this.candidates?.retry?.(candidate);
1717
+ if (accepted && this.isCurrentStart(generation)) {
1553
1718
  this.emit('candidateAnalyzed', {
1554
1719
  name: s.deps.name,
1555
1720
  waitedMs,
@@ -1558,6 +1723,7 @@ class CloudSensingManager extends events_1.EventEmitter {
1558
1723
  }
1559
1724
  }
1560
1725
  catch (err) {
1726
+ this.candidates?.retry?.(candidate);
1561
1727
  this.emitLoopError(s, err);
1562
1728
  }
1563
1729
  finally {
@@ -1614,6 +1780,7 @@ function emptyMotionReasonCounts() {
1614
1780
  return {
1615
1781
  heartbeat: 0,
1616
1782
  motion: 0,
1783
+ audio_onset: 0,
1617
1784
  no_motion: 0,
1618
1785
  calibrating: 0,
1619
1786
  stationary: 0,
@@ -1784,6 +1951,7 @@ function buildSensingLoops(config, deps) {
1784
1951
  }
1785
1952
  const loop = (feed, camera) => ({
1786
1953
  name: feed.name,
1954
+ audioRtspUrl: feed.rtspUrl,
1787
1955
  camera,
1788
1956
  client: clientFactory(feed),
1789
1957
  });