@camstack/addon-export-hap 1.1.2 → 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.
@@ -4664,7 +4664,7 @@ function _instanceof(cls, params = {}) {
4664
4664
  return inst;
4665
4665
  }
4666
4666
  //#endregion
4667
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4667
+ //#region ../types/dist/sleep-_J5S7OEP.mjs
4668
4668
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4669
4669
  EventCategory["SystemBoot"] = "system.boot";
4670
4670
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5779,15 +5779,24 @@ var BaseAddon = class {
5779
5779
  } catch {}
5780
5780
  }
5781
5781
  /**
5782
- * Resolve the shared models directory path via the storage capability.
5783
- * Falls back to `camstack-data/models` if storage is unavailable.
5784
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5782
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5783
+ *
5784
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5785
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5786
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5787
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5788
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5789
+ * whose real data dir differs (e.g. the macOS electron agent).
5790
+ *
5791
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5792
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5785
5793
  */
5786
5794
  async resolveModelsDir() {
5787
- return this.ctx.api.storage.resolve.query({
5788
- location: "models",
5789
- relativePath: ""
5790
- }).catch(() => "camstack-data/models");
5795
+ const { join } = await import("node:path");
5796
+ const { promises: fsp } = await import("node:fs");
5797
+ const dir = join(this.ctx.nodeDataDir, "models");
5798
+ await fsp.mkdir(dir, { recursive: true });
5799
+ return dir;
5791
5800
  }
5792
5801
  /**
5793
5802
  * Access the runtime capability registry for in-process provider lookups.
@@ -4639,7 +4639,7 @@ function _instanceof(cls, params = {}) {
4639
4639
  return inst;
4640
4640
  }
4641
4641
  //#endregion
4642
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4642
+ //#region ../types/dist/sleep-_J5S7OEP.mjs
4643
4643
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4644
4644
  EventCategory["SystemBoot"] = "system.boot";
4645
4645
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5754,15 +5754,24 @@ var BaseAddon = class {
5754
5754
  } catch {}
5755
5755
  }
5756
5756
  /**
5757
- * Resolve the shared models directory path via the storage capability.
5758
- * Falls back to `camstack-data/models` if storage is unavailable.
5759
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5757
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5758
+ *
5759
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5760
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5761
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5762
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5763
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5764
+ * whose real data dir differs (e.g. the macOS electron agent).
5765
+ *
5766
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5767
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5760
5768
  */
5761
5769
  async resolveModelsDir() {
5762
- return this.ctx.api.storage.resolve.query({
5763
- location: "models",
5764
- relativePath: ""
5765
- }).catch(() => "camstack-data/models");
5770
+ const { join } = await import("node:path");
5771
+ const { promises: fsp } = await import("node:fs");
5772
+ const dir = join(this.ctx.nodeDataDir, "models");
5773
+ await fsp.mkdir(dir, { recursive: true });
5774
+ return dir;
5766
5775
  }
5767
5776
  /**
5768
5777
  * 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-export-hap",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "HomeKit (HAP) bridge exporter for CamStack devices. Publishes a bridged accessory per exposed device — MotionSensor in this MVP; Camera/Doorbell/Switch/Light follow.",
5
5
  "keywords": [
6
6
  "camstack",