@camstack/addon-pipeline 1.2.261 → 1.2.264

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 (28) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/{default-detection-model-BtSBlVfL.mjs → default-detection-model-BAqtelIs.mjs} +1 -1
  4. package/dist/{default-detection-model-BV1oYSIq.js → default-detection-model-DS8yUWZy.js} +1 -1
  5. package/dist/detection-pipeline/index.js +4 -4
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-Bmn60GTy.js → dist-BNuwrzez.js} +2 -1
  8. package/dist/{dist-DBWkEUPE.mjs → dist-Cq5LGFGb.mjs} +2 -1
  9. package/dist/motion-wasm/index.js +1 -1
  10. package/dist/motion-wasm/index.mjs +1 -1
  11. package/dist/{node-dKZFwIEp.mjs → node-DSO2p3Sv.mjs} +1 -1
  12. package/dist/{node-_tNMjSF6.js → node-DT8wMxzw.js} +1 -1
  13. package/dist/pipeline-runner/index.js +3 -3
  14. package/dist/pipeline-runner/index.mjs +3 -3
  15. package/dist/{process-memory-DWZ3S13O.js → process-memory-Ba3DClP8.js} +1 -1
  16. package/dist/{process-memory-Bj-qzsjt.mjs → process-memory-QhWa5UZq.mjs} +1 -1
  17. package/dist/recorder/index.js +78 -4
  18. package/dist/recorder/index.mjs +78 -4
  19. package/dist/{segment-demux-js-dTUWx6pi.mjs → segment-demux-js-DfQPZtVo.mjs} +1 -1
  20. package/dist/{segment-demux-js-D4i63ROu.js → segment-demux-js-Qevmgb67.js} +1 -1
  21. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DuWd4nxA.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-r_tNVu_V.mjs} +2 -2
  22. package/dist/stream-broker/demux-worker-child.js +1 -1
  23. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  24. package/dist/stream-broker/{hostInit-lqhiwcu2.mjs → hostInit-CADqXjyN.mjs} +2 -2
  25. package/dist/stream-broker/index.js +3 -3
  26. package/dist/stream-broker/index.mjs +3 -3
  27. package/dist/stream-broker/remoteEntry.js +1 -1
  28. package/package.json +1 -1
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-Bmn60GTy.js");
7
- const require_process_memory = require("../process-memory-DWZ3S13O.js");
6
+ const require_dist = require("../dist-BNuwrzez.js");
7
+ const require_process_memory = require("../process-memory-Ba3DClP8.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
10
10
  let node_path = require("node:path");
@@ -1,6 +1,6 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as hydrateSchema, Jt as audioChunkBytesPerSample, Lt as errMsg, N as audioAnalysisCapability, Ot as resolvePoolMemoryPolicy, P as audioAnalyzerCapability, Qt as expandAudioChunkToF32le, Wt as BaseAddon, bn as EventCategory, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, rn as nodePin, s as DEFAULT_AUDIO_ANALYZER_CONFIG, w as PoolMemoryWatchdog, y as HF_BASE_URL } from "../dist-DBWkEUPE.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-Bj-qzsjt.mjs";
2
+ import { $t as hydrateSchema, Jt as audioChunkBytesPerSample, Lt as errMsg, N as audioAnalysisCapability, Ot as resolvePoolMemoryPolicy, P as audioAnalyzerCapability, Qt as expandAudioChunkToF32le, Wt as BaseAddon, bn as EventCategory, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, rn as nodePin, s as DEFAULT_AUDIO_ANALYZER_CONFIG, w as PoolMemoryWatchdog, y as HF_BASE_URL } from "../dist-Cq5LGFGb.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-QhWa5UZq.mjs";
4
4
  import * as fs from "node:fs";
5
5
  import * as path$1 from "node:path";
6
6
  import { downloadFile } from "@camstack/system/addon-utils";
