@aigne/core 1.43.1 → 1.44.0
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 +12 -0
- package/lib/cjs/agents/agent.js +2 -2
- package/lib/cjs/agents/chat-model.d.ts +4 -0
- package/lib/cjs/agents/chat-model.js +1 -0
- package/lib/cjs/utils/logger.d.ts +1 -0
- package/lib/cjs/utils/logger.js +2 -1
- package/lib/dts/agents/chat-model.d.ts +4 -0
- package/lib/dts/utils/logger.d.ts +1 -0
- package/lib/esm/agents/agent.js +2 -2
- package/lib/esm/agents/chat-model.d.ts +4 -0
- package/lib/esm/agents/chat-model.js +1 -0
- package/lib/esm/utils/logger.d.ts +1 -0
- package/lib/esm/utils/logger.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,18 @@
|
|
|
12
12
|
* dependencies
|
|
13
13
|
* @aigne/observability bumped to 0.1.0
|
|
14
14
|
|
|
15
|
+
## [1.44.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.43.1...core-v1.44.0) (2025-08-05)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* allow inserting agent-hub credits manually ([#315](https://github.com/AIGNE-io/aigne-framework/issues/315)) ([e3e4d1f](https://github.com/AIGNE-io/aigne-framework/commit/e3e4d1ff0d9d3fef33bb41d85e99735d4dd76cb7))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **cli:** improve CLI prompts and output handling ([#318](https://github.com/AIGNE-io/aigne-framework/issues/318)) ([681ee79](https://github.com/AIGNE-io/aigne-framework/commit/681ee79e9b18aed5a977a0a418c2d9df20a7297c))
|
|
26
|
+
|
|
15
27
|
## [1.43.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.43.0...core-v1.43.1) (2025-08-05)
|
|
16
28
|
|
|
17
29
|
|
package/lib/cjs/agents/agent.js
CHANGED
|
@@ -450,14 +450,14 @@ class Agent {
|
|
|
450
450
|
let finalOutput = this.includeInputInOutput ? { ...input, ...parsedOutput } : parsedOutput;
|
|
451
451
|
await this.postprocess(input, finalOutput, options);
|
|
452
452
|
logger_js_1.logger.debug("Invoke agent %s succeed with output: %O", this.name, finalOutput);
|
|
453
|
-
if (!this.disableEvents)
|
|
454
|
-
context.emit("agentSucceed", { agent: this, output: finalOutput });
|
|
455
453
|
let o = await this.callHooks("onSuccess", { input, output: finalOutput }, options);
|
|
456
454
|
if (o?.output)
|
|
457
455
|
finalOutput = o.output;
|
|
458
456
|
o = await this.callHooks("onEnd", { input, output: finalOutput }, options);
|
|
459
457
|
if (o?.output)
|
|
460
458
|
finalOutput = o.output;
|
|
459
|
+
if (!this.disableEvents)
|
|
460
|
+
context.emit("agentSucceed", { agent: this, output: finalOutput });
|
|
461
461
|
return finalOutput;
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
@@ -214,6 +214,7 @@ const chatModelOutputToolCallSchema = zod_1.z.object({
|
|
|
214
214
|
const chatModelOutputUsageSchema = zod_1.z.object({
|
|
215
215
|
inputTokens: zod_1.z.number(),
|
|
216
216
|
outputTokens: zod_1.z.number(),
|
|
217
|
+
aigneHubCredits: zod_1.z.number().optional(),
|
|
217
218
|
});
|
|
218
219
|
const chatModelOutputSchema = zod_1.z.object({
|
|
219
220
|
text: zod_1.z.string().optional(),
|
package/lib/cjs/utils/logger.js
CHANGED
|
@@ -9,6 +9,7 @@ const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
|
|
|
9
9
|
const debug_1 = __importDefault(require("debug"));
|
|
10
10
|
var LogLevel;
|
|
11
11
|
(function (LogLevel) {
|
|
12
|
+
LogLevel["SILENT"] = "silent";
|
|
12
13
|
LogLevel["ERROR"] = "error";
|
|
13
14
|
LogLevel["WARN"] = "warn";
|
|
14
15
|
LogLevel["INFO"] = "info";
|
|
@@ -76,5 +77,5 @@ class Logger {
|
|
|
76
77
|
exports.Logger = Logger;
|
|
77
78
|
exports.logger = new Logger({
|
|
78
79
|
ns: "aigne:core",
|
|
79
|
-
level: LogLevel.
|
|
80
|
+
level: LogLevel.SILENT,
|
|
80
81
|
});
|
package/lib/esm/agents/agent.js
CHANGED
|
@@ -405,14 +405,14 @@ export class Agent {
|
|
|
405
405
|
let finalOutput = this.includeInputInOutput ? { ...input, ...parsedOutput } : parsedOutput;
|
|
406
406
|
await this.postprocess(input, finalOutput, options);
|
|
407
407
|
logger.debug("Invoke agent %s succeed with output: %O", this.name, finalOutput);
|
|
408
|
-
if (!this.disableEvents)
|
|
409
|
-
context.emit("agentSucceed", { agent: this, output: finalOutput });
|
|
410
408
|
let o = await this.callHooks("onSuccess", { input, output: finalOutput }, options);
|
|
411
409
|
if (o?.output)
|
|
412
410
|
finalOutput = o.output;
|
|
413
411
|
o = await this.callHooks("onEnd", { input, output: finalOutput }, options);
|
|
414
412
|
if (o?.output)
|
|
415
413
|
finalOutput = o.output;
|
|
414
|
+
if (!this.disableEvents)
|
|
415
|
+
context.emit("agentSucceed", { agent: this, output: finalOutput });
|
|
416
416
|
return finalOutput;
|
|
417
417
|
}
|
|
418
418
|
/**
|
|
@@ -210,6 +210,7 @@ const chatModelOutputToolCallSchema = z.object({
|
|
|
210
210
|
const chatModelOutputUsageSchema = z.object({
|
|
211
211
|
inputTokens: z.number(),
|
|
212
212
|
outputTokens: z.number(),
|
|
213
|
+
aigneHubCredits: z.number().optional(),
|
|
213
214
|
});
|
|
214
215
|
const chatModelOutputSchema = z.object({
|
|
215
216
|
text: z.string().optional(),
|
package/lib/esm/utils/logger.js
CHANGED
|
@@ -2,6 +2,7 @@ import { nodejs } from "@aigne/platform-helpers/nodejs/index.js";
|
|
|
2
2
|
import debug from "debug";
|
|
3
3
|
export var LogLevel;
|
|
4
4
|
(function (LogLevel) {
|
|
5
|
+
LogLevel["SILENT"] = "silent";
|
|
5
6
|
LogLevel["ERROR"] = "error";
|
|
6
7
|
LogLevel["WARN"] = "warn";
|
|
7
8
|
LogLevel["INFO"] = "info";
|
|
@@ -68,5 +69,5 @@ export class Logger {
|
|
|
68
69
|
}
|
|
69
70
|
export const logger = new Logger({
|
|
70
71
|
ns: "aigne:core",
|
|
71
|
-
level: LogLevel.
|
|
72
|
+
level: LogLevel.SILENT,
|
|
72
73
|
});
|