@hiai-gg/docsmint 0.7.6 → 0.8.2

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 (84) hide show
  1. package/README.md +46 -113
  2. package/dist/backend/index.js +860 -132
  3. package/dist/backend-account-runtime-cleanup.js +2 -0
  4. package/dist/backend-api-key-facade.js +2 -0
  5. package/dist/backend-pipeline-cancellation.js +2 -0
  6. package/dist/client.d.ts +4 -3
  7. package/dist/client.js +9 -6
  8. package/dist/frontend/{CategoryDialog-D_xFSWGh.js → CategoryDialog-B6zqtwE6.js} +2 -2
  9. package/dist/frontend/{ConfirmDialog-Cfq3D2Di.js → ConfirmDialog-Dk7wwcj9.js} +1 -1
  10. package/dist/frontend/{CreateSnapshotDialog-BHODxZWK.js → CreateSnapshotDialog-BPYjO1qN.js} +2 -2
  11. package/dist/frontend/{DatePicker-CZyCnQ1q.js → DatePicker-SiGLx9yh.js} +46 -46
  12. package/dist/frontend/{DeleteDialog-DaJOO6SB.js → DeleteDialog-D1jox8h1.js} +2 -2
  13. package/dist/frontend/{FolderNode-C_91NlEO.js → FolderNode-BG4l6I5C.js} +100 -99
  14. package/dist/frontend/{HiAiEditor-DtUGbQg6.js → HiAiEditor-BpmzvTCP.js} +977 -1008
  15. package/dist/frontend/{SettingsDialog-BlIZqk2-.js → SettingsDialog-2d6ZA4Ze.js} +3 -3
  16. package/dist/frontend/Sidebar-Db_ffhAb.js +2149 -0
  17. package/dist/frontend/{TagCreateDialog-BlGz4O9Z.js → TagCreateDialog-C5j3H49u.js} +2 -2
  18. package/dist/frontend/app-shell.js +3 -3
  19. package/dist/frontend/components/category-dialog.js +1 -1
  20. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  21. package/dist/frontend/components/delete-dialog.js +1 -1
  22. package/dist/frontend/components/editor/compact-editor.js +1 -1
  23. package/dist/frontend/components/editor/document-editor.js +1 -1
  24. package/dist/frontend/components/editor/extensions.js +1 -1
  25. package/dist/frontend/components/editor/markdown-toggle.js +1 -1
  26. package/dist/frontend/components/editor/markdown.js +1 -1
  27. package/dist/frontend/components/folder-node.js +1 -1
  28. package/dist/frontend/components/save-as-dialog.js +2 -2
  29. package/dist/frontend/components/settings.js +1 -1
  30. package/dist/frontend/components/sidebar.js +1 -1
  31. package/dist/frontend/components/tag-create-dialog.js +1 -1
  32. package/dist/frontend/components/version-history.js +3 -3
  33. package/dist/frontend/dashboard.js +1034 -1034
  34. package/dist/frontend/{dialog-tHAH3-9M.js → dialog-DC97Hnxo.js} +1 -1
  35. package/dist/frontend/dist-BLpDfrDC.js +316 -0
  36. package/dist/frontend/dist-D7zL6zdU.js +40 -0
  37. package/dist/frontend/{dist-Cg1BpNS7.js → dist-qd_OnyUC.js} +492 -516
  38. package/dist/frontend/dropdown-menu-COZwS7c0.js +493 -0
  39. package/dist/frontend/editorExtensions-Cu__YKW7.js +158 -0
  40. package/dist/frontend/ellipsis-vertical-CObXWXZW.js +41 -0
  41. package/dist/frontend/frontend.css +1 -1
  42. package/dist/frontend/{editorExtensions-B-mKiWqq.js → lib-DYgslUw1.js} +6782 -6935
  43. package/dist/frontend/loader-circle-DnyUzAmN.js +25 -0
  44. package/dist/frontend/{markdown-CMij27Gg.js → markdown-Co8ZAKf4.js} +2 -1
  45. package/dist/frontend/search.js +2 -2
  46. package/dist/frontend/{confirm-dialog-BFTxjLv-.js → share-context-DooXPYKd.js} +2 -3
  47. package/dist/frontend/theme.js +1 -1
  48. package/dist/frontend/{theme.svelte-Bzitjfh9.js → theme.svelte-gLPpG6eU.js} +1 -0
  49. package/dist/frontend-ssr/app-shell.js +3 -3
  50. package/dist/frontend-ssr/assets/{FolderNode-CClgk8BL.js → FolderNode-CscMQ9sf.js} +2 -1
  51. package/dist/frontend-ssr/assets/{HiAiEditor-_-m7MJDd.js → HiAiEditor-DCpulE6N.js} +4 -50
  52. package/dist/frontend-ssr/assets/{SettingsDialog-BdvHRAxF.js → SettingsDialog-CpPxZahd.js} +1 -1
  53. package/dist/frontend-ssr/assets/{Sidebar-B3Saqn0O.js → Sidebar-BJ1XZ1DH.js} +7 -5
  54. package/dist/frontend-ssr/assets/dist-CshZmNmp.js +50 -0
  55. package/dist/frontend-ssr/assets/dist-DqeAICTy.js +300 -0
  56. package/dist/frontend-ssr/assets/{dropdown-menu-CdEpn_LT.js → dropdown-menu--acO7nXs.js} +1 -94
  57. package/dist/frontend-ssr/assets/ellipsis-vertical-BErUuhWg.js +96 -0
  58. package/dist/frontend-ssr/assets/{markdown-MhPwNWrC.js → markdown-Co31-Tl2.js} +1 -1
  59. package/dist/frontend-ssr/assets/{confirm-dialog-DeOR0SnQ.js → share-context-BvXQrIIH.js} +0 -1
  60. package/dist/frontend-ssr/assets/{theme.svelte-shZrSxz8.js → theme.svelte-CGgnJc3k.js} +1 -0
  61. package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
  62. package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
  63. package/dist/frontend-ssr/components/editor/extensions.js +1 -1
  64. package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
  65. package/dist/frontend-ssr/components/editor/markdown.js +1 -1
  66. package/dist/frontend-ssr/components/folder-node.js +1 -1
  67. package/dist/frontend-ssr/components/settings.js +1 -1
  68. package/dist/frontend-ssr/components/sidebar.js +1 -1
  69. package/dist/frontend-ssr/dashboard.js +6 -4
  70. package/dist/frontend-ssr/search.js +1 -1
  71. package/dist/frontend-ssr/theme.js +1 -1
  72. package/dist/lifecycle-runtime.js +42 -4
  73. package/dist/mcp-cli.js +9 -6
  74. package/dist/mcp-server.js +9 -6
  75. package/dist/types.d.ts +12 -0
  76. package/package.json +1 -1
  77. package/packages/cli/src/index.ts +1 -1
  78. package/packages/db/src/schema.ts +2 -0
  79. package/server.json +2 -2
  80. package/skills/docsmint-document-manager/SKILL.md +2 -2
  81. package/dist/frontend/Sidebar-BVGm5BRR.js +0 -2147
  82. package/dist/frontend/dropdown-menu-AJYeFPHu.js +0 -530
  83. package/dist/frontend-ssr/assets/{DatePicker-TZVeMZ2S.js → DatePicker-CCylVH0q.js} +12 -12
  84. package/dist/frontend-ssr/assets/{editorExtensions-qNlZVP98.js → editorExtensions-rhletNji.js} +1 -1
