simple-dynamsoft-mcp 6.3.0 → 7.0.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.
Files changed (47) hide show
  1. package/.env.example +35 -9
  2. package/README.md +156 -497
  3. package/package.json +13 -7
  4. package/scripts/prebuild-rag-index.mjs +1 -1
  5. package/scripts/run-gemini-tests.mjs +1 -1
  6. package/scripts/sync-submodules.mjs +1 -1
  7. package/scripts/verify-doc-resources.mjs +79 -0
  8. package/src/data/bootstrap.js +475 -0
  9. package/src/data/download-utils.js +99 -0
  10. package/src/data/hydration-mode.js +15 -0
  11. package/src/data/hydration-policy.js +39 -0
  12. package/src/data/repo-map.js +149 -0
  13. package/src/{data-root.js → data/root.js} +1 -1
  14. package/src/{submodule-sync.js → data/submodule-sync.js} +1 -1
  15. package/src/index.js +49 -1499
  16. package/src/observability/logging.js +51 -0
  17. package/src/rag/config.js +96 -0
  18. package/src/rag/index.js +266 -0
  19. package/src/rag/lexical-provider.js +170 -0
  20. package/src/rag/logger.js +46 -0
  21. package/src/rag/profile-config.js +48 -0
  22. package/src/rag/providers.js +585 -0
  23. package/src/rag/search-utils.js +166 -0
  24. package/src/rag/vector-cache.js +323 -0
  25. package/src/server/create-server.js +168 -0
  26. package/src/server/helpers/server-helpers.js +33 -0
  27. package/src/{resource-index → server/resource-index}/paths.js +2 -2
  28. package/src/{resource-index → server/resource-index}/samples.js +9 -1
  29. package/src/{resource-index.js → server/resource-index.js} +158 -93
  30. package/src/server/resources/register-resources.js +56 -0
  31. package/src/server/runtime-config.js +66 -0
  32. package/src/server/tools/register-index-tools.js +130 -0
  33. package/src/server/tools/register-project-tools.js +305 -0
  34. package/src/server/tools/register-quickstart-tools.js +572 -0
  35. package/src/server/tools/register-sample-tools.js +333 -0
  36. package/src/server/tools/register-version-tools.js +136 -0
  37. package/src/server/transports/http.js +84 -0
  38. package/src/server/transports/stdio.js +12 -0
  39. package/src/data-bootstrap.js +0 -255
  40. package/src/rag.js +0 -1203
  41. /package/src/{gemini-retry.js → rag/gemini-retry.js} +0 -0
  42. /package/src/{normalizers.js → server/normalizers.js} +0 -0
  43. /package/src/{resource-index → server/resource-index}/builders.js +0 -0
  44. /package/src/{resource-index → server/resource-index}/config.js +0 -0
  45. /package/src/{resource-index → server/resource-index}/docs-loader.js +0 -0
  46. /package/src/{resource-index → server/resource-index}/uri.js +0 -0
  47. /package/src/{resource-index → server/resource-index}/version-policy.js +0 -0
package/.env.example CHANGED
@@ -1,16 +1,24 @@
1
- # RAG provider selection (primary + fallback)
2
- # RAG_PROVIDER: auto | gemini | local | fuse
3
- # - auto: gemini if GEMINI_API_KEY is set, otherwise local
1
+ # Runtime profile selection (recommended)
2
+ # MCP_PROFILE: lite | semantic-local | semantic-gemini
3
+ # - lite: lightweight defaults for broad compatibility (no model download)
4
+ # - semantic-local: local embeddings via @xenova/transformers
5
+ # - semantic-gemini: remote embeddings via Google Gemini
6
+ MCP_PROFILE=lite
7
+
8
+ # RAG provider selection (optional explicit override)
9
+ # RAG_PROVIDER: lexical | gemini | local | fuse
10
+ # - lexical: hybrid lexical retrieval (BM25 + Fuse)
4
11
  # - gemini: remote embeddings via Google Gemini
5
12
  # - local: local embeddings via @xenova/transformers
6
- # - fuse: legacy fuzzy search only (no embeddings)
7
- RAG_PROVIDER=auto
13
+ # - fuse: compatibility fallback (fuzzy-only, no embeddings)
14
+ RAG_PROVIDER=lexical
8
15
 
9
- # RAG_FALLBACK: none | fuse | local
16
+ # RAG_FALLBACK: none | lexical | fuse | local
10
17
  # - none: do not fall back if primary fails
