@aigne/core 1.57.3 → 1.57.5
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 +14 -0
- package/lib/cjs/agents/chat-model.js +34 -5
- package/lib/cjs/prompt/template.d.ts +2 -0
- package/lib/cjs/prompt/template.js +6 -0
- package/lib/dts/prompt/template.d.ts +2 -0
- package/lib/esm/agents/chat-model.js +1 -2
- package/lib/esm/prompt/template.d.ts +2 -0
- package/lib/esm/prompt/template.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.57.5](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.57.4...core-v1.57.5) (2025-09-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **core:** replace static import with dynamic import for CommonJS compatibility ([#448](https://github.com/AIGNE-io/aigne-framework/issues/448)) ([6db1e57](https://github.com/AIGNE-io/aigne-framework/commit/6db1e570858fff32f7352143585b98e900f1f71d))
|
|
9
|
+
|
|
10
|
+
## [1.57.4](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.57.3...core-v1.57.4) (2025-08-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **core:** handle relative path correctly ([#440](https://github.com/AIGNE-io/aigne-framework/issues/440)) ([45a65fe](https://github.com/AIGNE-io/aigne-framework/commit/45a65fea432da44218007e566fe952fa973d8ae2))
|
|
16
|
+
|
|
3
17
|
## [1.57.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.57.2...core-v1.57.3) (2025-08-30)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,17 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.chatModelOutputUsageSchema = exports.ChatModel = exports.StructuredOutputError = void 0;
|
|
7
37
|
const ajv_1 = require("ajv");
|
|
8
|
-
const is_network_error_1 = __importDefault(require("is-network-error"));
|
|
9
38
|
const zod_1 = require("zod");
|
|
10
39
|
const type_utils_js_1 = require("../utils/type-utils.js");
|
|
11
40
|
const agent_js_1 = require("./agent.js");
|
|
12
41
|
const CHAT_MODEL_DEFAULT_RETRY_OPTIONS = {
|
|
13
42
|
retries: 3,
|
|
14
|
-
shouldRetry: (error) => error instanceof StructuredOutputError || (
|
|
43
|
+
shouldRetry: async (error) => error instanceof StructuredOutputError || (await Promise.resolve().then(() => __importStar(require("is-network-error")))).default(error),
|
|
15
44
|
};
|
|
16
45
|
class StructuredOutputError extends Error {
|
|
17
46
|
}
|
|
@@ -17,6 +17,8 @@ export declare class CustomLoader extends nunjucks.Loader {
|
|
|
17
17
|
workingDir: string;
|
|
18
18
|
});
|
|
19
19
|
async: boolean;
|
|
20
|
+
isRelative(filename: string): boolean;
|
|
21
|
+
resolve(from: string, to: string): string;
|
|
20
22
|
getSource(name: string, callback: Callback<Error, LoaderSource>): LoaderSource;
|
|
21
23
|
}
|
|
22
24
|
export declare class ChatMessageTemplate {
|
|
@@ -45,6 +45,12 @@ class CustomLoader extends nunjucks_1.default.Loader {
|
|
|
45
45
|
this.options = options;
|
|
46
46
|
}
|
|
47
47
|
async = true;
|
|
48
|
+
isRelative(filename) {
|
|
49
|
+
return !index_js_1.nodejs.path.isAbsolute(filename);
|
|
50
|
+
}
|
|
51
|
+
resolve(from, to) {
|
|
52
|
+
return index_js_1.nodejs.path.resolve(index_js_1.nodejs.path.dirname(from), to);
|
|
53
|
+
}
|
|
48
54
|
getSource(name, callback) {
|
|
49
55
|
let result = null;
|
|
50
56
|
const path = index_js_1.nodejs.path.isAbsolute(name)
|
|
@@ -17,6 +17,8 @@ export declare class CustomLoader extends nunjucks.Loader {
|
|
|
17
17
|
workingDir: string;
|
|
18
18
|
});
|
|
19
19
|
async: boolean;
|
|
20
|
+
isRelative(filename: string): boolean;
|
|
21
|
+
resolve(from: string, to: string): string;
|
|
20
22
|
getSource(name: string, callback: Callback<Error, LoaderSource>): LoaderSource;
|
|
21
23
|
}
|
|
22
24
|
export declare class ChatMessageTemplate {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Ajv } from "ajv";
|
|
2
|
-
import isNetworkError from "is-network-error";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { checkArguments } from "../utils/type-utils.js";
|
|
5
4
|
import { Agent, agentOptionsSchema, } from "./agent.js";
|
|
6
5
|
const CHAT_MODEL_DEFAULT_RETRY_OPTIONS = {
|
|
7
6
|
retries: 3,
|
|
8
|
-
shouldRetry: (error) => error instanceof StructuredOutputError ||
|
|
7
|
+
shouldRetry: async (error) => error instanceof StructuredOutputError || (await import("is-network-error")).default(error),
|
|
9
8
|
};
|
|
10
9
|
export class StructuredOutputError extends Error {
|
|
11
10
|
}
|
|
@@ -17,6 +17,8 @@ export declare class CustomLoader extends nunjucks.Loader {
|
|
|
17
17
|
workingDir: string;
|
|
18
18
|
});
|
|
19
19
|
async: boolean;
|
|
20
|
+
isRelative(filename: string): boolean;
|
|
21
|
+
resolve(from: string, to: string): string;
|
|
20
22
|
getSource(name: string, callback: Callback<Error, LoaderSource>): LoaderSource;
|
|
21
23
|
}
|
|
22
24
|
export declare class ChatMessageTemplate {
|
|
@@ -37,6 +37,12 @@ export class CustomLoader extends nunjucks.Loader {
|
|
|
37
37
|
this.options = options;
|
|
38
38
|
}
|
|
39
39
|
async = true;
|
|
40
|
+
isRelative(filename) {
|
|
41
|
+
return !nodejs.path.isAbsolute(filename);
|
|
42
|
+
}
|
|
43
|
+
resolve(from, to) {
|
|
44
|
+
return nodejs.path.resolve(nodejs.path.dirname(from), to);
|
|
45
|
+
}
|
|
40
46
|
getSource(name, callback) {
|
|
41
47
|
let result = null;
|
|
42
48
|
const path = nodejs.path.isAbsolute(name)
|