@aigne/transport 0.9.1 → 0.9.2

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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.2](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.9.1...transport-v0.9.2) (2025-07-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * share user context between server and client ([#233](https://github.com/AIGNE-io/aigne-framework/issues/233)) ([d55bfbc](https://github.com/AIGNE-io/aigne-framework/commit/d55bfbcc230e9c876c6d2fc0b74a4d7821f9e6ce))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/openai bumped to 0.8.1
16
+ * devDependencies
17
+ * @aigne/agent-library bumped to 1.20.1
18
+ * @aigne/core bumped to 1.32.1
19
+ * @aigne/test-utils bumped to 0.5.3
20
+
3
21
  ## [0.9.1](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.9.0...transport-v0.9.1) (2025-07-08)
4
22
 
5
23
 
@@ -41,6 +41,14 @@ class AIGNEHTTPClient {
41
41
  throw new Error("Method not implemented.");
42
42
  if (!message)
43
43
  throw new Error("Message is required for invoking an agent");
44
+ if (options?.userContext) {
45
+ Object.assign(this.userContext, options.userContext);
46
+ options.userContext = undefined;
47
+ }
48
+ if (options?.memories?.length) {
49
+ this.memories.push(...options.memories);
50
+ options.memories = undefined;
51
+ }
44
52
  const a = typeof agent === "string" ? this.getAgent({ name: agent }) : Promise.resolve(agent);
45
53
  return a.then((agent) => agent.invoke(message, { ...options, context: this }));
46
54
  }
@@ -82,7 +90,15 @@ class AIGNEHTTPClient {
82
90
  "Content-Type": "application/json",
83
91
  ...options?.fetchOptions?.headers,
84
92
  },
85
- body: JSON.stringify({ agent, input, options: options && (0, type_utils_js_1.omit)(options, "context") }),
93
+ body: JSON.stringify({
94
+ agent,
95
+ input,
96
+ options: options && {
97
+ ...(0, type_utils_js_1.omit)(options, "context"),
98
+ userContext: { ...this.userContext, ...options.userContext },
99
+ memories: [...this.memories, ...(options.memories ?? [])],
100
+ },
101
+ }),
86
102
  });
87
103
  // For non-streaming responses, simply parse the JSON response and return it
88
104
  if (!options?.streaming) {
@@ -38,6 +38,14 @@ export class AIGNEHTTPClient {
38
38
  throw new Error("Method not implemented.");
39
39
  if (!message)
40
40
  throw new Error("Message is required for invoking an agent");
41
+ if (options?.userContext) {
42
+ Object.assign(this.userContext, options.userContext);
43
+ options.userContext = undefined;
44
+ }
45
+ if (options?.memories?.length) {
46
+ this.memories.push(...options.memories);
47
+ options.memories = undefined;
48
+ }
41
49
  const a = typeof agent === "string" ? this.getAgent({ name: agent }) : Promise.resolve(agent);
42
50
  return a.then((agent) => agent.invoke(message, { ...options, context: this }));
43
51
  }
@@ -79,7 +87,15 @@ export class AIGNEHTTPClient {
79
87
  "Content-Type": "application/json",
80
88
  ...options?.fetchOptions?.headers,
81
89
  },
82
- body: JSON.stringify({ agent, input, options: options && omit(options, "context") }),
90
+ body: JSON.stringify({
91
+ agent,
92
+ input,
93
+ options: options && {
94
+ ...omit(options, "context"),
95
+ userContext: { ...this.userContext, ...options.userContext },
96
+ memories: [...this.memories, ...(options.memories ?? [])],
97
+ },
98
+ }),
83
99
  });
84
100
  // For non-streaming responses, simply parse the JSON response and return it
85
101
  if (!options?.streaming) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/transport",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
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,7 +39,7 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@aigne/openai": "^0.8.0"
42
+ "@aigne/openai": "^0.8.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/bun": "^1.2.17",
@@ -54,9 +54,9 @@
54
54
  "rimraf": "^6.0.1",
55
55
  "typescript": "^5.8.3",
56
56
  "uuid": "^11.1.0",
57
- "@aigne/core": "^1.32.0",
58
- "@aigne/agent-library": "^1.20.0",
59
- "@aigne/test-utils": "^0.5.2"
57
+ "@aigne/core": "^1.32.1",
58
+ "@aigne/test-utils": "^0.5.3",
59
+ "@aigne/agent-library": "^1.20.1"
60
60
  },
61
61
  "scripts": {
62
62
  "lint": "tsc --noEmit",