Problem
The public API (src/index.ts) exports rich indexing primitives (IndexBuilder, pipeline stages, walker, embedder) but almost no query surface. A library consumer embedding Lore into an agent framework today can build an index but cannot query it for search, blame, history, coverage, docs, architecture, metrics, etc. without spinning up an MCP server via createLoreMcpServer().
Proposal
Export typed query functions from the main entry point that create a read-only DB, call the handler, and return typed results — no MCP server required:
import { query } from '@jafreck/lore';
const db = openReadOnly('lore.db');
const results = await query.search(db, { query: 'auth', mode: 'structural' });
const blame = await query.blame(db, { path: 'src/server.ts', mode: 'ownership' });
Each tool handler already takes (db, args) internally — this just exposes that cleanly.
Implementation notes
- Add a
src/query.ts barrel that re-exports each tool handler with a typed (db, args) → result signature.
- Add a
"./query" entry to the exports map in package.json.
- Type exports for tool argument and return shapes.
- No MCP dependency in the query path.
Acceptance criteria