@hiai-gg/docsmint 0.5.10 → 0.6.1

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 (54) hide show
  1. package/LICENSE +39 -8
  2. package/README.md +90 -46
  3. package/dist/backend/index.js +797 -136
  4. package/dist/backend-account-runtime-cleanup.js +17 -0
  5. package/dist/backend-api-key-facade.js +17 -0
  6. package/dist/backend-pipeline-cancellation.js +17 -0
  7. package/dist/client.d.ts +6 -1
  8. package/dist/client.js +11 -0
  9. package/dist/frontend/HiAiEditor-DSVG3GNd.js +2986 -0
  10. package/dist/frontend/SettingsDialog-BDNgf5rv.js +969 -0
  11. package/dist/frontend/ShareDialog-2Mty7hm4.js +258 -0
  12. package/dist/frontend/{Sidebar-CzcLd6v5.js → Sidebar-DX08utdV.js} +2 -2
  13. package/dist/frontend/app-shell.js +27 -26
  14. package/dist/frontend/components/editor/compact-editor.d.ts +3 -0
  15. package/dist/frontend/components/editor/compact-editor.js +36 -0
  16. package/dist/frontend/components/editor/document-editor.js +2 -2986
  17. package/dist/frontend/components/settings.js +1 -1
  18. package/dist/frontend/components/share-dialog.d.ts +2 -1
  19. package/dist/frontend/components/share-dialog.js +1 -1
  20. package/dist/frontend/components/sidebar.js +1 -1
  21. package/dist/frontend/dashboard.js +1 -1
  22. package/dist/frontend/editor-preferences.d.ts +4 -0
  23. package/dist/frontend/editor-preferences.js +2 -0
  24. package/dist/frontend/editor-preferences.svelte-Bt_A9k7n.js +61 -0
  25. package/dist/frontend/frontend.css +1 -1
  26. package/dist/frontend-ssr/app-shell.js +3 -2
  27. package/dist/frontend-ssr/assets/HiAiEditor-CUOJmKzT.js +2358 -0
  28. package/dist/frontend-ssr/assets/{SettingsDialog-DVp0OxPO.js → SettingsDialog-BjJIiVLc.js} +2 -64
  29. package/dist/frontend-ssr/assets/{ShareDialog-BZd28sg-.js → ShareDialog-C9C-XTm4.js} +1 -1
  30. package/dist/frontend-ssr/assets/{Sidebar-CqsMw0Hd.js → Sidebar-C2sUfGNk.js} +2 -2
  31. package/dist/frontend-ssr/assets/editor-preferences.svelte-iI5jJM1x.js +65 -0
  32. package/dist/frontend-ssr/components/editor/compact-editor.js +19 -0
  33. package/dist/frontend-ssr/components/editor/document-editor.js +1 -2357
  34. package/dist/frontend-ssr/components/settings.js +1 -1
  35. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  36. package/dist/frontend-ssr/components/sidebar.js +1 -1
  37. package/dist/frontend-ssr/dashboard.js +1 -1
  38. package/dist/frontend-ssr/editor-preferences.js +2 -0
  39. package/dist/lifecycle-runtime.js +16 -0
  40. package/dist/types.d.ts +31 -0
  41. package/package.json +20 -2
  42. package/packages/cli/src/index.ts +1 -1
  43. package/packages/db/src/index.ts +16 -7
  44. package/packages/db/src/schema.ts +34 -0
  45. package/packages/mcp-server/src/capabilities.ts +165 -0
  46. package/packages/mcp-server/src/client.ts +191 -138
  47. package/packages/mcp-server/src/index.ts +4 -104
  48. package/packages/mcp-server/src/server.ts +82 -0
  49. package/packages/mcp-server/src/tools/create-document.ts +26 -19
  50. package/packages/mcp-server/src/tools/create-folder.ts +19 -12
  51. package/packages/mcp-server/src/tools/update-document.ts +31 -17
  52. package/skills/docsmint-document-manager/SKILL.md +33 -0
  53. package/dist/frontend/SettingsDialog-CyZSOjLE.js +0 -1024
  54. package/dist/frontend/ShareDialog-BC-Jl6v1.js +0 -257
