@aigne/core 1.46.0 → 1.46.1

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
@@ -12,6 +12,14 @@
12
12
  * dependencies
13
13
  * @aigne/observability bumped to 0.1.0
14
14
 
15
+ ## [1.46.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.46.0...core-v1.46.1) (2025-08-08)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **core:** auto trim trailing whitespace for AIAgent with structuredStreamMode enabled ([#334](https://github.com/AIGNE-io/aigne-framework/issues/334)) ([342eb49](https://github.com/AIGNE-io/aigne-framework/commit/342eb493995809f01da02fca6975ea6e52ecbd3a))
21
+ * **core:** hide internal prop toolsMap from trace logs ([#335](https://github.com/AIGNE-io/aigne-framework/issues/335)) ([bcec317](https://github.com/AIGNE-io/aigne-framework/commit/bcec317bf436988e5f43af05f649196bdbd6ac55))
22
+
15
23
  ## [1.46.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.45.0...core-v1.46.0) (2025-08-06)
16
24
 
17
25
 
package/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
  <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" media="(prefers-color-scheme: light)">
7
7
  <img src="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" alt="AIGNE Logo" width="400" />
8
8
  </picture>
9
+
10
+ <center>The functional core of agentic AI</center>
9
11
  </p>
10
12
 
11
13
  [![GitHub star chart](https://img.shields.io/github/stars/AIGNE-io/aigne-framework?style=flat-square)](https://star-history.com/#AIGNE-io/aigne-framework)
@@ -14,12 +16,16 @@
14
16
  [![NPM Version](https://img.shields.io/npm/v/@aigne/core)](https://www.npmjs.com/package/@aigne/core)
15
17
  [![Elastic-2.0 licensed](https://img.shields.io/npm/l/@aigne/core)](https://github.com/AIGNE-io/aigne-framework/blob/main/LICENSE)
16
18
 
17
- Core library of [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework) for building AI-powered applications.
18
-
19
19
  ## Introduction
20
20
 
21
21
  `@aigne/core` is the foundation component of [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework), providing the essential modules and tools needed to build AI-driven applications. This package implements the core functionalities of the framework, including agent systems, aigne environment, model integrations, and workflow pattern support.
22
22
 
23
+ <picture>
24
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/assets/aigne-framework-dark.png" media="(prefers-color-scheme: dark)">
25
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/assets/aigne-framework.png" media="(prefers-color-scheme: light)">
26
+ <img src="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/aigne-framework.png" alt="AIGNE Arch" />
27
+ </picture>
28
+
23
29
  ## Features
24
30
 
25
31
  * **Multiple AI Model Support**: Built-in support for OpenAI, Gemini, Claude, Nova, and other mainstream AI models, easily extensible to support additional models
@@ -103,7 +103,11 @@ class ChatModel extends agent_js_1.Agent {
103
103
  toolsMap[name] = originalTool;
104
104
  }
105
105
  this.validateToolNames(tools);
106
- Object.assign(input, { _toolsMap: toolsMap, tools });
106
+ Object.assign(input, { tools });
107
+ Object.defineProperty(input, "_toolsMap", {
108
+ value: toolsMap,
109
+ enumerable: false,
110
+ });
107
111
  }
108
112
  }
109
113
  /**
@@ -16,9 +16,17 @@ class ExtractMetadataTransform extends TransformStream {
16
16
  if (this.state === "none") {
17
17
  const found = findMatchIndex(this.buffer, this.cursor, start);
18
18
  if (found.start > this.cursor) {
19
- const text = this.buffer.slice(this.cursor, found.start);
19
+ let text = this.buffer.slice(this.cursor, found.start);
20
20
  this.cursor = found.start;
21
- controller.enqueue({ delta: { text: { text } } });
21
+ // Trim trailing whitespace from the text
22
+ const whitespace = text.match(/(?<whitespace>\s+)$/)?.groups?.whitespace;
23
+ if (whitespace) {
24
+ text = text.slice(0, -whitespace.length);
25
+ this.cursor -= whitespace.length;
26
+ }
27
+ if (text) {
28
+ controller.enqueue({ delta: { text: { text } } });
29
+ }
22
30
  }
23
31
  if (found.end) {
24
32
  this.state = "start";
@@ -100,7 +100,11 @@ export class ChatModel extends Agent {
100
100
  toolsMap[name] = originalTool;
101
101
  }
102
102
  this.validateToolNames(tools);
103
- Object.assign(input, { _toolsMap: toolsMap, tools });
103
+ Object.assign(input, { tools });
104
+ Object.defineProperty(input, "_toolsMap", {
105
+ value: toolsMap,
106
+ enumerable: false,
107
+ });
104
108
  }
105
109
  }
106
110
  /**
@@ -13,9 +13,17 @@ export class ExtractMetadataTransform extends TransformStream {
13
13
  if (this.state === "none") {
14
14
  const found = findMatchIndex(this.buffer, this.cursor, start);
15
15
  if (found.start > this.cursor) {
16
- const text = this.buffer.slice(this.cursor, found.start);
16
+ let text = this.buffer.slice(this.cursor, found.start);
17
17
  this.cursor = found.start;
18
- controller.enqueue({ delta: { text: { text } } });
18
+ // Trim trailing whitespace from the text
19
+ const whitespace = text.match(/(?<whitespace>\s+)$/)?.groups?.whitespace;
20
+ if (whitespace) {
21
+ text = text.slice(0, -whitespace.length);
22
+ this.cursor -= whitespace.length;
23
+ }
24
+ if (text) {
25
+ controller.enqueue({ delta: { text: { text } } });
26
+ }
19
27
  }
20
28
  if (found.end) {
21
29
  this.state = "start";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "1.46.0",
4
- "description": "AIGNE core library for building AI-powered applications",
3
+ "version": "1.46.1",
4
+ "description": "The functional core of agentic AI",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },