@mikemajara/agenthub
v1.0.0
Published
A simple utility hub for agent-based workflows
Readme
AgentHub
A simple utility hub for agent-based workflows.
Installation
npm install agenthubUsage
const { createAgent, log } = require('agenthub');
// Create a new agent
const agent = createAgent({
name: 'my-agent',
description: 'A sample agent'
});
// Execute a task
agent.execute(async (ctx) => {
log('info', `Agent ${ctx.name} is running`);
return 'Task completed';
});API
createAgent(config)
Creates a new agent with the given configuration.
config.name(string): The name of the agentconfig.description(string, optional): Description of the agent
Returns an agent object with:
name: Agent namedescription: Agent descriptionid: Unique identifiercreatedAt: Creation timestampexecute(task): Method to execute tasks
log(level, message, meta)
Simple logging utility.
level(string): Log level ('info', 'warn', 'error')message(string): The message to logmeta(object, optional): Additional metadata
License
MIT
