@modelkit/hub
v0.3.1
Published
Central orchestration hub for the ModelKit framework. Manages agent registration, task routing, state lifecycle, real-time events, and workflow execution.
Readme
@modelkit/hub
Central orchestration hub for the ModelKit framework. Manages agent registration, task routing, state lifecycle, real-time events, and workflow execution.
Install
npm install @modelkit/hub @modelkit/coreUsage
import { createModelKitHub } from '@modelkit/hub';
const hub = createModelKitHub({ dbPath: './modelkit.db' });
// Register an agent
hub.registerAgent({ agentId: 'agent-1', capabilities: ['code-review'] });
// Create and route tasks
hub.createTask({ capability: 'code-review', input: '...' });Framework Adapters
// Express
import { createExpressRouter } from '@modelkit/hub/express';
app.use('/api/hub', createExpressRouter(hub));
// Next.js
import { createNextHandlers } from '@modelkit/hub/nextjs';
export const { GET, POST } = createNextHandlers(hub);
// React
import { ModelKitHubProvider, useModelKitTasks } from '@modelkit/hub/react';What's Included
- Hub — Core orchestration with SQLite persistence
- Routing — Capability matching and round-robin task assignment
- Lifecycle — Task, session, objective, and agent health management
- Realtime — WebSocket event broadcasting
- Workflows — Multi-step workflow engine with YAML definitions
- MCP — Model Context Protocol server and tools
- Adapters — Express and Next.js route factories
- React — Hooks for tasks, agents, sessions, objectives, workflows
License
MIT
