@aigne/core 1.27.0 → 1.28.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 +7 -0
- package/lib/cjs/aigne/aigne.d.ts +1 -1
- package/lib/cjs/aigne/aigne.js +2 -2
- package/lib/cjs/aigne/context.d.ts +2 -2
- package/lib/cjs/aigne/context.js +16 -4
- package/lib/dts/aigne/aigne.d.ts +1 -1
- package/lib/dts/aigne/context.d.ts +2 -2
- package/lib/esm/aigne/aigne.d.ts +1 -1
- package/lib/esm/aigne/aigne.js +1 -1
- package/lib/esm/aigne/context.d.ts +2 -2
- package/lib/esm/aigne/context.js +16 -4
- package/package.json +2 -2
- /package/lib/cjs/utils/{typed-event-emtter.d.ts → typed-event-emitter.d.ts} +0 -0
- /package/lib/cjs/utils/{typed-event-emtter.js → typed-event-emitter.js} +0 -0
- /package/lib/dts/utils/{typed-event-emtter.d.ts → typed-event-emitter.d.ts} +0 -0
- /package/lib/esm/utils/{typed-event-emtter.d.ts → typed-event-emitter.d.ts} +0 -0
- /package/lib/esm/utils/{typed-event-emtter.js → typed-event-emitter.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
* dependencies
|
|
13
13
|
* @aigne/observability bumped to 0.1.0
|
|
14
14
|
|
|
15
|
+
## [1.28.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.27.0...core-v1.28.0) (2025-07-01)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **example:** use AIGNE cli to run chat-bot example ([#198](https://github.com/AIGNE-io/aigne-framework/issues/198)) ([7085541](https://github.com/AIGNE-io/aigne-framework/commit/708554100692f2a557f7329ea78e46c3c870ce10))
|
|
21
|
+
|
|
15
22
|
## [1.27.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.26.0...core-v1.27.0) (2025-07-01)
|
|
16
23
|
|
|
17
24
|
|
package/lib/cjs/aigne/aigne.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Agent, AgentResponse, AgentResponseStream, Message } from "../agents/agent.js";
|
|
3
3
|
import type { ChatModel } from "../agents/chat-model.js";
|
|
4
4
|
import type { UserAgent } from "../agents/user-agent.js";
|
package/lib/cjs/aigne/aigne.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AIGNE = void 0;
|
|
4
|
-
const
|
|
4
|
+
const observability_api_1 = require("@aigne/observability-api");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const index_js_1 = require("../loader/index.js");
|
|
7
7
|
const type_utils_js_1 = require("../utils/type-utils.js");
|
|
@@ -54,7 +54,7 @@ class AIGNE {
|
|
|
54
54
|
this.observer =
|
|
55
55
|
process.env.AIGNE_OBSERVABILITY_DISABLED === "true"
|
|
56
56
|
? undefined
|
|
57
|
-
: (options?.observer ?? new
|
|
57
|
+
: (options?.observer ?? new observability_api_1.AIGNEObserver());
|
|
58
58
|
if (options?.skills?.length)
|
|
59
59
|
this.skills.push(...options.skills);
|
|
60
60
|
if (options?.agents?.length)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import type { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Span } from "@opentelemetry/api";
|
|
3
3
|
import { Emitter } from "strict-event-emitter";
|
|
4
4
|
import { type Agent, type AgentInvokeOptions, type AgentProcessAsyncGenerator, type AgentResponse, type AgentResponseStream, type Message } from "../agents/agent.js";
|
|
@@ -6,7 +6,7 @@ import type { ChatModel } from "../agents/chat-model.js";
|
|
|
6
6
|
import { UserAgent } from "../agents/user-agent.js";
|
|
7
7
|
import type { Memory } from "../memory/memory.js";
|
|
8
8
|
import { type OmitPropertiesFromArrayFirstElement } from "../utils/type-utils.js";
|
|
9
|
-
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-
|
|
9
|
+
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-emitter.js";
|
|
10
10
|
import { type MessagePayload, MessageQueue, type MessageQueueListener, type Unsubscribe } from "./message-queue.js";
|
|
11
11
|
import { type ContextLimits, type ContextUsage } from "./usage.js";
|
|
12
12
|
/**
|
package/lib/cjs/aigne/context.js
CHANGED
|
@@ -220,7 +220,11 @@ class AIGNEContext {
|
|
|
220
220
|
logger_js_1.logger.error("parse memories error", _e.message);
|
|
221
221
|
span.setAttribute("memories", JSON.stringify([]));
|
|
222
222
|
}
|
|
223
|
-
await this.observer?.traceExporter
|
|
223
|
+
await this.observer?.traceExporter
|
|
224
|
+
?.upsertInitialSpan?.(span)
|
|
225
|
+
.catch((err) => {
|
|
226
|
+
logger_js_1.logger.error("upsertInitialSpan error", err?.message || err);
|
|
227
|
+
});
|
|
224
228
|
break;
|
|
225
229
|
}
|
|
226
230
|
case "agentSucceed": {
|
|
@@ -232,16 +236,24 @@ class AIGNEContext {
|
|
|
232
236
|
logger_js_1.logger.error("parse output error", _e.message);
|
|
233
237
|
span.setAttribute("output", JSON.stringify({}));
|
|
234
238
|
}
|
|
235
|
-
span.setStatus({ code: api_1.SpanStatusCode.OK
|
|
239
|
+
span.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
240
|
+
await this.observer?.traceExporter
|
|
241
|
+
?.upsertInitialSpan?.(span)
|
|
242
|
+
.catch((err) => {
|
|
243
|
+
logger_js_1.logger.error("upsertInitialSpan error", err?.message || err);
|
|
244
|
+
});
|
|
236
245
|
span.end();
|
|
237
|
-
await this.observer?.traceExporter?.forceFlush?.();
|
|
238
246
|
break;
|
|
239
247
|
}
|
|
240
248
|
case "agentFailed": {
|
|
241
249
|
const { error } = args[0];
|
|
242
250
|
span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
|
|
251
|
+
await this.observer?.traceExporter
|
|
252
|
+
?.upsertInitialSpan?.(span)
|
|
253
|
+
.catch((err) => {
|
|
254
|
+
logger_js_1.logger.error("upsertInitialSpan error", err?.message || err);
|
|
255
|
+
});
|
|
243
256
|
span.end();
|
|
244
|
-
await this.observer?.traceExporter?.forceFlush?.();
|
|
245
257
|
break;
|
|
246
258
|
}
|
|
247
259
|
}
|
package/lib/dts/aigne/aigne.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Agent, AgentResponse, AgentResponseStream, Message } from "../agents/agent.js";
|
|
3
3
|
import type { ChatModel } from "../agents/chat-model.js";
|
|
4
4
|
import type { UserAgent } from "../agents/user-agent.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import type { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Span } from "@opentelemetry/api";
|
|
3
3
|
import { Emitter } from "strict-event-emitter";
|
|
4
4
|
import { type Agent, type AgentInvokeOptions, type AgentProcessAsyncGenerator, type AgentResponse, type AgentResponseStream, type Message } from "../agents/agent.js";
|
|
@@ -6,7 +6,7 @@ import type { ChatModel } from "../agents/chat-model.js";
|
|
|
6
6
|
import { UserAgent } from "../agents/user-agent.js";
|
|
7
7
|
import type { Memory } from "../memory/memory.js";
|
|
8
8
|
import { type OmitPropertiesFromArrayFirstElement } from "../utils/type-utils.js";
|
|
9
|
-
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-
|
|
9
|
+
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-emitter.js";
|
|
10
10
|
import { type MessagePayload, MessageQueue, type MessageQueueListener, type Unsubscribe } from "./message-queue.js";
|
|
11
11
|
import { type ContextLimits, type ContextUsage } from "./usage.js";
|
|
12
12
|
/**
|
package/lib/esm/aigne/aigne.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Agent, AgentResponse, AgentResponseStream, Message } from "../agents/agent.js";
|
|
3
3
|
import type { ChatModel } from "../agents/chat-model.js";
|
|
4
4
|
import type { UserAgent } from "../agents/user-agent.js";
|
package/lib/esm/aigne/aigne.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIGNEObserver } from "@aigne/observability";
|
|
1
|
+
import type { AIGNEObserver } from "@aigne/observability-api";
|
|
2
2
|
import type { Span } from "@opentelemetry/api";
|
|
3
3
|
import { Emitter } from "strict-event-emitter";
|
|
4
4
|
import { type Agent, type AgentInvokeOptions, type AgentProcessAsyncGenerator, type AgentResponse, type AgentResponseStream, type Message } from "../agents/agent.js";
|
|
@@ -6,7 +6,7 @@ import type { ChatModel } from "../agents/chat-model.js";
|
|
|
6
6
|
import { UserAgent } from "../agents/user-agent.js";
|
|
7
7
|
import type { Memory } from "../memory/memory.js";
|
|
8
8
|
import { type OmitPropertiesFromArrayFirstElement } from "../utils/type-utils.js";
|
|
9
|
-
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-
|
|
9
|
+
import type { Args, Listener, TypedEventEmitter } from "../utils/typed-event-emitter.js";
|
|
10
10
|
import { type MessagePayload, MessageQueue, type MessageQueueListener, type Unsubscribe } from "./message-queue.js";
|
|
11
11
|
import { type ContextLimits, type ContextUsage } from "./usage.js";
|
|
12
12
|
/**
|
package/lib/esm/aigne/context.js
CHANGED
|
@@ -214,7 +214,11 @@ export class AIGNEContext {
|
|
|
214
214
|
logger.error("parse memories error", _e.message);
|
|
215
215
|
span.setAttribute("memories", JSON.stringify([]));
|
|
216
216
|
}
|
|
217
|
-
await this.observer?.traceExporter
|
|
217
|
+
await this.observer?.traceExporter
|
|
218
|
+
?.upsertInitialSpan?.(span)
|
|
219
|
+
.catch((err) => {
|
|
220
|
+
logger.error("upsertInitialSpan error", err?.message || err);
|
|
221
|
+
});
|
|
218
222
|
break;
|
|
219
223
|
}
|
|
220
224
|
case "agentSucceed": {
|
|
@@ -226,16 +230,24 @@ export class AIGNEContext {
|
|
|
226
230
|
logger.error("parse output error", _e.message);
|
|
227
231
|
span.setAttribute("output", JSON.stringify({}));
|
|
228
232
|
}
|
|
229
|
-
span.setStatus({ code: SpanStatusCode.OK
|
|
233
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
234
|
+
await this.observer?.traceExporter
|
|
235
|
+
?.upsertInitialSpan?.(span)
|
|
236
|
+
.catch((err) => {
|
|
237
|
+
logger.error("upsertInitialSpan error", err?.message || err);
|
|
238
|
+
});
|
|
230
239
|
span.end();
|
|
231
|
-
await this.observer?.traceExporter?.forceFlush?.();
|
|
232
240
|
break;
|
|
233
241
|
}
|
|
234
242
|
case "agentFailed": {
|
|
235
243
|
const { error } = args[0];
|
|
236
244
|
span.setStatus({ code: SpanStatusCode.ERROR, message: error.message });
|
|
245
|
+
await this.observer?.traceExporter
|
|
246
|
+
?.upsertInitialSpan?.(span)
|
|
247
|
+
.catch((err) => {
|
|
248
|
+
logger.error("upsertInitialSpan error", err?.message || err);
|
|
249
|
+
});
|
|
237
250
|
span.end();
|
|
238
|
-
await this.observer?.traceExporter?.forceFlush?.();
|
|
239
251
|
break;
|
|
240
252
|
}
|
|
241
253
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "AIGNE core library for building AI-powered applications",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"zod": "^3.24.4",
|
|
83
83
|
"zod-to-json-schema": "^3.24.5",
|
|
84
84
|
"@aigne/platform-helpers": "^0.1.2",
|
|
85
|
-
"@aigne/observability": "^0.3.0"
|
|
85
|
+
"@aigne/observability-api": "^0.3.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@types/bun": "^1.2.12",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|