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