@camstack/addon-pipeline 1.2.126 → 1.2.127

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.
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  const require_dist = require("../dist-BZUXb5S5.js");
6
6
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-BdArVUlx.js");
7
- const require_lazy_sharp = require("../lazy-sharp-BxMwCkCA.js");
7
+ const require_lazy_sharp = require("../lazy-sharp-DTDXrhMG.js");
8
8
  const require_process_memory = require("../process-memory-Dh1SyzdJ.js");
9
9
  const require_addon_utils = require("../addon-utils-BnprivSs.js");
10
10
  let sharp = require("sharp");
@@ -1,7 +1,7 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
2
  import { $ as pickClusterStepModels, D as YAMNET_TO_MACRO, Dt as hydrateSchema, Et as createEvent, Ft as sleep, G as evaluateZoneRules, Gt as string, I as defaultDeviceFor$1, Kt as union, Lt as array, Mt as parseJsonUnknown, St as BaseAddon, Ut as object, V as detectionPipelineCapability, W as enumerateInferenceDevices, Z as overlayClusterStepSettings, c as DEFAULT_CLUSTER_STEP_MODELS, dt as runtimeDevices$1, et as pickClusterStepSettings, gt as errMsg, jt as nodePin, l as DEFAULT_CLUSTER_STEP_SETTINGS, lt as resolvePoolMemoryPolicy, mt as supportedRuntimes$1, p as DEVICE_BACKEND_TO_FORMAT, q as inferModelProvider, qt as EventCategory, rt as pipelineExecutorCapability, st as resolveClusterStepModelId, t as APPLE_SA_TO_MACRO, x as PoolMemoryWatchdog } from "../dist-HLAOw6Pe.mjs";
3
3
  import { a as ALL_PIPELINE_STEPS, c as getDefaultModelForFormatFromDef, d as resolveModelForFormat, f as landmarkPrecisionVerdict, l as getStep, n as startEventLoopStallMonitor, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as getStepDefinition } from "../event-loop-stall-monitor-BH-cL_hg.mjs";
4
- import { t as getSharp } from "../lazy-sharp-6oymT_yf.mjs";
4
+ import { t as getSharp } from "../lazy-sharp-BtT5x-qP.mjs";
5
5
  import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CDPRLalN.mjs";
6
6
  import { a as ensureModel, o as isModelDownloaded, r as deleteModelFromDisk } from "../addon-utils-CgBCF-mE.mjs";
7
7
  import sharp from "sharp";
@@ -47,9 +47,10 @@ import * as path$1 from "node:path";
47
47
  * `CAMSTACK_FRAMEWORK_DIR` (`<frameworkDir>/node_modules/<pkg>`). The
48
48
  * launcher points this at the ACTIVE closure in data-root mode and forked
49
49
  * children inherit it (`server/backend/src/launcher.ts`).
50
- * - **ELECTRON agent** — the app bundle beside `CAMSTACK_BUNDLED_ADDONS_DIR`
51
- * (`<resources>/addons`): `<resources>/node_modules/<pkg>` and the
52
- * `app.asar.unpacked` mirror.
50
+ * - **ELECTRON agent** — the app bundle around `CAMSTACK_BUNDLED_ADDONS_DIR`
51
+ * (`<resources>/node_modules/@camstack` since 2026-08-25, `<resources>/addons`
52
+ * before it): `<resources>/node_modules/<pkg>` and the `app.asar.unpacked`
53
+ * mirror. See {@link electronResourcesRoot} — the depth is NOT assumed.
53
54
  * - **the process cwd** — always tried last, and it is NOT redundant:
