@elizaos/plugin-local-ai 2.0.0-alpha.1 → 2.0.0-alpha.3

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.
@@ -211,12 +211,18 @@ class DownloadManager {
211
211
  return DownloadManager.instance;
212
212
  }
213
213
  ensureCacheDirectory() {
214
+ if (!this.cacheDir || this.cacheDir.trim() === "") {
215
+ throw new Error("Cache directory path cannot be empty");
216
+ }
214
217
  if (!import_node_fs.default.existsSync(this.cacheDir)) {
215
218
  import_node_fs.default.mkdirSync(this.cacheDir, { recursive: true });
216
219
  import_core2.logger.debug("Created cache directory");
217
220
  }
218
221
  }
219
222
  ensureModelsDirectory() {
223
+ if (!this.modelsDir || this.modelsDir.trim() === "") {
224
+ throw new Error("Models directory path cannot be empty");
225
+ }
220
226
  import_core2.logger.debug("Ensuring models directory exists:", this.modelsDir);
221
227
  if (!import_node_fs.default.existsSync(this.modelsDir)) {
222
228
  import_node_fs.default.mkdirSync(this.modelsDir, { recursive: true });
@@ -469,6 +475,9 @@ class DownloadManager {
469
475
  return this.downloadFile(url, destPath);
470
476
  }
471
477
  ensureDirectoryExists(dirPath) {
478
+ if (!dirPath || dirPath.trim() === "") {
479
+ throw new Error("Directory path cannot be empty");
480
+ }
472
481
  if (!import_node_fs.default.existsSync(dirPath)) {
473
482
  import_node_fs.default.mkdirSync(dirPath, { recursive: true });
474
483
  import_core2.logger.info(`Created directory: ${dirPath}`);
@@ -2676,4 +2685,4 @@ Example response format:
2676
2685
  };
2677
2686
  var typescript_default = localAiPlugin;
2678
2687
 
2679
- //# debugId=1CE7B8E9FA96511864756E2164756E21
2688
+ //# debugId=987AE322E499B37164756E2164756E21