@ohos-cpf/3rdloop 0.0.8 → 0.0.9
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 +25 -0
- package/lib/cli.js +22 -5
- package/lib/doctor.js +111 -10
- package/lib/mcp.js +498 -0
- package/package.json +6 -2
- package/vendor/Archive/data/.index/meta.json +7 -0
- package/vendor/Archive/data/.index/search.db +0 -0
- package/vendor/Archive/data/docs/experiences/arkts-check-tool-pitfalls-baseline-comparison.md +13 -0
- package/vendor/Archive/data/docs/experiences/arkts-deep-path-import-recognition.md +31 -0
- package/vendor/Archive/data/docs/experiences/arkts-demo-coverage-entry-file-case-mismatch.md +25 -0
- package/vendor/Archive/data/docs/experiences/arkts-demo-coverage-import-trailing-slash.md +20 -0
- package/vendor/Archive/data/docs/experiences/arkts-library-source-files-may-be-ts.md +18 -0
- package/vendor/Archive/data/docs/experiences/arkts-typedarray-buffer-interface-cast-compile-fixes.md +36 -0
- package/vendor/Archive/data/docs/experiences/arkts-xts-compile-error-clustering-fix.md +24 -0
- package/vendor/Archive/data/docs/experiences/arkts-xts-doc-expected-value-runtime-probe.md +35 -0
- package/vendor/Archive/data/docs/experiences/arkts-xts-fixture-rawfile-testability-injection.md +33 -0
- package/vendor/Archive/data/docs/experiences/code-linter-chinese-comment-false-positive.md +16 -0
- package/vendor/Archive/data/docs/experiences/esobject-new-expression-variable-tracking.md +33 -0
- package/vendor/Archive/data/docs/experiences/filesystem-case-sensitivity-module-resolution.md +31 -0
- package/vendor/Archive/data/docs/experiences/gitcode-clone-redirect-warning-normal.md +13 -0
- package/vendor/Archive/data/docs/experiences/kn_msgvq1w585ec8319.md +77 -0
- package/vendor/Archive/data/docs/experiences/kn_msovnm6rd46de72c.md +98 -0
- package/vendor/Archive/data/docs/experiences/kn_mspt8vntfe708576.md +87 -0
- package/vendor/Archive/data/docs/experiences/kn_mspu1ei77adbbb48.md +133 -0
- package/vendor/Archive/data/docs/experiences/kn_mspubgak8d30bfce.md +128 -0
- package/vendor/Archive/data/docs/experiences/kn_mspug2de3cb1f7c3.md +115 -0
- package/vendor/Archive/data/docs/experiences/kn_skill_opt_001.md +38 -0
- package/vendor/Archive/data/docs/experiences/loop-artifacts-verification-evidence-triangle.md +19 -0
- package/vendor/Archive/data/docs/experiences/macos-bash-replace-build-ps1.md +19 -0
- package/vendor/Archive/data/docs/experiences/macos-bsd-diff-q-illegal-option.md +15 -0
- package/vendor/Archive/data/docs/experiences/migrate-cjs-compatible-api-version-map-limit.md +17 -0
- package/vendor/Archive/data/docs/experiences/mp3agic-arkts-library-behavior-quirks.md +21 -0
- package/vendor/Archive/data/docs/experiences/ohos-face-detection-scan-api-mapping.md +15 -0
- package/vendor/Archive/data/docs/experiences/pr-metadata-and-diff-integrity-verification.md +12 -0
- package/vendor/Archive/data/docs/experiences/rn-coverage-index-signature-pseudo-member-false-negative.md +32 -0
- package/vendor/Archive/data/docs/experiences/rn-memory-check-severity-calibration.md +21 -0
- package/vendor/Archive/data/docs/experiences/rn-platform-specific-api-exclusion-evidence.md +24 -0
- package/vendor/Archive/data/docs/experiences/rn-upstream-version-diff-pitfalls.md +17 -0
- package/vendor/Archive/data/docs/experiences/rn-version-gap-risk-rating-rules.md +13 -0
- package/vendor/Archive/data/docs/experiences/rn-view-lib-native-contract-diff-fabric-spec.md +16 -0
- package/vendor/Archive/data/docs/experiences/rnoh-adapter-package-version-field-semantics.md +18 -0
- package/vendor/Archive/data/docs/experiences/rnoh-arkts-sqlite-rows-array-format.md +18 -0
- package/vendor/Archive/data/docs/experiences/rnoh-dependency-residue-scan-strategy.md +18 -0
- package/vendor/Archive/data/docs/experiences/rnoh-example-local-lib-dep-use-tgz.md +53 -0
- package/vendor/Archive/data/docs/experiences/rnoh-example-prereserve-rntesterlist.md +17 -0
- package/vendor/Archive/data/docs/experiences/rnoh-example-template-compatiblesdkversion-upgrade.md +29 -0
- package/vendor/Archive/data/docs/experiences/rnoh-example-turbomodule-shell-adaptation-checklist.md +41 -0
- package/vendor/Archive/data/docs/experiences/rnoh-mcp-build-project-tool-risk.md +18 -0
- package/vendor/Archive/data/docs/experiences/rnoh-npm-devdependencies-version-precheck.md +29 -0
- package/vendor/Archive/data/docs/experiences/rnoh-repo-baseline-version-verification.md +13 -0
- package/vendor/Archive/data/docs/experiences/rnoh-repo-upstream-directory-mapping.md +18 -0
- package/vendor/Archive/data/docs/experiences/rnoh-stateless-library-zero-leak-verification.md +31 -0
- package/vendor/Archive/data/docs/experiences/rnoh-template-npmrc-credential-removal.md +15 -0
- package/vendor/Archive/data/docs/experiences/rnoh-turbomodule-codegen-wiring-verification.md +19 -0
- package/vendor/Archive/data/docs/experiences/rnoh-turbomodule-cpp-methodmap-compatibility-check.md +20 -0
- package/vendor/Archive/data/docs/experiences/scenario-doc-vs-source-signature-diff-four-patterns.md +24 -0
- package/vendor/Archive/data/docs/experiences/static-analysis-grep-cross-validation.md +29 -0
- package/vendor/Archive/demo.js +489 -0
- package/vendor/Archive/index.js +43 -0
- package/vendor/Archive/package.json +16 -0
- package/vendor/Archive/src/constants.js +83 -0
- package/vendor/Archive/src/data/stopwords.txt +110 -0
- package/vendor/Archive/src/data/synonyms.json +25 -0
- package/vendor/Archive/src/data/terms.txt +59 -0
- package/vendor/Archive/src/db/sqlite-backend.js +312 -0
- package/vendor/Archive/src/db/sqlite-schema.js +64 -0
- package/vendor/Archive/src/engine.js +501 -0
- package/vendor/Archive/src/index/index-manager.js +203 -0
- package/vendor/Archive/src/index/index-state.js +94 -0
- package/vendor/Archive/src/index/search-text-builder.js +106 -0
- package/vendor/Archive/src/index.js +22 -0
- package/vendor/Archive/src/parser/api-identifiers.js +121 -0
- package/vendor/Archive/src/parser/api-suffixes.js +48 -0
- package/vendor/Archive/src/parser/heading-normalize.js +40 -0
- package/vendor/Archive/src/parser/markdown-splitter.js +215 -0
- package/vendor/Archive/src/search/catalog-routing.js +87 -0
- package/vendor/Archive/src/search/fts-search.js +289 -0
- package/vendor/Archive/src/search/query-normalizer.js +159 -0
- package/vendor/Archive/src/search/query-rewriter.js +72 -0
- package/vendor/Archive/src/search/search-engine.js +72 -0
- package/vendor/Archive/src/search/snippet.js +64 -0
- package/vendor/Archive/src/store/dir-store.js +103 -0
- package/vendor/Archive/src/store/doc-store.js +36 -0
- package/vendor/Archive/src/tokenizer/lexicon.js +151 -0
- package/vendor/Archive/src/tokenizer/tokenizer.js +167 -0
- package/vendor/Archive/src/types.js +86 -0
- package/vendor/Archive/src/utils/hash.js +16 -0
- package/vendor/Archive/src/utils/lock.js +73 -0
- package/vendor/Archive/src/utils/path-safety.js +96 -0
- package/vendor/Archive/src/utils/paths.js +39 -0
- package/vendor/BadCase/rn/INDEX.md +127 -0
- package/vendor/BadCase/rn/cases/KI-001-webview/350/247/206/351/242/221/346/227/240/346/263/225/346/250/252/345/261/217.md +52 -0
- package/vendor/BadCase/rn/cases/KI-002-fastImage/347/203/255/346/233/264/346/226/260/345/233/276/347/211/207/345/244/261/350/264/245.md +37 -0
- package/vendor/BadCase/rn/cases/KI-003-wechat/347/274/251/347/225/245/345/233/276/346/234/254/345/234/260/345/233/276/347/211/207.md +62 -0
- package/vendor/BadCase/rn/cases/KI-004-wechat/345/233/236/350/260/203/346/227/266/345/272/217.md +47 -0
- package/vendor/BadCase/rn/cases/KI-005-geolocation/345/257/274/345/205/245/350/267/257/345/276/204/345/220/216/347/274/200.md +31 -0
- package/vendor/BadCase/rn/cases/KI-006-SmartRefreshLayout/346/231/272/350/203/275/346/214/207/351/222/210/345/264/251/346/272/203.md +55 -0
- package/vendor/BadCase/rn/cases/KI-007-orientation-locker/344/274/240/346/204/237/345/231/250/345/210/235/345/247/213/345/214/226.md +58 -0
- package/vendor/BadCase/rn/cases/KI-008-orientation-locker/344/274/240/346/204/237/345/231/250/345/274/225/347/224/250/350/256/241/346/225/260.md +47 -0
- package/vendor/BadCase/rn/cases/KI-009-pager-view/345/265/214/345/245/227/346/273/221/345/212/250.md +38 -0
- package/vendor/BadCase/rn/cases/KI-010-screens/346/211/213/345/212/277/345/206/262/347/252/201.md +48 -0
- package/vendor/BadCase/rn/cases/KI-011-spring-scrollview/346/211/213/345/212/277/351/207/215/345/244/215/347/273/221/345/256/232.md +49 -0
- package/vendor/BadCase/rn/cases/KI-012-qr-camera/346/250/252/345/261/217/351/200/202/351/205/215.md +59 -0
- package/vendor/BadCase/rn/cases/KI-013-webview/346/267/261/350/211/262/346/250/241/345/274/217/350/203/214/346/231/257/350/211/262.md +37 -0
- package/vendor/BadCase/rn/cases/KI-014-amap-geolocation/345/233/236/350/260/203/347/274/272/345/244/261.md +42 -0
- package/vendor/BadCase/rn/cases/KI-015-reanimated/350/277/220/350/241/214/346/227/266/346/236/220/346/236/204/345/264/251/346/272/203.md +54 -0
- package/vendor/BadCase/rn/cases/KI-016-fs/346/226/207/344/273/266/350/257/273/345/217/226/347/274/226/347/240/201.md +58 -0
- package/vendor/BadCase/rn/cases/KI-017-blob-util/345/217/202/346/225/260/347/274/226/347/240/201/351/224/231/350/257/257.md +39 -0
- package/vendor/BadCase/rn/cases/KI-018-modal/345/274/271/347/252/227/351/227/252/347/203/201.md +53 -0
- package/vendor/BadCase/rn/cases/KI-019-code-push/351/207/215/345/220/257/351/200/273/350/276/221/345/244/261/346/225/210.md +79 -0
- package/vendor/BadCase/rn/cases/KI-020-netinfo/346/225/217/346/204/237/344/277/241/346/201/257/346/263/204/351/234/262.md +60 -0
- package/vendor/BadCase/rn/cases/KI-021-video/346/234/254/345/234/260/350/247/206/351/242/221/346/222/255/346/224/276/345/274/202/345/270/270.md +79 -0
- package/vendor/BadCase/rn/cases/KI-022-audio-recorder-player/346/236/232/344/270/276/347/274/272/345/244/261.md +38 -0
- package/vendor/BadCase/rn/cases/KI-023-svg/346/270/220/345/217/230/347/273/247/346/211/277/345/244/261/346/225/210.md +62 -0
- package/vendor/BadCase/rn/generalization-log.md +55 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-SmartRefreshLayout-32.json +328 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-SmartRefreshLayout-32.md +382 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-amap-geolocation-27.json +1351 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-amap-geolocation-27.md +1176 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-audio-recorder-player-22.json +538 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-audio-recorder-player-22.md +1488 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-blob-util-23.json +211 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-blob-util-23.md +35 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-code-push-17.json +2048 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-code-push-17.md +3866 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-fast-image-102.json +198 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-fast-image-102.md +40 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-fs-38.json +751 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-fs-38.md +883 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-geolocation-24.json +1544 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-geolocation-24.md +2598 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-modal-20.json +246 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-modal-20.md +554 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-netinfo-31.json +211 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-netinfo-31.md +54 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-45.json +1626 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-45.md +2213 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-51.json +208 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-51.md +77 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-pager-view-32.json +377 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-pager-view-32.md +174 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-qr-decode-image-camera-37.json +232 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-qr-decode-image-camera-37.md +194 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-reanimated-82.json +198 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-reanimated-82.md +67 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-87.json +198 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-87.md +38 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-93.json +208 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-93.md +34 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-spring-scrollview-38.json +222 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-spring-scrollview-38.md +56 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-svg-117.json +463 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-svg-117.md +383 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-video-66.json +464 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-video-66.md +565 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-112.json +198 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-112.md +47 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-121.json +232 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-121.md +422 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-wechat-lib-15.json +295 -0
- package/vendor/BadCase/rn/pr-info/rntpc_react-native-wechat-lib-15.md +1038 -0
- package/vendor/BadCase/rn/rules/R-01-/345/205/250/345/261/217/347/252/227/345/217/243/347/212/266/346/200/201/347/256/241/347/220/206/345/256/214/346/225/264/346/200/247.md +20 -0
- package/vendor/BadCase/rn/rules/R-02-/350/265/204/346/272/220URI/345/275/242/346/200/201/345/210/206/346/224/257/350/246/206/347/233/226.md +21 -0
- package/vendor/BadCase/rn/rules/R-03-/351/231/204/345/261/236/346/223/215/344/275/234/345/244/261/350/264/245/351/230/273/346/226/255/344/270/273/346/265/201/347/250/213.md +20 -0
- package/vendor/BadCase/rn/rules/R-04-/345/274/202/346/255/245/345/233/236/350/260/203/346/263/250/345/206/214/346/227/266/345/272/217.md +20 -0
- package/vendor/BadCase/rn/rules/R-05-/346/250/241/345/235/227/345/257/274/345/205/245/350/267/257/345/276/204/350/247/204/350/214/203.md +19 -0
- package/vendor/BadCase/rn/rules/R-06-/344/274/240/346/204/237/345/231/250/347/241/254/344/273/266/346/235/203/351/231/220/346/214/211/351/234/200/350/216/267/345/217/226.md +21 -0
- package/vendor/BadCase/rn/rules/R-07-/346/231/272/350/203/275/346/214/207/351/222/210/347/224/237/345/221/275/345/221/250/346/234/237/347/256/241/347/220/206.md +20 -0
- package/vendor/BadCase/rn/rules/R-08-/346/211/213/345/212/277/344/272/213/344/273/266/346/263/250/345/206/214/344/270/216/345/206/262/347/252/201/345/244/204/347/220/206.md +22 -0
- package/vendor/BadCase/rn/rules/R-09-/346/250/252/347/253/226/345/261/217/345/244/232/345/275/242/346/200/201/345/270/203/345/261/200/351/200/202/351/205/215.md +20 -0
- package/vendor/BadCase/rn/rules/R-10-/346/267/261/350/211/262/346/250/241/345/274/217/344/270/273/351/242/230/351/242/234/350/211/262/351/200/202/351/205/215.md +19 -0
- package/vendor/BadCase/rn/rules/R-11-/346/216/245/345/217/243/345/233/236/350/260/203/345/256/236/347/216/260/345/256/214/346/225/264/346/200/247.md +20 -0
- package/vendor/BadCase/rn/rules/R-12-/345/216/237/347/224/237/350/277/220/350/241/214/346/227/266/350/265/204/346/272/220/346/236/220/346/236/204/346/227/266/345/272/217.md +20 -0
- package/vendor/BadCase/rn/rules/R-13-/346/226/207/344/273/266/346/225/260/346/215/256/347/274/226/347/240/201/344/270/216/346/240/274/345/274/217/345/205/274/345/256/271.md +21 -0
- package/vendor/BadCase/rn/rules/R-14-/345/212/250/347/224/273/345/210/235/345/247/213/345/214/226/346/227/266/345/272/217/344/270/216/347/212/266/346/200/201/345/220/214/346/255/245.md +20 -0
- package/vendor/BadCase/rn/rules/R-15-/347/212/266/346/200/201/346/214/201/344/271/205/345/214/226/344/270/216/351/207/215/345/220/257/351/200/273/350/276/221/344/270/200/350/207/264/346/200/247.md +20 -0
- package/vendor/BadCase/rn/rules/R-16-/346/225/217/346/204/237/344/277/241/346/201/257/346/227/245/345/277/227/346/263/204/351/234/262.md +19 -0
- package/vendor/BadCase/rn/rules/R-17-/345/252/222/344/275/223/350/265/204/346/272/220/347/224/237/345/221/275/345/221/250/346/234/237/344/270/216/351/224/231/350/257/257/345/244/204/347/220/206.md +21 -0
- package/vendor/BadCase/rn/rules/R-18-/350/203/275/345/212/233/346/236/232/344/270/276/351/205/215/347/275/256/345/256/214/346/225/264/346/200/247.md +19 -0
- package/vendor/BadCase/rn/rules/R-19-/345/233/276/345/275/242/346/270/262/346/237/223/345/261/236/346/200/247/347/273/247/346/211/277/344/270/216/351/207/215/347/275/256.md +19 -0
- package/vendor/MCP/README.md +490 -0
- package/vendor/MCP/config.json +29 -0
- package/vendor/MCP/package.json +23 -0
- package/vendor/MCP/scripts/analyze-demo-coverage.cjs +1203 -0
- package/vendor/MCP/scripts/analyze-xts-coverage.cjs +1245 -0
- package/vendor/MCP/scripts/deveco_docs.js +247 -0
- package/vendor/MCP/scripts/extract-interfaces.cjs +1487 -0
- package/vendor/MCP/scripts/flutter-analyze-demo-coverage.cjs +666 -0
- package/vendor/MCP/scripts/flutter-analyze-xts-coverage.cjs +684 -0
- package/vendor/MCP/scripts/flutter-extract-interfaces.cjs +1251 -0
- package/vendor/MCP/scripts/flutter-render-spec-doc.cjs +351 -0
- package/vendor/MCP/scripts/render-spec-doc.cjs +347 -0
- package/vendor/MCP/scripts/rn-analyze-demo-coverage.cjs +645 -0
- package/vendor/MCP/scripts/rn-analyze-test-coverage.cjs +614 -0
- package/vendor/MCP/scripts/rn-extract-interfaces.cjs +1462 -0
- package/vendor/MCP/scripts/rn-render-spec-doc.cjs +327 -0
- package/vendor/MCP/scripts/rn-scan-exports.cjs +1336 -0
- package/vendor/MCP/src/client/MCPClientPool.js +220 -0
- package/vendor/MCP/src/config/ConfigLoader.js +189 -0
- package/vendor/MCP/src/executor/ScriptExecutor.js +110 -0
- package/vendor/MCP/src/gateway/Gateway.js +451 -0
- package/vendor/MCP/src/index.js +87 -0
- package/vendor/MCP/src/library/KBToolProvider.js +229 -0
- package/vendor/MCP/src/library/logger.js +60 -0
- package/vendor/MCP/src/registry/ScriptRegistry.js +238 -0
- package/vendor/MCP/src/registry/ToolRegistry.js +111 -0
- package/vendor/MCP/src/types.js +115 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +4 -2
- package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +3 -3
- package/vendor/Server/Skills/knowledge-import/SKILL.md +1 -1
- package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +12 -4
- package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +5 -4
- package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +2 -2
- package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +2 -2
- package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +1 -2
- package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +1 -1
- package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +1 -2
- package/vendor/Server/package.json +5 -1
- package/vendor/VERSION +3 -3
package/README.md
CHANGED
|
@@ -165,6 +165,31 @@ npm i -g @ohos-cpf/3rdloop
|
|
|
165
165
|
3rdloop serve remove-ext <扩展名> # 移除已安装扩展
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
### 场景六:MCP Gateway 装配(kb 检索 / 覆盖率脚本等 AI 工具)
|
|
169
|
+
|
|
170
|
+
npm 包内置 MCP Gateway(`vendor/MCP`)、知识库检索引擎(`vendor/Archive`)与已知问题知识库种子(`vendor/BadCase`)。opencode / deveco-code serve 需要在**全局配置**注册 Gateway 才会在启动时自动 spawn:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
3rdloop doctor # 推荐:环境自检,检测到未装配时自动完成装配(幂等)
|
|
174
|
+
3rdloop mcp status # 查看注册状态与数据目录
|
|
175
|
+
3rdloop mcp install # 显式装配/重装(doctor 自动装配的底层命令,可单独使用)
|
|
176
|
+
3rdloop mcp uninstall # 仅移除注册(用户数据保留)
|
|
177
|
+
|
|
178
|
+
# 可选参数
|
|
179
|
+
3rdloop doctor --no-fix # 仅诊断,不做任何修改
|
|
180
|
+
3rdloop mcp install --cli opencode # 只注册到 opencode(--cli deveco | opencode | all)
|
|
181
|
+
3rdloop mcp install --force # 重置用户级配置为包内默认
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
装配效果:
|
|
185
|
+
|
|
186
|
+
- `~/.3lib/3rdloop/mcp/config.json` — 用户级 Gateway 配置(脚本/引擎指向包内,随包更新获得新版本)
|
|
187
|
+
- `~/.3lib/3rdloop/kb-data/` — 本地知识库数据(`kb_add_document` / `kb_search` 工具,跨版本更新不丢失)
|
|
188
|
+
- `~/.3lib/3rdloop/BadCase/` — 已知问题知识库副本(RN 检视 SKILL 消费;泛化 SKILL 的写入落在此处,不污染包目录)
|
|
189
|
+
- 装配后**重启 serve**,AI 会话即可调用全部 MCP 工具(kb 检索、覆盖率分析脚本、下游知识库等)
|
|
190
|
+
|
|
191
|
+
> SKILL 中的分析脚本(如 `analyze-xts-coverage.cjs`)通过 `{{skillDir}}/../../../MCP/scripts/` 相对路径调用,npm 安装态与仓库开发态一致,无需额外配置。装配通常无需手动执行——`3rdloop doctor`(README 快速上手第一步)会自动完成;`run/submit` 等任务命令的预检若发现未装配,仅在 stderr 提示一行(不修改任何文件)。
|
|
192
|
+
|
|
168
193
|
更多进阶用法(任务管理、`step` 单步执行、`orch` 自定义编排、工作流注册等),见仓库 `cli/README_DEVELOP.md` 或 `3rdloop <子命令> --help`。
|
|
169
194
|
|
|
170
195
|
|
package/lib/cli.js
CHANGED
|
@@ -108,7 +108,7 @@ export async function runCli(argv) {
|
|
|
108
108
|
return cmdVersion(jsonMode);
|
|
109
109
|
|
|
110
110
|
case 'doctor':
|
|
111
|
-
return cmdDoctor({ projectRoot, skillDir, dataDir, quiet });
|
|
111
|
+
return cmdDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, rest });
|
|
112
112
|
|
|
113
113
|
case 'run':
|
|
114
114
|
return cmdRun({ flags, rest, projectRoot, dataDir, skillDir, jsonMode, quiet, verbose, out, u });
|
|
@@ -143,8 +143,11 @@ export async function runCli(argv) {
|
|
|
143
143
|
case 'config':
|
|
144
144
|
return cmdConfig({ flags, rest, projectRoot, user3libHome, jsonMode, out });
|
|
145
145
|
|
|
146
|
+
case 'mcp':
|
|
147
|
+
return cmdMcpImpl({ rest, user3libHome, jsonMode });
|
|
148
|
+
|
|
146
149
|
case 'serve':
|
|
147
|
-
return cmdServe({
|
|
150
|
+
return cmdServe({ rest, jsonMode, dataDir, user3libHome });
|
|
148
151
|
|
|
149
152
|
case 'update':
|
|
150
153
|
return cmdUpdate({ flags, rest, jsonMode, out });
|
|
@@ -173,9 +176,10 @@ function cmdVersion(jsonMode) {
|
|
|
173
176
|
|
|
174
177
|
// ─── doctor ───────────────────────────────────────────────────────
|
|
175
178
|
|
|
176
|
-
async function cmdDoctor({ projectRoot, skillDir, dataDir, quiet }) {
|
|
179
|
+
async function cmdDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, rest = [] }) {
|
|
177
180
|
const { runDoctor } = await import('./doctor.js');
|
|
178
|
-
const
|
|
181
|
+
const fix = !rest.includes('--no-fix');
|
|
182
|
+
const { ok } = await runDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, fix });
|
|
179
183
|
return ok ? EXIT.OK : EXIT.ERROR;
|
|
180
184
|
}
|
|
181
185
|
|
|
@@ -224,6 +228,16 @@ async function cmdConfig({ flags, rest, projectRoot, user3libHome, jsonMode, out
|
|
|
224
228
|
return cmdConfigImpl({ projectRoot, user3libHome, jsonMode, out, rest });
|
|
225
229
|
}
|
|
226
230
|
|
|
231
|
+
// ─── mcp(MCP Gateway 装配)────────────────────────────────────────
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 3rdloop mcp 命令二段分发(转发到 lib/mcp.js)。
|
|
235
|
+
*/
|
|
236
|
+
async function cmdMcpImpl({ rest, user3libHome, jsonMode }) {
|
|
237
|
+
const { cmdMcp } = await import('./mcp.js');
|
|
238
|
+
return cmdMcp({ rest, user3libHome, jsonMode });
|
|
239
|
+
}
|
|
240
|
+
|
|
227
241
|
// ─── update(自更新)─────────────────────────────────────────────
|
|
228
242
|
|
|
229
243
|
async function cmdUpdate({ flags, rest, jsonMode, out }) {
|
|
@@ -667,12 +681,15 @@ function printHelp() {
|
|
|
667
681
|
3rdloop workflows 列出已注册的固定编排工作流
|
|
668
682
|
3rdloop run <工作流名> [--flag <值> ...] 以固定编排执行工作流(阻塞到终态)
|
|
669
683
|
3rdloop config list|get|set|unset ... 配置 .env 配置项(默认读写 ~/.3lib/.env)
|
|
684
|
+
3rdloop mcp install [--cli opencode|deveco|all] 装配 MCP Gateway(注册到 AI CLI +
|
|
685
|
+
种子复制知识库数据/BadCase 到 ~/.3lib/3rdloop/,npm 安装态必需)
|
|
686
|
+
3rdloop mcp uninstall|status 移除注册 / 查看装配状态
|
|
670
687
|
3rdloop serve [--port N] [--web-port N] 启动 Server 后端 + Web 前端(同时启动)
|
|
671
688
|
[--web-root <dir>] [--ext-root <dir>] [--ext <name,...>] [--no-ext] [--open]
|
|
672
689
|
3rdloop serve install-ext <dir> 安装扩展(tag/issue/prcheck 等二级功能)
|
|
673
690
|
3rdloop serve list-ext | remove-ext <name> 扩展管理
|
|
674
691
|
3rdloop update [--check] [--yes] [--registry <url>] 自更新到 npm 最新版
|
|
675
|
-
3rdloop doctor
|
|
692
|
+
3rdloop doctor [--no-fix] 环境自检(默认自动装配 MCP Gateway;--no-fix 仅诊断)
|
|
676
693
|
3rdloop version 版本信息
|
|
677
694
|
|
|
678
695
|
工作流机制:
|
package/lib/doctor.js
CHANGED
|
@@ -63,14 +63,16 @@ async function probeServe(baseUrl) {
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* 收集全部检查项(doctor 与 precheckEnv 共用)。
|
|
66
|
-
* 每项:{ name, passed, detail, fix }——fix
|
|
66
|
+
* 每项:{ name, passed, detail, fix, warning? }——fix 为不通过时的修复提示;
|
|
67
|
+
* warning: true 的项仅 doctor 展示提示,不参与 precheckEnv 阻断(MCP 等增强能力缺失不阻断核心引擎)。
|
|
67
68
|
* @param {object} opts
|
|
68
69
|
* @param {string} opts.projectRoot
|
|
69
70
|
* @param {string} opts.skillDir
|
|
70
71
|
* @param {string} opts.dataDir
|
|
71
|
-
* @
|
|
72
|
+
* @param {string} [opts.user3libHome] - ~/.3lib(MCP 装配检查用;缺省按 ~ 推导)
|
|
73
|
+
* @returns {Promise<Array<{name: string, passed: boolean, detail?: string, fix?: string, warning?: boolean}>>}
|
|
72
74
|
*/
|
|
73
|
-
async function collectChecks({ projectRoot, skillDir, dataDir }) {
|
|
75
|
+
async function collectChecks({ projectRoot, skillDir, dataDir, user3libHome = '' }) {
|
|
74
76
|
const checks = [];
|
|
75
77
|
|
|
76
78
|
// 1. Node.js 版本
|
|
@@ -161,30 +163,120 @@ async function collectChecks({ projectRoot, skillDir, dataDir }) {
|
|
|
161
163
|
fix: `端口 ${cliCfg.port} 被异常进程占用,请清理后重试(lsof -i :${cliCfg.port} 定位 / 任务管理器结束进程)`,
|
|
162
164
|
});
|
|
163
165
|
|
|
166
|
+
// 8. MCP Gateway 装配(警告级:不阻断核心引擎,仅影响 kb 工具/脚本工具/知识库检索)
|
|
167
|
+
// AI CLI 全局配置中 mcp-gateway 已注册且指向存在的入口脚本 → 通过
|
|
168
|
+
const mcpCheck = await checkMcpRegistration(cliType);
|
|
169
|
+
checks.push({ warning: true, ...mcpCheck });
|
|
170
|
+
|
|
164
171
|
return checks;
|
|
165
172
|
}
|
|
166
173
|
|
|
174
|
+
/**
|
|
175
|
+
* 检查 MCP Gateway 是否已装配(AI CLI 全局配置注册 + 入口脚本存在)。
|
|
176
|
+
* 宽容实现:不 import lib/mcp.js 的完整装配(避免 doctor 依赖装配状态本身),
|
|
177
|
+
* 仅读配置文件判断。
|
|
178
|
+
*/
|
|
179
|
+
async function checkMcpRegistration(cliType) {
|
|
180
|
+
const home = process.env['HOME'] || process.env['USERPROFILE'] || '';
|
|
181
|
+
const configRoot = process.env['XDG_CONFIG_HOME'] || path.join(home, '.config');
|
|
182
|
+
const files = [
|
|
183
|
+
path.join(configRoot, 'opencode', 'opencode.json'),
|
|
184
|
+
path.join(configRoot, 'deveco', 'deveco.jsonc'),
|
|
185
|
+
];
|
|
186
|
+
const details = [];
|
|
187
|
+
let anyRegistered = false;
|
|
188
|
+
for (const file of files) {
|
|
189
|
+
const label = path.basename(path.dirname(file));
|
|
190
|
+
if (!fs.existsSync(file)) {
|
|
191
|
+
details.push(`${label}: 未注册`);
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const raw = fs.readFileSync(file, 'utf8');
|
|
196
|
+
const json = JSON.parse(_stripJsoncComments(raw));
|
|
197
|
+
const entry = json?.mcp?.['mcp-gateway'];
|
|
198
|
+
if (!entry) {
|
|
199
|
+
details.push(`${label}: 未注册`);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
// 入口脚本存在性(command 数组第 2 个元素)
|
|
203
|
+
const entryPath = Array.isArray(entry.command) ? entry.command[1] : null;
|
|
204
|
+
if (entryPath && fs.existsSync(entryPath)) {
|
|
205
|
+
details.push(`${label}: 已注册`);
|
|
206
|
+
anyRegistered = true;
|
|
207
|
+
} else {
|
|
208
|
+
details.push(`${label}: 已注册但入口脚本不存在(${entryPath || '未配置'})`);
|
|
209
|
+
}
|
|
210
|
+
} catch {
|
|
211
|
+
details.push(`${label}: 配置解析失败`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
name: 'MCP Gateway 装配',
|
|
216
|
+
passed: anyRegistered,
|
|
217
|
+
detail: details.join(';'),
|
|
218
|
+
fix: '3rdloop doctor(自动装配)或 3rdloop mcp install(kb 检索/脚本工具/知识库检索需要)',
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** 剥离 JSONC 注释(// 行注释与 /* 块注释)。 */
|
|
223
|
+
function _stripJsoncComments(raw) {
|
|
224
|
+
return raw
|
|
225
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
226
|
+
.replace(/(^|[^:"'\\])\/\/.*$/gm, '$1');
|
|
227
|
+
}
|
|
228
|
+
|
|
167
229
|
/**
|
|
168
230
|
* 执行环境自检(3rdloop doctor 命令实现)。
|
|
169
231
|
*
|
|
232
|
+
* 默认自动修复(fix=true):MCP Gateway 未装配时自动执行装配(等价 3rdloop mcp install,
|
|
233
|
+
* 幂等可重跑);--no-fix 仅诊断不修改任何文件。
|
|
234
|
+
*
|
|
170
235
|
* @param {object} opts
|
|
171
236
|
* @param {string} opts.projectRoot
|
|
172
237
|
* @param {string} opts.skillDir
|
|
173
238
|
* @param {string} opts.dataDir
|
|
239
|
+
* @param {string} [opts.user3libHome] - ~/.3lib(自动装配目标)
|
|
174
240
|
* @param {boolean} [opts.quiet] - 静默模式(不打印表格,仅返回结果)
|
|
241
|
+
* @param {boolean} [opts.fix] - 自动修复开关(默认 true)
|
|
175
242
|
* @returns {Promise<{ ok: boolean, checks: Array<{name: string, passed: boolean, detail?: string, fix?: string}> }>}
|
|
176
243
|
*/
|
|
177
244
|
export async function runDoctor(opts = {}) {
|
|
178
|
-
const
|
|
245
|
+
const { fix = true } = opts;
|
|
246
|
+
let checks = await collectChecks(opts);
|
|
179
247
|
|
|
180
|
-
//
|
|
181
|
-
|
|
248
|
+
// ── 自动修复:MCP Gateway 未装配 → 自动执行装配并复查 ──
|
|
249
|
+
if (fix) {
|
|
250
|
+
const mcpIdx = checks.findIndex(c => c.name === 'MCP Gateway 装配' && !c.passed);
|
|
251
|
+
if (mcpIdx !== -1) {
|
|
252
|
+
if (!opts.quiet) {
|
|
253
|
+
process.stderr.write(`\n${C.yellow}检测到 MCP Gateway 未装配,正在自动装配(3rdloop mcp install)...${C.reset}\n`);
|
|
254
|
+
}
|
|
255
|
+
try {
|
|
256
|
+
const { mcpInstall } = await import('./mcp.js');
|
|
257
|
+
const code = await mcpInstall({ user3libHome: opts.user3libHome || '', rest: [], jsonMode: false });
|
|
258
|
+
if (code === 0) {
|
|
259
|
+
const recheck = await checkMcpRegistration();
|
|
260
|
+
checks[mcpIdx] = { warning: true, ...recheck };
|
|
261
|
+
} else {
|
|
262
|
+
checks[mcpIdx].detail += ';自动装配失败,请手动执行 3rdloop mcp install 查看报错';
|
|
263
|
+
}
|
|
264
|
+
} catch (err) {
|
|
265
|
+
checks[mcpIdx].detail += `;自动装配异常: ${err.message}`;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// 汇总:warning 项不参与通过判定(提示性)
|
|
271
|
+
const ok = checks.every(c => c.passed || c.warning);
|
|
182
272
|
|
|
183
|
-
//
|
|
273
|
+
// 打印(失败项附加修复提示;警告项用 ⚠ 标记)
|
|
184
274
|
if (!opts.quiet) {
|
|
185
275
|
process.stderr.write(`\n${C.bold}3rdloop doctor 环境自检${C.reset}${C.gray}(AI CLI: ${resolveCliType()})${C.reset}\n`);
|
|
186
276
|
for (const c of checks) {
|
|
187
|
-
const icon = c.passed
|
|
277
|
+
const icon = c.passed
|
|
278
|
+
? `${C.green}✓${C.reset}`
|
|
279
|
+
: (c.warning ? `${C.yellow}⚠${C.reset}` : `${C.red}✗${C.reset}`);
|
|
188
280
|
process.stderr.write(` ${icon} ${c.name}`);
|
|
189
281
|
if (c.detail) process.stderr.write(` ${C.gray}${c.detail}${C.reset}`);
|
|
190
282
|
process.stderr.write('\n');
|
|
@@ -202,7 +294,9 @@ export async function runDoctor(opts = {}) {
|
|
|
202
294
|
*
|
|
203
295
|
* 与 doctor 同一检查集,语义差异:
|
|
204
296
|
* - serve 未运行不算失败(执行命令时会自动拉起;端口异常仍算失败)
|
|
205
|
-
* - 轻量:仅文件/PATH
|
|
297
|
+
* - 轻量:仅文件/PATH/端口探测,不拉起任何进程、不触引擎、**不改任何文件**
|
|
298
|
+
* (MCP 装配等修复动作只在 3rdloop doctor 中执行,任务命令保持无副作用)
|
|
299
|
+
* - MCP 未装配为警告级:不阻断,仅 stderr 提示一行
|
|
206
300
|
*
|
|
207
301
|
* @param {object} opts - { projectRoot, skillDir, dataDir }(与 runDoctor 相同)
|
|
208
302
|
* @returns {Promise<{ ok: boolean, failures: Array<{name: string, detail?: string, fix?: string}> }>}
|
|
@@ -210,8 +304,15 @@ export async function runDoctor(opts = {}) {
|
|
|
210
304
|
export async function precheckEnv(opts = {}) {
|
|
211
305
|
const checks = await collectChecks(opts);
|
|
212
306
|
const failures = checks
|
|
213
|
-
.filter(c => !c.passed)
|
|
307
|
+
.filter(c => !c.passed && !c.warning)
|
|
214
308
|
.map(({ name, detail, fix }) => ({ name, detail, fix }));
|
|
309
|
+
|
|
310
|
+
// 警告级提示(不阻断):MCP 未装配时提醒一次
|
|
311
|
+
const mcpWarn = checks.find(c => c.name === 'MCP Gateway 装配' && !c.passed);
|
|
312
|
+
if (mcpWarn) {
|
|
313
|
+
process.stderr.write(`提示: MCP Gateway 未装配(kb 检索/脚本工具不可用),运行 ${C.cyan}3rdloop doctor${C.reset} 可自动装配\n`);
|
|
314
|
+
}
|
|
315
|
+
|
|
215
316
|
return { ok: failures.length === 0, failures };
|
|
216
317
|
}
|
|
217
318
|
|