@antipopp/agno-client 0.5.0 → 0.6.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/dist/index.d.mts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +14 -38
- package/dist/index.mjs +14 -38
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -60,10 +60,6 @@ declare class AgnoClient extends EventEmitter {
|
|
|
60
60
|
* Delete a session
|
|
61
61
|
*/
|
|
62
62
|
deleteSession(sessionId: string): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Delete a team session
|
|
65
|
-
*/
|
|
66
|
-
deleteTeamSession(teamId: string, sessionId: string): Promise<void>;
|
|
67
63
|
/**
|
|
68
64
|
* Add tool calls to the last message
|
|
69
65
|
* Used by frontend execution to add tool calls that were executed locally
|
|
@@ -81,7 +77,15 @@ declare class AgnoClient extends EventEmitter {
|
|
|
81
77
|
*/
|
|
82
78
|
private applyPendingUISpecs;
|
|
83
79
|
/**
|
|
84
|
-
* Continue a paused run
|
|
80
|
+
* Continue a paused run with tool execution results.
|
|
81
|
+
*
|
|
82
|
+
* **Note:** HITL (Human-in-the-Loop) frontend tool execution is only supported for agents.
|
|
83
|
+
* Teams do not support the continue endpoint.
|
|
84
|
+
*
|
|
85
|
+
* @param tools - Array of tool calls with execution results
|
|
86
|
+
* @param options - Optional request headers
|
|
87
|
+
* @throws Error if no paused run exists
|
|
88
|
+
* @throws Error if called with team mode (teams don't support HITL)
|
|
85
89
|
*/
|
|
86
90
|
continueRun(tools: ToolCall[], options?: {
|
|
87
91
|
headers?: Record<string, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -60,10 +60,6 @@ declare class AgnoClient extends EventEmitter {
|
|
|
60
60
|
* Delete a session
|
|
61
61
|
*/
|
|
62
62
|
deleteSession(sessionId: string): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Delete a team session
|
|
65
|
-
*/
|
|
66
|
-
deleteTeamSession(teamId: string, sessionId: string): Promise<void>;
|
|
67
63
|
/**
|
|
68
64
|
* Add tool calls to the last message
|
|
69
65
|
* Used by frontend execution to add tool calls that were executed locally
|
|
@@ -81,7 +77,15 @@ declare class AgnoClient extends EventEmitter {
|
|
|
81
77
|
*/
|
|
82
78
|
private applyPendingUISpecs;
|
|
83
79
|
/**
|
|
84
|
-
* Continue a paused run
|
|
80
|
+
* Continue a paused run with tool execution results.
|
|
81
|
+
*
|
|
82
|
+
* **Note:** HITL (Human-in-the-Loop) frontend tool execution is only supported for agents.
|
|
83
|
+
* Teams do not support the continue endpoint.
|
|
84
|
+
*
|
|
85
|
+
* @param tools - Array of tool calls with execution results
|
|
86
|
+
* @param options - Optional request headers
|
|
87
|
+
* @throws Error if no paused run exists
|
|
88
|
+
* @throws Error if called with team mode (teams don't support HITL)
|
|
85
89
|
*/
|
|
86
90
|
continueRun(tools: ToolCall[], options?: {
|
|
87
91
|
headers?: Record<string, string>;
|
package/dist/index.js
CHANGED
|
@@ -326,24 +326,6 @@ var SessionManager = class {
|
|
|
326
326
|
throw new Error(`Failed to delete session: ${response.statusText}`);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
/**
|
|
330
|
-
* Delete a team session
|
|
331
|
-
* Note: The API route has a typo with double slashes (/v1//teams), keeping it as-is for compatibility
|
|
332
|
-
*/
|
|
333
|
-
async deleteTeamSession(endpoint, teamId, sessionId, authToken) {
|
|
334
|
-
const url = `${endpoint}/v1//teams/${teamId}/sessions/${sessionId}`;
|
|
335
|
-
const headers = {};
|
|
336
|
-
if (authToken) {
|
|
337
|
-
headers["Authorization"] = `Bearer ${authToken}`;
|
|
338
|
-
}
|
|
339
|
-
const response = await fetch(url, {
|
|
340
|
-
method: "DELETE",
|
|
341
|
-
headers
|
|
342
|
-
});
|
|
343
|
-
if (!response.ok) {
|
|
344
|
-
throw new Error(`Failed to delete team session: ${response.statusText}`);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
329
|
/**
|
|
348
330
|
* Convert session runs array to chat messages
|
|
349
331
|
*/
|
|
@@ -1125,25 +1107,6 @@ var AgnoClient = class extends import_eventemitter3.default {
|
|
|
1125
1107
|
}
|
|
1126
1108
|
this.emit("state:change", this.getState());
|
|
1127
1109
|
}
|
|
1128
|
-
/**
|
|
1129
|
-
* Delete a team session
|
|
1130
|
-
*/
|
|
1131
|
-
async deleteTeamSession(teamId, sessionId) {
|
|
1132
|
-
const config = this.configManager.getConfig();
|
|
1133
|
-
await this.sessionManager.deleteTeamSession(
|
|
1134
|
-
config.endpoint,
|
|
1135
|
-
teamId,
|
|
1136
|
-
sessionId,
|
|
1137
|
-
config.authToken
|
|
1138
|
-
);
|
|
1139
|
-
this.state.sessions = this.state.sessions.filter(
|
|
1140
|
-
(s) => s.session_id !== sessionId
|
|
1141
|
-
);
|
|
1142
|
-
if (this.configManager.getSessionId() === sessionId) {
|
|
1143
|
-
this.clearMessages();
|
|
1144
|
-
}
|
|
1145
|
-
this.emit("state:change", this.getState());
|
|
1146
|
-
}
|
|
1147
1110
|
/**
|
|
1148
1111
|
* Add tool calls to the last message
|
|
1149
1112
|
* Used by frontend execution to add tool calls that were executed locally
|
|
@@ -1242,9 +1205,22 @@ var AgnoClient = class extends import_eventemitter3.default {
|
|
|
1242
1205
|
}
|
|
1243
1206
|
}
|
|
1244
1207
|
/**
|
|
1245
|
-
* Continue a paused run
|
|
1208
|
+
* Continue a paused run with tool execution results.
|
|
1209
|
+
*
|
|
1210
|
+
* **Note:** HITL (Human-in-the-Loop) frontend tool execution is only supported for agents.
|
|
1211
|
+
* Teams do not support the continue endpoint.
|
|
1212
|
+
*
|
|
1213
|
+
* @param tools - Array of tool calls with execution results
|
|
1214
|
+
* @param options - Optional request headers
|
|
1215
|
+
* @throws Error if no paused run exists
|
|
1216
|
+
* @throws Error if called with team mode (teams don't support HITL)
|
|
1246
1217
|
*/
|
|
1247
1218
|
async continueRun(tools, options) {
|
|
1219
|
+
if (this.configManager.getMode() === "team") {
|
|
1220
|
+
throw new Error(
|
|
1221
|
+
"HITL (Human-in-the-Loop) frontend tool execution is not supported for teams. Only agents support the continue endpoint."
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1248
1224
|
if (!this.state.isPaused || !this.state.pausedRunId) {
|
|
1249
1225
|
throw new Error("No paused run to continue");
|
|
1250
1226
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -288,24 +288,6 @@ var SessionManager = class {
|
|
|
288
288
|
throw new Error(`Failed to delete session: ${response.statusText}`);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
/**
|
|
292
|
-
* Delete a team session
|
|
293
|
-
* Note: The API route has a typo with double slashes (/v1//teams), keeping it as-is for compatibility
|
|
294
|
-
*/
|
|
295
|
-
async deleteTeamSession(endpoint, teamId, sessionId, authToken) {
|
|
296
|
-
const url = `${endpoint}/v1//teams/${teamId}/sessions/${sessionId}`;
|
|
297
|
-
const headers = {};
|
|
298
|
-
if (authToken) {
|
|
299
|
-
headers["Authorization"] = `Bearer ${authToken}`;
|
|
300
|
-
}
|
|
301
|
-
const response = await fetch(url, {
|
|
302
|
-
method: "DELETE",
|
|
303
|
-
headers
|
|
304
|
-
});
|
|
305
|
-
if (!response.ok) {
|
|
306
|
-
throw new Error(`Failed to delete team session: ${response.statusText}`);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
291
|
/**
|
|
310
292
|
* Convert session runs array to chat messages
|
|
311
293
|
*/
|
|
@@ -1087,25 +1069,6 @@ var AgnoClient = class extends EventEmitter {
|
|
|
1087
1069
|
}
|
|
1088
1070
|
this.emit("state:change", this.getState());
|
|
1089
1071
|
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Delete a team session
|
|
1092
|
-
*/
|
|
1093
|
-
async deleteTeamSession(teamId, sessionId) {
|
|
1094
|
-
const config = this.configManager.getConfig();
|
|
1095
|
-
await this.sessionManager.deleteTeamSession(
|
|
1096
|
-
config.endpoint,
|
|
1097
|
-
teamId,
|
|
1098
|
-
sessionId,
|
|
1099
|
-
config.authToken
|
|
1100
|
-
);
|
|
1101
|
-
this.state.sessions = this.state.sessions.filter(
|
|
1102
|
-
(s) => s.session_id !== sessionId
|
|
1103
|
-
);
|
|
1104
|
-
if (this.configManager.getSessionId() === sessionId) {
|
|
1105
|
-
this.clearMessages();
|
|
1106
|
-
}
|
|
1107
|
-
this.emit("state:change", this.getState());
|
|
1108
|
-
}
|
|
1109
1072
|
/**
|
|
1110
1073
|
* Add tool calls to the last message
|
|
1111
1074
|
* Used by frontend execution to add tool calls that were executed locally
|
|
@@ -1204,9 +1167,22 @@ var AgnoClient = class extends EventEmitter {
|
|
|
1204
1167
|
}
|
|
1205
1168
|
}
|
|
1206
1169
|
/**
|
|
1207
|
-
* Continue a paused run
|
|
1170
|
+
* Continue a paused run with tool execution results.
|
|
1171
|
+
*
|
|
1172
|
+
* **Note:** HITL (Human-in-the-Loop) frontend tool execution is only supported for agents.
|
|
1173
|
+
* Teams do not support the continue endpoint.
|
|
1174
|
+
*
|
|
1175
|
+
* @param tools - Array of tool calls with execution results
|
|
1176
|
+
* @param options - Optional request headers
|
|
1177
|
+
* @throws Error if no paused run exists
|
|
1178
|
+
* @throws Error if called with team mode (teams don't support HITL)
|
|
1208
1179
|
*/
|
|
1209
1180
|
async continueRun(tools, options) {
|
|
1181
|
+
if (this.configManager.getMode() === "team") {
|
|
1182
|
+
throw new Error(
|
|
1183
|
+
"HITL (Human-in-the-Loop) frontend tool execution is not supported for teams. Only agents support the continue endpoint."
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1210
1186
|
if (!this.state.isPaused || !this.state.pausedRunId) {
|
|
1211
1187
|
throw new Error("No paused run to continue");
|
|
1212
1188
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antipopp/agno-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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.
|
|
37
|
+
"@antipopp/agno-types": "0.6.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsup": "^8.0.1",
|