@hiai-gg/docsmint 0.6.7 → 0.6.8
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 +8 -1
- package/dist/backend/index.js +30 -16
- 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,14 @@ 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.8?
|
|
44
|
+
|
|
45
|
+
- **Workspace-safe recovery.** Explicit operator reindexing carries the
|
|
46
|
+
document's workspace into every durable pipeline stage, including RLS reads.
|
|
47
|
+
- **Consistent operator authentication.** Both documented admin key headers
|
|
48
|
+
bypass interactive rate limits during maintenance operations.
|
|
49
|
+
|
|
50
|
+
DocsMint 0.6.8 includes the self-host reliability fixes introduced in 0.6.7:
|
|
44
51
|
|
|
45
52
|
- **Reliable HTTPS sessions.** Every protected SvelteKit route accepts Better
|
|
46
53
|
Auth's secure production cookie as well as the local-development cookie.
|
package/dist/backend/index.js
CHANGED
|
@@ -193196,11 +193196,14 @@ function createRateLimiter(config4, redisClient) {
|
|
|
193196
193196
|
}
|
|
193197
193197
|
|
|
193198
193198
|
// ../../backend/src/api/middleware/rate-limit.ts
|
|
193199
|
-
function isInternalRequest(request) {
|
|
193199
|
+
function isInternalRequest(request, expected = config3.HIAI_DOCS_API_KEY) {
|
|
193200
193200
|
if (!request)
|
|
193201
193201
|
return false;
|
|
193202
|
-
|
|
193203
|
-
|
|
193202
|
+
if (!expected)
|
|
193203
|
+
return false;
|
|
193204
|
+
const headerKey = request.headers.get("x-api-key")?.trim();
|
|
193205
|
+
const bearer = /^Bearer\s+(.+)$/i.exec(request.headers.get("authorization")?.trim() ?? "")?.[1]?.trim();
|
|
193206
|
+
return headerKey === expected || bearer === expected;
|
|
193204
193207
|
}
|
|
193205
193208
|
function _limiterWithBypass(config4) {
|
|
193206
193209
|
const base = createRateLimiter(config4);
|
|
@@ -194513,6 +194516,25 @@ async function loadAdminFolderDocumentIds(folderId, limit) {
|
|
|
194513
194516
|
return limit > 0 ? query.limit(limit) : query;
|
|
194514
194517
|
});
|
|
194515
194518
|
}
|
|
194519
|
+
async function loadAdminDocumentTarget(documentId) {
|
|
194520
|
+
const rows = await withTenant(REEMBED_ADMIN_TENANT, (tx) => tx.select({ id: documents.id, workspaceId: documents.workspaceId }).from(documents).where(eq(documents.id, documentId)).limit(1));
|
|
194521
|
+
const row = rows[0];
|
|
194522
|
+
return row ? { id: row.id, workspaceId: row.workspaceId ?? undefined } : undefined;
|
|
194523
|
+
}
|
|
194524
|
+
async function reembedDocumentAdminWith(documentId, loadTarget) {
|
|
194525
|
+
const target2 = await loadTarget(documentId);
|
|
194526
|
+
if (!target2)
|
|
194527
|
+
return { found: false, enqueued: 0 };
|
|
194528
|
+
const enqueued = await enqueueReembed([target2.id], target2.workspaceId, {
|
|
194529
|
+
bypassDedup: true,
|
|
194530
|
+
forceNewGeneration: true,
|
|
194531
|
+
source: "reindex"
|
|
194532
|
+
});
|
|
194533
|
+
return { found: true, enqueued };
|
|
194534
|
+
}
|
|
194535
|
+
function reembedDocumentAdmin(documentId) {
|
|
194536
|
+
return reembedDocumentAdminWith(documentId, loadAdminDocumentTarget);
|
|
194537
|
+
}
|
|
194516
194538
|
async function reembedDocsInFolderAdminWith(folderId, loadRows) {
|
|
194517
194539
|
const limit = config3.FOLDER_REEMBED_BATCH_SIZE;
|
|
194518
194540
|
const rows = await loadRows(folderId, limit);
|
|
@@ -194614,27 +194636,19 @@ var adminRoutes = new Elysia({ prefix: "/api/admin" }).post("/reindex/:docId", a
|
|
|
194614
194636
|
return { error: "Invalid or missing admin API key" };
|
|
194615
194637
|
}
|
|
194616
194638
|
try {
|
|
194617
|
-
const
|
|
194618
|
-
|
|
194619
|
-
return rows.length > 0;
|
|
194620
|
-
});
|
|
194621
|
-
if (!existing) {
|
|
194639
|
+
const result = await reembedDocumentAdmin(params.docId);
|
|
194640
|
+
if (!result.found) {
|
|
194622
194641
|
set2.status = 404;
|
|
194623
194642
|
return { error: "Document not found" };
|
|
194624
194643
|
}
|
|
194625
|
-
|
|
194626
|
-
bypassDedup: true,
|
|
194627
|
-
forceNewGeneration: true,
|
|
194628
|
-
source: "reindex"
|
|
194629
|
-
});
|
|
194630
|
-
if (enqueued !== 1) {
|
|
194644
|
+
if (result.enqueued !== 1) {
|
|
194631
194645
|
set2.status = 503;
|
|
194632
194646
|
return { error: "Failed to queue document reindex" };
|
|
194633
194647
|
}
|
|
194634
194648
|
return {
|
|
194635
194649
|
success: true,
|
|
194636
194650
|
documentId: params.docId,
|
|
194637
|
-
enqueued,
|
|
194651
|
+
enqueued: result.enqueued,
|
|
194638
194652
|
message: "Document reindex queued with a new generation"
|
|
194639
194653
|
};
|
|
194640
194654
|
} catch (err) {
|
|
@@ -234960,7 +234974,7 @@ var swaggerConfig = {
|
|
|
234960
234974
|
},
|
|
234961
234975
|
info: {
|
|
234962
234976
|
title: "DocsMint API",
|
|
234963
|
-
version: "0.6.
|
|
234977
|
+
version: "0.6.8",
|
|
234964
234978
|
description: "Self-hosted AI-first documentation platform. Full-text + semantic search, version history, sharing, and folder organization.",
|
|
234965
234979
|
contact: { name: "HiAi-gg", url: "https://github.com/HiAi-gg/docsmint" },
|
|
234966
234980
|
license: {
|
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.8';
|
|
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.8' });
|
|
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.8",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@hiai-gg/docsmint",
|
|
16
|
-
"version": "0.6.
|
|
16
|
+
"version": "0.6.8",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|