package/README.md CHANGED
@@ -6,9 +6,9 @@ applications, and AI agents.**
6
6
  DocsMint stores documents in a structured JSON editor model first. Markdown is
7
7
  the convenient second format for editing, importing, and exporting content.
8
8
  Automatic chunking, 1024-dimensional embeddings, multilingual hybrid search,
9
- and GraphRAG make the same knowledge base useful to people, applications, and
10
- agents through the web application, REST API, TypeScript SDK, CLI, and MCP
11
- server.
9
+ GraphRAG, and cross-encoder rerank make the same knowledge base useful to
10
+ people, applications, and agents through the web application, REST API,
11
+ TypeScript SDK, CLI, and MCP server.
12
12
 
13
13
  [![Apache-2.0 License](https://img.shields.io/badge/License-Apache--2.0-green.svg)](LICENSE)
14
14
  [![Release](https://img.shields.io/github/v/release/hiai-gg/docsmint?sort=semver)](https://github.com/hiai-gg/docsmint/releases)
@@ -36,7 +36,8 @@ server.
36
36
 
37
37
  - **Write naturally** in a rich visual editor or raw Markdown.
38
38
  - **Find meaning, not only keywords** with exact, lexical, fuzzy, vector,
39
- multilingual expansion, and graph retrieval fused through RRF.
39
+ multilingual expansion, and graph retrieval fused through RRF, then
40
+ reranked with a cross-encoder (Voyage rerank-2.5 in the reference profile).
40
41
  - **Keep retrieval current** with automatic, incremental chunking and
41
42
  re-embedding after document or metadata changes.
42
43
  - **Connect agents directly** through REST, a typed SDK, CLI, or MCP.
@@ -45,46 +46,20 @@ server.
45
46
  - **Own the full stack**: application data, vectors, graph, queue, and files run
46
47
  on infrastructure you control.
47
48
 
48
- ## What's new in 0.7.6?
49
+ ## What's new in 0.8.2?
49
50
 
50
- - **MCP Registry description fits the 100-character limit**, so official
51
- catalog publication can complete after 0.7.3 reached npm.
51
+ - **Correct rerank identity.** Empty candidates can no longer shift provider
52
+ scores onto the wrong document ID; partial and invalid provider responses
53
+ still preserve stable RRF fallback order.
54
+ - **Recover optional AI stages safely.** Pipeline status includes typed graph
55
+ and summary warnings, and the API or SDK can retry only failed enrichment on
56
+ the current embedding generation without rebuilding ready chunks.
57
+ - **Reliable public frontend imports.** The standalone frontend consumes only
58
+ published `hiai-ui` exports, with no source or distribution aliases.
52
59
 
53
- ## What's new in 0.7.3?
54
-
55
- - **One public-link share dialog in OSS.** Dashboard, sidebar (including Recent),
56
- and the editor open the same public token share. Hosts can opt into restricted
57
- admission from `DocsmintAppShellHost`.
58
- - **Dialogs stay in their overlays** after hiai-ui 0.1, and nested routes load
59
- CSS from `/_app` instead of `./_app`.
60
- - **hiai-ui 0.1.3** for circular theme spread; Inter remains the product UI
61
- typeface.
62
-
63
- ## What's new in 0.7.2?
64
-
65
- - **Share view matches the editor.** Twitter/Twemoji SVG emoji images no longer
66
- expand across the public share column; they render as ordinary glyphs.
67
- - **Inter in the workspace chrome.** The sidebar uses the same Inter UI typeface
68
- as docsmint.com instead of the operating-system sans stack.
69
- - **MCP catalog 0.7.2.** Registry, LobeHub, and runtime metadata ship the dark
70
- catalog logo and the current product-aligned description.
71
-
72
- ## What's new in 0.7.0?
73
-
74
- - **Signed workspace assertions.** Trusted server-to-server hosts can restrict
75
- an assertion to one category with independent `read`, `edit`, and `write`
76
- permissions. An omitted scope remains workspace-wide and role-derived.
77
- - **Consistent effective-category authorization.** Direct and folder-inherited
78
- categories are enforced before counts, pagination, indexing, search, and
79
- GraphRAG retrieval. Index status is read-only; refresh requires write.
80
- - **Release-safe indexing.** Context-aware embedding generations and recovery
81
- prevent stale metadata work from becoming active.
82
-
83
- This OSS release adds no host RBAC, billing, invitations, or product UI. The
84
- 0.6.x reliability work — workspace-safe reindex, HTTPS sessions, trash-aware
85
- retrieval, explicit GraphRAG providers, MCP Registry identity, and the
86
- installable PWA — ships in this line. See the [changelog](CHANGELOG.md) for
87
- the complete history and the [roadmap](docs/ROADMAP.md) for what comes next.
60
+ Read the complete release history in the [changelog](CHANGELOG.md) or
61
+ [GitHub Releases](https://github.com/HiAi-gg/docsmint/releases). See the
62
+ [roadmap](docs/ROADMAP.md) for what comes next.
88
63
 
89
64
  ## Fastest installation: give this prompt to your agent
90
65
 
@@ -137,7 +112,7 @@ docker pull vgalibov/docsmint:web-latest
137
112
  docker pull vgalibov/docsmint:caddy-latest
138
113
  ```
139
114
 
140
- Use versioned tags such as `api-v0.7.6` for reproducible deploys. The
115
+ Use versioned tags such as `api-v0.8.1` for reproducible deploys. The
141
116
  quickstart still builds the Compose stack from this repository so PostgreSQL,
142
117
  Redis, and SeaweedFS start together with the application.
143
118
 
@@ -219,10 +194,24 @@ command and configuration precedence.
219
194
 
220
195
  ## Connect an MCP client
221
196
 
222
- DocsMint exposes document search, reading, creation, updates, categories,
223
- folders, tags, GraphRAG traversal, index status and refresh, snapshots,
224
- history, and export as MCP tools. It also publishes reusable prompts,
225
- context resources, and a document-manager skill for agent clients.
197
+ Give agents a secure path to search, read, and maintain your knowledge without
198
+ database or filesystem access. DocsMint publishes 17 tools plus ready-made
199
+ research prompts, scoped resources, and a document-manager skill.
200
+
201
+ ### Hosted DocsMint
202
+
203
+ Connect directly to the managed Streamable HTTP endpoint. Keep the API key in
204
+ an environment variable rather than writing it into client configuration:
205
+
206
+ ```bash
207
+ codex mcp add docsmint \
208
+ --url https://docsmint.com/mcp \
209
+ --bearer-token-env-var HIAI_DOCS_API_KEY
210
+ ```
211
+
212
+ ### Self-hosted DocsMint
213
+
214
+ Run the published stdio bridge against your own DocsMint API:
226
215
 
227
216
  ```json
228
217
  {
@@ -239,70 +228,10 @@ context resources, and a document-manager skill for agent clients.
239
228
  }
240
229
  ```
241
230
 
242
- Run the server directly to verify the installation:
243
-
244
- ```bash
245
- npx -y @hiai-gg/docsmint docsmint-mcp
246
- ```
247
-
248
- `npx` is the install path LobeHub and Node MCP clients validate. Bun checkouts can use
249
- `bunx --package @hiai-gg/docsmint docsmint-mcp` instead. The process speaks MCP on
250
- stdio and advertises tools, prompts, and resources without a running DocsMint API.
251
-
252
- The server uses stdio and works with MCP-capable clients such as Claude
253
- Desktop, Cursor, and coding agents that accept standard MCP configuration. See
254
- the [MCP guide](packages/mcp-server/README.md) for its 17 tools, prompts,
255
- resources, skill, and API routes.
256
-
257
- ## MCP Features
258
-
259
- ### Tools (17)
260
-
261
- - `search_documents`: Hybrid search (full-text + semantic pgvector).
262
- - `get_document`: Fetch document content and metadata.
263
- - `create_document`: Create a document with optional markdown, folder, and category.
264
- - `update_document`: Update title, content, folder, or category (new version on each save).
265
- - `list_documents`: Paginated document list, optionally filtered by folder or tag.
266
- - `list_folders`: List folders, optionally under a parent.
267
- - `create_folder`: Create a folder, optionally nested.
268
- - `create_snapshot`: Create a named snapshot of the current document.
269
- - `get_version_history`: List versions, optionally snapshots only.
270
- - `export_document`: Export a document as Markdown.
271
- - `list_categories`: List categories visible to the API key.
272
- - `create_category`: Create a category (workspace key with write access).
273
- - `list_tags`: List tags in the workspace or bound category.
274
- - `get_related_documents`: Traverse the knowledge graph from one authorized document.
275
- - `search_knowledge_graph`: Search connected knowledge from authorized seed documents.
276
- - `get_document_index_status`: Read indexing and knowledge-pipeline status.
277
- - `refresh_document_index`: Request reindexing after a document or metadata change.
278
-
279
- ### Prompts (2)
280
-
281
- - `organize_workspace`: Plan safe document organization using DocsMint categories and folders.
282
- - `research_workspace`: Research a question with hybrid search and GraphRAG citing document IDs.
283
-
284
- ### Resources (3)
285
-
286
- - `docsmint://guide/editor`: Editor usage guide.
287
- - `docsmint://guide/search`: Search and GraphRAG guide.
288
- - `docsmint://workspace/catalog`: Live scoped workspace catalog.
289
-
290
- ### Skills (1)
291
-
292
- - [`docsmint-document-manager`](skills/docsmint-document-manager/SKILL.md):
293
- create, organize, edit, and research DocsMint documents through the 17 MCP
294
- tools, including hybrid search, GraphRAG, and index refresh.
295
-
296
- The same Skill ships in the npm package under `skills/docsmint-document-manager/SKILL.md`.
297
-
298
- ## Agent skills after installation
299
-
300
- The MCP tools are the recommended portable agent skills. A category-bound agent
301
- can receive only the knowledge and operations it needs; a trusted personal
302
- agent can use a global key. Agents do not need database or filesystem access.
303
- After startup, create an API key in **Settings → API** and add the MCP block
304
- above to the agent client. For custom agent workflows, use the same key through
305
- the CLI, SDK, or REST API.
231
+ Category keys let you expose only the documents and operations an agent needs.
232
+ Use a global key only for trusted owner-wide automation. See the
233
+ [complete MCP reference](packages/mcp-server/README.md) for Bun, npm, local
234
+ checkout, all tools, prompts, resources, permissions, and REST mappings.
306
235
 
307
236
  ## TypeScript SDK
308
237
 
@@ -382,8 +311,12 @@ previous valid generation remains searchable if a provider call fails.
382
311
  Search combines exact title matches, multilingual lexical search, typo-tolerant
383
312
  fuzzy matching, semantic vectors, adaptive query expansion, and Apache AGE
384
313
  graph neighbors. Reciprocal rank fusion combines the channels without allowing
385
- one weak provider result to dominate. Authorization is applied before retrieval
386
- and again before results are returned.
314
+ one weak provider result to dominate. A cross-encoder then reranks the fused
315
+ prefix against the original query (Voyage rerank-2.5 by default). On a labeled
316
+ 24-document corpus that moved MRR 0.969 → 1.000 and nDCG@10 0.958 → 0.986
317
+ versus RRF-only. Rerank, expansion, embeddings, and AGE failures keep the
318
+ remaining channels. Authorization is applied before retrieval and again before
319
+ results are returned.
387
320
 
388
321
  GraphRAG is part of the normal search path in the reference configuration. It
389
322
  extracts entities after embeddings are ready and finds related documents beyond