@hiai-gg/docsmint 0.6.0 → 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.
- package/README.md +24 -4
- package/dist/backend/index.js +753 -125
- package/dist/backend-account-runtime-cleanup.js +17 -0
- package/dist/backend-api-key-facade.js +17 -0
- package/dist/backend-pipeline-cancellation.js +17 -0
- package/dist/client.d.ts +4 -1
- package/dist/client.js +9 -0
- package/dist/lifecycle-runtime.js +16 -0
- package/dist/types.d.ts +26 -0
- package/package.json +5 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/index.ts +16 -7
- package/packages/db/src/schema.ts +34 -0
- package/packages/mcp-server/src/capabilities.ts +165 -0
- package/packages/mcp-server/src/client.ts +191 -138
- package/packages/mcp-server/src/index.ts +4 -104
- package/packages/mcp-server/src/server.ts +82 -0
- package/packages/mcp-server/src/tools/create-document.ts +26 -19
- package/packages/mcp-server/src/tools/create-folder.ts +19 -12
- package/packages/mcp-server/src/tools/update-document.ts +31 -17
- package/skills/docsmint-document-manager/SKILL.md +33 -0
|
@@ -3,28 +3,42 @@ import { client } from "../client.js";
|
|
|
3
3
|
import type { DocumentDetail } from "../types.js";
|
|
4
4
|
|
|
5
5
|
export const definition = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
name: "update_document",
|
|
7
|
+
description:
|
|
8
|
+
"Update an existing document's title and/or content. The server creates a new version on each update.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
id: z.string().describe("Document ID to update."),
|
|
11
|
+
title: z.string().optional().describe("New title for the document."),
|
|
12
|
+
content: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("New markdown content for the document."),
|
|
16
|
+
folderId: z
|
|
17
|
+
.string()
|
|
18
|
+
.nullable()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Move the document to a folder."),
|
|
21
|
+
categoryId: z
|
|
22
|
+
.string()
|
|
23
|
+
.nullable()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe(
|
|
26
|
+
"Move the document to a category. Category keys cannot escape their configured category.",
|
|
27
|
+
),
|
|
28
|
+
},
|
|
17
29
|
} as const;
|
|
18
30
|
|
|
19
31
|
export interface UpdateDocumentArgs {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
id: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
content?: string;
|
|
35
|
+
folderId?: string | null;
|
|
36
|
+
categoryId?: string | null;
|
|
23
37
|
}
|
|
24
38
|
|
|
25
39
|
export async function handler(
|
|
26
|
-
|
|
40
|
+
args: UpdateDocumentArgs,
|
|
27
41
|
): Promise<DocumentDetail> {
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
const { id, ...patch } = args;
|
|
43
|
+
return (await client.updateDocument(id, patch)) as DocumentDetail;
|
|
30
44
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docsmint-document-manager
|
|
3
|
+
description: Manage and research DocsMint documents through its scoped MCP tools, including categories, folders, hybrid search, GraphRAG, and index refresh.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DocsMint Document Manager
|
|
7
|
+
|
|
8
|
+
Use this skill when an agent must create, organize, edit, or research documents in a DocsMint workspace.
|
|
9
|
+
|
|
10
|
+
## Safety and access
|
|
11
|
+
|
|
12
|
+
- Treat the configured API key as the complete authority boundary.
|
|
13
|
+
- A workspace key may manage categories, folders, tags, and documents according to its role.
|
|
14
|
+
- A category key may access only its bound category, folders and documents inside that category, and explicitly granted `read`, `edit`, or `write` operations.
|
|
15
|
+
- Never attempt to manage API keys, members, billing, or workspace settings through document tools.
|
|
16
|
+
- Read a document before changing it. Preserve its language and structure unless the user asks otherwise.
|
|
17
|
+
|
|
18
|
+
## Retrieval workflow
|
|
19
|
+
|
|
20
|
+
1. Use `search_documents` with the user's original language.
|
|
21
|
+
2. Read the most relevant documents with `get_document`.
|
|
22
|
+
3. Use `get_related_documents` or `search_knowledge_graph` only with authorized document IDs returned by search.
|
|
23
|
+
4. Cite document IDs and distinguish retrieved facts from inference.
|
|
24
|
+
|
|
25
|
+
## Document management workflow
|
|
26
|
+
|
|
27
|
+
1. Inspect `list_categories`, `list_folders`, and `list_tags` before organizing content.
|
|
28
|
+
2. Create categories only with a workspace-scoped key.
|
|
29
|
+
3. Create folders and documents within the active scope.
|
|
30
|
+
4. After an update, inspect `get_document_index_status`; use `refresh_document_index` only when indexing is stale or failed.
|
|
31
|
+
5. Use snapshots before a substantial rewrite when version history is important.
|
|
32
|
+
|
|
33
|
+
DocsMint owns chunking, embeddings, multilingual hybrid retrieval, entity extraction, and GraphRAG indexing. Agents must use the MCP tools and never write those persistence layers directly.
|