@itkoren/sqmd 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1052 -0
  4. package/dist/api/app.d.ts +14 -0
  5. package/dist/api/app.d.ts.map +1 -0
  6. package/dist/api/app.js +32 -0
  7. package/dist/api/app.js.map +1 -0
  8. package/dist/api/middleware.d.ts +5 -0
  9. package/dist/api/middleware.d.ts.map +1 -0
  10. package/dist/api/middleware.js +37 -0
  11. package/dist/api/middleware.js.map +1 -0
  12. package/dist/api/models.d.ts +178 -0
  13. package/dist/api/models.d.ts.map +1 -0
  14. package/dist/api/models.js +39 -0
  15. package/dist/api/models.js.map +1 -0
  16. package/dist/api/routes/documents.d.ts +4 -0
  17. package/dist/api/routes/documents.d.ts.map +1 -0
  18. package/dist/api/routes/documents.js +92 -0
  19. package/dist/api/routes/documents.js.map +1 -0
  20. package/dist/api/routes/health.d.ts +6 -0
  21. package/dist/api/routes/health.d.ts.map +1 -0
  22. package/dist/api/routes/health.js +38 -0
  23. package/dist/api/routes/health.js.map +1 -0
  24. package/dist/api/routes/index.d.ts +5 -0
  25. package/dist/api/routes/index.d.ts.map +1 -0
  26. package/dist/api/routes/index.js +83 -0
  27. package/dist/api/routes/index.js.map +1 -0
  28. package/dist/api/routes/search.d.ts +6 -0
  29. package/dist/api/routes/search.d.ts.map +1 -0
  30. package/dist/api/routes/search.js +104 -0
  31. package/dist/api/routes/search.js.map +1 -0
  32. package/dist/config/loader.d.ts +4 -0
  33. package/dist/config/loader.d.ts.map +1 -0
  34. package/dist/config/loader.js +144 -0
  35. package/dist/config/loader.js.map +1 -0
  36. package/dist/config/schema.d.ts +298 -0
  37. package/dist/config/schema.d.ts.map +1 -0
  38. package/dist/config/schema.js +50 -0
  39. package/dist/config/schema.js.map +1 -0
  40. package/dist/embeddings/ollama.d.ts +14 -0
  41. package/dist/embeddings/ollama.d.ts.map +1 -0
  42. package/dist/embeddings/ollama.js +46 -0
  43. package/dist/embeddings/ollama.js.map +1 -0
  44. package/dist/embeddings/transformers.d.ts +14 -0
  45. package/dist/embeddings/transformers.d.ts.map +1 -0
  46. package/dist/embeddings/transformers.js +64 -0
  47. package/dist/embeddings/transformers.js.map +1 -0
  48. package/dist/embeddings/types.d.ts +6 -0
  49. package/dist/embeddings/types.d.ts.map +1 -0
  50. package/dist/embeddings/types.js +2 -0
  51. package/dist/embeddings/types.js.map +1 -0
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +233 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/ingestion/chunker.d.ts +21 -0
  57. package/dist/ingestion/chunker.d.ts.map +1 -0
  58. package/dist/ingestion/chunker.js +117 -0
  59. package/dist/ingestion/chunker.js.map +1 -0
  60. package/dist/ingestion/fingerprint.d.ts +6 -0
  61. package/dist/ingestion/fingerprint.d.ts.map +1 -0
  62. package/dist/ingestion/fingerprint.js +17 -0
  63. package/dist/ingestion/fingerprint.js.map +1 -0
  64. package/dist/ingestion/parser.d.ts +16 -0
  65. package/dist/ingestion/parser.d.ts.map +1 -0
  66. package/dist/ingestion/parser.js +98 -0
  67. package/dist/ingestion/parser.js.map +1 -0
  68. package/dist/ingestion/pipeline.d.ts +32 -0
  69. package/dist/ingestion/pipeline.d.ts.map +1 -0
  70. package/dist/ingestion/pipeline.js +191 -0
  71. package/dist/ingestion/pipeline.js.map +1 -0
  72. package/dist/ingestion/scanner.d.ts +2 -0
  73. package/dist/ingestion/scanner.d.ts.map +1 -0
  74. package/dist/ingestion/scanner.js +54 -0
  75. package/dist/ingestion/scanner.js.map +1 -0
  76. package/dist/mcp/server.d.ts +8 -0
  77. package/dist/mcp/server.d.ts.map +1 -0
  78. package/dist/mcp/server.js +73 -0
  79. package/dist/mcp/server.js.map +1 -0
  80. package/dist/mcp/tools.d.ts +6 -0
  81. package/dist/mcp/tools.d.ts.map +1 -0
  82. package/dist/mcp/tools.js +276 -0
  83. package/dist/mcp/tools.js.map +1 -0
  84. package/dist/rag/context-builder.d.ts +3 -0
  85. package/dist/rag/context-builder.d.ts.map +1 -0
  86. package/dist/rag/context-builder.js +27 -0
  87. package/dist/rag/context-builder.js.map +1 -0
  88. package/dist/rag/prompt-templates.d.ts +5 -0
  89. package/dist/rag/prompt-templates.d.ts.map +1 -0
  90. package/dist/rag/prompt-templates.js +41 -0
  91. package/dist/rag/prompt-templates.js.map +1 -0
  92. package/dist/search/hybrid.d.ts +14 -0
  93. package/dist/search/hybrid.d.ts.map +1 -0
  94. package/dist/search/hybrid.js +58 -0
  95. package/dist/search/hybrid.js.map +1 -0
  96. package/dist/search/query.d.ts +4 -0
  97. package/dist/search/query.d.ts.map +1 -0
  98. package/dist/search/query.js +23 -0
  99. package/dist/search/query.js.map +1 -0
  100. package/dist/search/reranker.d.ts +11 -0
  101. package/dist/search/reranker.d.ts.map +1 -0
  102. package/dist/search/reranker.js +44 -0
  103. package/dist/search/reranker.js.map +1 -0
  104. package/dist/store/db.d.ts +11 -0
  105. package/dist/store/db.d.ts.map +1 -0
  106. package/dist/store/db.js +75 -0
  107. package/dist/store/db.js.map +1 -0
  108. package/dist/store/reader.d.ts +8 -0
  109. package/dist/store/reader.d.ts.map +1 -0
  110. package/dist/store/reader.js +122 -0
  111. package/dist/store/reader.js.map +1 -0
  112. package/dist/store/schema.d.ts +39 -0
  113. package/dist/store/schema.d.ts.map +1 -0
  114. package/dist/store/schema.js +33 -0
  115. package/dist/store/schema.js.map +1 -0
  116. package/dist/store/writer.d.ts +6 -0
  117. package/dist/store/writer.d.ts.map +1 -0
  118. package/dist/store/writer.js +43 -0
  119. package/dist/store/writer.js.map +1 -0
  120. package/dist/watcher/daemon.d.ts +5 -0
  121. package/dist/watcher/daemon.d.ts.map +1 -0
  122. package/dist/watcher/daemon.js +43 -0
  123. package/dist/watcher/daemon.js.map +1 -0
  124. package/dist/watcher/handler.d.ts +14 -0
  125. package/dist/watcher/handler.d.ts.map +1 -0
  126. package/dist/watcher/handler.js +82 -0
  127. package/dist/watcher/handler.js.map +1 -0
  128. package/package.json +56 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [Unreleased]