@@ -1,4 +1,4 @@
1
- import { F as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-DBWkEUPE.mjs";
1
+ import { F as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-Cq5LGFGb.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Bmn60GTy.js");
1
+ const require_dist = require("./dist-BNuwrzez.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-Bmn60GTy.js");
7
- const require_node = require("../node-_tNMjSF6.js");
8
- const require_default_detection_model = require("../default-detection-model-BV1oYSIq.js");
6
+ const require_dist = require("../dist-BNuwrzez.js");
7
+ const require_node = require("../node-DT8wMxzw.js");
8
+ const require_default_detection_model = require("../default-detection-model-DS8yUWZy.js");
9
9
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
10
- const require_process_memory = require("../process-memory-DWZ3S13O.js");
10
+ const require_process_memory = require("../process-memory-Ba3DClP8.js");
11
11
  let node_os = require("node:os");
12
12
  node_os = require_chunk.__toESM(node_os);
13
13
  let node_fs = require("node:fs");
@@ -1,9 +1,9 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as hydrateSchema, At as runtimeDevices$1, Ft as supportedRuntimes$1, G as detectionPipelineCapability, J as enumerateInferenceDevices, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, X as evaluateZoneRules, Yt as createEvent, bn as EventCategory, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as object, ht as pickClusterStepModels, in as parseJsonUnknown, it as loadContributionCapability, j as YAMNET_TO_MACRO, l as DEFAULT_CLUSTER_STEP_SETTINGS, ln as array, m as DEVICE_BACKEND_TO_FORMAT, nt as inferModelProvider, pt as overlayClusterStepSettings, rn as nodePin, sn as sleep, t as APPLE_SA_TO_MACRO, vn as string, w as PoolMemoryWatchdog, yn as union, yt as pipelineExecutorCapability } from "../dist-DBWkEUPE.mjs";
3
- import { o as readProcessCost } from "../node-dKZFwIEp.mjs";
4
- import { a as localFrameRegistry, c as ALL_STEPS, d as getStepDefinition, f as resolveModelForFormat, l as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as landmarkPrecisionVerdict, r as macroGateVerdict, s as ALL_PIPELINE_STEPS, u as getStep } from "../default-detection-model-BtSBlVfL.mjs";
2
+ import { $t as hydrateSchema, At as runtimeDevices$1, Ft as supportedRuntimes$1, G as detectionPipelineCapability, J as enumerateInferenceDevices, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, X as evaluateZoneRules, Yt as createEvent, bn as EventCategory, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as object, ht as pickClusterStepModels, in as parseJsonUnknown, it as loadContributionCapability, j as YAMNET_TO_MACRO, l as DEFAULT_CLUSTER_STEP_SETTINGS, ln as array, m as DEVICE_BACKEND_TO_FORMAT, nt as inferModelProvider, pt as overlayClusterStepSettings, rn as nodePin, sn as sleep, t as APPLE_SA_TO_MACRO, vn as string, w as PoolMemoryWatchdog, yn as union, yt as pipelineExecutorCapability } from "../dist-Cq5LGFGb.mjs";
3
+ import { o as readProcessCost } from "../node-DSO2p3Sv.mjs";
4
+ import { a as localFrameRegistry, c as ALL_STEPS, d as getStepDefinition, f as resolveModelForFormat, l as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as landmarkPrecisionVerdict, r as macroGateVerdict, s as ALL_PIPELINE_STEPS, u as getStep } from "../default-detection-model-BAqtelIs.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-Bj-qzsjt.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-QhWa5UZq.mjs";
7
7
  import * as os from "node:os";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
@@ -7577,7 +7577,7 @@ function sleep(ms) {
7577
7577
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
7578
7578
  }
7579
7579
  //#endregion
7580
- //#region ../types/dist/canonical-hash-DBkl8q6V.mjs
7580
+ //#region ../types/dist/canonical-hash-biq7T_dN.mjs
7581
7581
  var AUDIO_ENCODER_BY_CODEC = {
7582
7582
  opus: "libopus",
7583
7583
  aac: "aac",
@@ -7637,6 +7637,7 @@ function buildInputArgs(input, decodeHwAccel) {
7637
7637
  if (input.extraArgs?.length) args.push(...input.extraArgs);
7638
7638
  if (input.analyzeDurationUs !== void 0) args.push("-analyzeduration", String(input.analyzeDurationUs));
7639
7639
  if (input.probeSizeBytes !== void 0) args.push("-probesize", String(input.probeSizeBytes));
7640
+ if (input.lowDelay === true) args.push("-flags", "low_delay");
7640
7641
  if (input.fflags?.length) for (const flag of input.fflags) args.push("-fflags", flag);
7641
7642
  if (input.rtspTransport) args.push("-rtsp_transport", input.rtspTransport);
7642
7643
  args.push("-i", input.url);
@@ -7577,7 +7577,7 @@ function sleep(ms) {
7577
7577
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
7578
7578
  }
7579
7579
  //#endregion
7580
- //#region ../types/dist/canonical-hash-DBkl8q6V.mjs
7580
+ //#region ../types/dist/canonical-hash-biq7T_dN.mjs
7581
7581
  var AUDIO_ENCODER_BY_CODEC = {
7582
7582
  opus: "libopus",
7583
7583
  aac: "aac",
@@ -7637,6 +7637,7 @@ function buildInputArgs(input, decodeHwAccel) {
7637
7637
  if (input.extraArgs?.length) args.push(...input.extraArgs);
7638
7638
  if (input.analyzeDurationUs !== void 0) args.push("-analyzeduration", String(input.analyzeDurationUs));
7639
7639
  if (input.probeSizeBytes !== void 0) args.push("-probesize", String(input.probeSizeBytes));
7640
+ if (input.lowDelay === true) args.push("-flags", "low_delay");
7640
7641
  if (input.fflags?.length) for (const flag of input.fflags) args.push("-fflags", flag);
7641
7642
  if (input.rtspTransport) args.push("-rtsp_transport", input.rtspTransport);
7642
7643
  args.push("-i", input.url);
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Bmn60GTy.js");
5
+ const require_dist = require("../dist-BNuwrzez.js");
6
6
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { $t as hydrateSchema, Wt as BaseAddon, X as evaluateZoneRules, ft as motionDetectionCapability, qt as DeviceType } from "../dist-DBWkEUPE.mjs";
1
+ import { $t as hydrateSchema, Wt as BaseAddon, X as evaluateZoneRules, ft as motionDetectionCapability, qt as DeviceType } from "../dist-Cq5LGFGb.mjs";
2
2
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -1,4 +1,4 @@
1
- import { Bt as buildFfmpegArgs, Ht as isSoftwareDecode, Lt as errMsg, zt as Fmp4BoxSplitter } from "./dist-DBWkEUPE.mjs";
1
+ import { Bt as buildFfmpegArgs, Ht as isSoftwareDecode, Lt as errMsg, zt as Fmp4BoxSplitter } from "./dist-Cq5LGFGb.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { realpathSync } from "node:fs";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-Bmn60GTy.js");
2
+ const require_dist = require("./dist-BNuwrzez.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_fs = require("node:fs");
5
5
  node_fs = require_chunk.__toESM(node_fs, 1);
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-Bmn60GTy.js");
7
- const require_node = require("../node-_tNMjSF6.js");
8
- const require_default_detection_model = require("../default-detection-model-BV1oYSIq.js");
6
+ const require_dist = require("../dist-BNuwrzez.js");
7
+ const require_node = require("../node-DT8wMxzw.js");
8
+ const require_default_detection_model = require("../default-detection-model-DS8yUWZy.js");
9
9
  const require_worker_protocol = require("../worker-protocol-B2MfQLlu.js");
10
10
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
11
11
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
@@ -1,6 +1,6 @@
1
- import { $ as failureContributionCapability, Lt as errMsg, S as NativeLeaseSettingsSchema, U as deriveDetailCropRect, Wt as BaseAddon, Xt as customAction, Yt as createEvent, Zt as defineCustomActions, _ as FailureCounters, _t as pickDetailCropConvention, b as MOTION_CLOSE_AFTER_MS, bn as EventCategory, bt as pipelineRunnerCapability, cn as _enum, fn as lazy, hn as object, it as loadContributionCapability, ln as array, m as DEVICE_BACKEND_TO_FORMAT, mn as number, p as DEFAULT_NATIVE_LEASE_SETTINGS, pn as literal, rn as nodePin, u as DEFAULT_DETAIL_CROP_CONVENTION, un as boolean, vn as string, vt as pickNativeLeaseOverride, x as NativeLeaseAdmissionSchema } from "../dist-DBWkEUPE.mjs";
2
- import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-dKZFwIEp.mjs";
3
- import { a as localFrameRegistry, d as getStepDefinition, i as rootObjectGate, o as resolveFrameViewGeometry, r as macroGateVerdict } from "../default-detection-model-BtSBlVfL.mjs";
1
+ import { $ as failureContributionCapability, Lt as errMsg, S as NativeLeaseSettingsSchema, U as deriveDetailCropRect, Wt as BaseAddon, Xt as customAction, Yt as createEvent, Zt as defineCustomActions, _ as FailureCounters, _t as pickDetailCropConvention, b as MOTION_CLOSE_AFTER_MS, bn as EventCategory, bt as pipelineRunnerCapability, cn as _enum, fn as lazy, hn as object, it as loadContributionCapability, ln as array, m as DEVICE_BACKEND_TO_FORMAT, mn as number, p as DEFAULT_NATIVE_LEASE_SETTINGS, pn as literal, rn as nodePin, u as DEFAULT_DETAIL_CROP_CONVENTION, un as boolean, vn as string, vt as pickNativeLeaseOverride, x as NativeLeaseAdmissionSchema } from "../dist-Cq5LGFGb.mjs";
2
+ import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-DSO2p3Sv.mjs";
3
+ import { a as localFrameRegistry, d as getStepDefinition, i as rootObjectGate, o as resolveFrameViewGeometry, r as macroGateVerdict } from "../default-detection-model-BAqtelIs.mjs";
4
4
  import { t as isWorkerReply } from "../worker-protocol-C_W-P_g-.mjs";
5
5
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
6
6
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-Bmn60GTy.js");
2
+ const require_dist = require("./dist-BNuwrzez.js");
3
3
  let node_fs = require("node:fs");
4
4
  node_fs = require_chunk.__toESM(node_fs);
5
5
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { mt as parseProcStatus } from "./dist-DBWkEUPE.mjs";
1
+ import { mt as parseProcStatus } from "./dist-Cq5LGFGb.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile } from "node:child_process";
4
4
  //#region src/shared/node-topology-platform.ts
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-Bmn60GTy.js");
7
- const require_node = require("../node-_tNMjSF6.js");
6
+ const require_dist = require("../dist-BNuwrzez.js");
7
+ const require_node = require("../node-DT8wMxzw.js");
8
8
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
9
9
  const require_restream_intent = require("../restream-intent-iKGCB9IR.js");
10
10
  const require_retire_root_keys = require("../retire-root-keys-Csb8z2f3.js");
@@ -11928,6 +11928,31 @@ function pendingMovesSignature(moves) {
11928
11928
  return moves.map((m) => `${String(m.deviceId)}:${m.profile}>${m.plannedFor}`).join(",");
11929
11929
  }
11930
11930
  //#endregion
11931
+ //#region src/recorder/addon/hour-adoption-catchup.ts
11932
+ /**
11933
+ * @returns true when the run stopped with work still to do — the caller should
11934
+ * come back SOON rather than at the next daily tick. A repair that knows it
11935
+ * is unfinished and waits a day is how an archive stays short for months.
11936
+ */
11937
+ async function runAdoptionCatchUp(deps) {
11938
+ const startedAt = deps.now();
11939
+ const spent = () => deps.now() - startedAt;
11940
+ for (const locationId of deps.locationIds) for (;;) {
11941
+ if (spent() >= deps.budgetMs) return true;
11942
+ let report;
11943
+ try {
11944
+ report = await deps.sweep({ locationId });
11945
+ } catch (error) {
11946
+ deps.onError?.(locationId, error);
11947
+ break;
11948
+ }
11949
+ if (!report.bounded) break;
11950
+ if (spent() >= deps.budgetMs) return true;
11951
+ await deps.pace();
11952
+ }
11953
+ return false;
11954
+ }
11955
+ //#endregion
11931
11956
  //#region src/recorder/addon/hour-adoption-sweep.ts
11932
11957
  var HOUR_MS$1 = 36e5;
11933
11958
  /** The profile trees a camera directory is allowed to have. Everything else
@@ -12196,12 +12221,16 @@ function startPeriodicPass(deps) {
12196
12221
  };
12197
12222
  const timer = setInterval(fire, deps.intervalMs);
12198
12223
  timer.unref?.();
12224
+ const firstRun = deps.firstRunDelayMs === void 0 ? null : setTimeout(fire, deps.firstRunDelayMs);
12225
+ firstRun?.unref?.();
12199
12226
  return {
12200
12227
  stop() {
12201
12228
  stopped = true;
12202
12229
  clearInterval(timer);
12230
+ if (firstRun !== null) clearTimeout(firstRun);
12203
12231
  },
12204
- isRunning: () => startedAt !== null
12232
+ isRunning: () => startedAt !== null,
12233
+ fireNow: fire
12205
12234
  };
12206
12235
  }
12207
12236
  //#endregion
@@ -17793,6 +17822,29 @@ var LEDGER_WALK_PAUSE_MS = 100;
17793
17822
  * are already contending for that array.
17794
17823
  */
17795
17824
  var HOUR_ADOPTION_INTERVAL_MS = 1440 * 6e4;
17825
+ /**
17826
+ * How long after boot the first adoption pass runs.
17827
+ *
17828
+ * Long enough that it is not competing with everything else a starting recorder
17829
+ * does (locations resolving, writers attaching, the ledger warming), short
17830
+ * enough that a hub restarted twice in an evening still repairs its archive.
17831
+ */
17832
+ var HOUR_ADOPTION_FIRST_RUN_DELAY_MS = 3 * 6e4;
17833
+ /**
17834
+ * How long one adoption run may keep sweeping bounded locations.
17835
+ *
17836
+ * Long enough to make real progress on a damaged archive (the first pass here
17837
+ * moved ~29 k segments in about twenty seconds of listings), short enough that
17838
+ * the array is not being walked continuously — every listing is a `readdir` on
17839
+ * a spinning disk shared with live writers.
17840
+ */
17841
+ var HOUR_ADOPTION_CATCHUP_BUDGET_MS = 10 * 6e4;
17842
+ /**
17843
+ * How long the recorder waits before resuming an adoption run that stopped on
17844
+ * its budget. Enough of a gap that the array is not walked back-to-back;
17845
+ * nothing like a day.
17846
+ */
17847
+ var HOUR_ADOPTION_RESUME_MS = 5 * 6e4;
17796
17848
  /** An adoption pass longer than this is reported with its duration. Bounded
17797
17849
  * work (512 hour listings, paced) — minutes is normal, an hour is not. */
17798
17850
  var HOUR_ADOPTION_SLOW_AFTER_MS = 10 * 6e4;
@@ -18021,6 +18073,7 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
18021
18073
  * the storage record no longer has. Armed in `onHubReachable`. */
18022
18074
  ghostLocationPass = null;
18023
18075
  hourAdoptionPass = null;
18076
+ hourAdoptionResume;
18024
18077
  /** Reversible migration pause lease; never reflected in RecordingConfig. */
18025
18078
  storageMigrationLeaseId = null;
18026
18079
  /**
@@ -18920,9 +18973,30 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
18920
18973
  this.hourAdoptionPass = startPeriodicPass({
18921
18974
  name: "hour-adoption",
18922
18975
  intervalMs: HOUR_ADOPTION_INTERVAL_MS,
18976
+ firstRunDelayMs: HOUR_ADOPTION_FIRST_RUN_DELAY_MS,
18923
18977
  slowAfterMs: HOUR_ADOPTION_SLOW_AFTER_MS,
18924
18978
  run: async () => {
18925
- for (const location of this.resolvedLocations) await adopter.sweep({ locationId: location.id });
18979
+ if (await runAdoptionCatchUp({
18980
+ locationIds: this.resolvedLocations.map((location) => location.id),
18981
+ sweep: (input) => adopter.sweep(input),
18982
+ budgetMs: HOUR_ADOPTION_CATCHUP_BUDGET_MS,
18983
+ now: () => Date.now(),
18984
+ pace: () => require_dist.sleep(LEDGER_WALK_PAUSE_MS),
18985
+ onError: (locationId, error) => {
18986
+ this.ctx.logger.warn("recorder: hour adoption could not sweep a location", { meta: {
18987
+ locationId,
18988
+ error: require_dist.errMsg(error)
18989
+ } });
18990
+ }
18991
+ })) {
18992
+ this.ctx.logger.info("recorder: hour adoption stopped on its budget with work left — resuming shortly", { meta: { resumeInMs: HOUR_ADOPTION_RESUME_MS } });
18993
+ this.hourAdoptionResume?.unref?.();
18994
+ clearTimeout(this.hourAdoptionResume);
18995
+ this.hourAdoptionResume = setTimeout(() => {
18996
+ this.hourAdoptionPass?.fireNow();
18997
+ }, HOUR_ADOPTION_RESUME_MS);
18998
+ this.hourAdoptionResume.unref?.();
18999
+ }
18926
19000
  },
18927
19001
  logger: this.ctx.logger
18928
19002
  });
@@ -1,5 +1,5 @@
1
- import { $t as hydrateSchema, C as OpsLogEntrySchema, Ct as recordingExportCapability, D as RECORDING_EXPORT_MAX_READ_BYTES, Dt as resolveLocationMode, H as deriveBatteryPresence, I as batteryCapability, Kt as DeviceFeature, Lt as errMsg, Mt as storageOccupancyCapability, O as RecordingConfigSchema, Pt as stripRetiredBandPreBufferSec, Q as evictionPolicyOfLocation, St as recordingCapability, W as deriveRecordingMode, Wt as BaseAddon, Xt as customAction, Y as evaluateSensorEdge, Z as evictionPolicyForMode, Zt as defineCustomActions, _n as record, bn as EventCategory, cn as _enum, ct as mayReadLocation, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, dt as modeMayWrite, et as gbToBytes, g as ExportRecordSchema, gn as preprocess, hn as object, i as BatteryStatusSchema, it as loadContributionCapability, jt as storageEvictableCapability, k as RecordingSignalStatusSchema, kt as resolveRecordingProfiles, ln as array, lt as mayWriteToLocation, mn as number, on as selectAssignedProfileSlots, qt as DeviceType, rn as nodePin, rt as isFirstLevelMacroClass, sn as sleep$1, un as boolean, ut as migrateLegacyDeviceSignalConfig, vn as string, wt as recordingSignalCapability } from "../dist-DBWkEUPE.mjs";
2
- import { a as physicalRootOf, i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-dKZFwIEp.mjs";
1
+ import { $t as hydrateSchema, C as OpsLogEntrySchema, Ct as recordingExportCapability, D as RECORDING_EXPORT_MAX_READ_BYTES, Dt as resolveLocationMode, H as deriveBatteryPresence, I as batteryCapability, Kt as DeviceFeature, Lt as errMsg, Mt as storageOccupancyCapability, O as RecordingConfigSchema, Pt as stripRetiredBandPreBufferSec, Q as evictionPolicyOfLocation, St as recordingCapability, W as deriveRecordingMode, Wt as BaseAddon, Xt as customAction, Y as evaluateSensorEdge, Z as evictionPolicyForMode, Zt as defineCustomActions, _n as record, bn as EventCategory, cn as _enum, ct as mayReadLocation, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, dt as modeMayWrite, et as gbToBytes, g as ExportRecordSchema, gn as preprocess, hn as object, i as BatteryStatusSchema, it as loadContributionCapability, jt as storageEvictableCapability, k as RecordingSignalStatusSchema, kt as resolveRecordingProfiles, ln as array, lt as mayWriteToLocation, mn as number, on as selectAssignedProfileSlots, qt as DeviceType, rn as nodePin, rt as isFirstLevelMacroClass, sn as sleep$1, un as boolean, ut as migrateLegacyDeviceSignalConfig, vn as string, wt as recordingSignalCapability } from "../dist-Cq5LGFGb.mjs";
2
+ import { a as physicalRootOf, i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-DSO2p3Sv.mjs";
3
3
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
4
4
  import { d as PREBUFFER_MAX_MS, l as withRecordingIntent, r as RECORDING_PRE_ROLL_REQUEST_MS } from "../restream-intent-CW79dvFV.mjs";
5
5
  import { n as RowMapStore, t as retireRootKeys } from "../retire-root-keys-DZvlso2l.mjs";
@@ -11921,6 +11921,31 @@ function pendingMovesSignature(moves) {
11921
11921
  return moves.map((m) => `${String(m.deviceId)}:${m.profile}>${m.plannedFor}`).join(",");
11922
11922
  }
11923
11923
  //#endregion
11924
+ //#region src/recorder/addon/hour-adoption-catchup.ts
11925
+ /**
11926
+ * @returns true when the run stopped with work still to do — the caller should
11927
+ * come back SOON rather than at the next daily tick. A repair that knows it
11928
+ * is unfinished and waits a day is how an archive stays short for months.
11929
+ */
11930
+ async function runAdoptionCatchUp(deps) {
11931
+ const startedAt = deps.now();
11932
+ const spent = () => deps.now() - startedAt;
11933
+ for (const locationId of deps.locationIds) for (;;) {
11934
+ if (spent() >= deps.budgetMs) return true;
11935
+ let report;
11936
+ try {
11937
+ report = await deps.sweep({ locationId });
11938
+ } catch (error) {
11939
+ deps.onError?.(locationId, error);
11940
+ break;
11941
+ }
11942
+ if (!report.bounded) break;
11943
+ if (spent() >= deps.budgetMs) return true;
11944
+ await deps.pace();
11945
+ }
11946
+ return false;
11947
+ }
11948
+ //#endregion
11924
11949
  //#region src/recorder/addon/hour-adoption-sweep.ts
11925
11950
  var HOUR_MS$1 = 36e5;
11926
11951
  /** The profile trees a camera directory is allowed to have. Everything else
@@ -12189,12 +12214,16 @@ function startPeriodicPass(deps) {
12189
12214
  };
12190
12215
  const timer = setInterval(fire, deps.intervalMs);
12191
12216
  timer.unref?.();
12217
+ const firstRun = deps.firstRunDelayMs === void 0 ? null : setTimeout(fire, deps.firstRunDelayMs);
12218
+ firstRun?.unref?.();
12192
12219
  return {
12193
12220
  stop() {
12194
12221
  stopped = true;
12195
12222
  clearInterval(timer);
12223
+ if (firstRun !== null) clearTimeout(firstRun);
12196
12224
  },
12197
- isRunning: () => startedAt !== null
12225
+ isRunning: () => startedAt !== null,
12226
+ fireNow: fire
12198
12227
  };
12199
12228
  }
12200
12229
  //#endregion
@@ -17786,6 +17815,29 @@ var LEDGER_WALK_PAUSE_MS = 100;
17786
17815
  * are already contending for that array.
17787
17816
  */
17788
17817
  var HOUR_ADOPTION_INTERVAL_MS = 1440 * 6e4;
17818
+ /**
17819
+ * How long after boot the first adoption pass runs.
17820
+ *
17821
+ * Long enough that it is not competing with everything else a starting recorder
17822
+ * does (locations resolving, writers attaching, the ledger warming), short
17823
+ * enough that a hub restarted twice in an evening still repairs its archive.
17824
+ */
17825
+ var HOUR_ADOPTION_FIRST_RUN_DELAY_MS = 3 * 6e4;
17826
+ /**
17827
+ * How long one adoption run may keep sweeping bounded locations.
17828
+ *
17829
+ * Long enough to make real progress on a damaged archive (the first pass here
17830
+ * moved ~29 k segments in about twenty seconds of listings), short enough that
17831
+ * the array is not being walked continuously — every listing is a `readdir` on
17832
+ * a spinning disk shared with live writers.
17833
+ */
17834
+ var HOUR_ADOPTION_CATCHUP_BUDGET_MS = 10 * 6e4;
17835
+ /**
17836
+ * How long the recorder waits before resuming an adoption run that stopped on
17837
+ * its budget. Enough of a gap that the array is not walked back-to-back;
17838
+ * nothing like a day.
17839
+ */
17840
+ var HOUR_ADOPTION_RESUME_MS = 5 * 6e4;
17789
17841
  /** An adoption pass longer than this is reported with its duration. Bounded
17790
17842
  * work (512 hour listings, paced) — minutes is normal, an hour is not. */
17791
17843
  var HOUR_ADOPTION_SLOW_AFTER_MS = 10 * 6e4;
@@ -18014,6 +18066,7 @@ var RecorderV2Addon = class extends BaseAddon {
18014
18066
  * the storage record no longer has. Armed in `onHubReachable`. */
18015
18067
  ghostLocationPass = null;
18016
18068
  hourAdoptionPass = null;
18069
+ hourAdoptionResume;
18017
18070
  /** Reversible migration pause lease; never reflected in RecordingConfig. */
18018
18071
  storageMigrationLeaseId = null;
18019
18072
  /**
@@ -18913,9 +18966,30 @@ var RecorderV2Addon = class extends BaseAddon {
18913
18966
  this.hourAdoptionPass = startPeriodicPass({
18914
18967
  name: "hour-adoption",
18915
18968
  intervalMs: HOUR_ADOPTION_INTERVAL_MS,
18969
+ firstRunDelayMs: HOUR_ADOPTION_FIRST_RUN_DELAY_MS,
18916
18970
  slowAfterMs: HOUR_ADOPTION_SLOW_AFTER_MS,
18917
18971
  run: async () => {
18918
- for (const location of this.resolvedLocations) await adopter.sweep({ locationId: location.id });
18972
+ if (await runAdoptionCatchUp({
18973
+ locationIds: this.resolvedLocations.map((location) => location.id),
18974
+ sweep: (input) => adopter.sweep(input),
18975
+ budgetMs: HOUR_ADOPTION_CATCHUP_BUDGET_MS,
18976
+ now: () => Date.now(),
18977
+ pace: () => sleep$1(LEDGER_WALK_PAUSE_MS),
18978
+ onError: (locationId, error) => {
18979
+ this.ctx.logger.warn("recorder: hour adoption could not sweep a location", { meta: {
18980
+ locationId,
18981
+ error: errMsg(error)
18982
+ } });
18983
+ }
18984
+ })) {
18985
+ this.ctx.logger.info("recorder: hour adoption stopped on its budget with work left — resuming shortly", { meta: { resumeInMs: HOUR_ADOPTION_RESUME_MS } });
18986
+ this.hourAdoptionResume?.unref?.();
18987
+ clearTimeout(this.hourAdoptionResume);
18988
+ this.hourAdoptionResume = setTimeout(() => {
18989
+ this.hourAdoptionPass?.fireNow();
18990
+ }, HOUR_ADOPTION_RESUME_MS);
18991
+ this.hourAdoptionResume.unref?.();
18992
+ }
18919
18993
  },
18920
18994
  logger: this.ctx.logger
18921
18995
  });
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-DnnnRqeS.mjs";
2
- import { Lt as errMsg } from "./dist-DBWkEUPE.mjs";
2
+ import { Lt as errMsg } from "./dist-Cq5LGFGb.mjs";
3
3
  import { spawn } from "node:child_process";
4
4
  //#region ../../node_modules/mp4box/dist/mp4box.all.js
5
5
  var require_mp4box_all = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-Bmn60GTy.js");
2
+ const require_dist = require("./dist-BNuwrzez.js");
3
3
  let node_child_process = require("node:child_process");
4
4
  //#region ../../node_modules/mp4box/dist/mp4box.all.js
5
5
  var require_mp4box_all = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.212",
21
+ version: "1.2.216",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_stream_broker_widgets",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.2.178",
36
+ version: "1.2.179",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_stream_broker_widgets",
@@ -1,4 +1,4 @@
1
- const require_segment_demux_js = require("../segment-demux-js-D4i63ROu.js");
1
+ const require_segment_demux_js = require("../segment-demux-js-Qevmgb67.js");
2
2
  let node_worker_threads = require("node:worker_threads");
3
3
  //#region src/stream-broker/recorded/demux-worker-child.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as demuxSegmentFullJs } from "../segment-demux-js-dTUWx6pi.mjs";
1
+ import { t as demuxSegmentFullJs } from "../segment-demux-js-DfQPZtVo.mjs";
2
2
  import { parentPort } from "node:worker_threads";
3
3
  //#region src/stream-broker/recorded/demux-worker-child.ts
4
4
  /**
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.212",
39
+ version: "1.2.216",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.178",
84
+ version: "1.2.179",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -3,12 +3,12 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-Bmn60GTy.js");
7
- const require_node = require("../node-_tNMjSF6.js");
6
+ const require_dist = require("../dist-BNuwrzez.js");
7
+ const require_node = require("../node-DT8wMxzw.js");
8
8
  const require_restream_intent = require("../restream-intent-iKGCB9IR.js");
9
9
  const require_remote_restream = require("../remote-restream-CO36Sr30.js");
10
10
  const require_retire_root_keys = require("../retire-root-keys-Csb8z2f3.js");
11
- const require_segment_demux_js = require("../segment-demux-js-D4i63ROu.js");
11
+ const require_segment_demux_js = require("../segment-demux-js-Qevmgb67.js");
12
12
  let node_os = require("node:os");
13
13
  node_os = require_chunk.__toESM(node_os);
14
14
  let node_crypto = require("node:crypto");
@@ -1,10 +1,10 @@
1
1
  import { r as __toESM } from "../chunk-DnnnRqeS.mjs";
2
- import { A as RingBuffer, B as declareLogChannel, Bt as buildFfmpegArgs$1, E as RATE_CONTROL_TIGHT, Et as resolveEgressDecodeHwAccel, Gt as CAM_PROFILE_ORDER, H as deriveBatteryPresence, Ht as isSoftwareDecode, I as batteryCapability, It as webrtcSessionCapability, K as egressTranscodeSharingKey, Kt as DeviceFeature, L as cameraStreamsCapability, Lt as errMsg, M as addonWidgetsSourceCapability, Nt as streamBrokerCapability, Qt as expandAudioChunkToF32le, R as createHwAccelCache, Rt as AUDIO_PRESETS, T as RATE_CONTROL_RELAXED, Ut as BOOT_RECOVERY_BACKOFF_MS, Vt as invocationFromEncodeProfile, Wt as BaseAddon, Yt as createEvent, _n as record, an as parseProfileBrokerId, at as logChannelsCapability, bn as EventCategory, cn as _enum, dn as discriminatedUnion, en as isEvent, h as EncodeProfileSchema, hn as object, i as BatteryStatusSchema, it as loadContributionCapability, ln as array, mn as number, nn as makeSourceBrokerId, pn as literal, q as egressTransportFromRequest, qt as DeviceType, rn as nodePin, st as maskUrlCredentials, tn as makeProfileBrokerId, un as boolean, v as G711_SCALE_CORRECTION_DB, vn as string, xt as rankStreams, yn as union, z as createLogChannelsProvider } from "../dist-DBWkEUPE.mjs";
3
- import { i as NO_COST_CLAIM, n as Fmp4FragmentChild, r as Fmp4FragmentPlane, t as ChildCostRegistry } from "../node-dKZFwIEp.mjs";
2
+ import { A as RingBuffer, B as declareLogChannel, Bt as buildFfmpegArgs$1, E as RATE_CONTROL_TIGHT, Et as resolveEgressDecodeHwAccel, Gt as CAM_PROFILE_ORDER, H as deriveBatteryPresence, Ht as isSoftwareDecode, I as batteryCapability, It as webrtcSessionCapability, K as egressTranscodeSharingKey, Kt as DeviceFeature, L as cameraStreamsCapability, Lt as errMsg, M as addonWidgetsSourceCapability, Nt as streamBrokerCapability, Qt as expandAudioChunkToF32le, R as createHwAccelCache, Rt as AUDIO_PRESETS, T as RATE_CONTROL_RELAXED, Ut as BOOT_RECOVERY_BACKOFF_MS, Vt as invocationFromEncodeProfile, Wt as BaseAddon, Yt as createEvent, _n as record, an as parseProfileBrokerId, at as logChannelsCapability, bn as EventCategory, cn as _enum, dn as discriminatedUnion, en as isEvent, h as EncodeProfileSchema, hn as object, i as BatteryStatusSchema, it as loadContributionCapability, ln as array, mn as number, nn as makeSourceBrokerId, pn as literal, q as egressTransportFromRequest, qt as DeviceType, rn as nodePin, st as maskUrlCredentials, tn as makeProfileBrokerId, un as boolean, v as G711_SCALE_CORRECTION_DB, vn as string, xt as rankStreams, yn as union, z as createLogChannelsProvider } from "../dist-Cq5LGFGb.mjs";
3
+ import { i as NO_COST_CLAIM, n as Fmp4FragmentChild, r as Fmp4FragmentPlane, t as ChildCostRegistry } from "../node-DSO2p3Sv.mjs";
4
4
  import { a as parseRestreamPath, d as PREBUFFER_MAX_MS, f as capPreRollRequestMs, i as isLiveEdgeOnlyDial, m as resolvePrebuffer, n as NO_DECLARATION, p as prebufferRetentionMs, s as sdpVariantFor, u as withSentryIntent } from "../restream-intent-CW79dvFV.mjs";
5
5
  import { n as profileForStreamId } from "../remote-restream-BeHi78PZ.mjs";
6
6
  import { n as RowMapStore, t as retireRootKeys } from "../retire-root-keys-DZvlso2l.mjs";
7
- import { i as require_mp4box_all, n as demuxSegmentPreferJs, r as runFfmpegOnce, t as demuxSegmentFullJs } from "../segment-demux-js-dTUWx6pi.mjs";
7
+ import { i as require_mp4box_all, n as demuxSegmentPreferJs, r as runFfmpegOnce, t as demuxSegmentFullJs } from "../segment-demux-js-DfQPZtVo.mjs";
8
8
  import { createRequire } from "node:module";
9
9
  import * as os from "node:os";
10
10
  import { networkInterfaces, tmpdir } from "node:os";
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DuWd4nxA.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-r_tNVu_V.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline",
3
- "version": "1.2.261",
3
+ "version": "1.2.264",
4
4
  "description": "Pipeline bundle — runner, detection, motion, audio + stream broker. Multi-entry npm package shipping pipeline addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",