@vasperacapital/vasperamesh-sdk
v0.1.0
Published
VasperaMesh Agent SDK for building MCP-compatible agents with AMP protocol support
Maintainers
Readme
@vasperamesh/sdk
VasperaMesh Agent SDK for building MCP-compatible agents with AMP protocol support.
Installation
npm install @vasperamesh/sdk
# or
pnpm add @vasperamesh/sdkQuick Start
import { Agent } from '@vasperamesh/sdk'
const agent = new Agent({
name: 'CodeReviewer',
version: '1.0.0',
capabilities: ['code-review', 'suggest-improvements'],
meshUrl: process.env.MESH_URL,
})
// Add MCP tool
agent.addTool({
name: 'review_code',
description: 'Review code for issues',
inputSchema: {
type: 'object',
properties: {
code: { type: 'string' },
language: { type: 'string' },
},
required: ['code'],
},
handler: async (params) => {
// Your logic here
return { issues: [], suggestions: [] }
},
})
// Handle tasks from mesh
agent.onTask('code-review', async (task, context) => {
const { code, language } = task.payload
// Execute review
const review = await reviewCode(code, language)
// Optionally delegate to other agents
if (review.needsRefactoring) {
const architect = await context.findAgent('architect')
if (architect) {
const refactor = await architect.invoke('suggest_refactor', { code })
review.refactorSuggestions = refactor
}
}
return {
taskId: task.taskId,
status: 'completed',
result: review,
}
})
// Connect to mesh
await agent.connect()Documentation
See VasperaMesh Documentation for complete API reference.
