qmd/package.json
Tobi Lutke bab46dacb2
Refactor: extract store, LLM, and formatter modules with comprehensive tests
- Extract store.ts: database operations, search, document retrieval
  - createStore() factory pattern for clean DB lifecycle management
  - Unified DocumentResult type with optional body loading
  - Snippet extraction with diff-style headers (@@ -line,count @@)

- Extract llm.ts: LLM abstraction layer with Ollama implementation
  - Clean interface for embed, generate, rerank operations
  - High-level rerankerLogprobsCheck with logprob-based scoring
  - Query expansion support

- Extract formatter.ts: output formatting utilities
  - Support for CLI, JSON, CSV, MD, XML formats
  - MCP-specific CSV formatting

- Extract mcp.ts: MCP server using createStore() pattern
  - Single DB connection for server lifetime (fixes closed DB errors)
  - URL-decode resource paths for proper space/special char handling

- Add comprehensive test suites (215 tests total)
  - store.test.ts: 96 tests covering all store operations
  - llm.test.ts: 60 tests for LLM abstraction
  - mcp.test.ts: 59 tests for MCP endpoints and resources
  - All tests use mocked Ollama (errors on unmocked calls)

- Add bun run inspector script for MCP debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:33:32 -05:00

52 lines
1.1 KiB
JSON

{
"name": "qmd",
"version": "1.0.0",
"description": "Quick Markdown Search - Full-text and vector search for markdown files",
"type": "module",
"bin": {
"qmd": "./qmd"
},
"scripts": {
"test": "bun test",
"qmd": "bun qmd.ts",
"index": "bun qmd.ts index",
"vector": "bun qmd.ts vector",
"search": "bun qmd.ts search",
"vsearch": "bun qmd.ts vsearch",
"rerank": "bun qmd.ts rerank",
"link": "bun link",
"inspector": "npx @modelcontextprotocol/inspector bun qmd.ts mcp"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.24.3",
"sqlite-vec": "^0.1.7-alpha.2",
"zod": "^4.1.13"
},
"optionalDependencies": {
"sqlite-vec-darwin-arm64": "^0.1.7-alpha.2",
"sqlite-vec-darwin-x64": "^0.1.7-alpha.2",
"sqlite-vec-linux-x64": "^0.1.7-alpha.2",
"sqlite-vec-win32-x64": "^0.1.7-alpha.2"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"engines": {
"bun": ">=1.0.0"
},
"keywords": [
"markdown",
"search",
"fts",
"vector",
"sqlite",
"bm25",
"embeddings",
"ollama"
],
"license": "MIT"
}