package/LICENSE CHANGED
@@ -1,4 +1,5 @@
1
- Apache License
1
+
2
+ Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
4
5
 
@@ -34,7 +35,8 @@ Apache License
34
35
 
35
36
  "Work" shall mean the work of authorship, whether in Source or
36
37
  Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work.
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
38
40
 
39
41
  "Derivative Works" shall mean any work, whether in Source or Object
40
42
  form, that is based on (or derived from) the Work and for which the
@@ -90,16 +92,17 @@ Apache License
90
92
  modifications, and in Source or Object form, provided that You
91
93
  meet the following conditions:
92
94
 
93
- (a) You must give any other recipients of the Work or Derivative Works
94
- a copy of this License; and
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
95
97
 
96
98
  (b) You must cause any modified files to carry prominent notices
97
99
  stating that You changed the files; and
98
100
 
99
- (c) You must retain, in the Source form of any Derivative Works that
100
- You distribute, all copyright, patent, trademark, and attribution
101
- notices from the Source form of the Work, excluding those notices
102
- that do not pertain to any part of the Derivative Works; and
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
103
106
 
104
107
  (d) If the Work includes a "NOTICE" text file as part of its
105
108
  distribution, then any Derivative Works that You distribute must
@@ -129,6 +132,9 @@ Apache License
129
132
  any Contribution intentionally submitted for inclusion in the Work
130
133
  by You to the Licensor shall be under the terms and conditions of
131
134
  this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
132
138
 
133
139
  6. Trademarks. This License does not grant permission to use the trade
134
140
  names, trademarks, service marks, or product names of the Licensor,
@@ -169,3 +175,28 @@ Apache License
169
175
  of your accepting any such warranty or additional liability.
170
176
 
171
177
  END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # DocsMint
2
2
 
3
- **A self-hosted, AI-native knowledge workspace for people, applications, and agents.**
3
+ **A self-hosted AI-native knowledge workspace and installable PWA for people,
4
+ applications, and AI agents.**
4
5
 
5
6
  DocsMint stores documents in a structured JSON editor model first. Markdown is
6
7
  the convenient second format for editing, importing, and exporting content.
