Shared foundation for agent-* MCP servers (agent-comm, agent-tasks, agent-knowledge, agent-discover). Provides SQLite storage with WAL pragmas, transaction helper, and migration runner; REST transport with node:http router, JSON helper, CORS, body reader, static file serving; WebSocket server with full-state-on-connect, DB-fingerprint delta polling, ping/pong heartbeat, max-connection cap; MCP JSON-RPC over stdio with tool dispatcher; typed in-process EventBus with wildcards; CleanupService with retention timer; auto-starting dashboard with port leader-election; runtime package name+version reader; FTS5 and LIKE fallback search. Current version 1.1.1, MIT license, TypeScript types included, requires Node >=20.11.0 and peer deps better-sqlite3 >=11 and ws >=8. Internal use package, not yet stable API, no external documentation.
npm install agent-commonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an in-memory SQLite database with migrations, sets up a simple REST router, and demonstrates typed EventBus usage.
Upgrade Node.js to >=20.11.0 or use a polyfill (not recommended).
Import only from 'agent-common'.
Check if dashboard is needed; override or disable via configuration if unexpected.
Use import syntax or dynamic import() in CommonJS.
Add 'moduleResolution': 'bundler' to tsconfig.json.
Change to import syntax (import { ... } from 'agent-common') or use dynamic import() in CommonJS modules.Import from 'agent-common' only: import { createStorage } from 'agent-common'.Install better-sqlite3 >=11: npm install better-sqlite3@^11