@antipopp/agno-client 0.3.0 → 0.4.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/README.md CHANGED
@@ -28,6 +28,7 @@ const client = new AgnoClient({
28
28
  mode: 'agent',
29
29
  agentId: 'your-agent-id',
30
30
  authToken: 'optional-auth-token',
31
+ userId: 'user-123', // Optional: Link sessions to a user
31
32
  });
32
33
 
33
34
  // Listen to message updates
@@ -66,6 +67,7 @@ new AgnoClient(config: AgnoClientConfig)
66
67
  - `teamId` (string, optional) - Team ID (required if mode is 'team')
67
68
  - `dbId` (string, optional) - Database ID
68
69
  - `sessionId` (string, optional) - Current session ID
70
+ - `userId` (string, optional) - User ID to link sessions to a specific user
69
71
 
70
72
  ### Methods
71
73
 
@@ -136,6 +138,7 @@ Update client configuration.
136
138
  client.updateConfig({
137
139
  agentId: 'new-agent-id',
138
140
  authToken: 'new-token',
141
+ userId: 'user-456', // Update user ID
139
142
  });
140
143
  ```
141
144
 
package/dist/index.js CHANGED
@@ -226,6 +226,18 @@ var ConfigManager = class {
226
226
  setSessionId(sessionId) {
227
227
  this.updateField("sessionId", sessionId);
228
228
  }
229
+ /**
230
+ * Get user ID
231
+ */
232
+ getUserId() {
233
+ return this.config.userId;
234
+ }
235
+ /**
236
+ * Set user ID
237
+ */
238
+ setUserId(userId) {
239
+ this.updateField("userId", userId);
240
+ }
229
241
  /**
230
242
  * Get current entity ID (agent or team based on mode)
231
243
  */
@@ -953,6 +965,10 @@ var AgnoClient = class extends import_eventemitter3.default {
953
965
  try {
954
966
  formData.append("stream", "true");
955
967
  formData.append("session_id", newSessionId ?? "");
968
+ const userId = this.configManager.getUserId();
969
+ if (userId) {
970
+ formData.append("user_id", userId);
971
+ }
956
972
  const headers = { ...options?.headers };
957
973
  const authToken = this.configManager.getAuthToken();
958
974
  if (authToken) {
@@ -1275,6 +1291,10 @@ var AgnoClient = class extends import_eventemitter3.default {
1275
1291
  if (currentSessionId) {
1276
1292
  formData.append("session_id", currentSessionId);
1277
1293
  }
1294
+ const userId = this.configManager.getUserId();
1295
+ if (userId) {
1296
+ formData.append("user_id", userId);
1297
+ }
1278
1298
  const headers = { ...options?.headers };
1279
1299
  const authToken = this.configManager.getAuthToken();
1280
1300
  if (authToken) {
package/dist/index.mjs CHANGED
@@ -188,6 +188,18 @@ var ConfigManager = class {
188
188
  setSessionId(sessionId) {
189
189
  this.updateField("sessionId", sessionId);
190
190
  }
191
+ /**
192
+ * Get user ID
193
+ */
194
+ getUserId() {
195
+ return this.config.userId;
196
+ }
197
+ /**
198
+ * Set user ID
199
+ */
200
+ setUserId(userId) {
201
+ this.updateField("userId", userId);
202
+ }
191
203
  /**
192
204
  * Get current entity ID (agent or team based on mode)
193
205
  */
@@ -915,6 +927,10 @@ var AgnoClient = class extends EventEmitter {
915
927
  try {
916
928
  formData.append("stream", "true");
917
929
  formData.append("session_id", newSessionId ?? "");
930
+ const userId = this.configManager.getUserId();
931
+ if (userId) {
932
+ formData.append("user_id", userId);
933
+ }
918
934
  const headers = { ...options?.headers };
919
935
  const authToken = this.configManager.getAuthToken();
920
936
  if (authToken) {
@@ -1237,6 +1253,10 @@ var AgnoClient = class extends EventEmitter {
1237
1253
  if (currentSessionId) {
1238
1254
  formData.append("session_id", currentSessionId);
1239
1255
  }
1256
+ const userId = this.configManager.getUserId();
1257
+ if (userId) {
1258
+ formData.append("user_id", userId);
1259
+ }
1240
1260
  const headers = { ...options?.headers };
1241
1261
  const authToken = this.configManager.getAuthToken();
1242
1262
  if (authToken) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antipopp/agno-client",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Core client library for Agno agents with streaming support and HITL frontend tool execution",
5
5
  "author": "antipopp",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "eventemitter3": "^5.0.1",
37
- "@antipopp/agno-types": "0.3.0"
37
+ "@antipopp/agno-types": "0.4.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "tsup": "^8.0.1",