@camstack/addon-pipeline 1.2.144 → 1.2.146

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 (35) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/detection-pipeline/index.js +33 -32
  4. package/dist/detection-pipeline/index.mjs +5 -4
  5. package/dist/{dist-Dpy1KP1q.js → dist-DML3mpn9.js} +6 -6
  6. package/dist/{dist-uX-YDOrc.mjs → dist-cZopp8Xm.mjs} +6 -6
  7. package/dist/event-loop-stall-monitor-DXLNBMkY.mjs +138 -0
  8. package/dist/event-loop-stall-monitor-DaUBcb13.js +149 -0
  9. package/dist/{lazy-sharp-zDl97I3e.js → lazy-sharp-BzXIjfN8.js} +1 -1
  10. package/dist/{event-loop-stall-monitor-6YKQeg7_.mjs → local-frame-registry-Ctv_TzmF.mjs} +2 -139
  11. package/dist/{event-loop-stall-monitor-D947d97M.js → local-frame-registry-DO8-LuSo.js} +1 -150
  12. package/dist/motion-wasm/index.js +2 -2
  13. package/dist/motion-wasm/index.mjs +1 -1
  14. package/dist/{node-DuMWMV01.mjs → node-Br6p9KvD.mjs} +1 -1
  15. package/dist/{node-v9ZAGK2b.js → node-OvVqe9eh.js} +1 -1
  16. package/dist/pipeline-runner/index.js +14 -13
  17. package/dist/pipeline-runner/index.mjs +5 -4
  18. package/dist/{process-memory-CNISjywZ.mjs → process-memory-DX25Z60Q.mjs} +1 -1
  19. package/dist/{process-memory-ClAfQ1Nl.js → process-memory-NWKrKfmi.js} +1 -1
  20. package/dist/recorder/index.js +563 -41
  21. package/dist/recorder/index.mjs +563 -41
  22. package/dist/{segment-demux-js-Bpedn-T8.js → segment-demux-js-CerfMroc.js} +1 -1
  23. package/dist/{segment-demux-js-CCMG51zw.mjs → segment-demux-js-DGmFQ1Zj.mjs} +1 -1
  24. package/dist/session-decode/decode-worker-child.js +2 -2
  25. package/dist/session-decode/decode-worker-child.mjs +1 -1
  26. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-MRLUZgkR.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DQNgiTjz.mjs} +3 -3
  27. package/dist/stream-broker/demux-worker-child.js +1 -1
  28. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  29. package/dist/stream-broker/{hostInit-w0ytBmjx.mjs → hostInit-NShcJE25.mjs} +3 -3
  30. package/dist/stream-broker/index.js +3 -3
  31. package/dist/stream-broker/index.mjs +3 -3
  32. package/dist/stream-broker/remoteEntry.js +1 -1
  33. package/dist/{worker-protocol-Cd-G92Qt.mjs → worker-protocol-CUCQ1IPR.mjs} +1 -1
  34. package/dist/{worker-protocol-Cn5x8dbW.js → worker-protocol-Dt3zWCQY.js} +1 -1
  35. package/package.json +1 -1
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Dpy1KP1q.js");
6
- const require_process_memory = require("../process-memory-ClAfQ1Nl.js");
5
+ const require_dist = require("../dist-DML3mpn9.js");
6
+ const require_process_memory = require("../process-memory-NWKrKfmi.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_dist.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,6 +1,6 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { A as audioAnalysisCapability, It as hydrateSchema, S as PoolMemoryWatchdog, _t as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, jt as BaseAddon, n as AUDIO_BACKEND_CHOICES, nt as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL, wt as errMsg } from "../dist-uX-YDOrc.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CNISjywZ.mjs";
2
+ import { A as audioAnalysisCapability, It as hydrateSchema, S as PoolMemoryWatchdog, _t as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, jt as BaseAddon, n as AUDIO_BACKEND_CHOICES, nt as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL, wt as errMsg } from "../dist-cZopp8Xm.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DX25Z60Q.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";
@@ -2,11 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Dpy1KP1q.js");
6
- const require_node = require("../node-v9ZAGK2b.js");
7
- const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-D947d97M.js");
8
- const require_lazy_sharp = require("../lazy-sharp-zDl97I3e.js");
9
- const require_process_memory = require("../process-memory-ClAfQ1Nl.js");
5
+ const require_dist = require("../dist-DML3mpn9.js");
6
+ const require_node = require("../node-OvVqe9eh.js");
7
+ const require_local_frame_registry = require("../local-frame-registry-DO8-LuSo.js");
8
+ const require_lazy_sharp = require("../lazy-sharp-BzXIjfN8.js");
9
+ const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
+ const require_process_memory = require("../process-memory-NWKrKfmi.js");
10
11
  let node_fs = require("node:fs");
11
12
  node_fs = require_dist.__toESM(node_fs);
12
13
  let node_path = require("node:path");
@@ -519,7 +520,7 @@ function classifyAccelerator(backend, device) {
519
520
  * missing-build fallback branch is unit-testable without a live catalog —
520
521
  * mirrors `collectZeroBuildIssues`' injection seam.
521
522
  */
522
- function resolveDefaultDetectionModel(backend, device, format, getStepDef = require_event_loop_stall_monitor.getStepDefinition) {
523
+ function resolveDefaultDetectionModel(backend, device, format, getStepDef = require_local_frame_registry.getStepDefinition) {
523
524
  let def;
524
525
  try {
525
526
  def = getStepDef(OBJECT_DETECTION_STEP_ID);
@@ -531,7 +532,7 @@ function resolveDefaultDetectionModel(backend, device, format, getStepDef = requ
531
532
  const entry = def.models.find((m) => m.id === candidate);
532
533
  if (entry && entry.formats[format] !== void 0) return candidate;
533
534
  }
534
- return require_event_loop_stall_monitor.getDefaultModelForFormatFromDef(def, format);
535
+ return require_local_frame_registry.getDefaultModelForFormatFromDef(def, format);
535
536
  }
536
537
  //#endregion
537
538
  //#region src/detection-pipeline/device-override-mirror.ts
@@ -2524,7 +2525,7 @@ var EngineFactory = class {
2524
2525
  * to `buildConfig`, which throws the message naming the step and the model.
2525
2526
  */
2526
2527
  resolveDecode(stepId, modelId, settings) {
2527
- const def = require_event_loop_stall_monitor.getStepDefinition(stepId);
2528
+ const def = require_local_frame_registry.getStepDefinition(stepId);
2528
2529
  const modelEntry = def.models.find((m) => m.id === modelId) ?? this.opts.resolveCustomModel?.(stepId, modelId);
2529
2530
  if (!modelEntry) return null;
2530
2531
  return resolvePoolDecodeSettings({
@@ -2568,7 +2569,7 @@ var EngineFactory = class {
2568
2569
  */
2569
2570
  function buildPoolModelConfigForStep(inputs) {
2570
2571
  const { stepId, modelId, poolRuntime, modelsDir } = inputs;
2571
- const def = require_event_loop_stall_monitor.getStepDefinition(stepId);
2572
+ const def = require_local_frame_registry.getStepDefinition(stepId);
2572
2573
  const modelEntry = def.models.find((m) => m.id === modelId) ?? inputs.resolveCustomModel?.(stepId, modelId);
2573
2574
  if (!modelEntry) throw new Error(`Model "${modelId}" not found in step "${stepId}" catalog (static or custom registry)`);
2574
2575
  const format = RUNTIME_TO_FORMAT[poolRuntime];
@@ -5427,7 +5428,7 @@ var PipelineExecutor = class {
5427
5428
  this.warnFaceTooSmall(child, detShortSide, minFaceSize, void 0, deviceId);
5428
5429
  continue;
5429
5430
  }
5430
- const precision = require_event_loop_stall_monitor.landmarkPrecisionVerdict({
5431
+ const precision = require_local_frame_registry.landmarkPrecisionVerdict({
5431
5432
  detectionShortSidePx: detShortSide,
5432
5433
  floorPx: numericSetting(child.settings, "minLandmarkFaceSize", 24)
5433
5434
  });
@@ -5690,7 +5691,7 @@ function buildExecutableTree(steps, getEngine, resolveModel) {
5690
5691
  return { roots: steps.filter((s) => s.enabled).filter((s) => s.slot !== "audio-classifier").map((s) => buildNode(s, getEngine, resolveModel)) };
5691
5692
  }
5692
5693
  function buildNode(step, getEngine, resolveModel) {
5693
- const definition = require_event_loop_stall_monitor.getStepDefinition(step.addonId);
5694
+ const definition = require_local_frame_registry.getStepDefinition(step.addonId);
5694
5695
  const engine = getEngine(step.addonId);
5695
5696
  const children = (step.children ?? []).filter((c) => c.enabled).map((c) => buildNode(c, getEngine, resolveModel));
5696
5697
  const mergedSettings = {
@@ -5717,7 +5718,7 @@ function buildNode(step, getEngine, resolveModel) {
5717
5718
  * entered recursively. Fields without a declared default are skipped.
5718
5719
  */
5719
5720
  function collectSchemaDefaults(stepId) {
5720
- const schema = require_event_loop_stall_monitor.getStep(stepId).getConfigSchema();
5721
+ const schema = require_local_frame_registry.getStep(stepId).getConfigSchema();
5721
5722
  const out = {};
5722
5723
  walkFieldsForDefaults(schema, out);
5723
5724
  return out;
@@ -5811,7 +5812,7 @@ function mergeCustomModels(staticModels, customModels) {
5811
5812
  */
5812
5813
  var defaultLookup = (stepId) => {
5813
5814
  try {
5814
- return require_event_loop_stall_monitor.getStepDefinition(stepId);
5815
+ return require_local_frame_registry.getStepDefinition(stepId);
5815
5816
  } catch {
5816
5817
  return null;
5817
5818
  }
@@ -5860,7 +5861,7 @@ function collectSubstitutions(steps, format) {
5860
5861
  for (const step of steps) {
5861
5862
  const chosen = step.modelId;
5862
5863
  if (chosen != null) {
5863
- const running = require_event_loop_stall_monitor.resolveModelForFormat(step.addonId, chosen, format);
5864
+ const running = require_local_frame_registry.resolveModelForFormat(step.addonId, chosen, format);
5864
5865
  if (running !== chosen) result.push({
5865
5866
  addonId: step.addonId,
5866
5867
  chosen,
@@ -5886,7 +5887,7 @@ function collectSubstitutions(steps, format) {
5886
5887
  * black-box test. Unknown/custom addonIds (no registered `StepDefinition`)
5887
5888
  * are skipped, never thrown.
5888
5889
  */
5889
- function collectZeroBuildIssues(steps, format, getStepDef = require_event_loop_stall_monitor.getStepDefinition) {
5890
+ function collectZeroBuildIssues(steps, format, getStepDef = require_local_frame_registry.getStepDefinition) {
5890
5891
  const result = [];
5891
5892
  for (const step of steps) {
5892
5893
  let def;
@@ -5912,7 +5913,7 @@ function collectZeroBuildIssues(steps, format, getStepDef = require_event_loop_s
5912
5913
  * tests can exercise the unknown-addon branch with a fabricated resolver
5913
5914
  * without `vi.mock`.
5914
5915
  */
5915
- function collectUnknownAddonIssues(steps, getStepDef = require_event_loop_stall_monitor.getStepDefinition) {
5916
+ function collectUnknownAddonIssues(steps, getStepDef = require_local_frame_registry.getStepDefinition) {
5916
5917
  const result = [];
5917
5918
  for (const step of steps) {
5918
5919
  try {
@@ -5953,7 +5954,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
5953
5954
  for (const s of steps) {
5954
5955
  let def;
5955
5956
  try {
5956
- def = require_event_loop_stall_monitor.getStepDefinition(s.addonId);
5957
+ def = require_local_frame_registry.getStepDefinition(s.addonId);
5957
5958
  } catch {
5958
5959
  unknownAddonIds.push(s.addonId);
5959
5960
  continue;
@@ -5989,7 +5990,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
5989
5990
  }
5990
5991
  }
5991
5992
  const chosenModelId = s.modelId ?? null;
5992
- const runningModelId = chosenModelId === null && engine !== void 0 && s.addonId === "object-detection" ? resolveDefaultDetectionModel(engine.backend, engine.device, format) : require_event_loop_stall_monitor.resolveModelForFormat(s.addonId, chosenModelId, format);
5993
+ const runningModelId = chosenModelId === null && engine !== void 0 && s.addonId === "object-detection" ? resolveDefaultDetectionModel(engine.backend, engine.device, format) : require_local_frame_registry.resolveModelForFormat(s.addonId, chosenModelId, format);
5993
5994
  if (chosenModelId !== null && runningModelId !== chosenModelId) substitutions.push({
5994
5995
  addonId: s.addonId,
5995
5996
  chosen: chosenModelId,
@@ -7004,7 +7005,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7004
7005
  * first, then the custom registry. Returns undefined if neither has it.
7005
7006
  */
7006
7007
  async resolveModelEntry(addonId, modelId) {
7007
- const fromCatalog = require_event_loop_stall_monitor.getStepDefinition(addonId).models.find((m) => m.id === modelId);
7008
+ const fromCatalog = require_local_frame_registry.getStepDefinition(addonId).models.find((m) => m.id === modelId);
7008
7009
  if (fromCatalog) return fromCatalog;
7009
7010
  return (await this.getCustomModels()).get(addonId)?.find((m) => m.id === modelId);
7010
7011
  }
@@ -7100,7 +7101,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7100
7101
  /** Pure recursive resolver — builds the resolved step tree without touching `modelSubstitutions`. */
7101
7102
  resolveStepModelTree(steps, format) {
7102
7103
  return steps.map((step) => {
7103
- const resolved = require_event_loop_stall_monitor.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
7104
+ const resolved = require_local_frame_registry.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
7104
7105
  const children = step.children?.length ? this.resolveStepModelTree([...step.children], format) : step.children;
7105
7106
  return resolved === step.modelId && children === step.children ? step : {
7106
7107
  ...step,
@@ -7248,7 +7249,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7248
7249
  for (const step of nodes) {
7249
7250
  if (!step.enabled) continue;
7250
7251
  try {
7251
- if (require_event_loop_stall_monitor.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
7252
+ if (require_local_frame_registry.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
7252
7253
  } catch {
7253
7254
  continue;
7254
7255
  }
@@ -7268,7 +7269,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7268
7269
  async getCapabilities(_forceRefresh) {
7269
7270
  const agentId = (this.addonCtx?.kernel?.cluster?.broker)?.nodeID ?? node_os.hostname();
7270
7271
  const agentName = agentId;
7271
- const addons = require_event_loop_stall_monitor.ALL_PIPELINE_STEPS.map((s) => ({
7272
+ const addons = require_local_frame_registry.ALL_PIPELINE_STEPS.map((s) => ({
7272
7273
  id: s.definition.id,
7273
7274
  name: s.definition.name,
7274
7275
  models: s.definition.models.filter((m) => m.legacy !== true).map((m) => {
@@ -7766,7 +7767,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7766
7767
  let frameViewResolver;
7767
7768
  let rootInputViewProvider;
7768
7769
  if (runtimeFrameRef) {
7769
- frameViewResolver = createRootFrameViewResolver(require_event_loop_stall_monitor.localFrameRegistry, runtimeFrameRef);
7770
+ frameViewResolver = createRootFrameViewResolver(require_local_frame_registry.localFrameRegistry, runtimeFrameRef);
7770
7771
  rootInputViewProvider = async (root, crop) => {
7771
7772
  const view = await frameViewResolver(root, crop ? {
7772
7773
  left: crop[0],
@@ -9213,7 +9214,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9213
9214
  function buildSchemaSlots(formats, modelsDir, customByStep) {
9214
9215
  const slotMap = /* @__PURE__ */ new Map();
9215
9216
  const formatList = [...formats];
9216
- for (const pipelineStep of require_event_loop_stall_monitor.ALL_PIPELINE_STEPS) {
9217
+ for (const pipelineStep of require_local_frame_registry.ALL_PIPELINE_STEPS) {
9217
9218
  const step = pipelineStep.definition;
9218
9219
  const availableModels = mergeCustomModels(step.models, customByStep?.get(step.id) ?? []).filter((m) => m.legacy !== true && formatList.some((f) => m.formats[f]));
9219
9220
  if (availableModels.length === 0) continue;
@@ -9307,7 +9308,7 @@ function resolveChildSlots(slot) {
9307
9308
  */
9308
9309
  function buildDefaultStepTree(format, objectDetectionModelId) {
9309
9310
  const makeStep = (stepId, children, opts) => {
9310
- const def = require_event_loop_stall_monitor.getStepDefinition(stepId);
9311
+ const def = require_local_frame_registry.getStepDefinition(stepId);
9311
9312
  if (!def.models.some((m) => m.formats[format])) return null;
9312
9313
  return {
9313
9314
  addonId: def.id,
@@ -9316,7 +9317,7 @@ function buildDefaultStepTree(format, objectDetectionModelId) {
9316
9317
  inputClasses: def.inputClasses ?? [],
9317
9318
  outputClasses: def.outputClasses,
9318
9319
  enabled: opts?.enabled ?? true,
9319
- modelId: opts?.modelId ?? require_event_loop_stall_monitor.getDefaultModelForFormat(stepId, format),
9320
+ modelId: opts?.modelId ?? require_local_frame_registry.getDefaultModelForFormat(stepId, format),
9320
9321
  children,
9321
9322
  ...def.group ? { group: def.group } : {}
9322
9323
  };
@@ -9373,7 +9374,7 @@ function flattenSteps(steps) {
9373
9374
  */
9374
9375
  function isDetailPlaneStep(addonId) {
9375
9376
  try {
9376
- return require_event_loop_stall_monitor.getStepDefinition(addonId).inputClasses !== null;
9377
+ return require_local_frame_registry.getStepDefinition(addonId).inputClasses !== null;
9377
9378
  } catch {
9378
9379
  return false;
9379
9380
  }
@@ -9394,7 +9395,7 @@ function stepHasZeroBuildsFor(addonId, format) {
9394
9395
  */
9395
9396
  function availableFormatsForStep(addonId) {
9396
9397
  try {
9397
- const def = require_event_loop_stall_monitor.getStepDefinition(addonId);
9398
+ const def = require_local_frame_registry.getStepDefinition(addonId);
9398
9399
  const formats = /* @__PURE__ */ new Set();
9399
9400
  for (const model of def.models) for (const format of Object.keys(model.formats)) formats.add(format);
9400
9401
  return Array.from(formats).toSorted();
@@ -9963,7 +9964,7 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
9963
9964
  }).catch(() => {});
9964
9965
  }
9965
9966
  getModelCatalog() {
9966
- return require_event_loop_stall_monitor.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
9967
+ return require_local_frame_registry.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
9967
9968
  }
9968
9969
  /**
9969
9970
  * Proactively install the OpenVINO Python package when Intel hardware
@@ -10049,9 +10050,9 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
10049
10050
  }
10050
10051
  };
10051
10052
  //#endregion
10052
- exports.ALL_STEPS = require_event_loop_stall_monitor.ALL_STEPS;
10053
+ exports.ALL_STEPS = require_local_frame_registry.ALL_STEPS;
10053
10054
  exports.DetectionPipelineProvider = DetectionPipelineProvider;
10054
10055
  exports.default = DetectionPipelineAddon;
10055
- exports.getDefaultModelForFormat = require_event_loop_stall_monitor.getDefaultModelForFormat;
10056
- exports.getStepDefinition = require_event_loop_stall_monitor.getStepDefinition;
10056
+ exports.getDefaultModelForFormat = require_local_frame_registry.getDefaultModelForFormat;
10057
+ exports.getStepDefinition = require_local_frame_registry.getStepDefinition;
10057
10058
  exports.shouldInstallOpenvino = shouldInstallOpenvino;
@@ -1,9 +1,10 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { Bt as nodePin, Ft as createEvent, It as hydrateSchema, Kt as array, O as YAMNET_TO_MACRO, Q as inferModelProvider, Qt as object, S as PoolMemoryWatchdog, St as supportedRuntimes$1, Vt as parseJsonUnknown, W as detectionPipelineCapability, Wt as sleep, Y as evaluateZoneRules, _t as resolvePoolMemoryPolicy, at as overlayClusterStepSettings, c as DEFAULT_CLUSTER_STEP_MODELS, ct as pickClusterStepSettings, dt as pipelineExecutorCapability, en as string, et as loadContributionCapability, ht as resolveClusterStepModelId, jt as BaseAddon, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, nn as EventCategory, q as enumerateInferenceDevices, st as pickClusterStepModels, t as APPLE_SA_TO_MACRO, tn as union, wt as errMsg, yt as runtimeDevices$1, z as defaultDeviceFor$1 } from "../dist-uX-YDOrc.mjs";
3
- import { a as readProcessCost } from "../node-DuMWMV01.mjs";
4
- import { a as ALL_PIPELINE_STEPS, c as getDefaultModelForFormatFromDef, d as resolveModelForFormat, f as landmarkPrecisionVerdict, l as getStep, n as startEventLoopStallMonitor, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as getStepDefinition } from "../event-loop-stall-monitor-6YKQeg7_.mjs";
2
+ import { Bt as nodePin, Ft as createEvent, It as hydrateSchema, Kt as array, O as YAMNET_TO_MACRO, Q as inferModelProvider, Qt as object, S as PoolMemoryWatchdog, St as supportedRuntimes$1, Vt as parseJsonUnknown, W as detectionPipelineCapability, Wt as sleep, Y as evaluateZoneRules, _t as resolvePoolMemoryPolicy, at as overlayClusterStepSettings, c as DEFAULT_CLUSTER_STEP_MODELS, ct as pickClusterStepSettings, dt as pipelineExecutorCapability, en as string, et as loadContributionCapability, ht as resolveClusterStepModelId, jt as BaseAddon, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, nn as EventCategory, q as enumerateInferenceDevices, st as pickClusterStepModels, t as APPLE_SA_TO_MACRO, tn as union, wt as errMsg, yt as runtimeDevices$1, z as defaultDeviceFor$1 } from "../dist-cZopp8Xm.mjs";
3
+ import { a as readProcessCost } from "../node-Br6p9KvD.mjs";
4
+ import { a as getDefaultModelForFormat, c as getStepDefinition, i as ALL_STEPS, l as resolveModelForFormat, o as getDefaultModelForFormatFromDef, r as ALL_PIPELINE_STEPS, s as getStep, t as localFrameRegistry, u as landmarkPrecisionVerdict } from "../local-frame-registry-Ctv_TzmF.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CNISjywZ.mjs";
6
+ import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
7
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DX25Z60Q.mjs";
7
8
  import * as fs from "node:fs";
8
9
  import * as path$1 from "node:path";
9
10
  import { spawn } from "node:child_process";
@@ -26426,23 +26426,23 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
26426
26426
  sdpOffer: string()
26427
26427
  }), {
26428
26428
  kind: "mutation",
26429
- auth: "admin"
26429
+ auth: "protected"
26430
26430
  }), method(object({
26431
26431
  deviceId: number(),
26432
26432
  sessionId: string(),
26433
26433
  sdpAnswer: string()
26434
26434
  }), _void(), {
26435
26435
  kind: "mutation",
26436
- auth: "admin"
26436
+ auth: "protected"
26437
26437
  }), method(object({
26438
26438
  deviceId: number(),
26439
26439
  sessionId: string()
26440
26440
  }), _void(), {
26441
26441
  kind: "mutation",
26442
- auth: "admin"
26442
+ auth: "protected"
26443
26443
  }), method(object({ deviceId: number() }), object({ sessionId: string() }), {
26444
26444
  kind: "mutation",
26445
- auth: "admin"
26445
+ auth: "protected"
26446
26446
  }), method(object({
26447
26447
  deviceId: number(),
26448
26448
  /** Audio bytes for ONE frame, base64-encoded so the payload
@@ -26461,10 +26461,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
26461
26461
  sequenceNumber: number().int()
26462
26462
  }), object({ accepted: boolean() }), {
26463
26463
  kind: "mutation",
26464
- auth: "admin"
26464
+ auth: "protected"
26465
26465
  }), method(object({ deviceId: number() }), _void(), {
26466
26466
  kind: "mutation",
26467
- auth: "admin"
26467
+ auth: "protected"
26468
26468
  }), object({
26469
26469
  deviceId: number(),
26470
26470
  status: IntercomStatusSchema
@@ -26403,23 +26403,23 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
26403
26403
  sdpOffer: string()
26404
26404
  }), {
26405
26405
  kind: "mutation",
26406
- auth: "admin"
26406
+ auth: "protected"
26407
26407
  }), method(object({
26408
26408
  deviceId: number(),
26409
26409
  sessionId: string(),
26410
26410
  sdpAnswer: string()
26411
26411
  }), _void(), {
26412
26412
  kind: "mutation",
26413
- auth: "admin"
26413
+ auth: "protected"
26414
26414
  }), method(object({
26415
26415
  deviceId: number(),
26416
26416
  sessionId: string()
26417
26417
  }), _void(), {
26418
26418
  kind: "mutation",
26419
- auth: "admin"
26419
+ auth: "protected"
26420
26420
  }), method(object({ deviceId: number() }), object({ sessionId: string() }), {
26421
26421
  kind: "mutation",
26422
- auth: "admin"
26422
+ auth: "protected"
26423
26423
  }), method(object({
26424
26424
  deviceId: number(),
26425
26425
  /** Audio bytes for ONE frame, base64-encoded so the payload
@@ -26438,10 +26438,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
26438
26438
  sequenceNumber: number().int()
26439
26439
  }), object({ accepted: boolean() }), {
26440
26440
  kind: "mutation",
26441
- auth: "admin"
26441
+ auth: "protected"
26442
26442
  }), method(object({ deviceId: number() }), _void(), {
26443
26443
  kind: "mutation",
26444
- auth: "admin"
26444
+ auth: "protected"
26445
26445
  }), object({
26446
26446
  deviceId: number(),
26447
26447
  status: IntercomStatusSchema
@@ -0,0 +1,138 @@
1
+ import { PerformanceObserver } from "node:perf_hooks";
2
+ //#region src/detection-pipeline/diagnostics/event-loop-stall-monitor.ts
3
+ /**
4
+ * event-loop-stall-monitor — names the thing that freezes the detection process.
5
+ *
6
+ * ## What this exists to settle
7
+ *
8
+ * On 2026-08-01/02 inference across the whole fleet stalled in bursts: 759
9
+ * calls in 90 minutes crossed the runner's 20s deadline, p50 41s and max 80s,
10
+ * and EVERY one of them eventually resolved. Six explanations were killed with
11
+ * telemetry alone:
12
+ *
13
+ * - not a slow GPU or a wedged pool — the work completes, just enormously late;
14
+ * - not CPU starvation — hosts sat at 8-48% during the freezes;
15
+ * - not swap — `pswpin/pswpout` are flat zero on every host;
16
+ * - not a logging artifact — Loki's timestamp trails the in-process one by
17
+ * 0.1-1.0s at p95, so the gaps are real, not buffered delivery;
18
+ * - not the v1.2.30 release — the stalls predate it by a day;
19
+ * - not only the idle-pool recompile — that is real and hub-side, but the
20
+ * agent stalls with no eviction and no compile at all.
21
+ *
22
+ * What IS established: the 10s stats timer — which touches no inference code —
23
+ * stops firing for 22-88s and resumes at the same instant the abandoned calls
24
+ * settle. The event loop itself freezes. From outside the process, GC and a
25
+ * synchronous block are indistinguishable, and guessing between them is how
26
+ * this investigation would go wrong. So measure it.
27
+ *
28
+ * ## How
29
+ *
30
+ * A 1s interval whose LATENESS is the freeze: a tick that arrives 40s late means
31
+ * the loop was blocked ~39s, whatever blocked it. In the same window the GC
32
+ * observer accumulates pause time. The two numbers together answer the question
33
+ * outright:
34
+ *
35
+ * - `gcMs` ≈ `stallMs` → garbage collection. Look at heap growth.
36
+ * - `gcMs` ≈ 0 → something SYNCHRONOUS blocked the loop, and GC is innocent.
37
+ *
38
+ * Heap and RSS ride along because if it is GC, the next question is always
39
+ * "growing since when?".
40
+ *
41
+ * Deliberately not a histogram (`monitorEventLoopDelay`): that reports a
42
+ * distribution, and the question here is about ONE outlier and what coincided
43
+ * with it.
44
+ */
45
+ /** Tick period. Small enough to bound attribution error, large enough to cost
46
+ * nothing on a process already doing frame work. */
47
+ var STALL_TICK_MS = 1e3;
48
+ /**
49
+ * Report a freeze only past this. The runner's own inference deadline is 20s
50
+ * and the observed freezes run 22-88s, so this is far below the signal while
51
+ * staying clear of ordinary scheduling jitter (a busy frame path routinely
52
+ * overruns a 1s timer by tens of ms).
53
+ */
54
+ var STALL_REPORT_MS = 2e3;
55
+ /**
56
+ * Attribute a freeze. Pure, because this is the ONE judgement the whole module
57
+ * exists to make and it must be testable without freezing a real event loop.
58
+ *
59
+ * `gc` when garbage collection accounts for most of the stall; a
60
+ * `synchronous-block` when it accounts for almost none — that verdict points
61
+ * away from the heap entirely and at whatever ran without yielding.
62
+ */
63
+ function attributeStall(stallMs, gcMs, gcCount, longestGcMs) {
64
+ const share = stallMs > 0 ? gcMs / stallMs : 0;
65
+ return {
66
+ stallMs,
67
+ gcMs,
68
+ gcCount,
69
+ longestGcMs,
70
+ cause: share >= .7 ? "gc" : share <= .2 ? "synchronous-block" : "mixed"
71
+ };
72
+ }
73
+ /**
74
+ * Start watching. Returns a stop function; safe to call twice.
75
+ *
76
+ * Never throws into the caller: a diagnostic that can take the detection
77
+ * process down is worse than no diagnostic. `PerformanceObserver` for `gc` is
78
+ * unavailable in some embedded runtimes, and that must degrade to
79
+ * stall-detection-without-attribution rather than a boot failure.
80
+ */
81
+ function startEventLoopStallMonitor(logger, reportThresholdMs = STALL_REPORT_MS) {
82
+ let gc = {
83
+ totalMs: 0,
84
+ count: 0,
85
+ longestMs: 0
86
+ };
87
+ let observer = null;
88
+ try {
89
+ observer = new PerformanceObserver((list) => {
90
+ for (const entry of list.getEntries()) {
91
+ gc.totalMs += entry.duration;
92
+ gc.count += 1;
93
+ if (entry.duration > gc.longestMs) gc.longestMs = entry.duration;
94
+ }
95
+ });
96
+ observer.observe({ entryTypes: ["gc"] });
97
+ } catch {
98
+ observer = null;
99
+ }
100
+ let expected = Date.now() + STALL_TICK_MS;
101
+ const timer = setInterval(() => {
102
+ const now = Date.now();
103
+ const lateBy = now - expected;
104
+ const window = gc;
105
+ gc = {
106
+ totalMs: 0,
107
+ count: 0,
108
+ longestMs: 0
109
+ };
110
+ expected = now + STALL_TICK_MS;
111
+ if (lateBy < reportThresholdMs) return;
112
+ const verdict = attributeStall(lateBy, Math.round(window.totalMs), window.count, Math.round(window.longestMs));
113
+ const mem = process.memoryUsage();
114
+ logger.warn("event loop stalled", { meta: {
115
+ stallMs: verdict.stallMs,
116
+ cause: verdict.cause,
117
+ gcMs: verdict.gcMs,
118
+ gcCount: verdict.gcCount,
119
+ longestGcMs: verdict.longestGcMs,
120
+ gcObserved: observer !== null,
121
+ heapUsedMb: Math.round(mem.heapUsed / 1e6),
122
+ heapTotalMb: Math.round(mem.heapTotal / 1e6),
123
+ rssMb: Math.round(mem.rss / 1e6),
124
+ externalMb: Math.round(mem.external / 1e6),
125
+ arrayBuffersMb: Math.round(mem.arrayBuffers / 1e6)
126
+ } });
127
+ }, STALL_TICK_MS);
128
+ timer.unref?.();
129
+ let stopped = false;
130
+ return () => {
131
+ if (stopped) return;
132
+ stopped = true;
133
+ clearInterval(timer);
134
+ observer?.disconnect();
135
+ };
136
+ }
137
+ //#endregion
138
+ export { startEventLoopStallMonitor as n, attributeStall as t };
@@ -0,0 +1,149 @@
1
+ let node_perf_hooks = require("node:perf_hooks");
2
+ //#region src/detection-pipeline/diagnostics/event-loop-stall-monitor.ts
3
+ /**
4
+ * event-loop-stall-monitor — names the thing that freezes the detection process.
5
+ *
6
+ * ## What this exists to settle
7
+ *
8
+ * On 2026-08-01/02 inference across the whole fleet stalled in bursts: 759
9
+ * calls in 90 minutes crossed the runner's 20s deadline, p50 41s and max 80s,
10
+ * and EVERY one of them eventually resolved. Six explanations were killed with
11
+ * telemetry alone:
12
+ *
13
+ * - not a slow GPU or a wedged pool — the work completes, just enormously late;
14
+ * - not CPU starvation — hosts sat at 8-48% during the freezes;
15
+ * - not swap — `pswpin/pswpout` are flat zero on every host;
16
+ * - not a logging artifact — Loki's timestamp trails the in-process one by
17
+ * 0.1-1.0s at p95, so the gaps are real, not buffered delivery;
18
+ * - not the v1.2.30 release — the stalls predate it by a day;
19
+ * - not only the idle-pool recompile — that is real and hub-side, but the
20
+ * agent stalls with no eviction and no compile at all.
21
+ *
22
+ * What IS established: the 10s stats timer — which touches no inference code —
23
+ * stops firing for 22-88s and resumes at the same instant the abandoned calls
24
+ * settle. The event loop itself freezes. From outside the process, GC and a
25
+ * synchronous block are indistinguishable, and guessing between them is how
26
+ * this investigation would go wrong. So measure it.
27
+ *
28
+ * ## How
29
+ *
30
+ * A 1s interval whose LATENESS is the freeze: a tick that arrives 40s late means
31
+ * the loop was blocked ~39s, whatever blocked it. In the same window the GC
32
+ * observer accumulates pause time. The two numbers together answer the question
33
+ * outright:
34
+ *
35
+ * - `gcMs` ≈ `stallMs` → garbage collection. Look at heap growth.
36
+ * - `gcMs` ≈ 0 → something SYNCHRONOUS blocked the loop, and GC is innocent.
37
+ *
38
+ * Heap and RSS ride along because if it is GC, the next question is always
39
+ * "growing since when?".
40
+ *
41
+ * Deliberately not a histogram (`monitorEventLoopDelay`): that reports a
42
+ * distribution, and the question here is about ONE outlier and what coincided
43
+ * with it.
44
+ */
45
+ /** Tick period. Small enough to bound attribution error, large enough to cost
46
+ * nothing on a process already doing frame work. */
47
+ var STALL_TICK_MS = 1e3;
48
+ /**
49
+ * Report a freeze only past this. The runner's own inference deadline is 20s
50
+ * and the observed freezes run 22-88s, so this is far below the signal while
51
+ * staying clear of ordinary scheduling jitter (a busy frame path routinely
52
+ * overruns a 1s timer by tens of ms).
53
+ */
54
+ var STALL_REPORT_MS = 2e3;
55
+ /**
56
+ * Attribute a freeze. Pure, because this is the ONE judgement the whole module
57
+ * exists to make and it must be testable without freezing a real event loop.
58
+ *
59
+ * `gc` when garbage collection accounts for most of the stall; a
60
+ * `synchronous-block` when it accounts for almost none — that verdict points
61
+ * away from the heap entirely and at whatever ran without yielding.
62
+ */
63
+ function attributeStall(stallMs, gcMs, gcCount, longestGcMs) {
64
+ const share = stallMs > 0 ? gcMs / stallMs : 0;
65
+ return {
66
+ stallMs,
67
+ gcMs,
68
+ gcCount,
69
+ longestGcMs,
70
+ cause: share >= .7 ? "gc" : share <= .2 ? "synchronous-block" : "mixed"
71
+ };
72
+ }
73
+ /**
74
+ * Start watching. Returns a stop function; safe to call twice.
75
+ *
76
+ * Never throws into the caller: a diagnostic that can take the detection
77
+ * process down is worse than no diagnostic. `PerformanceObserver` for `gc` is
78
+ * unavailable in some embedded runtimes, and that must degrade to
79
+ * stall-detection-without-attribution rather than a boot failure.
80
+ */
81
+ function startEventLoopStallMonitor(logger, reportThresholdMs = STALL_REPORT_MS) {
82
+ let gc = {
83
+ totalMs: 0,
84
+ count: 0,
85
+ longestMs: 0
86
+ };
87
+ let observer = null;
88
+ try {
89
+ observer = new node_perf_hooks.PerformanceObserver((list) => {
90
+ for (const entry of list.getEntries()) {
91
+ gc.totalMs += entry.duration;
92
+ gc.count += 1;
93
+ if (entry.duration > gc.longestMs) gc.longestMs = entry.duration;
94
+ }
95
+ });
96
+ observer.observe({ entryTypes: ["gc"] });
97
+ } catch {
98
+ observer = null;
99
+ }
100
+ let expected = Date.now() + STALL_TICK_MS;
101
+ const timer = setInterval(() => {
102
+ const now = Date.now();
103
+ const lateBy = now - expected;
104
+ const window = gc;
105
+ gc = {
106
+ totalMs: 0,
107
+ count: 0,
108
+ longestMs: 0
109
+ };
110
+ expected = now + STALL_TICK_MS;
111
+ if (lateBy < reportThresholdMs) return;
112
+ const verdict = attributeStall(lateBy, Math.round(window.totalMs), window.count, Math.round(window.longestMs));
113
+ const mem = process.memoryUsage();
114
+ logger.warn("event loop stalled", { meta: {
115
+ stallMs: verdict.stallMs,
116
+ cause: verdict.cause,
117
+ gcMs: verdict.gcMs,
118
+ gcCount: verdict.gcCount,
119
+ longestGcMs: verdict.longestGcMs,
120
+ gcObserved: observer !== null,
121
+ heapUsedMb: Math.round(mem.heapUsed / 1e6),
122
+ heapTotalMb: Math.round(mem.heapTotal / 1e6),
123
+ rssMb: Math.round(mem.rss / 1e6),
124
+ externalMb: Math.round(mem.external / 1e6),
125
+ arrayBuffersMb: Math.round(mem.arrayBuffers / 1e6)
126
+ } });
127
+ }, STALL_TICK_MS);
128
+ timer.unref?.();
129
+ let stopped = false;
130
+ return () => {
131
+ if (stopped) return;
132
+ stopped = true;
133
+ clearInterval(timer);
134
+ observer?.disconnect();
135
+ };
136
+ }
137
+ //#endregion
138
+ Object.defineProperty(exports, "attributeStall", {
139
+ enumerable: true,
140
+ get: function() {
141
+ return attributeStall;
142
+ }
143
+ });
144
+ Object.defineProperty(exports, "startEventLoopStallMonitor", {
145
+ enumerable: true,
146
+ get: function() {
147
+ return startEventLoopStallMonitor;
148
+ }
149
+ });
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Dpy1KP1q.js");
1
+ const require_dist = require("./dist-DML3mpn9.js");
2
2
  let node_path = require("node:path");
3
3
  node_path = require_dist.__toESM(node_path);
4
4
  let node_url = require("node:url");