@camstack/addon-provider-onvif 1.1.3 → 1.1.4

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.
package/dist/addon.js CHANGED
@@ -4631,7 +4631,7 @@ function _instanceof(cls, params = {}) {
4631
4631
  return inst;
4632
4632
  }
4633
4633
  //#endregion
4634
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4634
+ //#region ../types/dist/sleep-_J5S7OEP.mjs
4635
4635
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4636
4636
  EventCategory["SystemBoot"] = "system.boot";
4637
4637
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5746,15 +5746,24 @@ var BaseAddon = class {
5746
5746
  } catch {}
5747
5747
  }
5748
5748
  /**
5749
- * Resolve the shared models directory path via the storage capability.
5750
- * Falls back to `camstack-data/models` if storage is unavailable.
5751
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5749
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5750
+ *
5751
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5752
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5753
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5754
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5755
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5756
+ * whose real data dir differs (e.g. the macOS electron agent).
5757
+ *
5758
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5759
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5752
5760
  */
5753
5761
  async resolveModelsDir() {
5754
- return this.ctx.api.storage.resolve.query({
5755
- location: "models",
5756
- relativePath: ""
5757
- }).catch(() => "camstack-data/models");
5762
+ const { join } = await import("node:path");
5763
+ const { promises: fsp } = await import("node:fs");
5764
+ const dir = join(this.ctx.nodeDataDir, "models");
5765
+ await fsp.mkdir(dir, { recursive: true });
5766
+ return dir;
5758
5767
  }
5759
5768
  /**
5760
5769
  * Access the runtime capability registry for in-process provider lookups.
package/dist/addon.mjs CHANGED
@@ -4632,7 +4632,7 @@ function _instanceof(cls, params = {}) {
4632
4632
  return inst;
4633
4633
  }
4634
4634
  //#endregion
4635
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4635
+ //#region ../types/dist/sleep-_J5S7OEP.mjs
4636
4636
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4637
4637
  EventCategory["SystemBoot"] = "system.boot";
4638
4638
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5747,15 +5747,24 @@ var BaseAddon = class {
5747
5747
  } catch {}
5748
5748
  }
5749
5749
  /**
5750
- * Resolve the shared models directory path via the storage capability.
5751
- * Falls back to `camstack-data/models` if storage is unavailable.
5752
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5750
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5751
+ *
5752
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5753
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5754
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5755
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5756
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5757
+ * whose real data dir differs (e.g. the macOS electron agent).
5758
+ *
5759
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5760
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5753
5761
  */
5754
5762
  async resolveModelsDir() {
5755
- return this.ctx.api.storage.resolve.query({
5756
- location: "models",
5757
- relativePath: ""
5758
- }).catch(() => "camstack-data/models");
5763
+ const { join } = await import("node:path");
5764
+ const { promises: fsp } = await import("node:fs");
5765
+ const dir = join(this.ctx.nodeDataDir, "models");
5766
+ await fsp.mkdir(dir, { recursive: true });
5767
+ return dir;
5759
5768
  }
5760
5769
  /**
5761
5770
  * Access the runtime capability registry for in-process provider lookups.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",