
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@antipopp/agno-client
Advanced tools
Core client library for Agno agents with streaming support and HITL frontend tool execution
Core stateful client library for Agno agents with streaming support.
npm install @antipopp/agno-client
import { AgnoClient } from '@antipopp/agno-client';
// Create a client instance
const client = new AgnoClient({
endpoint: 'http://localhost:7777',
mode: 'agent',
agentId: 'your-agent-id',
authToken: 'optional-auth-token',
userId: 'user-123', // Optional: Link sessions to a user
});
// Listen to message updates
client.on('message:update', (messages) => {
console.log('New messages:', messages);
});
// Listen to errors
client.on('message:error', (error) => {
console.error('Error:', error);
});
// Send a message
await client.sendMessage('Hello, agent!');
// Get current messages
const messages = client.getMessages();
// Clear chat
client.clearMessages();
new AgnoClient(config: AgnoClientConfig)
Config Options:
endpoint (string, required) - Base endpoint URLauthToken (string, optional) - Authentication tokenmode ('agent' | 'team', optional) - Operation mode (default: 'agent')agentId (string, optional) - Agent ID (required if mode is 'agent')teamId (string, optional) - Team ID (required if mode is 'team')dbId (string, optional) - Database IDsessionId (string, optional) - Current session IDuserId (string, optional) - User ID to link sessions to a specific userheaders (Record<string, string>, optional) - Global custom headers for all API requestsparams (Record<string, string>, optional) - Global query parameters for all API requestsdependencies (Record<string, unknown>, optional) - Global run dependencies merged into all sendMessage requestssendMessage(message, options?)Send a message to the agent/team.
await client.sendMessage('Hello!');
// With FormData (for file uploads)
const formData = new FormData();
formData.append('message', 'Hello!');
formData.append('files', fileBlob);
await client.sendMessage(formData);
// With per-request files option
await client.sendMessage('Hello!', {
files: [fileBlob]
});
// With global dependencies from config
const dependencyClient = new AgnoClient({
endpoint: 'http://localhost:7777',
agentId: 'agent-123',
dependencies: {
tenantId: 'tenant-1',
locale: 'en-US'
}
});
await dependencyClient.sendMessage('Hello!');
// Override/extend dependencies per request
await dependencyClient.sendMessage('Hello!', {
dependencies: {
locale: 'fr-FR', // overrides global
feature: 'rag' // merged new key
}
});
// With custom headers
await client.sendMessage('Hello!', {
headers: { 'X-Custom-Header': 'value' }
});
// With query parameters
await client.sendMessage('Hello!', {
params: { temperature: '0.7', max_tokens: '500' }
});
// With both headers and params
await client.sendMessage('Hello!', {
headers: { 'X-Request-ID': '12345' },
params: { debug: 'true' }
});
getMessages()Get current messages.
const messages: ChatMessage[] = client.getMessages();
clearMessages()Clear all messages and reset session.
client.clearMessages();
loadSession(sessionId)Load a specific session.
const messages = await client.loadSession('session-id');
fetchSessions()Fetch all sessions for current agent/team.
const { data, meta } = await client.fetchSessions();
initialize()Initialize client (check status and fetch agents/teams).
const { agents, teams } = await client.initialize();
updateConfig(updates)Update client configuration.
client.updateConfig({
agentId: 'new-agent-id',
authToken: 'new-token',
userId: 'user-456', // Update user ID
});
Subscribe to events using client.on(event, handler):
message:update - Emitted when messages are updated during streamingmessage:complete - Emitted when a message stream completesmessage:error - Emitted when an error occurssession:loaded - Emitted when a session is loadedsession:created - Emitted when a new session is createdstream:start - Emitted when streaming startsstream:end - Emitted when streaming endsstate:change - Emitted when client state changesconfig:change - Emitted when configuration changes// Subscribe to events
client.on('message:update', (messages) => {
console.log('Messages:', messages);
});
// Unsubscribe from events
const handler = (messages) => console.log(messages);
client.on('message:update', handler);
client.off('message:update', handler);
The package includes a secure Logger utility for production-safe debugging:
import { Logger } from '@antipopp/agno-client';
// Debug and info messages only log in development mode
Logger.debug('Debug message', { someData: 'value' });
Logger.info('Client initialized', { endpoint: 'http://localhost:7777' });
// Warnings and errors always log
Logger.warn('Connection issue detected');
Logger.error('Failed to send message', error);
// Sensitive data is automatically sanitized
Logger.debug('Config loaded', {
endpoint: 'http://localhost:7777',
authToken: 'secret-token' // Will be logged as [REDACTED]
});
Features:
Sanitized Fields:
authToken, Authorization, token, password, apiKey and any field containing these words (case-insensitive)// Fetch all sessions
const { data: sessions, meta } = await client.fetchSessions();
console.log(`Loaded ${meta.total_count} sessions across ${meta.total_pages} pages`);
// Load a specific session
const messages = await client.loadSession(sessions[0].session_id);
// Current session ID
const sessionId = client.getConfig().sessionId;
// Get current state
const state = client.getState();
console.log(state.isStreaming);
console.log(state.isEndpointActive);
console.log(state.agents);
console.log(state.teams);
client.on('message:error', (error) => {
console.error('Streaming error:', error);
});
try {
await client.sendMessage('Hello!');
} catch (error) {
console.error('Failed to send:', error);
}
The client supports both global and per-request headers and query parameters.
Set headers and params in the client config to apply them to all API requests:
const client = new AgnoClient({
endpoint: 'http://localhost:7777',
agentId: 'agent-123',
headers: {
'X-API-Version': 'v2',
'X-Client-ID': 'my-app'
},
params: {
locale: 'en-US',
environment: 'production'
}
});
Override or add headers/params for specific requests:
// Per-request overrides global settings
await client.sendMessage('Hello!', {
headers: { 'X-Request-ID': '12345' },
params: { temperature: '0.7' }
});
// All methods support headers and params
await client.loadSession('session-123', {
params: { include_metadata: 'true' }
});
await client.fetchSessions({
params: { limit: '50', status: 'active' }
});
await client.continueRun(tools, {
headers: { 'X-Trace-ID': 'abc123' },
params: { debug: 'true' }
});
Headers:
config.headers (lowest precedence)authToken (highest precedence - always overrides)Query Parameters:
config.params (lowest precedence)Dependencies (sendMessage only):
config.dependencies (lowest precedence)sendMessage(..., { dependencies }) (highest precedence - overrides global)const client = new AgnoClient({
endpoint: 'http://localhost:7777',
agentId: 'agent-123',
params: { version: 'v1', locale: 'en-US' }
});
// This request will have: version=v2 (overridden), locale=en-US (from global), debug=true (added)
await client.sendMessage('Hello!', {
params: { version: 'v2', debug: 'true' }
});
Headers:
{ 'X-Request-ID': uuid() }{ 'X-API-Version': 'v2' }{ 'X-Client-ID': 'mobile-app' }{ 'X-Custom-Auth': 'token' }Query Parameters:
{ temperature: '0.7', max_tokens: '500' }{ enable_streaming: 'true' }{ locale: 'en-US', timezone: 'America/New_York' }{ debug: 'true', trace_id: 'xyz' }{ page: '1', limit: '50' }Use AbortController to cancel ongoing requests. This is essential for preventing memory leaks when components unmount or users navigate away during streaming:
const controller = new AbortController();
// Pass signal to sendMessage options
await client.sendMessage('Hello!', {
signal: controller.signal
});
// Cancel the request (e.g., on component unmount)
controller.abort();
React Example:
import { useEffect } from 'react';
import { AgnoClient } from '@antipopp/agno-client';
function ChatComponent() {
const client = new AgnoClient(config);
useEffect(() => {
const controller = new AbortController();
// Send message with abort signal
client.sendMessage('Hello!', {
signal: controller.signal
});
// Cleanup: cancel request on unmount
return () => {
controller.abort();
};
}, []);
return <div>Chat</div>;
}
Use Cases:
Note: Aborted requests will not trigger the onError callback - they complete silently.
MIT
FAQs
Core client library for Agno agents with streaming support and HITL frontend tool execution
We found that @antipopp/agno-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.