@elizaos/plugin-local-ai 2.0.0-alpha.2 → 2.0.0-alpha.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/cjs/index.node.cjs +10 -1
- package/dist/cjs/index.node.js.map +3 -3
- package/dist/node/index.node.js +10 -17
- package/dist/node/index.node.js.map +3 -3
- package/dist/utils/downloadManager.d.ts +5 -0
- package/dist/utils/downloadManager.d.ts.map +1 -1
- package/package.json +15 -5
- package/LICENSE +0 -21
package/dist/node/index.node.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
2
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
19
3
|
|
|
20
4
|
// index.ts
|
|
@@ -188,12 +172,18 @@ class DownloadManager {
|
|
|
188
172
|
return DownloadManager.instance;
|
|
189
173
|
}
|
|
190
174
|
ensureCacheDirectory() {
|
|
175
|
+
if (!this.cacheDir || this.cacheDir.trim() === "") {
|
|
176
|
+
throw new Error("Cache directory path cannot be empty");
|
|
177
|
+
}
|
|
191
178
|
if (!fs.existsSync(this.cacheDir)) {
|
|
192
179
|
fs.mkdirSync(this.cacheDir, { recursive: true });
|
|
193
180
|
logger2.debug("Created cache directory");
|
|
194
181
|
}
|
|
195
182
|
}
|
|
196
183
|
ensureModelsDirectory() {
|
|
184
|
+
if (!this.modelsDir || this.modelsDir.trim() === "") {
|
|
185
|
+
throw new Error("Models directory path cannot be empty");
|
|
186
|
+
}
|
|
197
187
|
logger2.debug("Ensuring models directory exists:", this.modelsDir);
|
|
198
188
|
if (!fs.existsSync(this.modelsDir)) {
|
|
199
189
|
fs.mkdirSync(this.modelsDir, { recursive: true });
|
|
@@ -446,6 +436,9 @@ class DownloadManager {
|
|
|
446
436
|
return this.downloadFile(url, destPath);
|
|
447
437
|
}
|
|
448
438
|
ensureDirectoryExists(dirPath) {
|
|
439
|
+
if (!dirPath || dirPath.trim() === "") {
|
|
440
|
+
throw new Error("Directory path cannot be empty");
|
|
441
|
+
}
|
|
449
442
|
if (!fs.existsSync(dirPath)) {
|
|
450
443
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
451
444
|
logger2.info(`Created directory: ${dirPath}`);
|
|
@@ -2663,4 +2656,4 @@ export {
|
|
|
2663
2656
|
typescript_default as default
|
|
2664
2657
|
};
|
|
2665
2658
|
|
|
2666
|
-
//# debugId=
|
|
2659
|
+
//# debugId=95C530A9F4EA7C4764756E2164756E21
|