11
+
12
+ ### Added
13
+
14
+ ### Changed
15
+
16
+ ### Fixed
17
+
18
+ ### Deprecated
19
+
20
+ ### Removed
21
+
22
+ ### Security
23
+
24
+ ---
25
+
26
+ ## [0.1.0] - 2026-03-17
27
+
28
+ ### Added
29
+ - Local semantic search engine for Markdown files (`sqmd` CLI)
30
+ - Ingestion pipeline: directory scanner, remark-based Markdown parser, token-aware chunker with configurable overlap
31
+ - Content fingerprinting via SHA-256 (`hashFile`, `hashPath`) for incremental re-indexing
32
+ - LanceDB vector store with Apache Arrow schema (`ChunkRecord`, `FileRecord`)
33
+ - HuggingFace Transformers local embeddings with nomic-embed-text asymmetric prefix support (`search_query:` / `search_document:`)
34
+ - Ollama embedding backend alternative
35
+ - Hybrid search combining vector similarity and BM25 full-text search
36
+ - Cross-encoder reranker (`CrossEncoderReranker`) using `@huggingface/transformers` text-classification pipeline
37
+ - REST API via Hono + `@hono/node-server` (search, documents, index status/trigger, health endpoints)
38
+ - MCP server integration for tool-based access
39
+ - File watcher daemon using chokidar for live re-indexing
40
+ - RAG context builder with token-budget capping and attribution (Source / Section / Lines)
41
+ - RAG prompt templates (`ragSystemPrompt`, `formatResults`, `buildRagPrompt`)
42
+ - YAML configuration with Zod validation and env-var overrides
43
+ - Biome 1.9 for lint + format (`npm run check`)
44
+ - Vitest 2.x test suite with workspace projects (`unit` / `integration`) and v8 coverage (80% thresholds)
45
+ - GitHub Actions CI workflow (push/PR: type-check → lint → test → coverage → build)
46
+ - GitHub Actions release workflow (tag `v*.*.*`: test → build → GitHub Release → npm publish with provenance)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 George Liu (eva2000)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.