54
55
  * `CAMSTACK_FRAMEWORK_DIR` is only exported on some boots (the Docker
55
56
  * entrypoint sets it in its fallback branch; the launcher only in data-root
@@ -108,6 +109,38 @@ function isModuleResolutionError(err) {
108
109
  return err.message.includes("Cannot find package") || err.message.includes("Cannot find module");
109
110
  }
110
111
  /**
112
+ * Path segments that are containers on the way to a package dir, never the
113
+ * Electron `Resources` dir itself. Walking past them is what makes the anchor
114
+ * derivation independent of WHICH dir the shell chose to seed addons from.
115
+ */
116
+ var SEED_CONTAINER_SEGMENTS = [
117
+ "@camstack",
118
+ "node_modules",
119
+ "addons"
120
+ ];
121
+ /**
122
+ * The Electron `Contents/Resources` dir, derived from `CAMSTACK_BUNDLED_ADDONS_DIR`.
123
+ *
124
+ * That variable names the dir the launcher SEEDS addons from, and its shape has
125
+ * moved: it was `<resources>/addons` (a second, hand-copied tree) and is now
126
+ * `<resources>/node_modules/@camstack`, the closure's own scope dir — one copy
127
+ * (D45). What this function needs is neither: it needs the sibling
128
+ * `<resources>/node_modules`, where the hoisted `sharp` / `node-av` actually
129
+ * live. A plain `path.dirname` answered the first shape and would have silently
130
+ * answered `<resources>/node_modules/node_modules` for the second, losing both
131
+ * packages in every forked decode worker on a desktop agent. So: climb past the
132
+ * container segments instead of assuming a depth.
133
+ */
134
+ function electronResourcesRoot(bundledAddonsDir) {
135
+ let dir = path$1.resolve(bundledAddonsDir);
136
+ while (SEED_CONTAINER_SEGMENTS.includes(path$1.basename(dir))) {
137
+ const parent = path$1.dirname(dir);
138
+ if (parent === dir) break;
139
+ dir = parent;
140
+ }
141
+ return dir;
142
+ }
143
+ /**
111
144
  * The files a resolution is anchored at, in the order they are tried. Each is a
112
145
  * path INSIDE a candidate `node_modules` (so `<dir>/node_modules/<pkg>` is on
113
146
  * the walk), except the cwd anchor, which walks up from the cwd itself.
@@ -120,7 +153,7 @@ function hostExternalAnchors(env, cwd) {
120
153
  if (frameworkDir !== void 0 && frameworkDir.length > 0) anchors.push(path$1.join(frameworkDir, "node_modules", ANCHOR_FILE));
121
154
  const bundledAddons = env["CAMSTACK_BUNDLED_ADDONS_DIR"];
122
155
  if (bundledAddons !== void 0 && bundledAddons.length > 0) {
123
- const resourcesRoot = path$1.dirname(bundledAddons);
156
+ const resourcesRoot = electronResourcesRoot(bundledAddons);
124
157
  anchors.push(path$1.join(resourcesRoot, "node_modules", ANCHOR_FILE));
125
158
  anchors.push(path$1.join(resourcesRoot, "app.asar.unpacked", "node_modules", ANCHOR_FILE));
126
159
  }
@@ -49,9 +49,10 @@ node_path = require_dist.__toESM(node_path);
49
49
  * `CAMSTACK_FRAMEWORK_DIR` (`<frameworkDir>/node_modules/<pkg>`). The
50
50
  * launcher points this at the ACTIVE closure in data-root mode and forked
51
51
  * children inherit it (`server/backend/src/launcher.ts`).
52
- * - **ELECTRON agent** — the app bundle beside `CAMSTACK_BUNDLED_ADDONS_DIR`
53
- * (`<resources>/addons`): `<resources>/node_modules/<pkg>` and the
54
- * `app.asar.unpacked` mirror.
52
+ * - **ELECTRON agent** — the app bundle around `CAMSTACK_BUNDLED_ADDONS_DIR`
53
+ * (`<resources>/node_modules/@camstack` since 2026-08-25, `<resources>/addons`
54
+ * before it): `<resources>/node_modules/<pkg>` and the `app.asar.unpacked`
55
+ * mirror. See {@link electronResourcesRoot} — the depth is NOT assumed.
55
56
  * - **the process cwd** — always tried last, and it is NOT redundant:
56
57
  * `CAMSTACK_FRAMEWORK_DIR` is only exported on some boots (the Docker
57
58
  * entrypoint sets it in its fallback branch; the launcher only in data-root
@@ -110,6 +111,38 @@ function isModuleResolutionError(err) {
110
111
  return err.message.includes("Cannot find package") || err.message.includes("Cannot find module");
111
112
  }
112
113
  /**
114
+ * Path segments that are containers on the way to a package dir, never the
115
+ * Electron `Resources` dir itself. Walking past them is what makes the anchor
116
+ * derivation independent of WHICH dir the shell chose to seed addons from.
117
+ */
118
+ var SEED_CONTAINER_SEGMENTS = [
119
+ "@camstack",
120
+ "node_modules",
121
+ "addons"
122
+ ];
123
+ /**
124
+ * The Electron `Contents/Resources` dir, derived from `CAMSTACK_BUNDLED_ADDONS_DIR`.
125
+ *
126
+ * That variable names the dir the launcher SEEDS addons from, and its shape has
127
+ * moved: it was `<resources>/addons` (a second, hand-copied tree) and is now
128
+ * `<resources>/node_modules/@camstack`, the closure's own scope dir — one copy
129
+ * (D45). What this function needs is neither: it needs the sibling
130
+ * `<resources>/node_modules`, where the hoisted `sharp` / `node-av` actually
131
+ * live. A plain `path.dirname` answered the first shape and would have silently
132
+ * answered `<resources>/node_modules/node_modules` for the second, losing both
133
+ * packages in every forked decode worker on a desktop agent. So: climb past the
134
+ * container segments instead of assuming a depth.
135
+ */
136
+ function electronResourcesRoot(bundledAddonsDir) {
137
+ let dir = node_path.resolve(bundledAddonsDir);
138
+ while (SEED_CONTAINER_SEGMENTS.includes(node_path.basename(dir))) {
139
+ const parent = node_path.dirname(dir);
140
+ if (parent === dir) break;
141
+ dir = parent;
142
+ }
143
+ return dir;
144
+ }
145
+ /**
113
146
  * The files a resolution is anchored at, in the order they are tried. Each is a
114
147
  * path INSIDE a candidate `node_modules` (so `<dir>/node_modules/<pkg>` is on
115
148
  * the walk), except the cwd anchor, which walks up from the cwd itself.
@@ -122,7 +155,7 @@ function hostExternalAnchors(env, cwd) {
122
155
  if (frameworkDir !== void 0 && frameworkDir.length > 0) anchors.push(node_path.join(frameworkDir, "node_modules", ANCHOR_FILE));
123
156
  const bundledAddons = env["CAMSTACK_BUNDLED_ADDONS_DIR"];
124
157
  if (bundledAddons !== void 0 && bundledAddons.length > 0) {
125
- const resourcesRoot = node_path.dirname(bundledAddons);
158
+ const resourcesRoot = electronResourcesRoot(bundledAddons);
126
159
  anchors.push(node_path.join(resourcesRoot, "node_modules", ANCHOR_FILE));
127
160
  anchors.push(node_path.join(resourcesRoot, "app.asar.unpacked", "node_modules", ANCHOR_FILE));
128
161
  }
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_dist = require("../dist-BZUXb5S5.js");
6
- const require_lazy_sharp = require("../lazy-sharp-BxMwCkCA.js");
6
+ const require_lazy_sharp = require("../lazy-sharp-DTDXrhMG.js");
7
7
  let node_path = require("node:path");
8
8
  let node_fs = require("node:fs");
9
9
  //#region src/motion-wasm/wasm-motion-detector.ts
@@ -1,5 +1,5 @@
1
1
  import { Dt as hydrateSchema, G as evaluateZoneRules, St as BaseAddon, Tt as DeviceType, X as motionDetectionCapability } from "../dist-HLAOw6Pe.mjs";
2
- import { t as getSharp } from "../lazy-sharp-6oymT_yf.mjs";
2
+ import { t as getSharp } from "../lazy-sharp-BtT5x-qP.mjs";
3
3
  import { join } from "node:path";
4
4
  import { readFileSync } from "node:fs";
5
5
  //#region src/motion-wasm/wasm-motion-detector.ts
@@ -6,7 +6,7 @@ const require_dist = require("../dist-BZUXb5S5.js");
6
6
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-BdArVUlx.js");
7
7
  const require_worker_protocol = require("../worker-protocol-BxkCoVjw.js");
8
8
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
9
- const require_lazy_sharp = require("../lazy-sharp-BxMwCkCA.js");
9
+ const require_lazy_sharp = require("../lazy-sharp-DTDXrhMG.js");
10
10
  const require_restream_intent = require("../restream-intent-Cv9x3jmu.js");
11
11
  const require_remote_restream = require("../remote-restream-CO36Sr30.js");
12
12
  let sharp = require("sharp");
@@ -2,7 +2,7 @@ import { Bt as lazy, Et as createEvent, F as customAction, Gt as string, Ht as n
2
2
  import { i as resolveFrameViewGeometry, r as localFrameRegistry, t as attributeStall, u as getStepDefinition } from "../event-loop-stall-monitor-BH-cL_hg.mjs";
3
3
  import { a as nativeLeaseSettingEnv, t as isWorkerReply } from "../worker-protocol-h7Smb_0i.mjs";
4
4
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
5
- import { t as getSharp } from "../lazy-sharp-6oymT_yf.mjs";
5
+ import { t as getSharp } from "../lazy-sharp-BtT5x-qP.mjs";
6
6
  import { n as withDetectionIntent } from "../restream-intent-B4BXZra7.mjs";
7
7
  import { n as profileForStreamId, t as isRemoteRestream } from "../remote-restream-BeHi78PZ.mjs";
8
8
  import sharp from "sharp";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_worker_protocol = require("../worker-protocol-BxkCoVjw.js");
3
- const require_lazy_sharp = require("../lazy-sharp-BxMwCkCA.js");
3
+ const require_lazy_sharp = require("../lazy-sharp-DTDXrhMG.js");
4
4
  //#region src/session-decode/color-conversion.ts
5
5
  /**
6
6
  * Explicit YUV→RGB colorspace/range resolution for the session-decode worker.
@@ -1,5 +1,5 @@
1
1
  import { i as formatNativeLeaseKnobs, n as isWorkerRequest, o as resolveNativeLeaseKnobs, r as logLevelForLine } from "../worker-protocol-h7Smb_0i.mjs";
2
- import { n as setSharpWarnSink, r as hostExternalEntryUrls, t as getSharp } from "../lazy-sharp-6oymT_yf.mjs";
2
+ import { n as setSharpWarnSink, r as hostExternalEntryUrls, t as getSharp } from "../lazy-sharp-BtT5x-qP.mjs";
3
3
  //#region src/session-decode/color-conversion.ts
4
4
  /**
5
5
  * Explicit YUV→RGB colorspace/range resolution for the session-decode worker.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline",
3
- "version": "1.2.126",
3
+ "version": "1.2.127",
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",