@camstack/addon-pipeline 1.2.221 → 1.2.222

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-B1NT1A38.js → default-detection-model-B7kn9xHR.js} +1 -1
  4. package/dist/{default-detection-model-DkVFgubU.mjs → default-detection-model-BSX8cVHY.mjs} +1 -1
  5. package/dist/detection-pipeline/index.js +4 -4
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-CEFC3PkP.mjs → dist-BNzfbpF6.mjs} +31 -2
  8. package/dist/{dist-ATDfcxgL.js → dist-DZsjVFey.js} +31 -2
  9. package/dist/motion-wasm/index.js +1 -1
  10. package/dist/motion-wasm/index.mjs +1 -1
  11. package/dist/{node-C5jnTgpv.js → node-BhQ8dDQC.js} +1 -1
  12. package/dist/{node-DR3fHqUq.mjs → node-uYIx2aZF.mjs} +1 -1
  13. package/dist/pipeline-runner/index.js +123 -20
  14. package/dist/pipeline-runner/index.mjs +123 -20
  15. package/dist/{process-memory-DQbCPnMA.js → process-memory-BozKb5-g.js} +1 -1
  16. package/dist/{process-memory-DqYj5IAb.mjs → process-memory-CkoLpOV-.mjs} +1 -1
  17. package/dist/recorder/index.js +2 -2
  18. package/dist/recorder/index.mjs +2 -2
  19. package/dist/{segment-demux-js-o9KBAz9p.js → segment-demux-js-Cvszh55p.js} +1 -1
  20. package/dist/{segment-demux-js-CddDwD69.mjs → segment-demux-js-Dh1dn_AT.mjs} +1 -1
  21. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-D5XnLZWR.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BZG3prqU.mjs} +3 -3
  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-C-VdcJS2.mjs → hostInit-Cyo0CFo3.mjs} +3 -3
  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-ATDfcxgL.js");
