@aigne/transport 0.9.3 → 0.9.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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.5](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.9.4...transport-v0.9.5) (2025-07-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** update deps to latest version ([#247](https://github.com/AIGNE-io/aigne-framework/issues/247)) ([3972f88](https://github.com/AIGNE-io/aigne-framework/commit/3972f887a9abff20c26da6b51c1071cbd54c0bf1))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/openai bumped to 0.9.1
16
+ * devDependencies
17
+ * @aigne/agent-library bumped to 1.20.4
18
+ * @aigne/core bumped to 1.33.1
19
+ * @aigne/test-utils bumped to 0.5.6
20
+
21
+ ## [0.9.4](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.9.3...transport-v0.9.4) (2025-07-10)
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * The following workspace dependencies were updated
27
+ * dependencies
28
+ * @aigne/openai bumped to 0.9.0
29
+ * devDependencies
30
+ * @aigne/agent-library bumped to 1.20.3
31
+ * @aigne/core bumped to 1.33.0
32
+ * @aigne/test-utils bumped to 0.5.5
33
+
3
34
  ## [0.9.3](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.9.2...transport-v0.9.3) (2025-07-09)
4
35
 
5
36
 
package/README.md CHANGED
@@ -6,8 +6,6 @@
6
6
  [![NPM Version](https://img.shields.io/npm/v/@aigne/transport)](https://www.npmjs.com/package/@aigne/transport)
7
7
  [![Elastic-2.0 licensed](https://img.shields.io/npm/l/@aigne/transport)](https://github.com/AIGNE-io/aigne-framework/blob/main/LICENSE.md)
8
8
 
9
- **English** | [中文](README.zh.md)
10
-
11
9
  AIGNE Transport SDK providing HTTP client and server implementations for communication between AIGNE components within the [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework).
12
10
 
13
11
  ## Introduction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/transport",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "AIGNE Transport SDK providing HTTP client and server implementations for communication between AIGNE components",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,24 +39,24 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@aigne/openai": "^0.8.2"
42
+ "@aigne/openai": "^0.9.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/bun": "^1.2.17",
45
+ "@types/bun": "^1.2.18",
46
46
  "@types/express": "^5.0.3",
47
- "@types/node": "^24.0.10",
47
+ "@types/node": "^24.0.12",
48
48
  "compression": "^1.8.0",
49
49
  "detect-port": "^2.1.0",
50
50
  "express": "^5.1.0",
51
51
  "fast-deep-equal": "^3.1.3",
52
- "hono": "^4.8.3",
52
+ "hono": "^4.8.4",
53
53
  "npm-run-all": "^4.1.5",
54
54
  "rimraf": "^6.0.1",
55
55
  "typescript": "^5.8.3",
56
56
  "uuid": "^11.1.0",
57
- "@aigne/agent-library": "^1.20.2",
58
- "@aigne/test-utils": "^0.5.4",
59
- "@aigne/core": "^1.32.2"
57
+ "@aigne/test-utils": "^0.5.6",
58
+ "@aigne/agent-library": "^1.20.4",
59
+ "@aigne/core": "^1.33.1"
60
60
  },
61
61
  "scripts": {
62
62
  "lint": "tsc --noEmit",
package/README.zh.md DELETED
@@ -1,165 +0,0 @@
1
- # @aigne/transport
2
-
3
- [![GitHub star chart](https://img.shields.io/github/stars/AIGNE-io/aigne-framework?style=flat-square)](https://star-history.com/#AIGNE-io/aigne-framework)
4
- [![Open Issues](https://img.shields.io/github/issues-raw/AIGNE-io/aigne-framework?style=flat-square)](https://github.com/AIGNE-io/aigne-framework/issues)
5
- [![codecov](https://codecov.io/gh/AIGNE-io/aigne-framework/graph/badge.svg?token=DO07834RQL)](https://codecov.io/gh/AIGNE-io/aigne-framework)
6
- [![NPM Version](https://img.shields.io/npm/v/@aigne/transport)](https://www.npmjs.com/package/@aigne/transport)
7
- [![Elastic-2.0 licensed](https://img.shields.io/npm/l/@aigne/transport)](https://github.com/AIGNE-io/aigne-framework/blob/main/LICENSE.md)
8
-
9
- [English](README.md) | **中文**
10
-
11
- AIGNE Transport SDK,为 [AIGNE 框架](https://github.com/AIGNE-io/aigne-framework) 中的 AIGNE 组件之间的通信提供 HTTP 客户端和服务器实现。
12
-
13
- ## 简介
14
-
15
- `@aigne/transport` 为 AIGNE 组件提供了一个强大的通信层,使 AI 应用程序的不同部分之间能够无缝交互。该包提供了遵循一致协议的 HTTP 客户端和服务器实现,使用 AIGNE 框架构建分布式 AI 系统变得简单。
16
-
17
- ## 特性
18
-
19
- * **HTTP 客户端实现**:易于使用的客户端,用于与 AIGNE 服务器通信
20
- * **HTTP 服务器实现**:灵活的服务器实现,可与流行的 Node.js 框架集成
21
- * **框架无关**:支持 Express、Hono 和其他 Node.js HTTP 框架
22
- * **流式响应支持**:对流式响应的一流支持
23
- * **类型安全**:为所有 API 提供全面的 TypeScript 类型定义
24
- * **错误处理**:健壮的错误处理机制,提供详细的错误信息
25
- * **中间件支持**:兼容常见的 HTTP 中间件,如压缩中间件
26
-
27
- ## 安装
28
-
29
- ### 使用 npm
30
-
31
- ```bash
32
- npm install @aigne/transport @aigne/core
33
- ```
34
-
35
- ### 使用 yarn
36
-
37
- ```bash
38
- yarn add @aigne/transport @aigne/core
39
- ```
40
-
41
- ### 使用 pnpm
42
-
43
- ```bash
44
- pnpm add @aigne/transport @aigne/core
45
- ```
46
-
47
- ## 基本用法
48
-
49
- ### 服务端用法
50
-
51
- AIGNE HTTP 服务器可用于 Express 或 Hono 框架。
52
-
53
- #### Express 示例
54
-
55
- ```typescript file="test/http-server/http-server.test.ts" region="example-aigne-server-express"
56
- import { AIAgent, AIGNE } from "@aigne/core";
57
- import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
58
- import { AIGNEHTTPServer } from "@aigne/transport/http-server/index.js";
59
- import express from "express";
60
- import { OpenAIChatModel } from "../_mocks_/mock-models.js";
61
-
62
- const model = new OpenAIChatModel();
63
-
64
- const chat = AIAgent.from({
65
- name: "chat",
66
- });
67
-
68
- // AIGNE: Main execution engine of AIGNE Framework.
69
- const aigne = new AIGNE({ model, agents: [chat] });
70
-
71
- // Create an AIGNEServer instance
72
- const aigneServer = new AIGNEHTTPServer(aigne);
73
-
74
- // Setup the server to handle incoming requests
75
- const server = express();
76
- server.post("/aigne/invoke", async (req, res) => {
77
- await aigneServer.invoke(req, res);
78
- });
79
- const httpServer = server.listen(port);
80
-
81
- // Create an AIGNEClient instance
82
- const client = new AIGNEHTTPClient({ url });
83
-
84
- // Invoke the agent by client
85
- const response = await client.invoke("chat", { message: "hello" });
86
-
87
- console.log(response); // Output: {message: "Hello world!"}
88
- ```
89
-
90
- #### Hono 示例
91
-
92
- ```typescript file="test/http-server/http-server.test.ts" region="example-aigne-server-hono"
93
- import { AIAgent, AIGNE } from "@aigne/core";
94
- import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
95
- import { AIGNEHTTPServer } from "@aigne/transport/http-server/index.js";
96
- import { serve } from "bun";
97
- import { Hono } from "hono";
98
- import { OpenAIChatModel } from "../_mocks_/mock-models.js";
99
-
100
- const model = new OpenAIChatModel();
101
-
102
- const chat = AIAgent.from({
103
- name: "chat",
104
- });
105
-
106
- // AIGNE: Main execution engine of AIGNE Framework.
107
- const aigne = new AIGNE({ model, agents: [chat] });
108
-
109
- // Create an AIGNEServer instance
110
- const aigneServer = new AIGNEHTTPServer(aigne);
111
-
112
- // Setup the server to handle incoming requests
113
- const honoApp = new Hono();
114
- honoApp.post("/aigne/invoke", async (c) => {
115
- return aigneServer.invoke(c.req.raw);
116
- });
117
- const server = serve({ port, fetch: honoApp.fetch });
118
-
119
- // Create an AIGNEClient instance
120
- const client = new AIGNEHTTPClient({ url });
121
-
122
- // Invoke the agent by client
123
- const response = await client.invoke("chat", { message: "hello" });
124
- console.log(response); // Output: {message: "Hello world!"}
125
- ```
126
-
127
- ### HTTP 客户端
128
-
129
- ```typescript file="test/http-client/http-client.test.ts" region="example-aigne-client-simple"
130
- import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
131
-
132
- const client = new AIGNEHTTPClient({ url });
133
-
134
- const response = await client.invoke("chat", { message: "hello" });
135
-
136
- console.log(response); // Output: {message: "Hello world!"}
137
- ```
138
-
139
- ### 流式响应
140
-
141
- ```typescript file="test/http-client/http-client.test.ts" region="example-aigne-client-streaming"
142
- import { isAgentResponseDelta } from "@aigne/core";
143
- import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
144
-
145
- const client = new AIGNEHTTPClient({ url });
146
-
147
- const stream = await client.invoke(
148
- "chat",
149
- { message: "hello" },
150
- { streaming: true },
151
- );
152
-
153
- let text = "";
154
- for await (const chunk of stream) {
155
- if (isAgentResponseDelta(chunk)) {
156
- if (chunk.delta.text?.message) text += chunk.delta.text.message;
157
- }
158
- }
159
-
160
- console.log(text); // Output: "Hello world!"
161
- ```
162
-
163
- ## 许可证
164
-
165
- Elastic-2.0