simple-dynamsoft-mcp 7.2.5 → 7.2.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.
@@ -78,8 +78,8 @@
78
78
  "branch": "main",
79
79
  "owner": "dynamsoft-docs",
80
80
  "repo": "document-viewer-docs",
81
- "commit": "4a49e918d174f4efac927981b81c81024d9ba3dc",
82
- "archiveUrl": "https://codeload.github.com/dynamsoft-docs/document-viewer-docs/zip/4a49e918d174f4efac927981b81c81024d9ba3dc"
81
+ "commit": "b187c4d36884df285d02dfb977e450e53f097d51",
82
+ "archiveUrl": "https://codeload.github.com/dynamsoft-docs/document-viewer-docs/zip/b187c4d36884df285d02dfb977e450e53f097d51"
83
83
  },
84
84
  {
85
85
  "name": "data/documentation/web-twain-docs",
@@ -88,8 +88,8 @@
88
88
  "branch": "master",
89
89
  "owner": "dynamsoft-docs",
90
90
  "repo": "web-twain-docs",
91
- "commit": "a38d73c583b8379c0d80337e92f291f6c1ab10a8",
92
- "archiveUrl": "https://codeload.github.com/dynamsoft-docs/web-twain-docs/zip/a38d73c583b8379c0d80337e92f291f6c1ab10a8"
91
+ "commit": "7b8e127b298a2ef9abb7cd870bb742b44a132503",
92
+ "archiveUrl": "https://codeload.github.com/dynamsoft-docs/web-twain-docs/zip/7b8e127b298a2ef9abb7cd870bb742b44a132503"
93
93
  },
