@hiai-gg/docsmint 0.6.6 → 0.6.7
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 +13 -1
- package/dist/backend/index.js +17 -10
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/mcp-server/src/server.ts +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -40,7 +40,19 @@ server.
|
|
|
40
40
|
- **Own the full stack**: application data, vectors, graph, queue, and files run
|
|
41
41
|
on infrastructure you control.
|
|
42
42
|
|
|
43
|
-
## What's new in DocsMint 0.6.
|
|
43
|
+
## What's new in DocsMint 0.6.7?
|
|
44
|
+
|
|
45
|
+
- **Reliable HTTPS sessions.** Every protected SvelteKit route accepts Better
|
|
46
|
+
Auth's secure production cookie as well as the local-development cookie.
|
|
47
|
+
- **Cleaner retrieval.** Deleted documents are excluded before exact, lexical,
|
|
48
|
+
fuzzy, vector, chunk, and graph ranking.
|
|
49
|
+
- **Explicit GraphRAG providers.** Entity extraction requires its own
|
|
50
|
+
chat-completion URL and never sends chat requests to an embedding endpoint.
|
|
51
|
+
- **Safer self-host defaults.** Auth origins are validated configuration, the
|
|
52
|
+
SeaweedFS Filer UI binds to loopback, folder moves refresh knowledge
|
|
53
|
+
metadata, and backups exclude `.env`.
|
|
54
|
+
|
|
55
|
+
DocsMint 0.6.7 includes the safe index recovery introduced in 0.6.6:
|
|
44
56
|
|
|
45
57
|
- **Safe explicit index recovery.** Admin document reindexing keeps the active
|
|
46
58
|
generation searchable until a new generation has passed embedding, graph,
|
package/dist/backend/index.js
CHANGED
|
@@ -77709,6 +77709,7 @@ var init_config_schema = __esm(() => {
|
|
|
77709
77709
|
WEBHOOK_SECRET: exports_external2.string().min(1, "WEBHOOK_SECRET must not be empty").default("change-me-to-random-32-chars").refine((val) => val !== "change-me-to-random-32-chars", "WEBHOOK_SECRET must be set in production"),
|
|
77710
77710
|
BETTER_AUTH_URL: exports_external2.string().default("http://localhost:50700"),
|
|
77711
77711
|
CORS_ORIGINS: exports_external2.string().optional(),
|
|
77712
|
+
TRUSTED_ORIGINS: exports_external2.string().optional(),
|
|
77712
77713
|
WEB_PORT: exports_external2.coerce.number().default(50701),
|
|
77713
77714
|
EMBEDDING_BASE_URL: exports_external2.string().optional(),
|
|
77714
77715
|
EMBEDDING_API_KEY: exports_external2.string().optional(),
|
|
@@ -192960,7 +192961,7 @@ var auth = betterAuth({
|
|
|
192960
192961
|
}),
|
|
192961
192962
|
secret: config3.BETTER_AUTH_SECRET,
|
|
192962
192963
|
baseURL: config3.BETTER_AUTH_URL,
|
|
192963
|
-
trustedOrigins:
|
|
192964
|
+
trustedOrigins: config3.TRUSTED_ORIGINS ? config3.TRUSTED_ORIGINS.split(",").map((origin) => origin.trim()).filter(Boolean) : ["http://localhost:50701", "http://127.0.0.1:50701"],
|
|
192964
192965
|
emailAndPassword: {
|
|
192965
192966
|
enabled: true
|
|
192966
192967
|
},
|
|
@@ -229066,8 +229067,8 @@ var folderRoutes = new Elysia({ prefix: "/api/folders" }).get("/:id", async ({ p
|
|
|
229066
229067
|
set2.status = 404;
|
|
229067
229068
|
return { error: "Folder not found" };
|
|
229068
229069
|
}
|
|
229069
|
-
if (parsed.data.name !== undefined) {
|
|
229070
|
-
reembedDocsInFolder(params2.id, userId, ctx.workspaceId).catch((err) => logger3.warn({ err, folderId: params2.id }, "Failed to enqueue re-embedding for folder
|
|
229070
|
+
if (parsed.data.name !== undefined || parsed.data.parentId !== undefined || parsed.data.categoryId !== undefined) {
|
|
229071
|
+
reembedDocsInFolder(params2.id, userId, ctx.workspaceId).catch((err) => logger3.warn({ err, folderId: params2.id }, "Failed to enqueue re-embedding for folder metadata change"));
|
|
229071
229072
|
invalidateDocListCache(userId);
|
|
229072
229073
|
}
|
|
229073
229074
|
return result.updated;
|
|
@@ -229919,7 +229920,7 @@ async function resolveVisibleIds(ctx, ids, adapter, scope = _buildGraphVisibilit
|
|
|
229919
229920
|
id: documents.id,
|
|
229920
229921
|
ownerId: documents.ownerId,
|
|
229921
229922
|
visibility: documents.visibility
|
|
229922
|
-
}).from(documents).where(and(inArray(documents.id, ids), scope.kind === "admin" ? undefined : scope.kind === "public" ? eq(documents.visibility, "public") : scope.kind === "share" ? inArray(documents.id, scope.allowedDocumentIds) : or(eq(documents.ownerId, scope.ownerId), eq(documents.visibility, "public")))));
|
|
229923
|
+
}).from(documents).where(and(inArray(documents.id, ids), isNull(documents.deletedAt), scope.kind === "admin" ? undefined : scope.kind === "public" ? eq(documents.visibility, "public") : scope.kind === "share" ? inArray(documents.id, scope.allowedDocumentIds) : or(eq(documents.ownerId, scope.ownerId), eq(documents.visibility, "public")))));
|
|
229923
229924
|
return new Set(rows.filter((row) => _isGraphDocumentVisible(scope, {
|
|
229924
229925
|
id: row.id,
|
|
229925
229926
|
ownerId: row.ownerId,
|
|
@@ -230361,6 +230362,7 @@ async function retrieveExact(ctx, plan, limit, execute, scope) {
|
|
|
230361
230362
|
1.0::double precision AS score
|
|
230362
230363
|
FROM documents d
|
|
230363
230364
|
WHERE d.owner_id = ${ctx.userId}
|
|
230365
|
+
AND d.deleted_at IS NULL
|
|
230364
230366
|
${scope}
|
|
230365
230367
|
AND (
|
|
230366
230368
|
lower(trim(d.title)) = lower(trim(${plan.normalized}))
|
|
@@ -230388,6 +230390,7 @@ async function retrieveFts(ctx, plan, limit, execute, scope) {
|
|
|
230388
230390
|
ts_rank(d.search_vector, websearch_to_tsquery('english', ${plan.normalized})) AS score
|
|
230389
230391
|
FROM documents d
|
|
230390
230392
|
WHERE d.owner_id = ${ctx.userId}
|
|
230393
|
+
AND d.deleted_at IS NULL
|
|
230391
230394
|
${scope}
|
|
230392
230395
|
AND d.search_vector @@ websearch_to_tsquery('english', ${plan.normalized})
|
|
230393
230396
|
UNION ALL
|
|
@@ -230395,6 +230398,7 @@ async function retrieveFts(ctx, plan, limit, execute, scope) {
|
|
|
230395
230398
|
ts_rank(d.search_vector_simple, websearch_to_tsquery('simple', ${plan.normalized})) AS score
|
|
230396
230399
|
FROM documents d
|
|
230397
230400
|
WHERE d.owner_id = ${ctx.userId}
|
|
230401
|
+
AND d.deleted_at IS NULL
|
|
230398
230402
|
${scope}
|
|
230399
230403
|
AND d.search_vector_simple @@ websearch_to_tsquery('simple', ${plan.normalized})
|
|
230400
230404
|
)
|
|
@@ -230413,6 +230417,7 @@ async function retrieveFuzzy(ctx, plan, limit, minimum, execute, scope) {
|
|
|
230413
230417
|
similarity(d.title, ${plan.normalized})::double precision AS score
|
|
230414
230418
|
FROM documents d
|
|
230415
230419
|
WHERE d.owner_id = ${ctx.userId}
|
|
230420
|
+
AND d.deleted_at IS NULL
|
|
230416
230421
|
${scope}
|
|
230417
230422
|
AND d.title % ${plan.normalized}
|
|
230418
230423
|
AND similarity(d.title, ${plan.normalized}) >= ${minimum}
|
|
@@ -230447,6 +230452,7 @@ async function retrieveVector(ctx, plan, limit, minimum, chunkLimit, execute, pr
|
|
|
230447
230452
|
FROM document_embeddings de
|
|
230448
230453
|
JOIN documents d ON d.id = de.document_id
|
|
230449
230454
|
WHERE d.owner_id = ${ctx.userId}
|
|
230455
|
+
AND d.deleted_at IS NULL
|
|
230450
230456
|
${scope}
|
|
230451
230457
|
AND d.active_embedding_generation IS NOT NULL
|
|
230452
230458
|
AND de.generation_id = d.active_embedding_generation
|
|
@@ -231179,6 +231185,7 @@ async function hydrateResults(ctx, items, includeChunks, query, allowedDocumentI
|
|
|
231179
231185
|
JOIN documents d ON d.id = de.document_id
|
|
231180
231186
|
WHERE de.document_id IN (${sql.join(ids.map((id3) => sql`${id3}`), sql`, `)})
|
|
231181
231187
|
AND ${tenantOwnerSql("d", ctx)}
|
|
231188
|
+
AND d.deleted_at IS NULL
|
|
231182
231189
|
AND d.active_embedding_generation IS NOT NULL
|
|
231183
231190
|
AND de.generation_id = d.active_embedding_generation
|
|
231184
231191
|
AND de.is_valid = true
|
|
@@ -233301,13 +233308,13 @@ var extractionOutputSchema = exports_external2.object({
|
|
|
233301
233308
|
entities: exports_external2.array(exports_external2.unknown())
|
|
233302
233309
|
});
|
|
233303
233310
|
async function callEntityExtractionLLM(text4, options) {
|
|
233304
|
-
const primaryBase = options.llmBaseUrl ?? config3.GRAPH_EXTRACT_BASE_URL
|
|
233311
|
+
const primaryBase = options.llmBaseUrl ?? config3.GRAPH_EXTRACT_BASE_URL;
|
|
233305
233312
|
const primaryExplicitKey = options.llmApiKey ?? config3.GRAPH_EXTRACT_API_KEY;
|
|
233306
|
-
const primaryModel = options.llmModel ?? config3.GRAPH_EXTRACT_MODEL ??
|
|
233313
|
+
const primaryModel = options.llmModel ?? config3.GRAPH_EXTRACT_MODEL ?? "gpt-4o-mini";
|
|
233307
233314
|
const primaryKey = primaryBase ? resolveGraphProviderKey(primaryBase, primaryExplicitKey) : "";
|
|
233308
|
-
const fallbackBase = config3.GRAPH_EXTRACT_FALLBACK_BASE_URL
|
|
233315
|
+
const fallbackBase = config3.GRAPH_EXTRACT_FALLBACK_BASE_URL;
|
|
233309
233316
|
const fallbackExplicitKey = config3.GRAPH_EXTRACT_FALLBACK_API_KEY;
|
|
233310
|
-
const fallbackModel = config3.GRAPH_EXTRACT_FALLBACK_MODEL ??
|
|
233317
|
+
const fallbackModel = config3.GRAPH_EXTRACT_FALLBACK_MODEL ?? primaryModel;
|
|
233311
233318
|
const fallbackKey = fallbackBase ? resolveGraphProviderKey(fallbackBase, fallbackExplicitKey) : "";
|
|
233312
233319
|
const providers = [];
|
|
233313
233320
|
if (primaryBase) {
|
|
@@ -234953,7 +234960,7 @@ var swaggerConfig = {
|
|
|
234953
234960
|
},
|
|
234954
234961
|
info: {
|
|
234955
234962
|
title: "DocsMint API",
|
|
234956
|
-
version: "0.6.
|
|
234963
|
+
version: "0.6.7",
|
|
234957
234964
|
description: "Self-hosted AI-first documentation platform. Full-text + semantic search, version history, sharing, and folder organization.",
|
|
234958
234965
|
contact: { name: "HiAi-gg", url: "https://github.com/HiAi-gg/docsmint" },
|
|
234959
234966
|
license: {
|
|
@@ -234995,7 +235002,7 @@ var app = new Elysia().use(bodySizeLimit).onError(({ error: error53, set: set2 }
|
|
|
234995
235002
|
set2.headers["X-Content-Type-Options"] = "nosniff";
|
|
234996
235003
|
set2.headers["X-Frame-Options"] = "DENY";
|
|
234997
235004
|
}).use(cors({
|
|
234998
|
-
origin: config3.CORS_ORIGINS
|
|
235005
|
+
origin: config3.CORS_ORIGINS ? config3.CORS_ORIGINS.split(",").map((origin) => origin.trim()).filter(Boolean) : [config3.BETTER_AUTH_URL],
|
|
234999
235006
|
credentials: true,
|
|
235000
235007
|
maxAge: 86400
|
|
235001
235008
|
})).use(config3.NODE_ENV !== "production" ? swagger(swaggerConfig) : (e3) => e3).get("/api/health", async ({ request }) => {
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@ import { registerSearch } from './commands/search.js';
|
|
|
24
24
|
import { registerSnapshot } from './commands/snapshot.js';
|
|
25
25
|
import { registerUpdate } from './commands/update.js';
|
|
26
26
|
|
|
27
|
-
const VERSION = '0.6.
|
|
27
|
+
const VERSION = '0.6.7';
|
|
28
28
|
|
|
29
29
|
const program = new Command();
|
|
30
30
|
program.name('hiai-docs').description('CLI for the hiai-docs knowledge base').version(VERSION);
|
|
@@ -81,7 +81,7 @@ export interface CreateDocsmintMcpServerOptions {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export function createDocsmintMcpServer(options: CreateDocsmintMcpServerOptions = {}): McpServer {
|
|
84
|
-
const server = new McpServer({ name: 'docsmint', version: '0.6.
|
|
84
|
+
const server = new McpServer({ name: 'docsmint', version: '0.6.7' });
|
|
85
85
|
registerDocsmintMcpCapabilities(server, options.client ?? defaultClient);
|
|
86
86
|
return server;
|
|
87
87
|
}
|
package/server.json
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"source": "github",
|
|
9
9
|
"id": "1249550690"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.6.
|
|
11
|
+
"version": "0.6.7",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@hiai-gg/docsmint",
|
|
16
|
-
"version": "0.6.
|
|
16
|
+
"version": "0.6.7",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|