@@ -22,6 +23,7 @@ server.
22
23
  [![Tailwind_CSS](https://img.shields.io/badge/Tailwind_CSS-v4-06B6D4?logo=tailwindcss&logoColor=white)](https://tailwindcss.com)
23
24
  [![Drizzle_ORM](https://img.shields.io/badge/Drizzle_ORM-0.45-C5F74F?logo=drizzle&logoColor=black)](https://orm.drizzle.team)
24
25
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
26
+ [![MCP Badge](https://lobehub.com/badge/mcp/hiai-gg-docsmint?style=plastic)](https://lobehub.com/mcp/hiai-gg-docsmint)
25
27
 
26
28
  <img width="1920" height="974" alt="DocsMint installable document workspace" src="https://github.com/user-attachments/assets/94701d01-a361-4ca1-b16d-de2a0c64d684" />
27
29
 
@@ -38,24 +40,52 @@ server.
38
40
  - **Own the full stack**: application data, vectors, graph, queue, and files run
39
41
  on infrastructure you control.
40
42
 
41
- ## What is new in the 0.3.0 release line?
42
-
43
- - **Installable Progressive Web App (PWA)** with a manifest, service worker,
44
- responsive mobile shell, install prompt, update safety, and an offline
45
- fallback shell.
46
- - **Offline document access** through identity-partitioned IndexedDB/Dexie
47
- snapshots. Offline mode is cached read plus explicit local drafts; reconnect
48
- never silently replays mutations.
49
- - **Explicit local drafts** with local autosave, review/apply, optimistic
50
- concurrency (`expectedUpdatedAt`), and actionable conflict handling.
51
- - **Composable self-hosted UI** with typed dashboard/search hosts and extension
52
- slots.
53
- - **Mobile-first editor polish** including a single responsive sidebar, safe
54
- PWA updates, raw Markdown auto-height, and accessible narrow-screen controls.
55
-
56
- Search terms: installable self-hosted PWA knowledge base, offline document
57
- reading, local drafts, semantic multilingual search, GraphRAG, MCP, TypeScript
58
- SDK, CLI, and frontend extension hosts.
43
+ ## What's new in DocsMint 0.6.1?
44
+
45
+ - **Reliable knowledge refreshes.** Explicit full reindexing now supersedes
46
+ failed or stuck generations, retries release stale extraction claims, and
47
+ publishes embeddings, summaries, and graph projections only for the current
48
+ document generation.
49
+ - **Safer scoped automation.** Global keys can manage the complete document
50
+ domain, while category keys stay confined to their category, folders,
51
+ documents, tags, graph traversal, and index operations according to explicit
52
+ `read`, `edit`, and `write` permissions.
53
+ - **Portable agent integration.** The MCP package exposes 17 document-manager
54
+ tools, two reusable prompts, three context resources, and a bundled Skill,
55
+ with Bunx, NPX, and local-checkout installation paths.
56
+ - **Compatible frontend packaging.** Published frontend entrypoints resolve the
57
+ canonical hiai-ui exports used by the source build and packed consumers.
58
+
59
+ DocsMint 0.6.1 includes the mobile and PWA foundation introduced in 0.6.0:
60
+
61
+ - **Installable, update-safe PWA.** A versioned service worker, responsive app
62
+ shell, install prompt, and deterministic offline fallback make DocsMint feel
63
+ at home on desktop and mobile browsers.
64
+ - **Private offline reading and explicit drafts.** Identity-partitioned local
65
+ snapshots keep selected documents readable offline. Drafts autosave locally,
66
+ then return through a deliberate review-and-apply flow after reconnecting;
67
+ DocsMint never silently replays offline mutations.
68
+ - **Touch-safe mobile navigation.** Sidebar document actions, Copy controls, and
69
+ overflow menus remain reachable on touch devices without depending on hover,
70
+ with accessible targets and narrow-screen layouts.
71
+ - **A flexible editor contract.** Reactive visual/Markdown mode preferences,
72
+ Minimal toolbar support, and a reusable compact TipTap editor let hosts match
73
+ the writing surface to the task without forking editor internals.
74
+ - **Stable document discovery.** The public API and TypeScript SDK provide
75
+ deterministic cursor pagination and global sorting by title, category,
76
+ folder, or update time, with canonical category and folder metadata.
77
+ - **Clear public and restricted sharing.** Share creation exposes the resulting
78
+ URL for both public links and restricted invitation workflows, with an
79
+ explicit Copy action that works on narrow screens.
80
+ - **Knowledge built for agents.** REST, the typed SDK, CLI, and MCP server expose
81
+ scoped document operations, while multilingual hybrid search and GraphRAG
82
+ help people and AI agents retrieve connected knowledge instead of isolated
83
+ keyword matches.
84
+
85
+ DocsMint combines an installable self-hosted PWA knowledge base, mobile document
86
+ workspace, offline reading, local drafts, multilingual semantic search,
87
+ GraphRAG, MCP, a TypeScript SDK, CLI, and composable frontend hosts in one
88
+ open-source system.
59
89
 
60
90
  For self-hosted customization, see [PWA hosting](docs/PWA_HOSTING.md) and
61
91
  [extension points](docs/EXTENDING.md).
@@ -96,6 +126,7 @@ git clone https://github.com/HiAi-gg/docsmint.git
96
126
  cd docsmint
97
127
  bash scripts/quickstart.sh
98
128
  ```
129
+
99
130
  On its first run, the script creates an ignored root `.env`, generates the
100
131
  database, authentication, and storage secrets, builds the PostgreSQL image,
101
132
  applies migrations, and starts the complete application.
@@ -105,12 +136,14 @@ For OpenRouter, add one value to `.env` and run the script again:
105
136
  ```dotenv
106
137
  OPENROUTER_API_KEY=sk-or-your-key
107
138
  ```
139
+
108
140
  For Ollama, select the local provider instead:
109
141
 
110
142
  ```dotenv
111
143
  AI_PROVIDER=ollama
112
144
  OLLAMA_PORT=11434
113
145
  ```
146
+
114
147
  Then make sure the configured local models are available:
115
148
 
116
149
  ```bash
@@ -118,6 +151,7 @@ ollama pull bge-m3
118
151
  ollama pull qwen3:8b
119
152
  bash scripts/quickstart.sh
120
153
  ```
154
+
121
155
  Open **http://localhost:50701**. The API health endpoint is
122
156
  **http://localhost:50700/api/health**.
123
157
 
@@ -133,14 +167,14 @@ Open **http://localhost:50701**. The API health endpoint is
133
167
 
134
168
  The canonical local ports are:
135
169
 
136
- | Service | Port |
137
- |---|---:|
138
- | Web application | `50701` |
139
- | REST API | `50700` |
140
- | PostgreSQL | `5437` |
141
- | Redis | `6384` |
170
+ | Service | Port |
171
+ | -------------------- | ------: |
172
+ | Web application | `50701` |
173
+ | REST API | `50700` |
174
+ | PostgreSQL | `5437` |
175
+ | Redis | `6384` |
142
176
  | SeaweedFS S3 gateway | `50702` |
143
- | SeaweedFS filer UI | `50703` |
177
+ | SeaweedFS filer UI | `50703` |
144
178
 
145
179
  See [Deployment](docs/DEPLOYMENT.md) for domains, TLS, provider tuning,
146
180
  backups, and production operation.
@@ -165,14 +199,17 @@ bunx --package @hiai-gg/docsmint docsmint read <document-id>
165
199
  bunx --package @hiai-gg/docsmint docsmint create \
166
200
  --title "Release notes" --content "# Version 0.2.9"
167
201
  ```
202
+
168
203
  Credentials can also be supplied through `HIAI_DOCS_URL` and
169
204
  `HIAI_DOCS_API_KEY`. See the [CLI guide](packages/cli/README.md) for every
170
205
  command and configuration precedence.
171
206
 
172
207
  ## Connect an MCP client
173
208
 
174
- DocsMint exposes document search, reading, creation, updates, folders,
175
- snapshots, history, and export as MCP tools.
209
+ DocsMint exposes document search, reading, creation, updates, categories,
210
+ folders, tags, GraphRAG traversal, index status and refresh, snapshots,
211
+ history, and export as MCP tools. It also publishes reusable prompts,
212
+ context resources, and a document-manager skill for agent clients.
176
213
 
177
214
  ```json
178
215
  {
@@ -188,14 +225,17 @@ snapshots, history, and export as MCP tools.
188
225
  }
189
226
  }
190
227
  ```
228
+
191
229
  Run the server directly to verify the installation:
192
230
 
193
231
  ```bash
194
232
  bunx --package @hiai-gg/docsmint docsmint-mcp
195
233
  ```
234
+
196
235
  The server uses stdio and works with MCP-capable clients such as Claude
197
236
  Desktop, Cursor, and coding agents that accept standard MCP configuration. See
198
- the [MCP guide](packages/mcp-server/README.md) for its ten tools and routes.
237
+ the [MCP guide](packages/mcp-server/README.md) for its 17 tools, prompts,
238
+ resources, skill, and API routes.
199
239
 
200
240
  ## Agent skills after installation
201
241
 
@@ -211,22 +251,24 @@ the CLI, SDK, or REST API.
211
251
  ```bash
212
252
  bun add @hiai-gg/docsmint
213
253
  ```
254
+
214
255
  ```ts
215
- import { DocsClient } from "@hiai-gg/docsmint";
256
+ import { DocsClient } from '@hiai-gg/docsmint';
216
257
 
217
258
  const docs = new DocsClient({
218
- baseUrl: "http://localhost:50700",
259
+ baseUrl: 'http://localhost:50700',
219
260
  apiKey: process.env.HIAI_DOCS_API_KEY,
220
261
  });
221
262
 
222
263
  const created = await docs.createDoc({
223
- title: "Meeting notes",
224
- content: "# Agenda",
264
+ title: 'Meeting notes',
265
+ content: '# Agenda',
225
266
  });
226
267
 
227
- const results = await docs.search("what did we decide?");
268
+ const results = await docs.search('what did we decide?');
228
269
  console.log(created.id, results.items);
229
270
  ```
271
+
230
272
  The SDK is a typed `fetch` client with retries for transient failures. See the
231
273
  [SDK reference](packages/sdk/README.md) and [REST API](docs/API.md).
232
274
 
@@ -234,11 +276,11 @@ The SDK is a typed `fetch` client with retries for transient failures. See the
234
276
 
235
277
  Create and revoke integration keys from **Settings → API**.
236
278
 
237
- | Credential | Intended use | Access |
238
- |---|---|---|
239
- | Global API key | Trusted owner-wide CLI, MCP, SDK, or service | All owner content |
240
- | Category key | Least-privilege agent or product integration | One category with selected permissions |
241
- | Operator key | Administration and reindex operations | `/api/admin/*` only |
279
+ | Credential | Intended use | Access |
280
+ | -------------- | -------------------------------------------- | -------------------------------------- |
281
+ | Global API key | Trusted owner-wide CLI, MCP, SDK, or service | All owner content |
282
+ | Category key | Least-privilege agent or product integration | One category with selected permissions |
283
+ | Operator key | Administration and reindex operations | `/api/admin/*` only |
242
284
 
243
285
  Category permissions are explicit and non-hierarchical:
244
286
 
@@ -263,6 +305,7 @@ packages/cli/ Terminal client
263
305
  packages/mcp-server/ MCP stdio server
264
306
  postgres/ PostgreSQL image with vector and graph extensions
265
307
  ```
308
+
266
309
  The Docker deployment runs:
267
310
 
268
311
  - **Web** — document editor, folders, categories, sharing, settings, and search;
@@ -307,13 +350,13 @@ For pipeline internals and tuning, see [Architecture](docs/ARCHITECTURE.md) and
307
350
  DocsMint overlaps with several excellent open-source knowledge tools, but its
308
351
  focus is a compact knowledge runtime shared equally by humans and agents.
309
352
 
310
- | Project | Primary strength | Difference from DocsMint |
311
- |---|---|---|
312
- | [Outline](https://github.com/outline/outline) | Polished team wiki and collaboration | DocsMint emphasizes built-in retrieval, GraphRAG, scoped agent access, CLI, and MCP |
313
- | [Docmost](https://github.com/docmost/docmost) | Collaborative wiki and real-time editing | DocsMint centers automatic embeddings and agent-facing integration surfaces |
314
- | [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy) | Broad local-first productivity workspace | DocsMint is narrower: a self-hosted document and retrieval service |
315
- | [AnythingLLM](https://github.com/Mintplex-Labs/anything-llm) | Chat-oriented RAG over imported sources | DocsMint starts with the editable knowledge base and exposes it to many clients |
316
- | [Danswer](https://github.com/danswer-ai/danswer) / Onyx | Enterprise search across external connectors | DocsMint owns and edits its native corpus rather than primarily indexing other systems |
353
+ | Project | Primary strength | Difference from DocsMint |
354
+ | ------------------------------------------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------- |
355
+ | [Outline](https://github.com/outline/outline) | Polished team wiki and collaboration | DocsMint emphasizes built-in retrieval, GraphRAG, scoped agent access, CLI, and MCP |
356
+ | [Docmost](https://github.com/docmost/docmost) | Collaborative wiki and real-time editing | DocsMint centers automatic embeddings and agent-facing integration surfaces |
357
+ | [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy) | Broad local-first productivity workspace | DocsMint is narrower: a self-hosted document and retrieval service |
358
+ | [AnythingLLM](https://github.com/Mintplex-Labs/anything-llm) | Chat-oriented RAG over imported sources | DocsMint starts with the editable knowledge base and exposes it to many clients |
359
+ | [Danswer](https://github.com/danswer-ai/danswer) / Onyx | Enterprise search across external connectors | DocsMint owns and edits its native corpus rather than primarily indexing other systems |
317
360
 
318
361
  This is a product-positioning summary, not a claim that every listed project
319
362
  lacks a feature. Check each project's current documentation when choosing a
@@ -340,6 +383,7 @@ bun run typecheck
340
383
  bun run test
341
384
  bun run build
342
385
  ```
386
+
343
387
  Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. Please
344
388
  report vulnerabilities through [SECURITY.md](SECURITY.md), not a public issue.
345
389