@camstack/addon-pipeline 1.2.186 → 1.2.188

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 (36) 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 +5 -5
  4. package/dist/detection-pipeline/index.mjs +4 -4
  5. package/dist/{dist-CiVhPNTB.js → dist-CKr6Q6Qu.js} +66 -1
  6. package/dist/{dist-yaetDPpW.mjs → dist-CxYG8IUX.mjs} +66 -1
  7. package/dist/{lazy-sharp-D1PX1Psd.js → lazy-sharp-D-HdRPo5.js} +1 -1
  8. package/dist/{local-frame-registry-D5d1W1Vf.js → local-frame-registry-B4Bd4tnU.js} +1 -1
  9. package/dist/{local-frame-registry-CANBpRSg.mjs → local-frame-registry-DP5yyEWE.mjs} +1 -1
  10. package/dist/motion-wasm/index.js +2 -2
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-DGzZLg-c.js → node-CmRTB9W4.js} +1 -1
  13. package/dist/{node-CCRb0fqW.mjs → node-DhccO0of.mjs} +1 -1
  14. package/dist/pipeline-runner/index.js +191 -11
  15. package/dist/pipeline-runner/index.mjs +190 -10
  16. package/dist/{process-memory-C7f66zUT.js → process-memory-BW7XFoPY.js} +1 -1
  17. package/dist/{process-memory-BIy4e_mZ.mjs → process-memory-L6mHI28P.mjs} +1 -1
  18. package/dist/recorder/index.js +3 -2
  19. package/dist/recorder/index.mjs +3 -2
  20. package/dist/{segment-demux-js-CnqYsNPt.js → segment-demux-js-BTSHcSwg.js} +1 -1
  21. package/dist/{segment-demux-js-CViDx3UC.mjs → segment-demux-js-D2zZJQU4.mjs} +1 -1
  22. package/dist/session-decode/decode-worker-child.js +2 -2
  23. package/dist/session-decode/decode-worker-child.mjs +1 -1
  24. package/dist/stream-broker/_stub.js +2 -2
  25. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CR6bzoE5.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BttlkJ1n.mjs} +3 -3
  26. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BC1EK38M.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BFlcZNb6.mjs} +1 -1
  27. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BC-nahrU.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-ZzdpzejS.mjs} +1 -1
  28. package/dist/stream-broker/demux-worker-child.js +1 -1
  29. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  30. package/dist/stream-broker/{hostInit-DgDPe3HR.mjs → hostInit-BlXTzO4s.mjs} +3 -3
  31. package/dist/stream-broker/index.js +70 -48
  32. package/dist/stream-broker/index.mjs +70 -48
  33. package/dist/stream-broker/remoteEntry.js +1 -1
  34. package/dist/{worker-protocol-BcKW7xgG.mjs → worker-protocol-Br-omhiX.mjs} +1 -1
  35. package/dist/{worker-protocol-Db6BWHr-.js → worker-protocol-C8ZBUm08.js} +1 -1
  36. 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-CiVhPNTB.js");
6
- const require_process_memory = require("../process-memory-C7f66zUT.js");
5
+ const require_dist = require("../dist-CKr6Q6Qu.js");
6
+ const require_process_memory = require("../process-memory-BW7XFoPY.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-yaetDPpW.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-BIy4e_mZ.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-CxYG8IUX.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-L6mHI28P.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,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-CiVhPNTB.js");
6
- const require_node = require("../node-DGzZLg-c.js");
7
- const require_local_frame_registry = require("../local-frame-registry-D5d1W1Vf.js");
8
- const require_lazy_sharp = require("../lazy-sharp-D1PX1Psd.js");
5
+ const require_dist = require("../dist-CKr6Q6Qu.js");
6
+ const require_node = require("../node-CmRTB9W4.js");
7
+ const require_local_frame_registry = require("../local-frame-registry-B4Bd4tnU.js");
8
+ const require_lazy_sharp = require("../lazy-sharp-D-HdRPo5.js");
9
9
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
- const require_process_memory = require("../process-memory-C7f66zUT.js");
10
+ const require_process_memory = require("../process-memory-BW7XFoPY.js");
11
11
  let node_fs = require("node:fs");
12
12
  node_fs = require_dist.__toESM(node_fs);
13
13
  let node_path = require("node:path");
@@ -1,10 +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-yaetDPpW.mjs";
3
- import { a as readProcessCost } from "../node-CCRb0fqW.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-CANBpRSg.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-CxYG8IUX.mjs";
3
+ import { a as readProcessCost } from "../node-DhccO0of.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-DP5yyEWE.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
6
  import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
