@elizaos/prompts 2.0.0-alpha.2 → 2.0.0-alpha.26

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elizaos/prompts",
3
3
  "private": false,
4
- "version": "2.0.0-alpha.2",
4
+ "version": "2.0.0-alpha.26",
5
5
  "description": "Shared prompt templates for elizaOS across TypeScript, Python, and Rust",
6
6
  "type": "module",
7
7
  "main": "./dist/typescript/index.ts",
@@ -25,7 +25,8 @@
25
25
  "clean": "rm -rf dist",
26
26
  "lint": "bunx @biomejs/biome check --write --unsafe .",
27
27
  "lint:check": "bunx @biomejs/biome check .",
28
- "typecheck": "echo 'No TypeScript source files to check'"
28
+ "typecheck": "echo 'No TypeScript source files to check'",
29
+ "test": "node --test test/*.test.js"
29
30
  },
30
31
  "files": [
31
32
  "prompts/",
@@ -43,5 +44,5 @@
43
44
  "publishConfig": {
44
45
  "access": "public"
45
46
  },
46
- "gitHead": "bc6cac8d36845d7cbde51a64307c6a57c16378ad"
47
+ "gitHead": "91dceb1d2e9762af27353dbc764e40e1a0599508"
47
48
  }
@@ -420,9 +420,14 @@ function loadSpecs(dir, corePath, kind) {
420
420
  }
421
421
 
422
422
  /**
423
- * @param {string} dir
423
+ * Ensures a directory exists, creating it and parent directories if necessary.
424
+ * @param {string} dir - The directory path to ensure exists
425
+ * @throws {Error} If the directory path is empty or whitespace-only
424
426
  */
425
427
  function ensureDir(dir) {
428
+ if (!dir || dir.trim() === "") {
429
+ throw new Error("Directory path cannot be empty");
430
+ }
426
431
  fs.mkdirSync(dir, { recursive: true });
427
432
  }
428
433
 
@@ -41,7 +41,15 @@ function readJson(filePath) {
41
41
  return JSON.parse(readText(filePath));
42
42
  }
43
43
 
44
+ /**
45
+ * Ensures a directory exists, creating it and parent directories if necessary.
46
+ * @param {string} dir - The directory path to ensure exists
47
+ * @throws {Error} If the directory path is empty or whitespace-only
48
+ */
44
49
  function ensureDir(dir) {
50
+ if (!dir || dir.trim() === "") {
51
+ throw new Error("Directory path cannot be empty");
52
+ }
45
53
  fs.mkdirSync(dir, { recursive: true });
46
54
  }
47
55