@ormai/store
v0.1.1
Published
Audit logging stores for OrmAI — in-memory, JSONL, and middleware
Downloads
16
Maintainers
Readme
@ormai/store
Audit logging stores (in-memory, JSONL) and middleware for recording all tool operations.
@ormai/store provides audit logging implementations that capture before/after snapshots of every tool operation. Use it to maintain a tamper-proof record of all database actions performed by AI agents.
Installation
npm install @ormai/core @ormai/storeQuick Start
import { JsonlAuditStore, createJsonlAuditStore, withAudit } from '@ormai/store';
import { createGenericTools, createContext } from '@ormai/core';
const auditStore = createJsonlAuditStore('./audit.jsonl');
const tool = registry.get('db.query');
const auditedTool = withAudit(tool, auditStore, {
includeInputs: true,
includeOutputs: true,
redactInputFields: ['password'],
});
const result = await auditedTool.execute(input, ctx);API Reference
InMemoryAuditStore,createInMemoryAuditStore()-- In-memory store for testingJsonlAuditStore,createJsonlAuditStore(path)-- JSONL file store for productionwithAudit(tool, store, options)-- Wrap a tool with audit loggingcreateAuditedToolRegistry(registry, store, options)-- Wrap all tools in a registryAuditMiddlewareOptions-- Configuration for redaction and inclusion
Related Packages
- @ormai/core -- Audit record types and base store interface
- @ormai/tools -- Generic database tools
- @ormai/mcp -- MCP server with auth middleware
- @ormai/utils -- Testing helpers including
createMockAdapter
License
MIT
