
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
A TypeScript SDK for interacting with Rhun AI Agents.
npm install @rhun/sdk
Create a .env file in your project root:
RHUN_API_KEY=your_api_key_here
If you want to build the SDK from source:
git clone https://github.com/rhun-ai/rhun-sdk.git
cd rhun-sdk
npm install
npm run build
npm test
import { RhunClient } from '@rhun/sdk';
// Initialize the client
const client = new RhunClient({
apiKey: process.env.RHUN_API_KEY, // Best practice: use environment variables
baseUrl: 'https://beta.rhun.io'
});
// Create a crypto research agent
const agent = await client.createAgent({
name: 'Token Scout',
description: 'Crypto research specialist focusing on token discovery, market analysis, and due diligence. Equipped with comprehensive token database access and real-time market data.',
coreCapabilities: 'Token search and analysis, market data aggregation, contract verification, liquidity analysis',
interactionStyle: 'Informative and precise, with clear risk disclaimers',
analysisApproach: 'Multi-factor analysis combining on-chain data, market metrics, and social signals',
riskCommunication: 'Detailed risk assessment with contract audit status and liquidity metrics',
responseFormat: 'Token summary followed by key metrics and risk factors'
});
// Example: Search for tokens and analyze market data
await client.streamChat(agent.id, 'Find new DeFi tokens and analyze their metrics', (chunk) => {
if (chunk.type === 'message') {
// Handle narrative responses
console.log('Analysis:', chunk.data.content);
} else if (chunk.type === 'tool_invocation') {
const tool = chunk.data;
switch (tool.tool) {
case 'getRecentlyLaunchedCoins':
// Handle newly launched tokens
console.log('New tokens:', tool.output.tokens.map(t => ({
name: t.name,
chain: t.chain,
launchDate: t.launchDate
})));
break;
case 'getTokenInfo':
// Handle detailed token information
console.log('Token details:', {
price: tool.output.price,
volume24h: tool.output.volume24h,
marketCap: tool.output.marketCap,
holders: tool.output.holders
});
break;
case 'getTopHolders':
// Handle holder distribution analysis
console.log('Top holders:', tool.output.holders.map(h => ({
address: h.address,
percentage: h.percentage,
balance: h.balance
})));
break;
case 'getFearAndGreedIndex':
// Handle market sentiment data
console.log('Market sentiment:', tool.output.value, tool.output.classification);
break;
}
}
});
// Example: Get technical analysis with TradingView charts
const response = await client.chat(agent.id, 'Show me technical analysis for SOL');
console.log('Analysis:', response.message.content);
// Update agent with enhanced capabilities
const updatedAgent = await client.updateAgent(agent.id, {
description: 'Advanced market analyst with real-time technical analysis and sentiment tracking',
coreCapabilities: 'Technical analysis, market sentiment, holder analysis, trend prediction'
});
The main client class for interacting with the Rhun API.
new RhunClient(config: RhunClientConfig)
config.apiKey: Your Rhun API key (will be sent as a Bearer token)config.baseUrl: (optional) The base URL for the API. Defaults to https://beta.rhun.iocreateAgent(config: AgentConfig): Promise<Agent>getAgent(agentId: string): Promise<Agent>updateAgent(agentId: string, config: Partial<AgentConfig>): Promise<Agent>deleteAgent(agentId: string): Promise<void>listAgents(): Promise<Agent[]>chat(agentId: string, message: string): Promise<ChatResponse>streamChat(agentId: string, message: string, onChunk: (chunk: StreamChatResponse) => void): Promise<void>Configuration for creating/updating an agent:
Required fields:
name: string - Agent namedescription: string - Agent descriptionOptional fields:
image?: Buffer | string - Agent profile image (Buffer or file path)Advanced Configuration (all optional):
coreCapabilities?: string - Core capabilities and knowledge domainsinteractionStyle?: string - How the agent should interactanalysisApproach?: string - How the agent should analyze problemsriskCommunication?: string - How to communicate risksresponseFormat?: string - Structure for responseslimitationsDisclaimers?: string - Agent limitationsprohibitedBehaviors?: string - What the agent must not doknowledgeUpdates?: string - How to handle knowledge updatesstyleGuide?: string - Communication style guidelinesspecialInstructions?: string - Special handling instructionsresponsePriorityOrder?: string - Priority order for responsesSystem-managed fields (do not set these manually):
userId?: string - Set automatically from authenticationcreatedAt?: string - Set automatically on creationupdatedAt?: string - Set automatically on updatesOther Types:
Agent: An agent instanceChatMessage: A message in a chatToolInvocation: A tool invocation by an agentChatResponse: Response from a chat requestStreamChatResponse: Response chunk from a streaming chat requestMIT
FAQs
TypeScript SDK for interacting with Rhun AI Agents
The npm package @rhun/sdk receives a total of 0 weekly downloads. As such, @rhun/sdk popularity was classified as not popular.
We found that @rhun/sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.