7
- const require_process_memory = require("../process-memory-DQbCPnMA.js");
6
+ const require_dist = require("../dist-DZsjVFey.js");
7
+ const require_process_memory = require("../process-memory-BozKb5-g.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 { C as PoolMemoryWatchdog, Jt as audioChunkBytesPerSample, Lt as errMsg, M as audioAnalysisCapability, N as audioAnalyzerCapability, Ot as resolvePoolMemoryPolicy, Wt as BaseAddon, Xt as expandAudioChunkToF32le, Zt as hydrateSchema, n as AUDIO_BACKEND_CHOICES, s as DEFAULT_AUDIO_ANALYZER_CONFIG, st as mapAudioLabelToMacro, tn as nodePin, vn as EventCategory, y as HF_BASE_URL } from "../dist-CEFC3PkP.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DqYj5IAb.mjs";
2
+ import { C as PoolMemoryWatchdog, Jt as audioChunkBytesPerSample, Lt as errMsg, M as audioAnalysisCapability, N as audioAnalyzerCapability, Ot as resolvePoolMemoryPolicy, Wt as BaseAddon, Xt as expandAudioChunkToF32le, Zt as hydrateSchema, n as AUDIO_BACKEND_CHOICES, s as DEFAULT_AUDIO_ANALYZER_CONFIG, st as mapAudioLabelToMacro, tn as nodePin, vn as EventCategory, y as HF_BASE_URL } from "../dist-BNzfbpF6.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CkoLpOV-.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
- const require_dist = require("./dist-ATDfcxgL.js");
1
+ const require_dist = require("./dist-DZsjVFey.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { P as audioKindId, a as COCO_80_LABELS, nt as hfModelUrl, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-CEFC3PkP.mjs";
1
+ import { P as audioKindId, a as COCO_80_LABELS, nt as hfModelUrl, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-BNzfbpF6.mjs";
2
2
  import { randomUUID } from "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-ATDfcxgL.js");
7
- const require_node = require("../node-C5jnTgpv.js");
8
- const require_default_detection_model = require("../default-detection-model-B1NT1A38.js");
6
+ const require_dist = require("../dist-DZsjVFey.js");
7
+ const require_node = require("../node-BhQ8dDQC.js");
8
+ const require_default_detection_model = require("../default-detection-model-B7kn9xHR.js");
9
9
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
10
- const require_process_memory = require("../process-memory-DQbCPnMA.js");
10
+ const require_process_memory = require("../process-memory-BozKb5-g.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 { A as YAMNET_TO_MACRO, At as runtimeDevices$1, C as PoolMemoryWatchdog, Ft as supportedRuntimes$1, K as detectionPipelineCapability, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, Y as enumerateInferenceDevices, Yt as createEvent, Z as evaluateZoneRules, Zt as hydrateSchema, _n as union, _t as pickClusterStepSettings, an as sleep, at as loadContributionCapability, bt as pipelineExecutorCapability, c as DEFAULT_CLUSTER_STEP_MODELS, gn as string, gt as pickClusterStepModels, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, mt as overlayClusterStepSettings, nn as parseJsonUnknown, pn as object, rt as inferModelProvider, sn as array, t as APPLE_SA_TO_MACRO, tn as nodePin, vn as EventCategory } from "../dist-CEFC3PkP.mjs";
3
- import { o as readProcessCost } from "../node-DR3fHqUq.mjs";
4
- import { a as ALL_PIPELINE_STEPS, c as getStep, d as landmarkPrecisionVerdict, l as getStepDefinition, n as resolveDefaultDetectionModel, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as resolveModelForFormat } from "../default-detection-model-DkVFgubU.mjs";
2
+ import { A as YAMNET_TO_MACRO, At as runtimeDevices$1, C as PoolMemoryWatchdog, Ft as supportedRuntimes$1, K as detectionPipelineCapability, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, Y as enumerateInferenceDevices, Yt as createEvent, Z as evaluateZoneRules, Zt as hydrateSchema, _n as union, _t as pickClusterStepSettings, an as sleep, at as loadContributionCapability, bt as pipelineExecutorCapability, c as DEFAULT_CLUSTER_STEP_MODELS, gn as string, gt as pickClusterStepModels, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, mt as overlayClusterStepSettings, nn as parseJsonUnknown, pn as object, rt as inferModelProvider, sn as array, t as APPLE_SA_TO_MACRO, tn as nodePin, vn as EventCategory } from "../dist-BNzfbpF6.mjs";
3
+ import { o as readProcessCost } from "../node-uYIx2aZF.mjs";
4
+ import { a as ALL_PIPELINE_STEPS, c as getStep, d as landmarkPrecisionVerdict, l as getStepDefinition, n as resolveDefaultDetectionModel, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as resolveModelForFormat } from "../default-detection-model-BSX8cVHY.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DqYj5IAb.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CkoLpOV-.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";
@@ -23091,6 +23091,14 @@ var NativeCropResultSchema = object({
23091
23091
  * set `encodeJpeg: true`; `bytes` is then absent.
23092
23092
  */
23093
23093
  jpeg: string().optional(),
23094
+ /**
23095
+ * The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
23096
+ * `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
23097
+ * `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
23098
+ * `bytes` above has crossed this boundary as a `Uint8Array` all along — so
23099
+ * base64 was buying nothing but a multi-megabyte string in the relay's heap.
23100
+ */
23101
+ jpegBytes: _instanceof(Uint8Array).optional(),
23094
23102
  width: number().int().positive(),
23095
23103
  height: number().int().positive(),
23096
23104
  /**
@@ -23157,7 +23165,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
23157
23165
  })]);
23158
23166
  /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
23159
23167
  var ParkedTrackFrameSchema = object({
23160
- jpeg: string(),
23168
+ /**
23169
+ * Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
23170
+ * `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
23171
+ * Exactly one of the two is present.
23172
+ */
23173
+ jpeg: string().optional(),
23174
+ /** The same JPEG as bytes, for a caller that declared it reads them (D462). */
23175
+ jpegBytes: _instanceof(Uint8Array).optional(),
23161
23176
  width: number().int().positive(),
23162
23177
  height: number().int().positive(),
23163
23178
  /** The frame instant the parcel shows (the caller's clock, echoed back). */
@@ -23808,6 +23823,13 @@ var pipelineRunnerCapability = {
23808
23823
  bbox: NativeCropBboxSchema,
23809
23824
  maxWidth: number().int().positive().optional(),
23810
23825
  /**
23826
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
23827
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
23828
+ * wire — never assume consent: a pre-D462 caller parses the field as
23829
+ * base64 and bytes would decode to garbage rather than fail.
23830
+ */
23831
+ acceptJpegBytes: boolean().optional(),
23832
+ /**
23811
23833
  * When `true`, the runner encodes the resolved crop to JPEG ON THE
23812
23834
  * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
23813
23835
  * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
@@ -23980,7 +24002,14 @@ var pipelineRunnerCapability = {
23980
24002
  getParkedTrackFrame: method(object({
23981
24003
  deviceId: number(),
23982
24004
  trackId: string(),
23983
- kind: ParkedFrameKindSchema
24005
+ kind: ParkedFrameKindSchema,
24006
+ /**
24007
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
24008
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
24009
+ * wire — never assume consent: a pre-D462 caller parses the field as
24010
+ * base64 and bytes would decode to garbage rather than fail.
24011
+ */
24012
+ acceptJpegBytes: boolean().optional()
23984
24013
  }), ParkedTrackFrameSchema.nullable()),
23985
24014
  /**
23986
24015
  * Drop every parcel of a track — the hub closed it. Idempotent. A track
@@ -23091,6 +23091,14 @@ var NativeCropResultSchema = object({
23091
23091
  * set `encodeJpeg: true`; `bytes` is then absent.
23092
23092
  */
23093
23093
  jpeg: string().optional(),
23094
+ /**
23095
+ * The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
23096
+ * `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
23097
+ * `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
23098
+ * `bytes` above has crossed this boundary as a `Uint8Array` all along — so
23099
+ * base64 was buying nothing but a multi-megabyte string in the relay's heap.
23100
+ */
23101
+ jpegBytes: _instanceof(Uint8Array).optional(),
23094
23102
  width: number().int().positive(),
23095
23103
  height: number().int().positive(),
23096
23104
  /**
@@ -23157,7 +23165,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
23157
23165
  })]);
23158
23166
  /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
23159
23167
  var ParkedTrackFrameSchema = object({
23160
- jpeg: string(),
23168
+ /**
23169
+ * Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
23170
+ * `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
23171
+ * Exactly one of the two is present.
23172
+ */
23173
+ jpeg: string().optional(),
23174
+ /** The same JPEG as bytes, for a caller that declared it reads them (D462). */
23175
+ jpegBytes: _instanceof(Uint8Array).optional(),
23161
23176
  width: number().int().positive(),
23162
23177
  height: number().int().positive(),
23163
23178
  /** The frame instant the parcel shows (the caller's clock, echoed back). */
@@ -23808,6 +23823,13 @@ var pipelineRunnerCapability = {
23808
23823
  bbox: NativeCropBboxSchema,
23809
23824
  maxWidth: number().int().positive().optional(),
23810
23825
  /**
23826
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
23827
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
23828
+ * wire — never assume consent: a pre-D462 caller parses the field as
23829
+ * base64 and bytes would decode to garbage rather than fail.
23830
+ */
23831
+ acceptJpegBytes: boolean().optional(),
23832
+ /**
23811
23833
  * When `true`, the runner encodes the resolved crop to JPEG ON THE
23812
23834
  * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
23813
23835
  * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
@@ -23980,7 +24002,14 @@ var pipelineRunnerCapability = {
23980
24002
  getParkedTrackFrame: method(object({
23981
24003
  deviceId: number(),
23982
24004
  trackId: string(),
23983
- kind: ParkedFrameKindSchema
24005
+ kind: ParkedFrameKindSchema,
24006
+ /**
24007
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
24008
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
24009
+ * wire — never assume consent: a pre-D462 caller parses the field as
24010
+ * base64 and bytes would decode to garbage rather than fail.
24011
+ */
24012
+ acceptJpegBytes: boolean().optional()
23984
24013
  }), ParkedTrackFrameSchema.nullable()),
23985
24014
  /**
23986
24015
  * Drop every parcel of a track — the hub closed it. Idempotent. A track
@@ -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-ATDfcxgL.js");
5
+ const require_dist = require("../dist-DZsjVFey.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 { Wt as BaseAddon, Z as evaluateZoneRules, Zt as hydrateSchema, pt as motionDetectionCapability, qt as DeviceType } from "../dist-CEFC3PkP.mjs";
1
+ import { Wt as BaseAddon, Z as evaluateZoneRules, Zt as hydrateSchema, pt as motionDetectionCapability, qt as DeviceType } from "../dist-BNzfbpF6.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,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-ATDfcxgL.js");
2
+ const require_dist = require("./dist-DZsjVFey.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);
@@ -1,4 +1,4 @@
1
- import { Bt as buildFfmpegArgs, Ht as isSoftwareDecode, Lt as errMsg, zt as Fmp4BoxSplitter } from "./dist-CEFC3PkP.mjs";
1
+ import { Bt as buildFfmpegArgs, Ht as isSoftwareDecode, Lt as errMsg, zt as Fmp4BoxSplitter } from "./dist-BNzfbpF6.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { realpathSync } from "node:fs";
4
4
  import path from "node:path";
@@ -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-ATDfcxgL.js");
7
- const require_node = require("../node-C5jnTgpv.js");
8
- const require_default_detection_model = require("../default-detection-model-B1NT1A38.js");
6
+ const require_dist = require("../dist-DZsjVFey.js");
7
+ const require_node = require("../node-BhQ8dDQC.js");
8
+ const require_default_detection_model = require("../default-detection-model-B7kn9xHR.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");
@@ -4782,9 +4782,23 @@ function shouldRetainDetectionFrame(input) {
4782
4782
  if (input.continuousRetain) return true;
4783
4783
  return input.hasDetection;
4784
4784
  }
4785
+ /**
4786
+ * The ONE place the cross-node crop wire format is decided (D462).
4787
+ *
4788
+ * `jpeg` arrives as the bytes the encoder produced. Whether they leave as
4789
+ * those bytes or as a base64 string is not this function's preference — it is
4790
+ * the CALLER'S declaration, `acceptBytes`, and an absent declaration means the
4791
+ * old wire. A pre-D462 consumer does `Buffer.from(reply.jpeg, 'base64')`, so
4792
+ * reading a missing flag as consent would hand it a `Uint8Array` to parse as
4793
+ * base64 and it would decode to garbage rather than fail.
4794
+ *
4795
+ * Base64 cost ~400 MB/min of hub-main relay traffic and, on the decoded half
4796
+ * of that, a multi-megabyte string in old space per call.
4797
+ */
4785
4798
  function encodeCrossNodeCrop(input) {
4786
- if (!input.jpeg) return null;
4787
- return { jpeg: input.jpeg };
4799
+ if (!input.jpeg || input.jpeg.byteLength === 0) return null;
4800
+ if (input.acceptBytes === true) return { jpegBytes: input.jpeg };
4801
+ return { jpeg: Buffer.from(input.jpeg).toString("base64") };
4788
4802
  }
4789
4803
  function handleKey(handle) {
4790
4804
  return `${handle.shmId}#${handle.slot}#${handle.seq}`;
@@ -6491,6 +6505,44 @@ function isUsable(bbox) {
6491
6505
  return bbox.width > 0 && bbox.height > 0;
6492
6506
  }
6493
6507
  //#endregion
6508
+ //#region src/pipeline-runner/runtime-labels.ts
6509
+ /**
6510
+ * `null` for either input means "could not be read", and the corresponding
6511
+ * field is OMITTED. The two are independent: an engine that failed to answer
6512
+ * must not also erase the models, which is how the original field managed to
6513
+ * be null on every line ever logged.
6514
+ */
6515
+ function buildRuntimeLabels(engine, steps) {
6516
+ const runtime = engine === null ? void 0 : [
6517
+ engine.runtime,
6518
+ engine.backend,
6519
+ engine.device
6520
+ ].filter((part) => part !== void 0 && part !== "").join("/");
6521
+ const models = steps === null ? void 0 : [...new Set(steps.filter((s) => s.enabled).map((s) => s.modelId))];
6522
+ return {
6523
+ ...runtime !== void 0 ? { pipelineRuntime: runtime } : {},
6524
+ ...models !== void 0 ? { pipelineModels: models } : {}
6525
+ };
6526
+ }
6527
+ /**
6528
+ * Depth-first flatten of the active pipeline tree.
6529
+ *
6530
+ * A DISABLED step takes its subtree with it: the children of a step that does
6531
+ * not run did not run either, and listing a face model under a disabled face
6532
+ * detector would name a model that never loaded.
6533
+ */
6534
+ function flattenLabelledSteps(steps) {
6535
+ const out = [];
6536
+ for (const step of steps) {
6537
+ out.push({
6538
+ modelId: step.modelId,
6539
+ enabled: step.enabled
6540
+ });
6541
+ if (step.enabled && step.children !== void 0) out.push(...flattenLabelledSteps(step.children));
6542
+ }
6543
+ return out;
6544
+ }
6545
+ //#endregion
6494
6546
  //#region src/pipeline-runner/track-frame-park.ts
6495
6547
  /** Park one frame for one track. Never throws; a refusal is an answer. */
6496
6548
  async function parkTrackFrame(deps, input) {
@@ -6644,6 +6696,12 @@ var PACKAGE_ZONE_UNION_TTL_MS = 6e4;
6644
6696
  var MAX_BOUND_FRAME_CUTTERS = 256;
6645
6697
  /** How often a camera reports its undispatched cuts. */
6646
6698
  var TILE_CUT_DROP_LOG_INTERVAL_MS = 6e4;
6699
+ /**
6700
+ * How often the `pipeline stats` runtime labels are re-read (D463). Slow on
6701
+ * purpose: this answers "which engine is this node on", which changes when an
6702
+ * operator re-selects one or lazy provisioning completes — not per frame.
6703
+ */
6704
+ var RUNTIME_INFO_REFRESH_MS = 3e5;
6647
6705
  /** How often a camera reports parcels that left without a release (D422). */
6648
6706
  var PARKED_EVICTION_LOG_INTERVAL_MS = 6e4;
6649
6707
  /**
@@ -7080,6 +7138,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
7080
7138
  parkedDetail = /* @__PURE__ */ new Map();
7081
7139
  nodeId = "unknown";
7082
7140
  metricsSnapshotTimer = null;
7141
+ runtimeInfoTimer = null;
7083
7142
  unsubMotionEvents = null;
7084
7143
  /** Devices we have positively observed reporting `battery.sleeping: true`.
7085
7144
  * Absent = unknown or awake; both mean "do not gate" (D49). Fed only by
@@ -7331,6 +7390,9 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
7331
7390
  workerFootprintMb: decodeWorkerFootprintMb(this.nativeLease.current())
7332
7391
  });
7333
7392
  this.runner.timingSampler.setLogger(this.ctx.logger.child("timing"));
7393
+ this.refreshRuntimeInfo();
7394
+ this.runtimeInfoTimer = setInterval(() => void this.refreshRuntimeInfo(), RUNTIME_INFO_REFRESH_MS);
7395
+ this.runtimeInfoTimer.unref?.();
7334
7396
  this.runner.onDetectionStreamChange((deviceId, action) => {
7335
7397
  this.handleDetectionStreamChange(deviceId, action);
7336
7398
  });
@@ -7397,6 +7459,10 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
7397
7459
  };
7398
7460
  }
7399
7461
  async onShutdown() {
7462
+ if (this.runtimeInfoTimer !== null) {
7463
+ clearInterval(this.runtimeInfoTimer);
7464
+ this.runtimeInfoTimer = null;
7465
+ }
7400
7466
  if (this.metricsSnapshotTimer) {
7401
7467
  clearInterval(this.metricsSnapshotTimer);
7402
7468
  this.metricsSnapshotTimer = null;
@@ -8204,7 +8270,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8204
8270
  const resolved = await this.resolveNativeCropPixels(input);
8205
8271
  if (resolved.tier === "native" && resolved.pixels !== null) {
8206
8272
  this.frameLazy.noteHit(resolveNativeCropHitKind(resolved.pixels.source), deviceId);
8207
- return this.encodeNativeCropResult(resolved.pixels, resolved.tier, input.encodeJpeg);
8273
+ return this.encodeNativeCropResult(resolved.pixels, resolved.tier, input.encodeJpeg, input.acceptJpegBytes);
8208
8274
  }
8209
8275
  this.frameLazy.noteMiss("native", deviceId);
8210
8276
  if (resolved.tier !== "ram-fullframe") return null;
@@ -8230,7 +8296,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8230
8296
  bytes: crop.bytes,
8231
8297
  width: crop.width,
8232
8298
  height: crop.height
8233
- }, resolved.tier, input.encodeJpeg);
8299
+ }, resolved.tier, input.encodeJpeg, input.acceptJpegBytes);
8234
8300
  }
8235
8301
  /**
8236
8302
  * PARK a frame for a track (D422) — the hub judged it relevant, and this node
@@ -8253,8 +8319,8 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8253
8319
  store,
8254
8320
  resolvePixels: (request) => this.resolveNativeCropPixels(request),
8255
8321
  encodeJpeg: async (pixels) => {
8256
- const encoded = await this.encodeNativeCropResult(pixels, "native", true);
8257
- return encoded?.jpeg !== void 0 ? Buffer.from(encoded.jpeg, "base64") : null;
8322
+ const encoded = await this.encodeNativeCropResult(pixels, "native", true, true);
8323
+ return encoded?.jpegBytes !== void 0 ? Buffer.from(encoded.jpegBytes) : null;
8258
8324
  },
8259
8325
  logger: this.ctx.logger
8260
8326
  }, input);
@@ -8277,7 +8343,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8277
8343
  return null;
8278
8344
  }
8279
8345
  return {
8280
- jpeg: parcel.jpeg.toString("base64"),
8346
+ ...input.acceptJpegBytes === true ? { jpegBytes: new Uint8Array(parcel.jpeg) } : { jpeg: parcel.jpeg.toString("base64") },
8281
8347
  width: parcel.width,
8282
8348
  height: parcel.height,
8283
8349
  timestamp: parcel.timestamp,
@@ -8657,12 +8723,15 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8657
8723
  * boundary (CLAUDE.md invariant #21). On an encode failure the crop is a miss
8658
8724
  * (`null`) — the caller retries — never a silent raw-RGB cross-node fallback.
8659
8725
  */
8660
- async encodeNativeCropResult(crop, tier, encodeJpeg) {
8726
+ async encodeNativeCropResult(crop, tier, encodeJpeg, acceptJpegBytes) {
8661
8727
  if (crop.bytes.byteLength >= 2 && crop.bytes[0] === 255 && crop.bytes[1] === 216) {
8662
- const encoded = encodeCrossNodeCrop({ jpeg: Buffer.from(crop.bytes).toString("base64") });
8728
+ const encoded = encodeCrossNodeCrop({
8729
+ jpeg: crop.bytes,
8730
+ acceptBytes: acceptJpegBytes
8731
+ });
8663
8732
  if (!encoded) return null;
8664
8733
  return {
8665
- jpeg: encoded.jpeg,
8734
+ ...encoded,
8666
8735
  width: crop.width,
8667
8736
  height: crop.height,
8668
8737
  tier
@@ -8676,16 +8745,17 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8676
8745
  };
8677
8746
  try {
8678
8747
  const encoded = encodeCrossNodeCrop({
8679
- jpeg: (await (await require_lazy_sharp.getSharp())(Buffer.from(crop.bytes), { raw: {
8748
+ jpeg: await (await require_lazy_sharp.getSharp())(Buffer.from(crop.bytes), { raw: {
8680
8749
  width: crop.width,
8681
8750
  height: crop.height,
8682
8751
  channels: 3
8683
- } }).jpeg({ quality: 90 }).toBuffer()).toString("base64"),
8684
- bytes: crop.bytes
8752
+ } }).jpeg({ quality: 90 }).toBuffer(),
8753
+ bytes: crop.bytes,
8754
+ acceptBytes: acceptJpegBytes
8685
8755
  });
8686
8756
  if (!encoded) return null;
8687
8757
  return {
8688
- jpeg: encoded.jpeg,
8758
+ ...encoded,
8689
8759
  width: crop.width,
8690
8760
  height: crop.height,
8691
8761
  tier
@@ -8742,6 +8812,39 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8742
8812
  }, input);
8743
8813
  }
8744
8814
  /**
8815
+ * Re-read the labels the `pipeline stats` lines carry (D463).
8816
+ *
8817
+ * Each half is read INDEPENDENTLY and a failure omits only its own field:
8818
+ * an engine that will not answer must not also erase the model list. Both
8819
+ * reads are best-effort by design — this is a label on a telemetry line, and
8820
+ * it must never be able to take the runner down or to log a storm. A failure
8821
+ * is logged once per refresh at `debug`, deliberately: the ABSENCE of the
8822
+ * field in the line is the signal, and the hub writes `info`.
8823
+ */
8824
+ async refreshRuntimeInfo() {
8825
+ const api = this.ctxIfReady?.api;
8826
+ if (!api) return;
8827
+ let engine = null;
8828
+ let steps = null;
8829
+ try {
8830
+ engine = await api.pipelineExecutor.getSelectedEngine.query();
8831
+ } catch (err) {
8832
+ this.ctxIfReady?.logger.debug("runtime labels: selected engine unreadable", { meta: { error: require_dist.errMsg(err) } });
8833
+ }
8834
+ try {
8835
+ const active = await api.pipelineExecutor.getGlobalSteps.query();
8836
+ steps = active === null ? null : flattenLabelledSteps(active);
8837
+ } catch (err) {
8838
+ this.ctxIfReady?.logger.debug("runtime labels: active steps unreadable", { meta: { error: require_dist.errMsg(err) } });
8839
+ }
8840
+ const sampler = this.runner?.timingSampler;
8841
+ if (sampler === void 0 || sampler === null) return;
8842
+ sampler.runtimeInfo = {
8843
+ ...sampler.runtimeInfo,
8844
+ ...buildRuntimeLabels(engine, steps)
8845
+ };
8846
+ }
8847
+ /**
8745
8848
  * The model format this node dispatches on when no `deviceKey` is given —
8746
8849
  * its selected engine's format. `null` on any failure, which the caller
8747
8850
  * turns into a refusal rather than a guess: a model pin that cannot be
@@ -8970,13 +9073,13 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends require_dist.BaseAdd
8970
9073
  handleAgeMs: resolved.handleAgeMs,
8971
9074
  ...resolved.workerReason !== void 0 ? { workerReason: resolved.workerReason } : {}
8972
9075
  };
8973
- const encoded = await this.encodeNativeCropResult(resolved.pixels, "native", true);
8974
- if (!encoded?.jpeg) return {
9076
+ const encoded = await this.encodeNativeCropResult(resolved.pixels, "native", true, true);
9077
+ if (!encoded?.jpegBytes) return {
8975
9078
  miss: "jpeg-encode-failed",
8976
9079
  handleAgeMs: resolved.handleAgeMs
8977
9080
  };
8978
9081
  return {
8979
- jpeg: Buffer.from(encoded.jpeg, "base64"),
9082
+ jpeg: Buffer.from(encoded.jpegBytes),
8980
9083
  width: encoded.width,
8981
9084
  height: encoded.height,
8982
9085
  frameSpace: denormalizeRect(paddedBbox, handle.width, handle.height)
@@ -1,6 +1,6 @@
1
- import { H as defineCustomActions, Lt as errMsg, W as deriveDetailCropRect, Wt as BaseAddon, Yt as createEvent, _ as FailureCounters, at as loadContributionCapability, b as NativeLeaseAdmissionSchema, cn as boolean, dn as literal, et as failureContributionCapability, fn as number, gn as string, m as DEVICE_BACKEND_TO_FORMAT, on as _enum, p as DEFAULT_NATIVE_LEASE_SETTINGS, pn as object, sn as array, tn as nodePin, u as DEFAULT_DETAIL_CROP_CONVENTION, un as lazy, vn as EventCategory, vt as pickDetailCropConvention, x as NativeLeaseSettingsSchema, xt as pipelineRunnerCapability, yt as pickNativeLeaseOverride, z as customAction } from "../dist-CEFC3PkP.mjs";
2
- import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-DR3fHqUq.mjs";
3
- import { i as resolveFrameViewGeometry, l as getStepDefinition, r as localFrameRegistry } from "../default-detection-model-DkVFgubU.mjs";
1
+ import { H as defineCustomActions, Lt as errMsg, W as deriveDetailCropRect, Wt as BaseAddon, Yt as createEvent, _ as FailureCounters, at as loadContributionCapability, b as NativeLeaseAdmissionSchema, cn as boolean, dn as literal, et as failureContributionCapability, fn as number, gn as string, m as DEVICE_BACKEND_TO_FORMAT, on as _enum, p as DEFAULT_NATIVE_LEASE_SETTINGS, pn as object, sn as array, tn as nodePin, u as DEFAULT_DETAIL_CROP_CONVENTION, un as lazy, vn as EventCategory, vt as pickDetailCropConvention, x as NativeLeaseSettingsSchema, xt as pipelineRunnerCapability, yt as pickNativeLeaseOverride, z as customAction } from "../dist-BNzfbpF6.mjs";
2
+ import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-uYIx2aZF.mjs";
3
+ import { i as resolveFrameViewGeometry, l as getStepDefinition, r as localFrameRegistry } from "../default-detection-model-BSX8cVHY.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";
@@ -4774,9 +4774,23 @@ function shouldRetainDetectionFrame(input) {
4774
4774
  if (input.continuousRetain) return true;
4775
4775
  return input.hasDetection;
4776
4776
  }
4777
+ /**
4778
+ * The ONE place the cross-node crop wire format is decided (D462).
4779
+ *
4780
+ * `jpeg` arrives as the bytes the encoder produced. Whether they leave as
4781
+ * those bytes or as a base64 string is not this function's preference — it is
4782
+ * the CALLER'S declaration, `acceptBytes`, and an absent declaration means the
4783
+ * old wire. A pre-D462 consumer does `Buffer.from(reply.jpeg, 'base64')`, so
4784
+ * reading a missing flag as consent would hand it a `Uint8Array` to parse as
4785
+ * base64 and it would decode to garbage rather than fail.
4786
+ *
4787
+ * Base64 cost ~400 MB/min of hub-main relay traffic and, on the decoded half
4788
+ * of that, a multi-megabyte string in old space per call.
4789
+ */
4777
4790
  function encodeCrossNodeCrop(input) {
4778
- if (!input.jpeg) return null;
4779
- return { jpeg: input.jpeg };
4791
+ if (!input.jpeg || input.jpeg.byteLength === 0) return null;
4792
+ if (input.acceptBytes === true) return { jpegBytes: input.jpeg };
4793
+ return { jpeg: Buffer.from(input.jpeg).toString("base64") };
4780
4794
  }
4781
4795
  function handleKey(handle) {
4782
4796
  return `${handle.shmId}#${handle.slot}#${handle.seq}`;
@@ -6483,6 +6497,44 @@ function isUsable(bbox) {
6483
6497
  return bbox.width > 0 && bbox.height > 0;
6484
6498
  }
6485
6499
  //#endregion
6500
+ //#region src/pipeline-runner/runtime-labels.ts
6501
+ /**
6502
+ * `null` for either input means "could not be read", and the corresponding
6503
+ * field is OMITTED. The two are independent: an engine that failed to answer
6504
+ * must not also erase the models, which is how the original field managed to
6505
+ * be null on every line ever logged.
6506
+ */
6507
+ function buildRuntimeLabels(engine, steps) {
6508
+ const runtime = engine === null ? void 0 : [
6509
+ engine.runtime,
6510
+ engine.backend,
6511
+ engine.device
6512
+ ].filter((part) => part !== void 0 && part !== "").join("/");
6513
+ const models = steps === null ? void 0 : [...new Set(steps.filter((s) => s.enabled).map((s) => s.modelId))];
6514
+ return {
6515
+ ...runtime !== void 0 ? { pipelineRuntime: runtime } : {},
6516
+ ...models !== void 0 ? { pipelineModels: models } : {}
6517
+ };
6518
+ }
6519
+ /**
6520
+ * Depth-first flatten of the active pipeline tree.
6521
+ *
6522
+ * A DISABLED step takes its subtree with it: the children of a step that does
6523
+ * not run did not run either, and listing a face model under a disabled face
6524
+ * detector would name a model that never loaded.
6525
+ */
6526
+ function flattenLabelledSteps(steps) {
6527
+ const out = [];
6528
+ for (const step of steps) {
6529
+ out.push({
6530
+ modelId: step.modelId,
6531
+ enabled: step.enabled
6532
+ });
6533
+ if (step.enabled && step.children !== void 0) out.push(...flattenLabelledSteps(step.children));
6534
+ }
6535
+ return out;
6536
+ }
6537
+ //#endregion
6486
6538
  //#region src/pipeline-runner/track-frame-park.ts
6487
6539
  /** Park one frame for one track. Never throws; a refusal is an answer. */
6488
6540
  async function parkTrackFrame(deps, input) {
@@ -6636,6 +6688,12 @@ var PACKAGE_ZONE_UNION_TTL_MS = 6e4;
6636
6688
  var MAX_BOUND_FRAME_CUTTERS = 256;
6637
6689
  /** How often a camera reports its undispatched cuts. */
6638
6690
  var TILE_CUT_DROP_LOG_INTERVAL_MS = 6e4;
6691
+ /**
6692
+ * How often the `pipeline stats` runtime labels are re-read (D463). Slow on
6693
+ * purpose: this answers "which engine is this node on", which changes when an
6694
+ * operator re-selects one or lazy provisioning completes — not per frame.
6695
+ */
6696
+ var RUNTIME_INFO_REFRESH_MS = 3e5;
6639
6697
  /** How often a camera reports parcels that left without a release (D422). */
6640
6698
  var PARKED_EVICTION_LOG_INTERVAL_MS = 6e4;
6641
6699
  /**
@@ -7072,6 +7130,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
7072
7130
  parkedDetail = /* @__PURE__ */ new Map();
7073
7131
  nodeId = "unknown";
7074
7132
  metricsSnapshotTimer = null;
7133
+ runtimeInfoTimer = null;
7075
7134
  unsubMotionEvents = null;
7076
7135
  /** Devices we have positively observed reporting `battery.sleeping: true`.
7077
7136
  * Absent = unknown or awake; both mean "do not gate" (D49). Fed only by
@@ -7323,6 +7382,9 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
7323
7382
  workerFootprintMb: decodeWorkerFootprintMb(this.nativeLease.current())
7324
7383
  });
7325
7384
  this.runner.timingSampler.setLogger(this.ctx.logger.child("timing"));
7385
+ this.refreshRuntimeInfo();
7386
+ this.runtimeInfoTimer = setInterval(() => void this.refreshRuntimeInfo(), RUNTIME_INFO_REFRESH_MS);
7387
+ this.runtimeInfoTimer.unref?.();
7326
7388
  this.runner.onDetectionStreamChange((deviceId, action) => {
7327
7389
  this.handleDetectionStreamChange(deviceId, action);
7328
7390
  });
@@ -7389,6 +7451,10 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
7389
7451
  };
7390
7452
  }
7391
7453
  async onShutdown() {
7454
+ if (this.runtimeInfoTimer !== null) {
7455
+ clearInterval(this.runtimeInfoTimer);
7456
+ this.runtimeInfoTimer = null;
7457
+ }
7392
7458
  if (this.metricsSnapshotTimer) {
7393
7459
  clearInterval(this.metricsSnapshotTimer);
7394
7460
  this.metricsSnapshotTimer = null;
@@ -8196,7 +8262,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8196
8262
  const resolved = await this.resolveNativeCropPixels(input);
8197
8263
  if (resolved.tier === "native" && resolved.pixels !== null) {
8198
8264
  this.frameLazy.noteHit(resolveNativeCropHitKind(resolved.pixels.source), deviceId);
8199
- return this.encodeNativeCropResult(resolved.pixels, resolved.tier, input.encodeJpeg);
8265
+ return this.encodeNativeCropResult(resolved.pixels, resolved.tier, input.encodeJpeg, input.acceptJpegBytes);
8200
8266
  }
8201
8267
  this.frameLazy.noteMiss("native", deviceId);
8202
8268
  if (resolved.tier !== "ram-fullframe") return null;
@@ -8222,7 +8288,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8222
8288
  bytes: crop.bytes,
8223
8289
  width: crop.width,
8224
8290
  height: crop.height
8225
- }, resolved.tier, input.encodeJpeg);
8291
+ }, resolved.tier, input.encodeJpeg, input.acceptJpegBytes);
8226
8292
  }
8227
8293
  /**
8228
8294
  * PARK a frame for a track (D422) — the hub judged it relevant, and this node
@@ -8245,8 +8311,8 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8245
8311
  store,
8246
8312
  resolvePixels: (request) => this.resolveNativeCropPixels(request),
8247
8313
  encodeJpeg: async (pixels) => {
8248
- const encoded = await this.encodeNativeCropResult(pixels, "native", true);
8249
- return encoded?.jpeg !== void 0 ? Buffer.from(encoded.jpeg, "base64") : null;
8314
+ const encoded = await this.encodeNativeCropResult(pixels, "native", true, true);
8315
+ return encoded?.jpegBytes !== void 0 ? Buffer.from(encoded.jpegBytes) : null;
8250
8316
  },
8251
8317
  logger: this.ctx.logger
8252
8318
  }, input);
@@ -8269,7 +8335,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8269
8335
  return null;
8270
8336
  }
8271
8337
  return {
8272
- jpeg: parcel.jpeg.toString("base64"),
8338
+ ...input.acceptJpegBytes === true ? { jpegBytes: new Uint8Array(parcel.jpeg) } : { jpeg: parcel.jpeg.toString("base64") },
8273
8339
  width: parcel.width,
8274
8340
  height: parcel.height,
8275
8341
  timestamp: parcel.timestamp,
@@ -8649,12 +8715,15 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8649
8715
  * boundary (CLAUDE.md invariant #21). On an encode failure the crop is a miss
8650
8716
  * (`null`) — the caller retries — never a silent raw-RGB cross-node fallback.
8651
8717
  */
8652
- async encodeNativeCropResult(crop, tier, encodeJpeg) {
8718
+ async encodeNativeCropResult(crop, tier, encodeJpeg, acceptJpegBytes) {
8653
8719
  if (crop.bytes.byteLength >= 2 && crop.bytes[0] === 255 && crop.bytes[1] === 216) {
8654
- const encoded = encodeCrossNodeCrop({ jpeg: Buffer.from(crop.bytes).toString("base64") });
8720
+ const encoded = encodeCrossNodeCrop({
8721
+ jpeg: crop.bytes,
8722
+ acceptBytes: acceptJpegBytes
8723
+ });
8655
8724
  if (!encoded) return null;
8656
8725
  return {
8657
- jpeg: encoded.jpeg,
8726
+ ...encoded,
8658
8727
  width: crop.width,
8659
8728
  height: crop.height,
8660
8729
  tier
@@ -8668,16 +8737,17 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8668
8737
  };
8669
8738
  try {
8670
8739
  const encoded = encodeCrossNodeCrop({
8671
- jpeg: (await (await getSharp())(Buffer.from(crop.bytes), { raw: {
8740
+ jpeg: await (await getSharp())(Buffer.from(crop.bytes), { raw: {
8672
8741
  width: crop.width,
8673
8742
  height: crop.height,
8674
8743
  channels: 3
8675
- } }).jpeg({ quality: 90 }).toBuffer()).toString("base64"),
8676
- bytes: crop.bytes
8744
+ } }).jpeg({ quality: 90 }).toBuffer(),
8745
+ bytes: crop.bytes,
8746
+ acceptBytes: acceptJpegBytes
8677
8747
  });
8678
8748
  if (!encoded) return null;
8679
8749
  return {
8680
- jpeg: encoded.jpeg,
8750
+ ...encoded,
8681
8751
  width: crop.width,
8682
8752
  height: crop.height,
8683
8753
  tier
@@ -8734,6 +8804,39 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8734
8804
  }, input);
8735
8805
  }
8736
8806
  /**
8807
+ * Re-read the labels the `pipeline stats` lines carry (D463).
8808
+ *
8809
+ * Each half is read INDEPENDENTLY and a failure omits only its own field:
8810
+ * an engine that will not answer must not also erase the model list. Both
8811
+ * reads are best-effort by design — this is a label on a telemetry line, and
8812
+ * it must never be able to take the runner down or to log a storm. A failure
8813
+ * is logged once per refresh at `debug`, deliberately: the ABSENCE of the
8814
+ * field in the line is the signal, and the hub writes `info`.
8815
+ */
8816
+ async refreshRuntimeInfo() {
8817
+ const api = this.ctxIfReady?.api;
8818
+ if (!api) return;
8819
+ let engine = null;
8820
+ let steps = null;
8821
+ try {
8822
+ engine = await api.pipelineExecutor.getSelectedEngine.query();
8823
+ } catch (err) {
8824
+ this.ctxIfReady?.logger.debug("runtime labels: selected engine unreadable", { meta: { error: errMsg(err) } });
8825
+ }
8826
+ try {
8827
+ const active = await api.pipelineExecutor.getGlobalSteps.query();
8828
+ steps = active === null ? null : flattenLabelledSteps(active);
8829
+ } catch (err) {
8830
+ this.ctxIfReady?.logger.debug("runtime labels: active steps unreadable", { meta: { error: errMsg(err) } });
8831
+ }
8832
+ const sampler = this.runner?.timingSampler;
8833
+ if (sampler === void 0 || sampler === null) return;
8834
+ sampler.runtimeInfo = {
8835
+ ...sampler.runtimeInfo,
8836
+ ...buildRuntimeLabels(engine, steps)
8837
+ };
8838
+ }
8839
+ /**
8737
8840
  * The model format this node dispatches on when no `deviceKey` is given —
8738
8841
  * its selected engine's format. `null` on any failure, which the caller
8739
8842
  * turns into a refusal rather than a guess: a model pin that cannot be
@@ -8962,13 +9065,13 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
8962
9065
  handleAgeMs: resolved.handleAgeMs,
8963
9066
  ...resolved.workerReason !== void 0 ? { workerReason: resolved.workerReason } : {}
8964
9067
  };
8965
- const encoded = await this.encodeNativeCropResult(resolved.pixels, "native", true);
8966
- if (!encoded?.jpeg) return {
9068
+ const encoded = await this.encodeNativeCropResult(resolved.pixels, "native", true, true);
9069
+ if (!encoded?.jpegBytes) return {
8967
9070
  miss: "jpeg-encode-failed",
8968
9071
  handleAgeMs: resolved.handleAgeMs
8969
9072
  };
8970
9073
  return {
8971
- jpeg: Buffer.from(encoded.jpeg, "base64"),
9074
+ jpeg: Buffer.from(encoded.jpegBytes),
8972
9075
  width: encoded.width,
8973
9076
  height: encoded.height,
8974
9077
  frameSpace: denormalizeRect(paddedBbox, handle.width, handle.height)
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-ATDfcxgL.js");
2
+ const require_dist = require("./dist-DZsjVFey.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 { ht as parseProcStatus } from "./dist-CEFC3PkP.mjs";
1
+ import { ht as parseProcStatus } from "./dist-BNzfbpF6.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-ATDfcxgL.js");
7
- const require_node = require("../node-C5jnTgpv.js");
6
+ const require_dist = require("../dist-DZsjVFey.js");
7
+ const require_node = require("../node-BhQ8dDQC.js");
8
8
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
9
9
  const require_restream_intent = require("../restream-intent-B1Difcnq.js");
10
10
  const require_retire_root_keys = require("../retire-root-keys-Csb8z2f3.js");
@@ -1,5 +1,5 @@
1
- import { $ as evictionPolicyOfLocation, Ct as recordingExportCapability, D as RecordingConfigSchema, Dt as resolveLocationMode, E as RECORDING_EXPORT_MAX_READ_BYTES, F as batteryCapability, G as deriveRecordingMode, H as defineCustomActions, Kt as DeviceFeature, Lt as errMsg, Mt as storageOccupancyCapability, O as RecordingSignalStatusSchema, Pt as stripRetiredBandPreBufferSec, Q as evictionPolicyForMode, S as OpsLogEntrySchema, St as recordingCapability, U as deriveBatteryPresence, Wt as BaseAddon, X as evaluateSensorEdge, Zt as hydrateSchema, an as sleep$1, at as loadContributionCapability, cn as boolean, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, dt as migrateLegacyDeviceSignalConfig, fn as number, ft as modeMayWrite, g as ExportRecordSchema, gn as string, hn as record, i as BatteryStatusSchema, in as selectAssignedProfileSlots, it as isFirstLevelMacroClass, jt as storageEvictableCapability, kt as resolveRecordingProfiles, lt as mayReadLocation, mn as preprocess, on as _enum, pn as object, qt as DeviceType, sn as array, tn as nodePin, tt as gbToBytes, ut as mayWriteToLocation, vn as EventCategory, wt as recordingSignalCapability, z as customAction } from "../dist-CEFC3PkP.mjs";
2
- import { a as physicalRootOf, i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-DR3fHqUq.mjs";
1
+ import { $ as evictionPolicyOfLocation, Ct as recordingExportCapability, D as RecordingConfigSchema, Dt as resolveLocationMode, E as RECORDING_EXPORT_MAX_READ_BYTES, F as batteryCapability, G as deriveRecordingMode, H as defineCustomActions, Kt as DeviceFeature, Lt as errMsg, Mt as storageOccupancyCapability, O as RecordingSignalStatusSchema, Pt as stripRetiredBandPreBufferSec, Q as evictionPolicyForMode, S as OpsLogEntrySchema, St as recordingCapability, U as deriveBatteryPresence, Wt as BaseAddon, X as evaluateSensorEdge, Zt as hydrateSchema, an as sleep$1, at as loadContributionCapability, cn as boolean, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, dt as migrateLegacyDeviceSignalConfig, fn as number, ft as modeMayWrite, g as ExportRecordSchema, gn as string, hn as record, i as BatteryStatusSchema, in as selectAssignedProfileSlots, it as isFirstLevelMacroClass, jt as storageEvictableCapability, kt as resolveRecordingProfiles, lt as mayReadLocation, mn as preprocess, on as _enum, pn as object, qt as DeviceType, sn as array, tn as nodePin, tt as gbToBytes, ut as mayWriteToLocation, vn as EventCategory, wt as recordingSignalCapability, z as customAction } from "../dist-BNzfbpF6.mjs";
2
+ import { a as physicalRootOf, i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-uYIx2aZF.mjs";
3
3
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
4
4
  import { c as PREBUFFER_MAX_MS, r as RECORDING_PRE_ROLL_REQUEST_MS, s as withRecordingIntent } from "../restream-intent-DWe2kInY.mjs";
5
5
  import { n as RowMapStore, t as retireRootKeys } from "../retire-root-keys-DZvlso2l.mjs";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-ATDfcxgL.js");
2
+ const require_dist = require("./dist-DZsjVFey.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) => {
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-DnnnRqeS.mjs";
2
- import { Lt as errMsg } from "./dist-CEFC3PkP.mjs";
2
+ import { Lt as errMsg } from "./dist-BNzfbpF6.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) => {
@@ -3,7 +3,7 @@ import "./dist-CYZr2fwk.mjs";
3
3
  var e = {
4
4
  "@camstack/sdk": {
5
5
  name: "@camstack/sdk",
6
- version: "1.2.99",
6
+ version: "1.2.100",
7
7
  scope: ["default"],
8
8
  loaded: !1,
9
9
  from: "addon_stream_broker_widgets",
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.179",
21
+ version: "1.2.180",
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.147",
36
+ version: "1.2.148",
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-o9KBAz9p.js");
1
+ const require_segment_demux_js = require("../segment-demux-js-Cvszh55p.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-CddDwD69.mjs";
1
+ import { t as demuxSegmentFullJs } from "../segment-demux-js-Dh1dn_AT.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.179",
39
+ version: "1.2.180",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -45,7 +45,7 @@ async function r() {
45
45
  }
46
46
  },
47
47
  "@camstack/sdk": {
48
- version: "1.2.99",
48
+ version: "1.2.100",
49
49
  scope: "default",
50
50
  shareConfig: {
51
51
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.147",
84
+ version: "1.2.148",
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-ATDfcxgL.js");
7
- const require_node = require("../node-C5jnTgpv.js");
6
+ const require_dist = require("../dist-DZsjVFey.js");
7
+ const require_node = require("../node-BhQ8dDQC.js");
8
8
  const require_restream_intent = require("../restream-intent-B1Difcnq.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-o9KBAz9p.js");
11
+ const require_segment_demux_js = require("../segment-demux-js-Cvszh55p.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 { $t as makeProfileBrokerId, B as declareLogChannel, Bt as buildFfmpegArgs$1, Et as resolveEgressDecodeHwAccel, F as batteryCapability, Gt as CAM_PROFILE_ORDER, Ht as isSoftwareDecode, I as cameraStreamsCapability, It as webrtcSessionCapability, J as egressTransportFromRequest, Kt as DeviceFeature, L as createHwAccelCache, Lt as errMsg, Nt as streamBrokerCapability, Qt as isEvent, R as createLogChannelsProvider, Rt as AUDIO_PRESETS, T as RATE_CONTROL_TIGHT, U as deriveBatteryPresence, Ut as BOOT_RECOVERY_BACKOFF_MS, Vt as invocationFromEncodeProfile, Wt as BaseAddon, Xt as expandAudioChunkToF32le, Yt as createEvent, _n as union, at as loadContributionCapability, cn as boolean, ct as maskUrlCredentials, dn as literal, en as makeSourceBrokerId, fn as number, gn as string, h as EncodeProfileSchema, hn as record, i as BatteryStatusSchema, j as addonWidgetsSourceCapability, k as RingBuffer, ln as discriminatedUnion, on as _enum, ot as logChannelsCapability, pn as object, q as egressTranscodeSharingKey, qt as DeviceType, rn as parseProfileBrokerId, sn as array, tn as nodePin, v as G711_SCALE_CORRECTION_DB, vn as EventCategory, w as RATE_CONTROL_RELAXED } from "../dist-CEFC3PkP.mjs";
3
- import { i as NO_COST_CLAIM, n as Fmp4FragmentChild, r as Fmp4FragmentPlane, t as ChildCostRegistry } from "../node-DR3fHqUq.mjs";
2
+ import { $t as makeProfileBrokerId, B as declareLogChannel, Bt as buildFfmpegArgs$1, Et as resolveEgressDecodeHwAccel, F as batteryCapability, Gt as CAM_PROFILE_ORDER, Ht as isSoftwareDecode, I as cameraStreamsCapability, It as webrtcSessionCapability, J as egressTransportFromRequest, Kt as DeviceFeature, L as createHwAccelCache, Lt as errMsg, Nt as streamBrokerCapability, Qt as isEvent, R as createLogChannelsProvider, Rt as AUDIO_PRESETS, T as RATE_CONTROL_TIGHT, U as deriveBatteryPresence, Ut as BOOT_RECOVERY_BACKOFF_MS, Vt as invocationFromEncodeProfile, Wt as BaseAddon, Xt as expandAudioChunkToF32le, Yt as createEvent, _n as union, at as loadContributionCapability, cn as boolean, ct as maskUrlCredentials, dn as literal, en as makeSourceBrokerId, fn as number, gn as string, h as EncodeProfileSchema, hn as record, i as BatteryStatusSchema, j as addonWidgetsSourceCapability, k as RingBuffer, ln as discriminatedUnion, on as _enum, ot as logChannelsCapability, pn as object, q as egressTranscodeSharingKey, qt as DeviceType, rn as parseProfileBrokerId, sn as array, tn as nodePin, v as G711_SCALE_CORRECTION_DB, vn as EventCategory, w as RATE_CONTROL_RELAXED } from "../dist-BNzfbpF6.mjs";
3
+ import { i as NO_COST_CLAIM, n as Fmp4FragmentChild, r as Fmp4FragmentPlane, t as ChildCostRegistry } from "../node-uYIx2aZF.mjs";
4
4
  import { c as PREBUFFER_MAX_MS, d as resolvePrebuffer, i as parseRestreamPath, l as capPreRollRequestMs, n as NO_DECLARATION, u as prebufferRetentionMs } from "../restream-intent-DWe2kInY.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-CddDwD69.mjs";
7
+ import { i as require_mp4box_all, n as demuxSegmentPreferJs, r as runFfmpegOnce, t as demuxSegmentFullJs } from "../segment-demux-js-Dh1dn_AT.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-D5XnLZWR.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BZG3prqU.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.221",
3
+ "version": "1.2.222",
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",