7
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-BIy4e_mZ.mjs";
7
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-L6mHI28P.mjs";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
10
10
  import { dirname, join } from "node:path";
@@ -21542,6 +21542,33 @@ var RecentTracksQueryInput = object({
21542
21542
  */
21543
21543
  classes: array(string()).optional()
21544
21544
  });
21545
+ /**
21546
+ * A Summary (D359): the per-camera session envelope that references tracks.
21547
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
21548
+ * served by the event-media plane by key), null until the first frame with a
21549
+ * member visible has been materialised.
21550
+ */
21551
+ var SummarySchema = object({
21552
+ id: string(),
21553
+ deviceId: number(),
21554
+ openedAt: number(),
21555
+ lastActiveAt: number(),
21556
+ sealedAt: number().nullable(),
21557
+ memberCount: number().int().nonnegative(),
21558
+ groupShotKey: string().nullable()
21559
+ });
21560
+ var SummariesQueryInput = object({
21561
+ deviceIds: array(number()).min(1),
21562
+ since: number().optional(),
21563
+ until: number().optional(),
21564
+ limit: number().int().min(1).max(200).default(50)
21565
+ });
21566
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
21567
+ var SummaryDetailSchema = object({
21568
+ summary: SummarySchema,
21569
+ /** Member track ids, in absorption order. */
21570
+ trackIds: array(string()).readonly()
21571
+ });
21545
21572
  var RecentTracksPageSchema = object({
21546
21573
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
21547
21574
  tracks: array(TrackSchema).readonly(),
@@ -21942,7 +21969,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21942
21969
  * timeline would read as a camera that saw nothing.
21943
21970
  */
21944
21971
  classes: array(string()).optional()
21945
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
21972
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
21946
21973
  kind: "mutation",
21947
21974
  auth: "admin"
21948
21975
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23019,6 +23046,14 @@ var AgentPipelineSettingsSchema = object({
23019
23046
  /** Node is eligible to be the ingest / source-owner (serve the restream). */
23020
23047
  ingest: boolean().optional(),
23021
23048
  /**
23049
+ * This node's decode RAM budget, MB. Wins over the cluster
23050
+ * `nodeDecodeBudgetMb`; absent, the runner derives a share of the node's
23051
+ * own RAM unless the operator moved the cluster value (D365).
23052
+ */
23053
+ decodeBudgetMb: number().int().min(1024).max(65536).optional(),
23054
+ /** This node's live decode-worker cap. Wins over the cluster `maxLiveDecodeWorkers`. */
23055
+ maxLiveDecodeWorkers: number().int().min(1).max(32).optional(),
23056
+ /**
23022
23057
  * Operator override for the LAN host a cross-node decoder dials to reach
23023
23058
  * THIS node's restream (Cluster UI). Absent → auto-detect: a remote runner
23024
23059
  * falls back to its `CAMSTACK_HUB_URL`-derived host (the Moleculer address
@@ -23480,6 +23515,13 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23480
23515
  }), object({ success: literal(true) }), {
23481
23516
  kind: "mutation",
23482
23517
  auth: "admin"
23518
+ }), method(object({
23519
+ agentNodeId: string(),
23520
+ decodeBudgetMb: number().int().min(1024).max(65536).nullable().optional(),
23521
+ maxLiveDecodeWorkers: number().int().min(1).max(32).nullable().optional()
23522
+ }), object({ success: literal(true) }), {
23523
+ kind: "mutation",
23524
+ auth: "admin"
23483
23525
  }), method(object({
23484
23526
  agentNodeId: string(),
23485
23527
  reachableHost: string().nullable()
@@ -35577,6 +35619,12 @@ Object.freeze({
35577
35619
  addonId: null,
35578
35620
  access: "view"
35579
35621
  },
35622
+ "pipelineAnalytics.getSummary": {
35623
+ capName: "pipeline-analytics",
35624
+ capScope: "device",
35625
+ addonId: null,
35626
+ access: "view"
35627
+ },
35580
35628
  "pipelineAnalytics.getTrack": {
35581
35629
  capName: "pipeline-analytics",
35582
35630
  capScope: "device",
@@ -35655,6 +35703,12 @@ Object.freeze({
35655
35703
  addonId: null,
35656
35704
  access: "view"
35657
35705
  },
35706
+ "pipelineAnalytics.listSummaries": {
35707
+ capName: "pipeline-analytics",
35708
+ capScope: "device",
35709
+ addonId: null,
35710
+ access: "view"
35711
+ },
35658
35712
  "pipelineAnalytics.listTrackMedia": {
35659
35713
  capName: "pipeline-analytics",
35660
35714
  capScope: "device",
@@ -36213,6 +36267,12 @@ Object.freeze({
36213
36267
  addonId: null,
36214
36268
  access: "create"
36215
36269
  },
36270
+ "pipelineOrchestrator.setAgentDecodeLimits": {
36271
+ capName: "pipeline-orchestrator",
36272
+ capScope: "system",
36273
+ addonId: null,
36274
+ access: "create"
36275
+ },
36216
36276
  "pipelineOrchestrator.setAgentDetectWeight": {
36217
36277
  capName: "pipeline-orchestrator",
36218
36278
  capScope: "system",
@@ -39344,6 +39404,11 @@ Object.freeze({
39344
39404
  form: "array",
39345
39405
  optional: true
39346
39406
  }],
39407
+ "pipelineAnalytics.listSummaries": [{
39408
+ name: "deviceIds",
39409
+ form: "array",
39410
+ optional: false
39411
+ }],
39347
39412
  "pipelineAnalytics.listTrackMedia": [{
39348
39413
  name: "deviceId",
39349
39414
  form: "single",
@@ -21519,6 +21519,33 @@ var RecentTracksQueryInput = object({
21519
21519
  */
21520
21520
  classes: array(string()).optional()
21521
21521
  });
21522
+ /**
21523
+ * A Summary (D359): the per-camera session envelope that references tracks.
21524
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
21525
+ * served by the event-media plane by key), null until the first frame with a
21526
+ * member visible has been materialised.
21527
+ */
21528
+ var SummarySchema = object({
21529
+ id: string(),
21530
+ deviceId: number(),
21531
+ openedAt: number(),
21532
+ lastActiveAt: number(),
21533
+ sealedAt: number().nullable(),
21534
+ memberCount: number().int().nonnegative(),
21535
+ groupShotKey: string().nullable()
21536
+ });
21537
+ var SummariesQueryInput = object({
21538
+ deviceIds: array(number()).min(1),
21539
+ since: number().optional(),
21540
+ until: number().optional(),
21541
+ limit: number().int().min(1).max(200).default(50)
21542
+ });
21543
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
21544
+ var SummaryDetailSchema = object({
21545
+ summary: SummarySchema,
21546
+ /** Member track ids, in absorption order. */
21547
+ trackIds: array(string()).readonly()
21548
+ });
21522
21549
  var RecentTracksPageSchema = object({
21523
21550
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
21524
21551
  tracks: array(TrackSchema).readonly(),
@@ -21919,7 +21946,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21919
21946
  * timeline would read as a camera that saw nothing.
21920
21947
  */
21921
21948
  classes: array(string()).optional()
21922
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
21949
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
21923
21950
  kind: "mutation",
21924
21951
  auth: "admin"
21925
21952
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -22996,6 +23023,14 @@ var AgentPipelineSettingsSchema = object({
22996
23023
  /** Node is eligible to be the ingest / source-owner (serve the restream). */
22997
23024
  ingest: boolean().optional(),
22998
23025
  /**
23026
+ * This node's decode RAM budget, MB. Wins over the cluster
23027
+ * `nodeDecodeBudgetMb`; absent, the runner derives a share of the node's
23028
+ * own RAM unless the operator moved the cluster value (D365).
23029
+ */
23030
+ decodeBudgetMb: number().int().min(1024).max(65536).optional(),
23031
+ /** This node's live decode-worker cap. Wins over the cluster `maxLiveDecodeWorkers`. */
23032
+ maxLiveDecodeWorkers: number().int().min(1).max(32).optional(),
23033
+ /**
22999
23034
  * Operator override for the LAN host a cross-node decoder dials to reach
23000
23035
  * THIS node's restream (Cluster UI). Absent → auto-detect: a remote runner
23001
23036
  * falls back to its `CAMSTACK_HUB_URL`-derived host (the Moleculer address
@@ -23457,6 +23492,13 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23457
23492
  }), object({ success: literal(true) }), {
23458
23493
  kind: "mutation",
23459
23494
  auth: "admin"
23495
+ }), method(object({
23496
+ agentNodeId: string(),
23497
+ decodeBudgetMb: number().int().min(1024).max(65536).nullable().optional(),
23498
+ maxLiveDecodeWorkers: number().int().min(1).max(32).nullable().optional()
23499
+ }), object({ success: literal(true) }), {
23500
+ kind: "mutation",
23501
+ auth: "admin"
23460
23502
  }), method(object({
23461
23503
  agentNodeId: string(),
23462
23504
  reachableHost: string().nullable()
@@ -35554,6 +35596,12 @@ Object.freeze({
35554
35596
  addonId: null,
35555
35597
  access: "view"
35556
35598
  },
35599
+ "pipelineAnalytics.getSummary": {
35600
+ capName: "pipeline-analytics",
35601
+ capScope: "device",
35602
+ addonId: null,
35603
+ access: "view"
35604
+ },
35557
35605
  "pipelineAnalytics.getTrack": {
35558
35606
  capName: "pipeline-analytics",
35559
35607
  capScope: "device",
@@ -35632,6 +35680,12 @@ Object.freeze({
35632
35680
  addonId: null,
35633
35681
  access: "view"
35634
35682
  },
35683
+ "pipelineAnalytics.listSummaries": {
35684
+ capName: "pipeline-analytics",
35685
+ capScope: "device",
35686
+ addonId: null,
35687
+ access: "view"
35688
+ },
35635
35689
  "pipelineAnalytics.listTrackMedia": {
35636
35690
  capName: "pipeline-analytics",
35637
35691
  capScope: "device",
@@ -36190,6 +36244,12 @@ Object.freeze({
36190
36244
  addonId: null,
36191
36245
  access: "create"
36192
36246
  },
36247
+ "pipelineOrchestrator.setAgentDecodeLimits": {
36248
+ capName: "pipeline-orchestrator",
36249
+ capScope: "system",
36250
+ addonId: null,
36251
+ access: "create"
36252
+ },
36193
36253
  "pipelineOrchestrator.setAgentDetectWeight": {
36194
36254
  capName: "pipeline-orchestrator",
36195
36255
  capScope: "system",
@@ -39321,6 +39381,11 @@ Object.freeze({
39321
39381
  form: "array",
39322
39382
  optional: true
39323
39383
  }],
39384
+ "pipelineAnalytics.listSummaries": [{
39385
+ name: "deviceIds",
39386
+ form: "array",
39387
+ optional: false
39388
+ }],
39324
39389
  "pipelineAnalytics.listTrackMedia": [{
39325
39390
  name: "deviceId",
39326
39391
  form: "single",
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CiVhPNTB.js");
1
+ const require_dist = require("./dist-CKr6Q6Qu.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");
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CiVhPNTB.js");
1
+ const require_dist = require("./dist-CKr6Q6Qu.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/registry/model-catalogs.ts
4
4
  var HF_REPO = "camstack/camstack-models";
@@ -1,4 +1,4 @@
1
- import { M as audioKindId, Z as hfModelUrl, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-yaetDPpW.mjs";
1
+ import { M as audioKindId, Z as hfModelUrl, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-CxYG8IUX.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/detection-pipeline/registry/model-catalogs.ts
4
4
  var HF_REPO = "camstack/camstack-models";
@@ -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-CiVhPNTB.js");
6
- const require_lazy_sharp = require("../lazy-sharp-D1PX1Psd.js");
5
+ const require_dist = require("../dist-CKr6Q6Qu.js");
6
+ const require_lazy_sharp = require("../lazy-sharp-D-HdRPo5.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_path = require("node:path");
9
9
  //#region src/motion-wasm/wasm-motion-detector.ts
@@ -1,4 +1,4 @@
1
- import { It as hydrateSchema, Pt as DeviceType, Y as evaluateZoneRules, it as motionDetectionCapability, jt as BaseAddon } from "../dist-yaetDPpW.mjs";
1
+ import { It as hydrateSchema, Pt as DeviceType, Y as evaluateZoneRules, it as motionDetectionCapability, jt as BaseAddon } from "../dist-CxYG8IUX.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
- const require_dist = require("./dist-CiVhPNTB.js");
1
+ const require_dist = require("./dist-CKr6Q6Qu.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  let node_fs = require("node:fs");
4
4
  node_fs = require_dist.__toESM(node_fs, 1);
@@ -1,4 +1,4 @@
1
- import { Dt as buildFfmpegArgs, Et as Fmp4BoxSplitter, kt as isSoftwareDecode, wt as errMsg } from "./dist-yaetDPpW.mjs";
1
+ import { Dt as buildFfmpegArgs, Et as Fmp4BoxSplitter, kt as isSoftwareDecode, wt as errMsg } from "./dist-CxYG8IUX.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import "node:fs";
4
4
  import "node:path";
@@ -2,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-CiVhPNTB.js");
6
- const require_node = require("../node-DGzZLg-c.js");
7
- const require_local_frame_registry = require("../local-frame-registry-D5d1W1Vf.js");
8
- const require_worker_protocol = require("../worker-protocol-Db6BWHr-.js");
5
+ const require_dist = require("../dist-CKr6Q6Qu.js");
6
+ const require_node = require("../node-CmRTB9W4.js");
7
+ const require_local_frame_registry = require("../local-frame-registry-B4Bd4tnU.js");
8
+ const require_worker_protocol = require("../worker-protocol-C8ZBUm08.js");
9
9
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
10
- const require_lazy_sharp = require("../lazy-sharp-D1PX1Psd.js");
10
+ const require_lazy_sharp = require("../lazy-sharp-D-HdRPo5.js");
11
11
  const require_restream_intent = require("../restream-intent-Cv9x3jmu.js");
12
12
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
13
13
  const require_remote_restream = require("../remote-restream-CO36Sr30.js");
@@ -1535,7 +1535,7 @@ function startSessionDecodePump(deps) {
1535
1535
  release: () => image.releaseNativeLease?.(),
1536
1536
  markInferred: () => image.markInferred?.()
1537
1537
  }) : void 0;
1538
- if (deps.frameRegistry && deps.onFrameRef) {
1538
+ if (deps.frameRegistry && deps.onFrameRef && deps.inlineWhen?.() !== true) {
1539
1539
  const capturedAt = Date.now();
1540
1540
  const ref = deps.frameRegistry.register(image, {
1541
1541
  timestamp: frame.timestamp,
@@ -3381,6 +3381,115 @@ var NativeLeaseSettingsSource = class {
3381
3381
  }
3382
3382
  }
3383
3383
  };
3384
+ function pickLimits(settings) {
3385
+ if (settings === null) return {};
3386
+ const budget = settings.decodeBudgetMb;
3387
+ const workers = settings.maxLiveDecodeWorkers;
3388
+ return {
3389
+ ...typeof budget === "number" && Number.isFinite(budget) ? { decodeBudgetMb: budget } : {},
3390
+ ...typeof workers === "number" && Number.isFinite(workers) ? { maxLiveDecodeWorkers: workers } : {}
3391
+ };
3392
+ }
3393
+ function sameLimits(a, b) {
3394
+ return a.decodeBudgetMb === b.decodeBudgetMb && a.maxLiveDecodeWorkers === b.maxLiveDecodeWorkers;
3395
+ }
3396
+ var NodeDecodeLimitsSource = class {
3397
+ limits = {};
3398
+ lastReadAtMs = Number.NEGATIVE_INFINITY;
3399
+ inFlight = null;
3400
+ logger;
3401
+ nodeId;
3402
+ now;
3403
+ ttlMs;
3404
+ constructor(options) {
3405
+ this.logger = options.logger;
3406
+ this.nodeId = options.nodeId;
3407
+ this.now = options.now ?? (() => Date.now());
3408
+ this.ttlMs = options.ttlMs ?? 3e4;
3409
+ }
3410
+ current() {
3411
+ return this.limits;
3412
+ }
3413
+ async refresh(api) {
3414
+ if (api === void 0) return this.limits;
3415
+ if (this.now() - this.lastReadAtMs < this.ttlMs) return this.limits;
3416
+ this.inFlight ??= this.read(api).finally(() => {
3417
+ this.inFlight = null;
3418
+ });
3419
+ await this.inFlight;
3420
+ return this.limits;
3421
+ }
3422
+ async read(api) {
3423
+ try {
3424
+ const next = pickLimits(await api.pipelineOrchestrator.getAgentSettings.query({ agentNodeId: this.nodeId }));
3425
+ this.lastReadAtMs = this.now();
3426
+ if (sameLimits(next, this.limits)) return;
3427
+ this.logger.info("node decode limits changed — the admission resizes on the next dial", { meta: {
3428
+ nodeId: this.nodeId,
3429
+ from: { ...this.limits },
3430
+ to: { ...next }
3431
+ } });
3432
+ this.limits = next;
3433
+ } catch (err) {
3434
+ this.logger.warn("node decode limits read failed — keeping the last known value", { meta: {
3435
+ nodeId: this.nodeId,
3436
+ inUse: { ...this.limits },
3437
+ error: err instanceof Error ? err.message : String(err)
3438
+ } });
3439
+ }
3440
+ }
3441
+ };
3442
+ //#endregion
3443
+ //#region src/session-decode/node-decode-budget.ts
3444
+ /**
3445
+ * The decode RAM budget and worker cap THIS node runs under.
3446
+ *
3447
+ * `nodeDecodeBudgetMb` and `maxLiveDecodeWorkers` are cluster settings — one
3448
+ * number for a 64 GB hub and a 16 GB Mac alike. Until 2026-09-05 the shipped
3449
+ * 8192 MB was the hub's number applied everywhere; with the footprint fixed
3450
+ * (D361) that admits 8 workers on the Mac, whose workers measure RSS p90
3451
+ * 952 MB on a machine already at 80% — 7.6 GB of decode on 16 GB is a swap
3452
+ * away from a stall — while the hub leaves 56 GB idle.
3453
+ *
3454
+ * Three sources, in order, and the winner is NAMED so a log line can say why:
3455
+ * 1. the node's own agent setting (`decodeBudgetMb` / `maxLiveDecodeWorkers`
3456
+ * in `AgentPipelineSettings`) — the operator sized this node;
3457
+ * 2. the cluster setting when the operator MOVED it off the shipped default
3458
+ * (a value equal to the default reads as "nobody chose", the same rule the
3459
+ * native-lease knobs use, `readKnob`);
3460
+ * 3. otherwise a share of the node's RAM, clamped — the shipped default
3461
+ * becomes a per-node derivation instead of the hub's number.
3462
+ */
3463
+ var DECODE_BUDGET_RAM_SHARE = .5;
3464
+ var DECODE_BUDGET_MIN_MB = 2048;
3465
+ var DECODE_BUDGET_MAX_MB = 16384;
3466
+ function derivedDecodeBudgetMb(totalMemMb) {
3467
+ const share = Math.round(totalMemMb * DECODE_BUDGET_RAM_SHARE);
3468
+ return Math.max(DECODE_BUDGET_MIN_MB, Math.min(DECODE_BUDGET_MAX_MB, share));
3469
+ }
3470
+ function resolveNodeDecodeLimits(input) {
3471
+ const budget = input.node.decodeBudgetMb !== void 0 ? {
3472
+ budgetMb: input.node.decodeBudgetMb,
3473
+ budgetSource: "node"
3474
+ } : input.clusterBudgetMb !== input.defaultBudgetMb ? {
3475
+ budgetMb: input.clusterBudgetMb,
3476
+ budgetSource: "cluster"
3477
+ } : {
3478
+ budgetMb: derivedDecodeBudgetMb(input.totalMemMb),
3479
+ budgetSource: "derived"
3480
+ };
3481
+ const workers = input.node.maxLiveDecodeWorkers !== void 0 ? {
3482
+ maxWorkers: input.node.maxLiveDecodeWorkers,
3483
+ maxWorkersSource: "node"
3484
+ } : {
3485
+ maxWorkers: input.clusterMaxWorkers,
3486
+ maxWorkersSource: "cluster"
3487
+ };
3488
+ return {
3489
+ ...budget,
3490
+ ...workers
3491
+ };
3492
+ }
3384
3493
  //#endregion
3385
3494
  //#region src/session-decode/on-demand-jpeg-fallback.ts
3386
3495
  /** Single content-sized JPEG requested after a detection, never a continuous raw. */
@@ -4508,6 +4617,18 @@ var PipelineRunner = class {
4508
4617
  * {@link reserveDetectionFrame}. Kept separate so the ordinary public path
4509
4618
  * cannot accidentally count one source frame twice.
4510
4619
  */
4620
+ /**
4621
+ * True when a frame enqueued NOW would wait for an inference slot before
4622
+ * the executor reads its pixels — the window in which a lazy `frameRef` is
4623
+ * a gamble on the worker's 8-slot hold. The detection queue keeps only the
4624
+ * latest frame, so the queue can never be "deep": the semaphore is the one
4625
+ * live signal (the shm passthrough reads the same one). Asked at enqueue
4626
+ * time so the pump can copy the pixels while the frame is still reserved.
4627
+ */
4628
+ detectionBackpressure(deviceId) {
4629
+ if (!this.cameras.has(deviceId)) return true;
4630
+ return this.semaphore.available <= 0;
4631
+ }
4511
4632
  enqueueReservedDetectionFrame(deviceId, frame, handle) {
4512
4633
  const state = this.cameras.get(deviceId);
4513
4634
  if (!state || state.phase !== "active") return false;
@@ -5652,6 +5773,13 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
5652
5773
  async onInitialize() {
5653
5774
  const raw = this.ctx.kernel.localNodeId ?? this.ctx.id;
5654
5775
  this.nodeId = raw.includes("/") ? raw.split("/")[0] : raw;
5776
+ this.nodeLimits = new NodeDecodeLimitsSource({
5777
+ logger: {
5778
+ info: (message, extras) => this.ctxIfReady?.logger.info(message, extras),
5779
+ warn: (message, extras) => this.ctxIfReady?.logger.warn(message, extras)
5780
+ },
5781
+ nodeId: this.nodeId
5782
+ });
5655
5783
  this.retainedFrames = new RetainedFrameStore({
5656
5784
  nodeId: this.nodeId,
5657
5785
  logger: this.ctx.logger.child("retained-frames"),
@@ -5682,10 +5810,20 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
5682
5810
  noteInferenceOutcome: (deviceId, reason) => this.failureReport.noteInference(deviceId, reason)
5683
5811
  });
5684
5812
  this.spawnGate = new Semaphore(Math.max(1, this.config.maxConcurrentDecodeSpawns));
5813
+ const decodeLimits = this.resolvedNodeDecodeLimits();
5814
+ this.lastAppliedDecodeLimits = decodeLimits;
5815
+ this.ctx.logger.info("node decode limits in force", { meta: {
5816
+ reason: "boot",
5817
+ budgetMb: decodeLimits.budgetMb,
5818
+ budgetSource: decodeLimits.budgetSource,
5819
+ maxWorkers: decodeLimits.maxWorkers,
5820
+ maxWorkersSource: decodeLimits.maxWorkersSource,
5821
+ totalMemMb: Math.round(node_os.totalmem() / 1048576)
5822
+ } });
5685
5823
  this.liveWorkers = new LiveDecodeWorkerAdmission({
5686
- limit: this.config.maxLiveDecodeWorkers,
5824
+ limit: decodeLimits.maxWorkers,
5687
5825
  logger: this.ctx.logger,
5688
- nodeBudgetMb: this.config.nodeDecodeBudgetMb,
5826
+ nodeBudgetMb: decodeLimits.budgetMb,
5689
5827
  workerFootprintMb: decodeWorkerFootprintMb(this.nativeLease.current())
5690
5828
  });
5691
5829
  this.runner.timingSampler.setLogger(this.ctx.logger.child("timing"));
@@ -6907,6 +7045,45 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
6907
7045
  async refreshNativeLeaseSettings() {
6908
7046
  await this.nativeLease.refresh(this.ctxIfReady?.api);
6909
7047
  this.liveWorkers?.resizeFootprint(decodeWorkerFootprintMb(this.nativeLease.current()));
7048
+ await this.nodeLimits?.refresh(this.ctxIfReady?.api);
7049
+ this.applyNodeDecodeLimits("lease-refresh");
7050
+ }
7051
+ nodeLimits = null;
7052
+ lastAppliedDecodeLimits = null;
7053
+ /**
7054
+ * The budget and worker cap THIS node runs under (D365): its own agent
7055
+ * setting, else the cluster value the operator moved, else a share of its
7056
+ * RAM. One resolver for construction, the lease refresh and a settings
7057
+ * change — computing it in two places is how the count and the budget
7058
+ * drifted apart before.
7059
+ */
7060
+ resolvedNodeDecodeLimits() {
7061
+ return resolveNodeDecodeLimits({
7062
+ clusterBudgetMb: this.config.nodeDecodeBudgetMb,
7063
+ clusterMaxWorkers: this.config.maxLiveDecodeWorkers,
7064
+ defaultBudgetMb: DEFAULT_CONFIG.nodeDecodeBudgetMb,
7065
+ defaultMaxWorkers: DEFAULT_CONFIG.maxLiveDecodeWorkers,
7066
+ node: this.nodeLimits?.current() ?? {},
7067
+ totalMemMb: Math.round(node_os.totalmem() / 1048576)
7068
+ });
7069
+ }
7070
+ /** Resize the admission to the resolved limits; one info line per change. */
7071
+ applyNodeDecodeLimits(reason) {
7072
+ const limits = this.resolvedNodeDecodeLimits();
7073
+ const last = this.lastAppliedDecodeLimits;
7074
+ this.liveWorkers?.resize(limits.maxWorkers);
7075
+ this.liveWorkers?.resizeBudget(limits.budgetMb);
7076
+ if (last !== null && last.budgetMb === limits.budgetMb && last.maxWorkers === limits.maxWorkers && last.budgetSource === limits.budgetSource) return;
7077
+ this.lastAppliedDecodeLimits = limits;
7078
+ this.ctxIfReady?.logger.info("node decode limits in force", { meta: {
7079
+ reason,
7080
+ budgetMb: limits.budgetMb,
7081
+ budgetSource: limits.budgetSource,
7082
+ maxWorkers: limits.maxWorkers,
7083
+ maxWorkersSource: limits.maxWorkersSource,
7084
+ totalMemMb: Math.round(node_os.totalmem() / 1048576),
7085
+ decodeCeilingInForce: this.liveWorkers?.ceiling
7086
+ } });
6910
7087
  }
6911
7088
  /** A warn sink that survives a not-yet-ready ctx (boot-order dispatches). */
6912
7089
  detailSubtreeLogger() {
@@ -7576,6 +7753,8 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
7576
7753
  },
7577
7754
  ...useLocalFrameRef ? {
7578
7755
  frameRegistry: require_local_frame_registry.localFrameRegistry,
7756
+ inlineWhen: () => runner.detectionBackpressure(config.deviceId),
7757
+ inlineViewSpec: SPLIT_DETECTION_VIEW,
7579
7758
  onFrameRef: async (frame, nativeCrop) => {
7580
7759
  const current = reservation;
7581
7760
  reservation = null;
@@ -8258,6 +8437,8 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8258
8437
  },
8259
8438
  ...useLocalFrameRef ? {
8260
8439
  frameRegistry: require_local_frame_registry.localFrameRegistry,
8440
+ inlineWhen: () => runner.detectionBackpressure(config.deviceId),
8441
+ inlineViewSpec: SPLIT_DETECTION_VIEW,
8261
8442
  onFrameRef: (frame, nativeCrop) => {
8262
8443
  if (settled) return false;
8263
8444
  const handle = writeRetainedDetectionFrame(retainedFrames, config.deviceId, frame, this.retention);
@@ -8456,7 +8637,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8456
8637
  type: "slider",
8457
8638
  key: "nodeDecodeBudgetMb",
8458
8639
  label: "Decode worker RAM budget (MB)",
8459
- description: "RAM this node lets live decode workers commit. The number of workers admitted is derived from it: budget divided by one worker's worst case — what the lease store can hold (the smaller of the lease budget and held frames × 25 MB, one 4K frame), plus the tile and scene budgets, plus ~350 MB of baseline. At the shipped lease knobs (8 held frames) that is ~660 MB and the default admits 8, the count cap. Raising held frames or the lease budget per worker therefore LOWERS how many run at once, instead of silently authorising more memory.",
8640
+ description: "Cluster-wide fallback for the RAM a node lets live decode workers commit. Each node resolves its own number: its agent setting (decodeBudgetMb) wins; otherwise this value when moved off the default; otherwise half the node's RAM (2-16 GB). The number of workers admitted is derived from it: budget divided by one worker's worst case — what the lease store can hold (the smaller of the lease budget and held frames × 25 MB, one 4K frame), plus the tile and scene budgets, plus ~350 MB of baseline, ~660 MB at the shipped knobs. Raising held frames or the lease budget per worker therefore LOWERS how many run at once, instead of silently authorising more memory.",
8460
8641
  min: 1024,
8461
8642
  max: 32768,
8462
8643
  step: 512,
@@ -8469,8 +8650,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8469
8650
  async onConfigChanged() {
8470
8651
  this.runner?.updateLimits(this.config);
8471
8652
  this.spawnGate?.resize(Math.max(1, this.config.maxConcurrentDecodeSpawns));
8472
- this.liveWorkers?.resize(this.config.maxLiveDecodeWorkers);
8473
- this.liveWorkers?.resizeBudget(this.config.nodeDecodeBudgetMb);
8653
+ this.applyNodeDecodeLimits("settings");
8474
8654
  this.ctx.logger.info("pipeline-runner tuning updated", { meta: {
8475
8655
  maxQueueDepth: this.config.maxQueueDepth,
8476
8656
  maxConcurrentInferences: this.config.maxConcurrentInferences,