18
+ # - lexical: hybrid lexical fallback (recommended for no-model fallback)
11
19
  # - fuse: fuzzy search fallback (fast, no embeddings)
12
20
  # - local: local embeddings fallback (if primary is gemini)
13
- RAG_FALLBACK=fuse
21
+ RAG_FALLBACK=none
14
22
 
15
23
  # Gemini remote embeddings (required when RAG_PROVIDER=gemini)
16
24
  # * GEMINI_API_KEY: your Gemini API key (never commit to git)
@@ -60,14 +68,18 @@ RAG_FALLBACK=fuse
60
68
  # * RAG_REBUILD: true to ignore cache and rebuild on startup/search
61
69
  # * RAG_PREWARM: true to build the embedding index at startup
62
70
  # * RAG_PREWARM_BLOCK: true to block startup until prewarm completes
63
- # * RAG_PREBUILT_INDEX_AUTO_DOWNLOAD: auto-download prebuilt local index when local embeddings are selected
64
- # * RAG_PREBUILT_INDEX_URL: override prebuilt index archive URL (default GitHub release asset for current package version)
71
+ # * RAG_PREBUILT_INDEX_AUTO_DOWNLOAD: auto-download prebuilt index when local or gemini embeddings are selected
72
+ # * RAG_PREBUILT_INDEX_URL: global override URL for prebuilt index archive (applies to both local and gemini providers)
73
+ # * RAG_PREBUILT_INDEX_URL_LOCAL: provider-specific URL override for local prebuilt index archive
74
+ # * RAG_PREBUILT_INDEX_URL_GEMINI: provider-specific URL override for gemini prebuilt index archive
65
75
  # * RAG_PREBUILT_INDEX_TIMEOUT_MS: timeout for prebuilt index download request
66
76
  # RAG_REBUILD=false
67
77
  # RAG_PREWARM=false
68
78
  # RAG_PREWARM_BLOCK=false
69
79
  # RAG_PREBUILT_INDEX_AUTO_DOWNLOAD=true
70
80
  # RAG_PREBUILT_INDEX_URL=
81
+ # RAG_PREBUILT_INDEX_URL_LOCAL=
82
+ # RAG_PREBUILT_INDEX_URL_GEMINI=
71
83
  # RAG_PREBUILT_INDEX_TIMEOUT_MS=180000
72
84
 
73
85
  # Optional data submodule sync on server startup
@@ -81,9 +93,23 @@ RAG_FALLBACK=fuse
81
93
  # * MCP_DATA_AUTO_DOWNLOAD: auto-download pinned sample/doc archives when local data is missing
82
94
  # * MCP_DATA_CACHE_DIR: where downloaded data is stored
83
95
  # * MCP_DATA_REFRESH_ON_START: force re-download even when cache matches lock manifest
96
+ # * MCP_DATA_HYDRATION_MODE: eager (download all repos at startup) | lazy (metadata-first, hydrate repos on demand)
84
97
  # * MCP_DATA_DOWNLOAD_TIMEOUT_MS: timeout per archive download request in milliseconds
98
+ # * MCP_DATA_DOWNLOAD_RETRY_MAX_ATTEMPTS: max retry attempts for retryable archive download failures
99
+ # * MCP_DATA_DOWNLOAD_RETRY_BASE_DELAY_MS: exponential backoff base delay in milliseconds
100
+ # * MCP_DATA_DOWNLOAD_RETRY_MAX_DELAY_MS: exponential backoff max delay in milliseconds
85
101
  # MCP_DATA_DIR=
86
102
  # MCP_DATA_AUTO_DOWNLOAD=true
87
103
  # MCP_DATA_CACHE_DIR=
88
104
  # MCP_DATA_REFRESH_ON_START=false
105
+ # MCP_DATA_HYDRATION_MODE=lazy
89
106
  # MCP_DATA_DOWNLOAD_TIMEOUT_MS=180000
107
+ # MCP_DATA_DOWNLOAD_RETRY_MAX_ATTEMPTS=3
108
+ # MCP_DATA_DOWNLOAD_RETRY_BASE_DELAY_MS=500
109
+ # MCP_DATA_DOWNLOAD_RETRY_MAX_DELAY_MS=5000
110
+
111
+ # Observability logs
112
+ # * MCP_VERBOSE_LOGS: true to include debug-level diagnostics
113
+ # * MCP_LOG_LEVEL: info | debug (debug enables verbose logs)
114
+ # MCP_VERBOSE_LOGS=false
115
+ # MCP_LOG_LEVEL=info