simple-dynamsoft-mcp 7.3.0 → 7.3.2
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/data/metadata/data-manifest.json +28 -28
- package/data/metadata/dynamsoft_sdks.json +42 -0
- package/package.json +2 -2
- package/scripts/sdk-version-sources.mjs +84 -0
- package/scripts/update-sdk-versions.mjs +10 -58
- package/src/server/normalizers.js +23 -0
- package/src/server/resource-index/builders.js +21 -16
- package/src/server/resource-index/version-policy.js +22 -14
- package/src/server/resource-index.js +11 -1
- package/src/server/tools/register-version-tools.js +5 -10
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"branch": "main",
|
|
19
19
|
"owner": "dynamsoft-docs",
|
|
20
20
|
"repo": "barcode-reader-docs-mobile",
|
|
21
|
-
"commit": "
|
|
22
|
-
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/barcode-reader-docs-mobile/zip/
|
|
21
|
+
"commit": "73e2ec43e875e093367b385f167e021f47f2ee1b",
|
|
22
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/barcode-reader-docs-mobile/zip/73e2ec43e875e093367b385f167e021f47f2ee1b"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "data/documentation/barcode-reader-docs-server",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"branch": "main",
|
|
29
29
|
"owner": "dynamsoft-docs",
|
|
30
30
|
"repo": "barcode-reader-docs-server",
|
|
31
|
-
"commit": "
|
|
32
|
-
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/barcode-reader-docs-server/zip/
|
|
31
|
+
"commit": "2a786507c616bc82e79e626f6d03f6b67bf93059",
|
|
32
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/barcode-reader-docs-server/zip/2a786507c616bc82e79e626f6d03f6b67bf93059"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"name": "data/documentation/capture-vision-docs",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"branch": "main",
|
|
49
49
|
"owner": "dynamsoft-docs",
|
|
50
50
|
"repo": "capture-vision-docs-js",
|
|
51
|
-
"commit": "
|
|
52
|
-
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-js/zip/
|
|
51
|
+
"commit": "e0a78b0bbe850feacac32c93ccc9f362ea7f2e2d",
|
|
52
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-js/zip/e0a78b0bbe850feacac32c93ccc9f362ea7f2e2d"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"name": "data/documentation/capture-vision-docs-mobile",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"branch": "main",
|
|
59
59
|
"owner": "dynamsoft-docs",
|
|
60
60
|
"repo": "capture-vision-docs-mobile",
|
|
61
|
-
"commit": "
|
|
62
|
-
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-mobile/zip/
|
|
61
|
+
"commit": "06b8b0009ae72427dc63d4a2b58491c5fc74ed70",
|
|
62
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-mobile/zip/06b8b0009ae72427dc63d4a2b58491c5fc74ed70"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"name": "data/documentation/capture-vision-docs-server",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"branch": "main",
|
|
69
69
|
"owner": "dynamsoft-docs",
|
|
70
70
|
"repo": "capture-vision-docs-server",
|
|
71
|
-
"commit": "
|
|
72
|
-
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-server/zip/
|
|
71
|
+
"commit": "f4653d3b7a5fa7e6706a3e848f676ed06f696685",
|
|
72
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-server/zip/f4653d3b7a5fa7e6706a3e848f676ed06f696685"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"name": "data/documentation/document-viewer-docs",
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
"branch": "main",
|
|
149
149
|
"owner": "Dynamsoft",
|
|
150
150
|
"repo": "barcode-reader-c-cpp-samples",
|
|
151
|
-
"commit": "
|
|
152
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-c-cpp-samples/zip/
|
|
151
|
+
"commit": "3af2b7b60342e97b8f91ef803ea26e777bb4b4dd",
|
|
152
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-c-cpp-samples/zip/3af2b7b60342e97b8f91ef803ea26e777bb4b4dd"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
"name": "data/samples/dynamsoft-barcode-reader-dotnet",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
"branch": "main",
|
|
159
159
|
"owner": "Dynamsoft",
|
|
160
160
|
"repo": "barcode-reader-dotnet-samples",
|
|
161
|
-
"commit": "
|
|
162
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-dotnet-samples/zip/
|
|
161
|
+
"commit": "e1779bb6996510225bb7e3adac365b3bed688be2",
|
|
162
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-dotnet-samples/zip/e1779bb6996510225bb7e3adac365b3bed688be2"
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"name": "data/samples/dynamsoft-barcode-reader-flutter",
|
|
@@ -178,8 +178,8 @@
|
|
|
178
178
|
"branch": "main",
|
|
179
179
|
"owner": "Dynamsoft",
|
|
180
180
|
"repo": "barcode-reader-java-samples",
|
|
181
|
-
"commit": "
|
|
182
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-java-samples/zip/
|
|
181
|
+
"commit": "c3f164a5eefd795ae2a7bb0cd8dacb70db7450b2",
|
|
182
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-java-samples/zip/c3f164a5eefd795ae2a7bb0cd8dacb70db7450b2"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"name": "data/samples/dynamsoft-barcode-reader-maui",
|
|
@@ -198,8 +198,8 @@
|
|
|
198
198
|
"branch": "main",
|
|
199
199
|
"owner": "Dynamsoft",
|
|
200
200
|
"repo": "barcode-reader-mobile-samples",
|
|
201
|
-
"commit": "
|
|
202
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-mobile-samples/zip/
|
|
201
|
+
"commit": "8876a6373ccf800c3f4369c6fcb96aabd705d999",
|
|
202
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-mobile-samples/zip/8876a6373ccf800c3f4369c6fcb96aabd705d999"
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
"name": "data/samples/dynamsoft-barcode-reader-python",
|
|
@@ -218,8 +218,8 @@
|
|
|
218
218
|
"branch": "main",
|
|
219
219
|
"owner": "Dynamsoft",
|
|
220
220
|
"repo": "barcode-reader-react-native-samples",
|
|
221
|
-
"commit": "
|
|
222
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-react-native-samples/zip/
|
|
221
|
+
"commit": "05c43007ec6b64221d6ffad986ed6623195cb88b",
|
|
222
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-react-native-samples/zip/05c43007ec6b64221d6ffad986ed6623195cb88b"
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"name": "data/samples/dynamsoft-capture-vision-c-cpp",
|
|
@@ -228,8 +228,8 @@
|
|
|
228
228
|
"branch": "main",
|
|
229
229
|
"owner": "Dynamsoft",
|
|
230
230
|
"repo": "capture-vision-cpp-samples",
|
|
231
|
-
"commit": "
|
|
232
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-cpp-samples/zip/
|
|
231
|
+
"commit": "dc2f6f21579591b95b6d5251066cb0094fa4ce74",
|
|
232
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-cpp-samples/zip/dc2f6f21579591b95b6d5251066cb0094fa4ce74"
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
"name": "data/samples/dynamsoft-capture-vision-dotnet",
|
|
@@ -238,8 +238,8 @@
|
|
|
238
238
|
"branch": "main",
|
|
239
239
|
"owner": "Dynamsoft",
|
|
240
240
|
"repo": "capture-vision-dotnet-samples",
|
|
241
|
-
"commit": "
|
|
242
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-dotnet-samples/zip/
|
|
241
|
+
"commit": "1c6d1f3dbdcc11192b83498f5dca01fd192ee26a",
|
|
242
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-dotnet-samples/zip/1c6d1f3dbdcc11192b83498f5dca01fd192ee26a"
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
"name": "data/samples/dynamsoft-capture-vision-flutter",
|
|
@@ -258,8 +258,8 @@
|
|
|
258
258
|
"branch": "main",
|
|
259
259
|
"owner": "Dynamsoft",
|
|
260
260
|
"repo": "capture-vision-java-samples",
|
|
261
|
-
"commit": "
|
|
262
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-java-samples/zip/
|
|
261
|
+
"commit": "ad9d5516cdae5d1240966271896f6f13e6ae5476",
|
|
262
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-java-samples/zip/ad9d5516cdae5d1240966271896f6f13e6ae5476"
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
"name": "data/samples/dynamsoft-capture-vision-javascript",
|
|
@@ -318,8 +318,8 @@
|
|
|
318
318
|
"branch": "main",
|
|
319
319
|
"owner": "Dynamsoft",
|
|
320
320
|
"repo": "capture-vision-react-native-samples",
|
|
321
|
-
"commit": "
|
|
322
|
-
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-react-native-samples/zip/
|
|
321
|
+
"commit": "e27f4e6708f4eb8570893bf36399cc02b6f7759f",
|
|
322
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-react-native-samples/zip/e27f4e6708f4eb8570893bf36399cc02b6f7759f"
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
"name": "data/samples/dynamsoft-capture-vision-spm",
|
|
@@ -520,6 +520,48 @@
|
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
+
},
|
|
524
|
+
"mrz-web": {
|
|
525
|
+
"name": "Dynamsoft MRZ Scanner JavaScript SDK",
|
|
526
|
+
"description": "MRZ scanning for web applications using JavaScript/TypeScript.",
|
|
527
|
+
"version": "3.1.0",
|
|
528
|
+
"default_platform": "web",
|
|
529
|
+
"snippet_path": "dynamsoft-mrz-scanner/web",
|
|
530
|
+
"platforms": {
|
|
531
|
+
"web": {
|
|
532
|
+
"languages": [
|
|
533
|
+
"JavaScript",
|
|
534
|
+
"TypeScript"
|
|
535
|
+
],
|
|
536
|
+
"samples": {
|
|
537
|
+
"repo": "https://github.com/Dynamsoft/mrz-scanner-javascript"
|
|
538
|
+
},
|
|
539
|
+
"installation": {
|
|
540
|
+
"npm": "npm install dynamsoft-mrz-scanner"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"mds-web": {
|
|
546
|
+
"name": "Dynamsoft Document Scanner JavaScript SDK",
|
|
547
|
+
"description": "Document scanning for web applications using JavaScript/TypeScript.",
|
|
548
|
+
"version": "1.4.2",
|
|
549
|
+
"default_platform": "web",
|
|
550
|
+
"snippet_path": "dynamsoft-document-scanner/web",
|
|
551
|
+
"platforms": {
|
|
552
|
+
"web": {
|
|
553
|
+
"languages": [
|
|
554
|
+
"JavaScript",
|
|
555
|
+
"TypeScript"
|
|
556
|
+
],
|
|
557
|
+
"samples": {
|
|
558
|
+
"repo": "https://github.com/Dynamsoft/document-scanner-javascript"
|
|
559
|
+
},
|
|
560
|
+
"installation": {
|
|
561
|
+
"npm": "npm install dynamsoft-document-scanner"
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
523
565
|
}
|
|
524
566
|
}
|
|
525
567
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-dynamsoft-mcp",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.2",
|
|
4
4
|
"description": "MCP server for Dynamsoft SDKs - Capture Vision, Barcode Reader (Mobile/Python/Web), Dynamic Web TWAIN, and Document Viewer. Provides documentation, code snippets, and API guidance.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"start": "node src/index.js",
|
|
26
26
|
"test": "npm run test:lite",
|
|
27
|
-
"test:unit": "node --test test/unit/gemini-retry.test.js test/unit/profile-config.test.js test/unit/lexical-provider.test.js test/unit/hydration-mode.test.js test/unit/hydration-policy.test.js test/unit/repo-map.test.js test/unit/download-utils.test.js test/unit/logging.test.js test/unit/rag-signature-manifest.test.js test/unit/startup-timing.test.js test/unit/http-startup-readiness.test.js test/unit/resource-index-startup.test.js test/unit/create-server.test.js test/unit/server-helpers.test.js",
|
|
27
|
+
"test:unit": "node --test test/unit/gemini-retry.test.js test/unit/profile-config.test.js test/unit/lexical-provider.test.js test/unit/hydration-mode.test.js test/unit/hydration-policy.test.js test/unit/repo-map.test.js test/unit/download-utils.test.js test/unit/logging.test.js test/unit/rag-signature-manifest.test.js test/unit/startup-timing.test.js test/unit/http-startup-readiness.test.js test/unit/resource-index-startup.test.js test/unit/create-server.test.js test/unit/server-helpers.test.js test/unit/update-sdk-versions.test.js",
|
|
28
28
|
"test:lite": "npm run test:stdio && npm run test:http && npm run test:package",
|
|
29
29
|
"test:lexical": "node --test test/integration/stdio.test.js test/integration/http.test.js",
|
|
30
30
|
"test:gemini": "node scripts/run-gemini-tests.mjs",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
export function normalizeVersion(version) {
|
|
5
|
+
const parts = String(version)
|
|
6
|
+
.trim()
|
|
7
|
+
.split(".")
|
|
8
|
+
.map((part) => Number.parseInt(part, 10))
|
|
9
|
+
.filter((part) => Number.isInteger(part) && part >= 0);
|
|
10
|
+
if (parts.length < 2) return "";
|
|
11
|
+
return parts.join(".");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function detectFromPackageJson(rootDir, relativeFile = "package.json") {
|
|
15
|
+
const filePath = join(rootDir, ...relativeFile.split("/"));
|
|
16
|
+
if (!existsSync(filePath)) return { version: "", detail: `${relativeFile} missing` };
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const pkg = JSON.parse(readFileSync(filePath, "utf8"));
|
|
20
|
+
return {
|
|
21
|
+
version: normalizeVersion(pkg?.version || ""),
|
|
22
|
+
detail: `parsed ${relativeFile}`
|
|
23
|
+
};
|
|
24
|
+
} catch (error) {
|
|
25
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
26
|
+
return { version: "", detail: `${relativeFile} invalid JSON (${message})` };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const sdkVersionSources = [
|
|
31
|
+
{
|
|
32
|
+
sdkId: "dbr-web",
|
|
33
|
+
docsPath: "data/documentation/barcode-reader-docs-js",
|
|
34
|
+
strategies: ["release-note-indexes"]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
sdkId: "dbr-mobile",
|
|
38
|
+
docsPath: "data/documentation/barcode-reader-docs-mobile",
|
|
39
|
+
strategies: ["release-note-indexes"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
sdkId: "dbr-server",
|
|
43
|
+
docsPath: "data/documentation/barcode-reader-docs-server",
|
|
44
|
+
strategies: ["release-note-indexes"]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
sdkId: "dwt",
|
|
48
|
+
docsPath: "data/documentation/web-twain-docs",
|
|
49
|
+
strategies: [{ type: "latest-version-js", file: "assets/js/setLatestVersion.js" }]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
sdkId: "ddv",
|
|
53
|
+
docsPath: "data/documentation/document-viewer-docs",
|
|
54
|
+
strategies: ["product-version-yml", "release-note-indexes"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
sdkId: "dcv-web",
|
|
58
|
+
docsPath: "data/documentation/capture-vision-docs-js",
|
|
59
|
+
strategies: ["release-note-indexes"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
sdkId: "dcv-mobile",
|
|
63
|
+
docsPath: "data/documentation/capture-vision-docs-mobile",
|
|
64
|
+
strategies: ["release-note-indexes"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
sdkId: "dcv-server",
|
|
68
|
+
docsPath: "data/documentation/capture-vision-docs-server",
|
|
69
|
+
strategies: ["release-note-indexes"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
sdkId: "dcv-core",
|
|
73
|
+
docsPath: "data/documentation/capture-vision-docs",
|
|
74
|
+
strategies: ["product-version-yml", { type: "max-of-sdks", sdkIds: ["dcv-server", "dcv-mobile", "dcv-web"] }]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
sdkId: "mrz-web",
|
|
78
|
+
strategies: [{ type: "package-json", file: "data/samples/mrz-scanner-javascript/package.json" }]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
sdkId: "mds-web",
|
|
82
|
+
strategies: [{ type: "package-json", file: "data/samples/document-scanner-javascript/package.json" }]
|
|
83
|
+
}
|
|
84
|
+
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
|
+
import { detectFromPackageJson, normalizeVersion, sdkVersionSources } from "./sdk-version-sources.mjs";
|
|
4
5
|
|
|
5
6
|
const projectRoot = process.cwd();
|
|
6
7
|
const metadataPath = join(projectRoot, "data", "metadata", "dynamsoft_sdks.json");
|
|
@@ -33,16 +34,6 @@ function walkFiles(rootDir, fileFilter) {
|
|
|
33
34
|
return files.sort((a, b) => a.localeCompare(b));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function normalizeVersion(version) {
|
|
37
|
-
const parts = String(version)
|
|
38
|
-
.trim()
|
|
39
|
-
.split(".")
|
|
40
|
-
.map((part) => Number.parseInt(part, 10))
|
|
41
|
-
.filter((part) => Number.isInteger(part) && part >= 0);
|
|
42
|
-
if (parts.length < 2) return "";
|
|
43
|
-
return parts.join(".");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
37
|
function compareVersion(a, b) {
|
|
47
38
|
const aParts = String(a).split(".").map((part) => Number.parseInt(part, 10));
|
|
48
39
|
const bParts = String(b).split(".").map((part) => Number.parseInt(part, 10));
|
|
@@ -172,6 +163,15 @@ function detectFromStrategies(strategies, source, resolvedVersions, metadata) {
|
|
|
172
163
|
continue;
|
|
173
164
|
}
|
|
174
165
|
|
|
166
|
+
if (typeof strategy === "object" && strategy.type === "package-json") {
|
|
167
|
+
const result = detectFromPackageJson(projectRoot, strategy.file || "package.json");
|
|
168
|
+
attempts.push(`package-json(${strategy.file || "package.json"}): ${result.detail}`);
|
|
169
|
+
if (result.version) {
|
|
170
|
+
return { version: result.version, strategy: `package-json(${strategy.file || "package.json"})`, attempts };
|
|
171
|
+
}
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
175
|
if (typeof strategy === "object" && strategy.type === "max-of-sdks") {
|
|
176
176
|
const candidates = [];
|
|
177
177
|
for (const sdkId of strategy.sdkIds || []) {
|
|
@@ -191,54 +191,6 @@ function detectFromStrategies(strategies, source, resolvedVersions, metadata) {
|
|
|
191
191
|
return { version: "", strategy: "", attempts };
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
const sdkVersionSources = [
|
|
195
|
-
{
|
|
196
|
-
sdkId: "dbr-web",
|
|
197
|
-
docsPath: "data/documentation/barcode-reader-docs-js",
|
|
198
|
-
strategies: ["release-note-indexes"]
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
sdkId: "dbr-mobile",
|
|
202
|
-
docsPath: "data/documentation/barcode-reader-docs-mobile",
|
|
203
|
-
strategies: ["release-note-indexes"]
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
sdkId: "dbr-server",
|
|
207
|
-
docsPath: "data/documentation/barcode-reader-docs-server",
|
|
208
|
-
strategies: ["release-note-indexes"]
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
sdkId: "dwt",
|
|
212
|
-
docsPath: "data/documentation/web-twain-docs",
|
|
213
|
-
strategies: [{ type: "latest-version-js", file: "assets/js/setLatestVersion.js" }]
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
sdkId: "ddv",
|
|
217
|
-
docsPath: "data/documentation/document-viewer-docs",
|
|
218
|
-
strategies: ["product-version-yml", "release-note-indexes"]
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
sdkId: "dcv-web",
|
|
222
|
-
docsPath: "data/documentation/capture-vision-docs-js",
|
|
223
|
-
strategies: ["release-note-indexes"]
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
sdkId: "dcv-mobile",
|
|
227
|
-
docsPath: "data/documentation/capture-vision-docs-mobile",
|
|
228
|
-
strategies: ["release-note-indexes"]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
sdkId: "dcv-server",
|
|
232
|
-
docsPath: "data/documentation/capture-vision-docs-server",
|
|
233
|
-
strategies: ["release-note-indexes"]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
sdkId: "dcv-core",
|
|
237
|
-
docsPath: "data/documentation/capture-vision-docs",
|
|
238
|
-
strategies: ["product-version-yml", { type: "max-of-sdks", sdkIds: ["dcv-server", "dcv-mobile", "dcv-web"] }]
|
|
239
|
-
}
|
|
240
|
-
];
|
|
241
|
-
|
|
242
194
|
if (!existsSync(metadataPath)) {
|
|
243
195
|
console.error(`[version-sync] metadata file not found: ${metadataPath}`);
|
|
244
196
|
process.exit(1);
|
|
@@ -184,6 +184,25 @@ const dcvFeatureTerms = [
|
|
|
184
184
|
"crop"
|
|
185
185
|
];
|
|
186
186
|
|
|
187
|
+
const mrzFeatureTerms = [
|
|
188
|
+
"mrz",
|
|
189
|
+
"machine readable zone",
|
|
190
|
+
"passport"
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
const mdsFeatureTerms = [
|
|
194
|
+
"mds",
|
|
195
|
+
"document scanner",
|
|
196
|
+
"document scanning",
|
|
197
|
+
"document scan",
|
|
198
|
+
"document normalization",
|
|
199
|
+
"document normalizer",
|
|
200
|
+
"auto capture",
|
|
201
|
+
"auto-capture",
|
|
202
|
+
"cropping",
|
|
203
|
+
"crop"
|
|
204
|
+
];
|
|
205
|
+
|
|
187
206
|
const dwtFeatureTerms = ["dwt", "web twain", "webtwain", "twain", "wia", "ica", "sane"];
|
|
188
207
|
|
|
189
208
|
let webFrameworkPlatformsGetter = null;
|
|
@@ -296,6 +315,10 @@ function inferProductFromQuery(query) {
|
|
|
296
315
|
const normalized = query.toLowerCase();
|
|
297
316
|
const isDwtQuery = dwtFeatureTerms.some((term) => normalized.includes(term));
|
|
298
317
|
if (isDwtQuery) return "dwt";
|
|
318
|
+
const isMrzQuery = mrzFeatureTerms.some((term) => normalized.includes(term));
|
|
319
|
+
if (isMrzQuery) return "mrz";
|
|
320
|
+
const isMdsQuery = mdsFeatureTerms.some((term) => normalized.includes(term));
|
|
321
|
+
if (isMdsQuery) return "mds";
|
|
299
322
|
const isDcvQuery = dcvFeatureTerms.some((term) => normalized.includes(term));
|
|
300
323
|
if (isDcvQuery) return "dcv";
|
|
301
324
|
if (normalized.includes("ddv") || normalized.includes("document viewer") || normalized.includes("pdf viewer") || normalized.includes("edit viewer")) {
|
|
@@ -303,7 +303,7 @@ function buildIndexData({
|
|
|
303
303
|
}) {
|
|
304
304
|
if (Array.isArray(resourceIndex) && resourceIndex.length > 0) {
|
|
305
305
|
const products = Object.fromEntries(PUBLIC_OFFERING_PRODUCTS.map((product) => [product, {
|
|
306
|
-
latestMajor:
|
|
306
|
+
latestMajor: LATEST_MAJOR[product],
|
|
307
307
|
editions: {}
|
|
308
308
|
}]));
|
|
309
309
|
|
|
@@ -312,9 +312,10 @@ function buildIndexData({
|
|
|
312
312
|
if (entry.type !== "doc" && entry.type !== "sample") continue;
|
|
313
313
|
|
|
314
314
|
const editionName = entry.edition === "python" ? "server" : (entry.edition || "web");
|
|
315
|
+
if (entry.product === "mrz" && editionName === "mobile") continue;
|
|
315
316
|
if (!products[entry.product].editions[editionName]) {
|
|
316
317
|
const version = entry.version
|
|
317
|
-
||
|
|
318
|
+
|| LATEST_VERSIONS[entry.product]?.[editionName]
|
|
318
319
|
|| "";
|
|
319
320
|
products[entry.product].editions[editionName] = {
|
|
320
321
|
version,
|
|
@@ -403,6 +404,8 @@ function buildIndexData({
|
|
|
403
404
|
const dbrServerVersion = LATEST_VERSIONS.dbr.server;
|
|
404
405
|
const dwtVersion = LATEST_VERSIONS.dwt.web;
|
|
405
406
|
const ddvVersion = LATEST_VERSIONS.ddv.web;
|
|
407
|
+
const mrzWebVersion = LATEST_VERSIONS.mrz.web;
|
|
408
|
+
const mdsWebVersion = LATEST_VERSIONS.mds.web;
|
|
406
409
|
|
|
407
410
|
const dcvWebSamples = discoverDcvWebSamples();
|
|
408
411
|
const dcvWebFrameworks = getDcvWebFrameworkPlatforms();
|
|
@@ -510,10 +513,10 @@ function buildIndexData({
|
|
|
510
513
|
}
|
|
511
514
|
},
|
|
512
515
|
mrz: {
|
|
513
|
-
latestMajor: LATEST_MAJOR.
|
|
516
|
+
latestMajor: LATEST_MAJOR.mrz,
|
|
514
517
|
editions: {
|
|
515
518
|
web: {
|
|
516
|
-
version:
|
|
519
|
+
version: mrzWebVersion,
|
|
517
520
|
platforms: ["js", ...mrzWebFrameworks],
|
|
518
521
|
docCount: mrzWebDocs.length,
|
|
519
522
|
sampleCount: countSamples(mrzWebSamples)
|
|
@@ -521,10 +524,10 @@ function buildIndexData({
|
|
|
521
524
|
}
|
|
522
525
|
},
|
|
523
526
|
mds: {
|
|
524
|
-
latestMajor: LATEST_MAJOR.
|
|
527
|
+
latestMajor: LATEST_MAJOR.mds,
|
|
525
528
|
editions: {
|
|
526
529
|
web: {
|
|
527
|
-
version:
|
|
530
|
+
version: mdsWebVersion,
|
|
528
531
|
platforms: ["js", ...mdsWebFrameworks],
|
|
529
532
|
docCount: mdsWebDocs.length,
|
|
530
533
|
sampleCount: countSamples(mdsWebSamples)
|
|
@@ -635,6 +638,8 @@ function buildResourceIndex({
|
|
|
635
638
|
const dbrServerVersion = LATEST_VERSIONS.dbr.server;
|
|
636
639
|
const dwtVersion = LATEST_VERSIONS.dwt.web;
|
|
637
640
|
const ddvVersion = LATEST_VERSIONS.ddv.web;
|
|
641
|
+
const mrzWebVersion = LATEST_VERSIONS.mrz.web;
|
|
642
|
+
const mdsWebVersion = LATEST_VERSIONS.mds.web;
|
|
638
643
|
|
|
639
644
|
addMarkdownDocResources({
|
|
640
645
|
addResourceToIndex,
|
|
@@ -671,8 +676,8 @@ function buildResourceIndex({
|
|
|
671
676
|
uriPrefix: "doc://mrz/web",
|
|
672
677
|
product: "mrz",
|
|
673
678
|
edition: "web",
|
|
674
|
-
version:
|
|
675
|
-
majorVersion: LATEST_MAJOR.
|
|
679
|
+
version: mrzWebVersion,
|
|
680
|
+
majorVersion: LATEST_MAJOR.mrz,
|
|
676
681
|
defaultPlatform: "web",
|
|
677
682
|
defaultSummary: "Dynamsoft MRZ Scanner Web documentation",
|
|
678
683
|
baseTags: ["doc", "mrz", "web"]
|
|
@@ -685,8 +690,8 @@ function buildResourceIndex({
|
|
|
685
690
|
uriPrefix: "doc://mds/web",
|
|
686
691
|
product: "mds",
|
|
687
692
|
edition: "web",
|
|
688
|
-
version:
|
|
689
|
-
majorVersion: LATEST_MAJOR.
|
|
693
|
+
version: mdsWebVersion,
|
|
694
|
+
majorVersion: LATEST_MAJOR.mds,
|
|
690
695
|
defaultPlatform: "web",
|
|
691
696
|
defaultSummary: "Dynamsoft Mobile Document Scanner Web documentation",
|
|
692
697
|
baseTags: ["doc", "mds", "web"]
|
|
@@ -761,13 +766,13 @@ function buildResourceIndex({
|
|
|
761
766
|
for (const sampleName of samples) {
|
|
762
767
|
addResourceToIndex({
|
|
763
768
|
id: `mrz-web-${category}-${sampleName}`,
|
|
764
|
-
uri: `sample://mrz/web/web/${
|
|
769
|
+
uri: `sample://mrz/web/web/${mrzWebVersion}/${category}/${sampleName}`,
|
|
765
770
|
type: "sample",
|
|
766
771
|
product: "mrz",
|
|
767
772
|
edition: "web",
|
|
768
773
|
platform: "web",
|
|
769
|
-
version:
|
|
770
|
-
majorVersion: LATEST_MAJOR.
|
|
774
|
+
version: mrzWebVersion,
|
|
775
|
+
majorVersion: LATEST_MAJOR.mrz,
|
|
771
776
|
title: `MRZ sample: ${sampleName} (${category})`,
|
|
772
777
|
summary: `MRZ web sample ${category}/${sampleName}.`,
|
|
773
778
|
mimeType: "text/plain",
|
|
@@ -788,13 +793,13 @@ function buildResourceIndex({
|
|
|
788
793
|
for (const sampleName of samples) {
|
|
789
794
|
addResourceToIndex({
|
|
790
795
|
id: `mds-web-${category}-${sampleName}`,
|
|
791
|
-
uri: `sample://mds/web/web/${
|
|
796
|
+
uri: `sample://mds/web/web/${mdsWebVersion}/${category}/${sampleName}`,
|
|
792
797
|
type: "sample",
|
|
793
798
|
product: "mds",
|
|
794
799
|
edition: "web",
|
|
795
800
|
platform: "web",
|
|
796
|
-
version:
|
|
797
|
-
majorVersion: LATEST_MAJOR.
|
|
801
|
+
version: mdsWebVersion,
|
|
802
|
+
majorVersion: LATEST_MAJOR.mds,
|
|
798
803
|
title: `MDS sample: ${sampleName} (${category})`,
|
|
799
804
|
summary: `MDS web sample ${category}/${sampleName}.`,
|
|
800
805
|
mimeType: "text/plain",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { LEGACY_DBR_LINKS, LEGACY_DWT_LINKS } from "./config.js";
|
|
2
2
|
import { inferProductFromQuery, normalizeEdition, normalizePlatform } from "../normalizers.js";
|
|
3
3
|
|
|
4
|
-
const VERSION_FAMILY_BY_PRODUCT = {
|
|
5
|
-
mrz: "dcv",
|
|
6
|
-
mds: "dcv"
|
|
7
|
-
};
|
|
8
|
-
|
|
9
4
|
function parseMajorVersion(version) {
|
|
10
5
|
if (!version) return null;
|
|
11
6
|
const match = String(version).match(/(\d+)/);
|
|
@@ -17,7 +12,7 @@ function detectMajorFromQuery(query) {
|
|
|
17
12
|
if (!query) return null;
|
|
18
13
|
const text = String(query);
|
|
19
14
|
const explicit = text.match(/(?:\bv|\bversion\s*)(\d{1,2})(?:\.\d+)?/i);
|
|
20
|
-
const productScoped = text.match(/(?:dbr|dcv|dwt|ddv)[^0-9]*(\d{1,2})(?:\.\d+)?/i);
|
|
15
|
+
const productScoped = text.match(/(?:dbr|dcv|dwt|ddv|mrz|mds)[^0-9]*(\d{1,2})(?:\.\d+)?/i);
|
|
21
16
|
const match = explicit || productScoped;
|
|
22
17
|
if (!match) return null;
|
|
23
18
|
const major = Number.parseInt(match[1], 10);
|
|
@@ -74,10 +69,17 @@ function ensureLatestMajor({ product, version, query, edition, platform, latestM
|
|
|
74
69
|
const inferredProduct = product || inferProductFromQuery(query);
|
|
75
70
|
if (!inferredProduct) return { ok: true };
|
|
76
71
|
|
|
77
|
-
const
|
|
78
|
-
const currentMajor = latestMajor[versionFamily];
|
|
72
|
+
const normalizedEdition = normalizeEdition(edition, platform, inferredProduct);
|
|
79
73
|
const requestedMajor = parseMajorVersion(version) ?? detectMajorFromQuery(query);
|
|
80
74
|
|
|
75
|
+
if (inferredProduct === "mrz" && !normalizedEdition && requestedMajor && requestedMajor === latestMajor.dcv) {
|
|
76
|
+
return { ok: true, latestMajor: latestMajor.dcv };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const currentMajor = inferredProduct === "mrz" && normalizedEdition === "mobile"
|
|
80
|
+
? latestMajor.dcv
|
|
81
|
+
: latestMajor[inferredProduct];
|
|
82
|
+
|
|
81
83
|
if (!requestedMajor || requestedMajor === currentMajor) {
|
|
82
84
|
return { ok: true, latestMajor: currentMajor };
|
|
83
85
|
}
|
|
@@ -89,11 +91,17 @@ function ensureLatestMajor({ product, version, query, edition, platform, latestM
|
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
+
if (inferredProduct === "dcv") {
|
|
95
|
+
return {
|
|
96
|
+
ok: false,
|
|
97
|
+
message: `This MCP server only serves the latest major version of DCV (v${currentMajor}).`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (inferredProduct === "mrz" || inferredProduct === "mds") {
|
|
94
102
|
return {
|
|
95
103
|
ok: false,
|
|
96
|
-
message: `This MCP server only serves the latest major version of ${
|
|
104
|
+
message: `This MCP server only serves the latest major version of ${inferredProduct.toUpperCase()} (v${currentMajor}).`
|
|
97
105
|
};
|
|
98
106
|
}
|
|
99
107
|
|
|
@@ -147,14 +155,14 @@ function buildVersionPolicyText(latestMajor) {
|
|
|
147
155
|
"This MCP server only serves the latest major versions of each product.",
|
|
148
156
|
"",
|
|
149
157
|
`- DBR latest major: v${latestMajor.dbr}`,
|
|
150
|
-
`- MRZ latest major: v${latestMajor.
|
|
151
|
-
`- MDS latest major: v${latestMajor.
|
|
158
|
+
`- MRZ latest major: v${latestMajor.mrz}`,
|
|
159
|
+
`- MDS latest major: v${latestMajor.mds}`,
|
|
152
160
|
`- DWT latest major: v${latestMajor.dwt}`,
|
|
153
161
|
`- DDV latest major: v${latestMajor.ddv}`,
|
|
154
162
|
"",
|
|
155
163
|
"Legacy support:",
|
|
156
164
|
"- DBR v9 and v10 docs are linked when requested.",
|
|
157
|
-
"- MRZ and MDS do not publish separate legacy archive links
|
|
165
|
+
"- MRZ and MDS do not publish separate legacy archive links in this server.",
|
|
158
166
|
`- DWT archived docs available: ${dwtLegacyVersions || "none"}.`,
|
|
159
167
|
"- DDV has no legacy archive links in this server.",
|
|
160
168
|
"",
|
|
@@ -269,6 +269,8 @@ const dcvMobileSdk = registry.sdks["dcv-mobile"];
|
|
|
269
269
|
const dcvWebSdk = registry.sdks["dcv-web"];
|
|
270
270
|
const dcvServerSdk = registry.sdks["dcv-server"];
|
|
271
271
|
const dcvCoreSdk = registry.sdks["dcv-core"];
|
|
272
|
+
const mrzWebSdk = registry.sdks["mrz-web"] || dcvWebSdk;
|
|
273
|
+
const mdsWebSdk = registry.sdks["mds-web"] || dcvWebSdk;
|
|
272
274
|
|
|
273
275
|
const LATEST_VERSIONS = {
|
|
274
276
|
dbr: {
|
|
@@ -288,6 +290,12 @@ const LATEST_VERSIONS = {
|
|
|
288
290
|
},
|
|
289
291
|
ddv: {
|
|
290
292
|
web: registry.sdks.ddv.version
|
|
293
|
+
},
|
|
294
|
+
mrz: {
|
|
295
|
+
web: mrzWebSdk.version
|
|
296
|
+
},
|
|
297
|
+
mds: {
|
|
298
|
+
web: mdsWebSdk.version
|
|
291
299
|
}
|
|
292
300
|
};
|
|
293
301
|
|
|
@@ -295,7 +303,9 @@ const LATEST_MAJOR = {
|
|
|
295
303
|
dbr: parseMajorVersion(registry.sdks["dbr-mobile"].version),
|
|
296
304
|
dcv: parseMajorVersion(dcvMobileSdk.version),
|
|
297
305
|
dwt: parseMajorVersion(registry.sdks.dwt.version),
|
|
298
|
-
ddv: parseMajorVersion(registry.sdks.ddv.version)
|
|
306
|
+
ddv: parseMajorVersion(registry.sdks.ddv.version),
|
|
307
|
+
mrz: parseMajorVersion(mrzWebSdk.version),
|
|
308
|
+
mds: parseMajorVersion(mdsWebSdk.version)
|
|
299
309
|
};
|
|
300
310
|
|
|
301
311
|
setWebFrameworkPlatformsGetter(getWebFrameworkPlatforms);
|
|
@@ -10,20 +10,15 @@ export function registerVersionTools({
|
|
|
10
10
|
LATEST_MAJOR,
|
|
11
11
|
LATEST_VERSIONS
|
|
12
12
|
}) {
|
|
13
|
-
function
|
|
13
|
+
function buildPublicWebVersionResponse(product, edition, platform) {
|
|
14
14
|
const label = product === "mrz" ? "MRZ" : "MDS";
|
|
15
|
-
const supportedEditions =
|
|
16
|
-
? [
|
|
17
|
-
{ key: "web", name: "Web", version: LATEST_VERSIONS.dcv.web },
|
|
18
|
-
{ key: "mobile", name: "Mobile", version: LATEST_VERSIONS.dcv.mobile }
|
|
19
|
-
]
|
|
20
|
-
: [{ key: "web", name: "Web", version: LATEST_VERSIONS.dcv.web }];
|
|
15
|
+
const supportedEditions = [{ key: "web", name: "Web", version: LATEST_VERSIONS[product].web }];
|
|
21
16
|
const supportedEditionKeys = supportedEditions.map((entry) => entry.key).join(", ");
|
|
22
17
|
|
|
23
18
|
if (!edition) {
|
|
24
19
|
const lines = [
|
|
25
20
|
`# ${label} Version Resolution`,
|
|
26
|
-
`- Latest major: v${LATEST_MAJOR
|
|
21
|
+
`- Latest major: v${LATEST_MAJOR[product]}`,
|
|
27
22
|
...supportedEditions.map((entry) => `- ${entry.name}: ${entry.version}`),
|
|
28
23
|
"",
|
|
29
24
|
"Specify edition/platform to resolve a single version."
|
|
@@ -44,7 +39,7 @@ export function registerVersionTools({
|
|
|
44
39
|
`# ${label} Version Resolution`,
|
|
45
40
|
`- Edition: ${edition}`,
|
|
46
41
|
displayPlatform ? `- Platform: ${displayPlatform}` : "",
|
|
47
|
-
`- Latest major: v${LATEST_MAJOR
|
|
42
|
+
`- Latest major: v${LATEST_MAJOR[product]}`,
|
|
48
43
|
`- Resolved version: ${supportedEdition.version}`
|
|
49
44
|
].filter(Boolean);
|
|
50
45
|
|
|
@@ -116,7 +111,7 @@ export function registerVersionTools({
|
|
|
116
111
|
}
|
|
117
112
|
|
|
118
113
|
if (normalizedProduct === "mrz" || normalizedProduct === "mds") {
|
|
119
|
-
return
|
|
114
|
+
return buildPublicWebVersionResponse(normalizedProduct, normalizedEdition, normalizedPlatform);
|
|
120
115
|
}
|
|
121
116
|
|
|
122
117
|
if (normalizedProduct === "dbr") {
|