94
94
  {
95
95
  "name": "data/samples/dynamic-web-twain",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-dynamsoft-mcp",
3
- "version": "7.2.5",
3
+ "version": "7.2.7",
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": {
@@ -2,12 +2,24 @@ import { existsSync, readdirSync, statSync } from "node:fs";
2
2
  import { extname, join } from "node:path";
3
3
  import { DDV_PREFERRED_ENTRY_FILES } from "./config.js";
4
4
 
5
- function mapDocTitlesWithOptionalPlatform(articles, includePlatform = false) {
6
- return articles.map((article) => ({
7
- title: article.title,
8
- category: article.breadcrumb || "",
9
- ...(includePlatform && article.platform ? { platform: article.platform } : {})
10
- }));
5
+ function countSamples(sampleData) {
6
+ if (Array.isArray(sampleData)) {
7
+ return sampleData.length;
8
+ }
9
+
10
+ if (sampleData && typeof sampleData === "object") {
11
+ return Object.values(sampleData).reduce((total, value) => {
12
+ return total + countSamples(value);
13
+ }, 0);
14
+ }
15
+
16
+ return 0;
17
+ }
18
+
19
+ function countDiscoveredSamplesByPlatforms(platforms, discoverSamplesForPlatform) {
20
+ return platforms.reduce((total, platform) => {
21
+ return total + countSamples(discoverSamplesForPlatform(platform));
22
+ }, 0);
11
23
  }
12
24
 
13
25
  function getDcvScenarioTags(sampleName) {
@@ -35,20 +47,20 @@ function buildProductSelectionGuidanceText() {
35
47
  return [
36
48
  "# Product Selection Guidance",
37
49
  "",
38
- "## DBR vs DCV",
50
+ "## Dynamsoft Barcode Reader (DBR) vs Dynamsoft Capture Vision (DCV)",
39
51
  "",
40
- "Dynamsoft Capture Vision (DCV) is a superset architecture that aggregates DBR, DLR, DDN, DCP, and DCE.",
52
+ "Dynamsoft Capture Vision (DCV) is a superset architecture that aggregates Dynamsoft Barcode Reader (DBR), Dynamsoft Label Recognizer (DLR), Dynamsoft Document Normalizer (DDN), Dynamsoft Code Parser (DCP), and Dynamsoft Camera Enhancer (DCE).",
41
53
  "",
42
- "Use DBR when you only need barcode reading and do not need DCV workflows.",
54
+ "Use Dynamsoft Barcode Reader (DBR) when you only need barcode reading and do not need Dynamsoft Capture Vision (DCV) workflows.",
43
55
  "",
44
- "Use DCV when your scenario includes:",
56
+ "Use Dynamsoft Capture Vision (DCV) when your scenario includes:",
45
57
  "- VIN scanning",
46
58
  "- MRZ/passport/ID scanning",
47
59
  "- Driver license parsing",
48
60
  "- Document detection/normalization/auto-capture/cropping",
49
61
  "- Multi-task image processing and parsing workflows",
50
62
  "",
51
- "If a query includes MRZ, VIN, driver license, or document-normalization intents, prefer DCV samples/docs."
63
+ "If a query includes MRZ, VIN, driver license, or document-normalization intents, prefer Dynamsoft Capture Vision (DCV) samples and docs."
52
64
  ].join("\n");
53
65
  }
54
66
 
@@ -146,16 +158,17 @@ function buildIndexData({
146
158
  const dcvWebFrameworks = getDcvWebFrameworkPlatforms();
147
159
  const dcvMobilePlatforms = getDcvMobilePlatforms();
148
160
  const dcvServerPlatforms = getDcvServerPlatforms();
149
- const dbrWebSamples = discoverWebSamples();
161
+ const dbrWebSampleCount = countSamples(discoverWebSamples());
150
162
  const dbrWebFrameworks = getDbrWebFrameworkPlatforms();
151
163
  const dbrMobilePlatforms = getDbrMobilePlatforms();
152
164
  const dbrServerPlatforms = getDbrServerPlatforms();
165
+ const dwtSampleCount = countSamples(discoverDwtSamples());
153
166
  const ddvSamples = discoverDdvSamples();
154
167
  const ddvWebFrameworks = getDdvWebFrameworkPlatforms();
155
168
 
156
169
  return {
157
170
  productSelection: {
158
- dcvSupersetSummary: "DCV aggregates DBR, DLR, DDN, DCP, and DCE into one pipeline.",
171
+ dcvSupersetSummary: "Dynamsoft Capture Vision (DCV) aggregates Dynamsoft Barcode Reader (DBR), Dynamsoft Label Recognizer (DLR), Dynamsoft Document Normalizer (DDN), Dynamsoft Code Parser (DCP), and Dynamsoft Camera Enhancer (DCE) into one pipeline.",
159
172
  useDbrWhen: [
160
173
  "Barcode-only workflows where DCV-specific workflows are not required."
161
174
  ],
@@ -175,32 +188,25 @@ function buildIndexData({
175
188
  version: dcvCoreVersion,
176
189
  platforms: ["core"],
177
190
  docCount: dcvCoreDocs.length,
178
- docTitles: mapDocTitlesWithOptionalPlatform(dcvCoreDocs)
191
+ sampleCount: 0
179
192
  },
180
193
  web: {
181
194
  version: dcvWebVersion,
182
195
  platforms: ["js", ...dcvWebFrameworks],
183
- samples: dcvWebSamples,
184
196
  docCount: dcvWebDocs.length,
185
- docTitles: mapDocTitlesWithOptionalPlatform(dcvWebDocs)
197
+ sampleCount: countSamples(dcvWebSamples)
186
198
  },
187
199
  mobile: {
188
200
  version: dcvMobileVersion,
189
201
  platforms: dcvMobilePlatforms,
190
- samples: Object.fromEntries(
191
- dcvMobilePlatforms.map((platform) => [platform, discoverDcvMobileSamples(platform)])
192
- ),
193
202
  docCount: dcvMobileDocs.length,
194
- docTitles: mapDocTitlesWithOptionalPlatform(dcvMobileDocs, true)
203
+ sampleCount: countDiscoveredSamplesByPlatforms(dcvMobilePlatforms, discoverDcvMobileSamples)
195
204
  },
196
205
  server: {
197
206
  version: dcvServerVersion,
198
207
  platforms: dcvServerPlatforms,
199
- samples: Object.fromEntries(
200
- dcvServerPlatforms.map((platform) => [platform, discoverDcvServerSamples(platform)])
201
- ),
202
208
  docCount: dcvServerDocs.length,
203
- docTitles: mapDocTitlesWithOptionalPlatform(dcvServerDocs, true)
209
+ sampleCount: countDiscoveredSamplesByPlatforms(dcvServerPlatforms, discoverDcvServerSamples)
204
210
  }
205
211
  }
206
212
  },
@@ -210,27 +216,20 @@ function buildIndexData({
210
216
  mobile: {
211
217
  version: dbrMobileVersion,
212
218
  platforms: dbrMobilePlatforms,
213
- samples: Object.fromEntries(
214
- dbrMobilePlatforms.map((platform) => [platform, discoverMobileSamples(platform)])
215
- ),
216
219
  docCount: dbrMobileDocs.length,
217
- docTitles: mapDocTitlesWithOptionalPlatform(dbrMobileDocs, true)
220
+ sampleCount: countDiscoveredSamplesByPlatforms(dbrMobilePlatforms, discoverMobileSamples)
218
221
  },
219
222
  web: {
220
223
  version: dbrWebVersion,
221
224
  platforms: ["js", ...dbrWebFrameworks],
222
- samples: dbrWebSamples,
223
225
  docCount: dbrWebDocs.length,
224
- docTitles: mapDocTitlesWithOptionalPlatform(dbrWebDocs)
226
+ sampleCount: dbrWebSampleCount
225
227
  },
226
228
  server: {
227
229
  version: dbrServerVersion,
228
230
  platforms: dbrServerPlatforms,
229
- samples: Object.fromEntries(
230
- dbrServerPlatforms.map((platform) => [platform, discoverDbrServerSamples(platform)])
231
- ),
232
231
  docCount: dbrServerDocs.length,
233
- docTitles: mapDocTitlesWithOptionalPlatform(dbrServerDocs, true)
232
+ sampleCount: countDiscoveredSamplesByPlatforms(dbrServerPlatforms, discoverDbrServerSamples)
234
233
  }
235
234
  }
236
235
  },
@@ -240,12 +239,8 @@ function buildIndexData({
240
239
  web: {
241
240
  version: dwtVersion,
242
241
  platforms: ["js"],
243
- sampleCategories: discoverDwtSamples(),
244
242
  docCount: dwtDocs.articles.length,
245
- docTitles: dwtDocs.articles.map((article) => ({
246
- title: article.title,
247
- category: article.breadcrumb || ""
248
- }))
243
+ sampleCount: dwtSampleCount
249
244
  }
250
245
  }
251
246
  },
@@ -255,12 +250,8 @@ function buildIndexData({
255
250
  web: {
256
251
  version: ddvVersion,
257
252
  platforms: ["js", ...ddvWebFrameworks],
258
- samples: ddvSamples,
259
253
  docCount: ddvDocs.articles.length,
260
- docTitles: ddvDocs.articles.map((article) => ({
261
- title: article.title,
262
- category: article.breadcrumb || ""
263
- }))
254
+ sampleCount: countSamples(ddvSamples)
264
255
  }
265
256
  }
266
257
  }