@aigne/core 1.65.1-beta.2 → 1.65.1-beta.3
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 +15 -0
- package/lib/cjs/agents/agent.js +5 -1
- package/lib/cjs/aigne/context.js +4 -1
- package/lib/cjs/loader/agent-js.js +2 -1
- package/lib/cjs/loader/error.d.ts +2 -0
- package/lib/cjs/loader/error.js +6 -0
- package/lib/dts/loader/error.d.ts +2 -0
- package/lib/esm/agents/agent.js +5 -1
- package/lib/esm/aigne/context.js +4 -1
- package/lib/esm/loader/agent-js.js +2 -1
- package/lib/esm/loader/error.d.ts +2 -0
- package/lib/esm/loader/error.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.65.1-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.1-beta.2...core-v1.65.1-beta.3) (2025-11-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add taskTitle to observability traces and fix GPT-5/o1 model parameters ([#700](https://github.com/AIGNE-io/aigne-framework/issues/700)) ([30b513b](https://github.com/AIGNE-io/aigne-framework/commit/30b513b46ab5edb58a37f29e566e311bbb389f44))
|
|
9
|
+
* **cli:** only auto-reinstall on agent loading errors ([#702](https://github.com/AIGNE-io/aigne-framework/issues/702)) ([52f61a4](https://github.com/AIGNE-io/aigne-framework/commit/52f61a47537f2be8763f7bd45b8baea94cf43e60))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @aigne/observability-api bumped to 0.11.5-beta.2
|
|
17
|
+
|
|
3
18
|
## [1.65.1-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.1-beta.1...core-v1.65.1-beta.2) (2025-11-04)
|
|
4
19
|
|
|
5
20
|
|
package/lib/cjs/agents/agent.js
CHANGED
|
@@ -411,7 +411,11 @@ class Agent {
|
|
|
411
411
|
input = this.mergeDefaultInput(input);
|
|
412
412
|
logger_js_1.logger.debug("Invoke agent %s started with input: %O", this.name, input);
|
|
413
413
|
if (!this.disableEvents)
|
|
414
|
-
opts.context.emit("agentStarted", {
|
|
414
|
+
opts.context.emit("agentStarted", {
|
|
415
|
+
agent: this,
|
|
416
|
+
input,
|
|
417
|
+
taskTitle: await this.renderTaskTitle(input),
|
|
418
|
+
});
|
|
415
419
|
try {
|
|
416
420
|
const s = await this.callHooks("onStart", { input }, opts);
|
|
417
421
|
if (s?.input)
|
package/lib/cjs/aigne/context.js
CHANGED
|
@@ -210,7 +210,7 @@ class AIGNEContext {
|
|
|
210
210
|
try {
|
|
211
211
|
switch (eventName) {
|
|
212
212
|
case "agentStarted": {
|
|
213
|
-
const { agent, input } = args[0];
|
|
213
|
+
const { agent, input, taskTitle } = args[0];
|
|
214
214
|
span.updateName(agent.name);
|
|
215
215
|
span.setAttribute("custom.trace_id", this.rootId);
|
|
216
216
|
span.setAttribute("custom.span_id", this.id);
|
|
@@ -221,6 +221,9 @@ class AIGNEContext {
|
|
|
221
221
|
span.setAttribute("custom.started_at", b.timestamp);
|
|
222
222
|
span.setAttribute("input", JSON.stringify(input));
|
|
223
223
|
span.setAttribute("agentTag", agent.tag ?? "UnknownAgent");
|
|
224
|
+
if (taskTitle) {
|
|
225
|
+
span.setAttribute("taskTitle", taskTitle);
|
|
226
|
+
}
|
|
224
227
|
try {
|
|
225
228
|
span.setAttribute("userContext", JSON.stringify(this.userContext));
|
|
226
229
|
}
|
|
@@ -5,11 +5,12 @@ const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
|
|
|
5
5
|
const agent_js_1 = require("../agents/agent.js");
|
|
6
6
|
const type_utils_js_1 = require("../utils/type-utils.js");
|
|
7
7
|
const agent_yaml_js_1 = require("./agent-yaml.js");
|
|
8
|
+
const error_js_1 = require("./error.js");
|
|
8
9
|
const importFn = new Function("path", "return import(path)");
|
|
9
10
|
async function loadAgentFromJsFile(path) {
|
|
10
11
|
if (index_js_1.nodejs.path.isAbsolute(path))
|
|
11
12
|
path = index_js_1.nodejs.url.pathToFileURL(path).toString();
|
|
12
|
-
const { default: agent } = await (0, type_utils_js_1.tryOrThrow)(() => importFn(path), (error) => new
|
|
13
|
+
const { default: agent } = await (0, type_utils_js_1.tryOrThrow)(() => importFn(path), (error) => new error_js_1.LoadJsAgentError(`Failed to load agent definition from ${path}: ${error.message}`));
|
|
13
14
|
if (agent instanceof agent_js_1.Agent)
|
|
14
15
|
return agent;
|
|
15
16
|
if (typeof agent !== "function") {
|
package/lib/esm/agents/agent.js
CHANGED
|
@@ -363,7 +363,11 @@ export class Agent {
|
|
|
363
363
|
input = this.mergeDefaultInput(input);
|
|
364
364
|
logger.debug("Invoke agent %s started with input: %O", this.name, input);
|
|
365
365
|
if (!this.disableEvents)
|
|
366
|
-
opts.context.emit("agentStarted", {
|
|
366
|
+
opts.context.emit("agentStarted", {
|
|
367
|
+
agent: this,
|
|
368
|
+
input,
|
|
369
|
+
taskTitle: await this.renderTaskTitle(input),
|
|
370
|
+
});
|
|
367
371
|
try {
|
|
368
372
|
const s = await this.callHooks("onStart", { input }, opts);
|
|
369
373
|
if (s?.input)
|
package/lib/esm/aigne/context.js
CHANGED
|
@@ -204,7 +204,7 @@ export class AIGNEContext {
|
|
|
204
204
|
try {
|
|
205
205
|
switch (eventName) {
|
|
206
206
|
case "agentStarted": {
|
|
207
|
-
const { agent, input } = args[0];
|
|
207
|
+
const { agent, input, taskTitle } = args[0];
|
|
208
208
|
span.updateName(agent.name);
|
|
209
209
|
span.setAttribute("custom.trace_id", this.rootId);
|
|
210
210
|
span.setAttribute("custom.span_id", this.id);
|
|
@@ -215,6 +215,9 @@ export class AIGNEContext {
|
|
|
215
215
|
span.setAttribute("custom.started_at", b.timestamp);
|
|
216
216
|
span.setAttribute("input", JSON.stringify(input));
|
|
217
217
|
span.setAttribute("agentTag", agent.tag ?? "UnknownAgent");
|
|
218
|
+
if (taskTitle) {
|
|
219
|
+
span.setAttribute("taskTitle", taskTitle);
|
|
220
|
+
}
|
|
218
221
|
try {
|
|
219
222
|
span.setAttribute("userContext", JSON.stringify(this.userContext));
|
|
220
223
|
}
|
|
@@ -2,11 +2,12 @@ import { nodejs } from "@aigne/platform-helpers/nodejs/index.js";
|
|
|
2
2
|
import { Agent } from "../agents/agent.js";
|
|
3
3
|
import { tryOrThrow } from "../utils/type-utils.js";
|
|
4
4
|
import { parseAgentFile } from "./agent-yaml.js";
|
|
5
|
+
import { LoadJsAgentError } from "./error.js";
|
|
5
6
|
const importFn = new Function("path", "return import(path)");
|
|
6
7
|
export async function loadAgentFromJsFile(path) {
|
|
7
8
|
if (nodejs.path.isAbsolute(path))
|
|
8
9
|
path = nodejs.url.pathToFileURL(path).toString();
|
|
9
|
-
const { default: agent } = await tryOrThrow(() => importFn(path), (error) => new
|
|
10
|
+
const { default: agent } = await tryOrThrow(() => importFn(path), (error) => new LoadJsAgentError(`Failed to load agent definition from ${path}: ${error.message}`));
|
|
10
11
|
if (agent instanceof Agent)
|
|
11
12
|
return agent;
|
|
12
13
|
if (typeof agent !== "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/core",
|
|
3
|
-
"version": "1.65.1-beta.
|
|
3
|
+
"version": "1.65.1-beta.3",
|
|
4
4
|
"description": "The functional core of agentic AI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"zod-from-json-schema": "^0.0.5",
|
|
93
93
|
"zod-to-json-schema": "^3.24.6",
|
|
94
94
|
"@aigne/afs": "^1.1.1",
|
|
95
|
-
"@aigne/observability-api": "^0.11.5-beta.
|
|
95
|
+
"@aigne/observability-api": "^0.11.5-beta.2",
|
|
96
96
|
"@aigne/platform-helpers": "^0.6.3"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|