@hiai-gg/docsmint 2.0.3 → 2.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.
- package/README.md +68 -3
- package/dist/backend/index.js +22540 -2807
- package/dist/backend-account-runtime-cleanup.js +2 -1
- package/dist/backend-api-key-facade.js +2 -1
- package/dist/backend-pipeline-cancellation.js +2 -1
- package/dist/client.d.ts +33 -7
- package/dist/client.js +55 -1
- package/dist/frontend/{HiAiEditor-DDpfdQEg.js → HiAiEditor-D6ad_auS.js} +2 -2
- package/dist/frontend/{SettingsDialog-DzlYW50I.js → SettingsDialog-B8Oswuqb.js} +4 -4
- package/dist/frontend/{Sidebar-rFiVen96.js → Sidebar-BV0IDqTS.js} +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/app-shell.js +45 -36
- package/dist/frontend/{auth-client-CXR-7mIO.js → auth-client-C5EyWdAF.js} +416 -349
- package/dist/frontend/components/editor/compact-editor.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/{db-Dya0HRhS.js → db-CgTtukT4.js} +1 -1
- package/dist/frontend/{identity-BOA7Jejv.js → identity-CNhtuCJV.js} +1 -1
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/{settings-BRcYFQa_.js → settings-CHx4wBwb.js} +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/app-shell.js +2 -2
- package/dist/frontend-ssr/assets/{HiAiEditor-Bj6tiE97.js → HiAiEditor-Cj3B2Dt6.js} +2 -2
- package/dist/frontend-ssr/assets/{SettingsDialog-h4SFwpUa.js → SettingsDialog-DAT-Zxu0.js} +4 -4
- package/dist/frontend-ssr/assets/{Sidebar-BFBpsd3L.js → Sidebar-B_Ey6QNL.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-BC4hSFKF.js → auth-client-CITU3xkE.js} +308 -227
- package/dist/frontend-ssr/assets/{db-C3rFdTZa.js → db-DxRzq-kx.js} +1 -1
- package/dist/frontend-ssr/assets/{identity-DNIo1bgc.js → identity-B7ngLQzZ.js} +1 -1
- package/dist/frontend-ssr/assets/{settings-DWCpfCPj.js → settings-BRxvn30Y.js} +1 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lifecycle-runtime.js +4 -1
- package/dist/mcp-cli.js +301 -22
- package/dist/mcp-server.d.ts +92 -23
- package/dist/mcp-server.js +469 -22
- package/dist/types.d.ts +68 -1
- package/package.json +2 -2
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -1
- package/server.json +2 -2
package/dist/mcp-server.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
McpServer,
|
|
3
|
+
Tool,
|
|
4
|
+
Prompt,
|
|
5
|
+
Resource,
|
|
6
|
+
} from "@modelcontextprotocol/server";
|
|
2
7
|
|
|
3
|
-
import type { DocsClient, DocsRequestContext } from "./index.js";
|
|
8
|
+
import type { DocsClient, DocsRequestContext, DocsListOptions, DocsDocumentExport } from "./index.js";
|
|
4
9
|
|
|
5
10
|
export interface DocsMintMcpCapabilityCatalog {
|
|
6
11
|
readonly tools: readonly string[];
|
|
@@ -14,43 +19,84 @@ export interface HiaiDocsClient {
|
|
|
14
19
|
deleteDocument?(id: string): Promise<void>;
|
|
15
20
|
deleteFolder?(id: string): Promise<void>;
|
|
16
21
|
deleteCategory?(id: string): Promise<void>;
|
|
17
|
-
restoreDocumentVersion?(
|
|
18
|
-
|
|
22
|
+
restoreDocumentVersion?(
|
|
23
|
+
documentId: string,
|
|
24
|
+
versionId: string,
|
|
25
|
+
): Promise<unknown>;
|
|
26
|
+
search(params: {
|
|
27
|
+
query: string;
|
|
28
|
+
folder?: string;
|
|
29
|
+
tags?: string[];
|
|
30
|
+
includeChunks?: boolean;
|
|
31
|
+
includeDiagnostics?: boolean;
|
|
32
|
+
limit?: number;
|
|
33
|
+
}): Promise<unknown>;
|
|
19
34
|
getDocument(id: string): Promise<unknown>;
|
|
20
|
-
createDocument(input: {
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
createDocument(input: {
|
|
36
|
+
title?: string;
|
|
37
|
+
content?: string;
|
|
38
|
+
folderId?: string | null;
|
|
39
|
+
categoryId?: string | null;
|
|
40
|
+
}): Promise<unknown>;
|
|
41
|
+
updateDocument(
|
|
42
|
+
id: string,
|
|
43
|
+
input: {
|
|
44
|
+
title?: string;
|
|
45
|
+
content?: string;
|
|
46
|
+
folderId?: string | null;
|
|
47
|
+
categoryId?: string | null;
|
|
48
|
+
},
|
|
49
|
+
): Promise<unknown>;
|
|
50
|
+
listDocuments(params: DocsListOptions): Promise<unknown>;
|
|
23
51
|
listFolders(params: { parentId?: string }): Promise<unknown>;
|
|
24
|
-
createFolder(input: {
|
|
52
|
+
createFolder(input: {
|
|
53
|
+
name: string;
|
|
54
|
+
parentId?: string | null;
|
|
55
|
+
categoryId?: string | null;
|
|
56
|
+
}): Promise<unknown>;
|
|
25
57
|
listCategories(): Promise<unknown>;
|
|
26
58
|
createCategory(input: { name: string }): Promise<unknown>;
|
|
27
59
|
listTags(): Promise<unknown>;
|
|
28
60
|
getRelatedDocuments(documentId: string, limit?: number): Promise<unknown>;
|
|
29
|
-
searchGraph(input: {
|
|
61
|
+
searchGraph(input: {
|
|
62
|
+
query?: string;
|
|
63
|
+
docIds: string[];
|
|
64
|
+
limit?: number;
|
|
65
|
+
}): Promise<unknown>;
|
|
30
66
|
getDocumentIndexStatus(documentId: string): Promise<unknown>;
|
|
31
67
|
refreshDocumentIndex(documentId: string): Promise<unknown>;
|
|
32
|
-
createSnapshot(
|
|
33
|
-
|
|
34
|
-
|
|
68
|
+
createSnapshot(
|
|
69
|
+
documentId: string,
|
|
70
|
+
input: { label: string; description?: string },
|
|
71
|
+
): Promise<unknown>;
|
|
72
|
+
getVersionHistory(
|
|
73
|
+
documentId: string,
|
|
74
|
+
onlySnapshots?: boolean,
|
|
75
|
+
): Promise<unknown>;
|
|
76
|
+
exportDocument(id: string): Promise<DocsDocumentExport>;
|
|
35
77
|
}
|
|
36
78
|
|
|
37
79
|
export interface McpWorkspaceDescriptor {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
slug: string;
|
|
83
|
+
entireWorkspace: boolean;
|
|
84
|
+
categoryIds: string[];
|
|
43
85
|
}
|
|
44
86
|
export interface McpWorkspaceRouting {
|
|
45
|
-
|
|
46
|
-
|
|
87
|
+
listWorkspaces(): Promise<McpWorkspaceDescriptor[]>;
|
|
88
|
+
assertSelection(workspaceId: string): Promise<void>;
|
|
47
89
|
}
|
|
48
|
-
export declare function createMcpScopedResult(
|
|
90
|
+
export declare function createMcpScopedResult(
|
|
91
|
+
toolName: "find_documents" | "list_workspace_structure" | "list_trash",
|
|
92
|
+
input: unknown,
|
|
93
|
+
): unknown;
|
|
49
94
|
|
|
50
95
|
export interface CreateDocsmintMcpServerOptions {
|
|
51
|
-
docsClient?: DocsClient
|
|
96
|
+
docsClient?: Omit<DocsClient, "withRequestContext">;
|
|
97
|
+
decorateResult?: (tool: string, output: unknown) => unknown | Promise<unknown>;
|
|
52
98
|
requestContext?: DocsRequestContext;
|
|
53
|
-
|
|
99
|
+
workspaceRouting?: McpWorkspaceRouting;
|
|
54
100
|
/** @deprecated Inject a legacy capability client only for compatibility. */
|
|
55
101
|
client?: HiaiDocsClient;
|
|
56
102
|
}
|
|
@@ -58,9 +104,32 @@ export interface CreateDocsmintMcpServerOptions {
|
|
|
58
104
|
export declare function registerDocsmintMcpCapabilities(
|
|
59
105
|
server: McpServer,
|
|
60
106
|
client: HiaiDocsClient,
|
|
61
|
-
|
|
107
|
+
workspaceRouting?: McpWorkspaceRouting,
|
|
108
|
+
decorateResult?: (tool: string, output: unknown) => unknown | Promise<unknown>,
|
|
62
109
|
): void;
|
|
63
110
|
|
|
64
111
|
export declare function createDocsmintMcpServer(
|
|
65
112
|
options?: CreateDocsmintMcpServerOptions,
|
|
66
113
|
): McpServer;
|
|
114
|
+
|
|
115
|
+
/** Public inventory derived from the actual MCP registration and protocol discovery. */
|
|
116
|
+
export interface DocsMintMcpDocumentationCatalog {
|
|
117
|
+
server: { name: string; version: string };
|
|
118
|
+
tools: Array<Tool & { examples: Record<string, unknown>[] }>;
|
|
119
|
+
prompts: Prompt[];
|
|
120
|
+
resources: Resource[];
|
|
121
|
+
}
|
|
122
|
+
export declare function generateDocsmintMcpCatalog(): Promise<DocsMintMcpDocumentationCatalog>;
|
|
123
|
+
|
|
124
|
+
export interface DocsmintMcpHttpOptions {
|
|
125
|
+
createServer(request: Request): Promise<McpServer | Response>;
|
|
126
|
+
allowedOrigins: readonly string[];
|
|
127
|
+
enabled?: boolean;
|
|
128
|
+
onerror?: (error: Error) => void;
|
|
129
|
+
}
|
|
130
|
+
export declare function createDocsmintMcpHttpHandler(
|
|
131
|
+
options: DocsmintMcpHttpOptions,
|
|
132
|
+
): {
|
|
133
|
+
fetch(request: Request): Promise<Response>;
|
|
134
|
+
close(): Promise<void>;
|
|
135
|
+
};
|