@aigne/core 1.57.1 → 1.57.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.57.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.57.1...core-v1.57.2) (2025-08-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **core:** resolve nested prompt file correctly ([#434](https://github.com/AIGNE-io/aigne-framework/issues/434)) ([b334092](https://github.com/AIGNE-io/aigne-framework/commit/b334092900c003ca3c22d320e12712fd55c2500c))
9
+
3
10
  ## [1.57.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.57.0...core-v1.57.1) (2025-08-29)
4
11
 
5
12
 
@@ -38,6 +38,7 @@ class PromptTemplate {
38
38
  }
39
39
  }
40
40
  exports.PromptTemplate = PromptTemplate;
41
+ const IGNORED_PROMPT_DIRS = ["node_modules", ".git"];
41
42
  class CustomLoader extends nunjucks_1.default.Loader {
42
43
  options;
43
44
  constructor(options) {
@@ -46,19 +47,20 @@ class CustomLoader extends nunjucks_1.default.Loader {
46
47
  }
47
48
  async = true;
48
49
  async findFile(dir, name) {
49
- name = index_js_1.nodejs.path.basename(name);
50
+ name = name.replace(/^[./]*/, "");
50
51
  const files = await index_js_1.nodejs.fs.readdir(dir, { withFileTypes: true });
51
- const file = files.find((f) => f.name === name);
52
+ const file = files.find((f) => index_js_1.nodejs.path.join(f.parentPath, f.name).endsWith(name));
52
53
  if (file)
53
54
  return index_js_1.nodejs.path.join(file.parentPath, file.name);
54
- for (const dir of files) {
55
- if (dir.isDirectory()) {
56
- const result = await this.findFile(index_js_1.nodejs.path.join(dir.parentPath, dir.name), name);
55
+ for (const entry of files) {
56
+ if (entry.isDirectory()) {
57
+ if (IGNORED_PROMPT_DIRS.includes(entry.name))
58
+ continue;
59
+ const result = await this.findFile(index_js_1.nodejs.path.join(entry.parentPath, entry.name), name);
57
60
  if (result)
58
61
  return result;
59
62
  }
60
63
  }
61
- return null;
62
64
  }
63
65
  getSource(name, callback) {
64
66
  let result = null;
@@ -30,6 +30,7 @@ export class PromptTemplate {
30
30
  }));
31
31
  }
32
32
  }
33
+ const IGNORED_PROMPT_DIRS = ["node_modules", ".git"];
33
34
  export class CustomLoader extends nunjucks.Loader {
34
35
  options;
35
36
  constructor(options) {
@@ -38,19 +39,20 @@ export class CustomLoader extends nunjucks.Loader {
38
39
  }
39
40
  async = true;
40
41
  async findFile(dir, name) {
41
- name = nodejs.path.basename(name);
42
+ name = name.replace(/^[./]*/, "");
42
43
  const files = await nodejs.fs.readdir(dir, { withFileTypes: true });
43
- const file = files.find((f) => f.name === name);
44
+ const file = files.find((f) => nodejs.path.join(f.parentPath, f.name).endsWith(name));
44
45
  if (file)
45
46
  return nodejs.path.join(file.parentPath, file.name);
46
- for (const dir of files) {
47
- if (dir.isDirectory()) {
48
- const result = await this.findFile(nodejs.path.join(dir.parentPath, dir.name), name);
47
+ for (const entry of files) {
48
+ if (entry.isDirectory()) {
49
+ if (IGNORED_PROMPT_DIRS.includes(entry.name))
50
+ continue;
51
+ const result = await this.findFile(nodejs.path.join(entry.parentPath, entry.name), name);
49
52
  if (result)
50
53
  return result;
51
54
  }
52
55
  }
53
- return null;
54
56
  }
55
57
  getSource(name, callback) {
56
58
  let result = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "1.57.1",
3
+ "version": "1.57.2",
4
4
  "description": "The functional core of agentic AI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -91,8 +91,8 @@
91
91
  "yaml": "^2.8.0",
92
92
  "zod": "^3.25.67",
93
93
  "zod-to-json-schema": "^3.24.6",
94
- "@aigne/platform-helpers": "^0.6.2",
95
- "@aigne/observability-api": "^0.10.1"
94
+ "@aigne/observability-api": "^0.10.1",
95
+ "@aigne/platform-helpers": "^0.6.2"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@types/bun": "^1.2.18",