@ohos-cpf/3rdloop 0.0.7 → 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 +44 -25
- package/lib/cli.js +54 -29
- package/lib/config-cmd.js +1 -1
- package/lib/config.js +32 -0
- package/lib/doctor.js +266 -48
- package/lib/mcp.js +498 -0
- package/lib/opencode.js +75 -29
- package/lib/orch.js +32 -10
- package/lib/runner.js +8 -5
- package/lib/serve.js +162 -149
- package/lib/step.js +15 -4
- package/lib/web.js +107 -265
- package/lib/workflow.js +18 -8
- 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/CLI/cli.js +3 -3
- package/vendor/Server/Routes/server.js +3 -3
- 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
|
@@ -44,10 +44,10 @@ npm i -g @ohos-cpf/3rdloop
|
|
|
44
44
|
3rdloop doctor
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
`doctor` 会逐项检查 Node /
|
|
47
|
+
`doctor` 会逐项检查 Node / CLI_TYPE 配置 / AI CLI(按 `CLI_TYPE` 检测 opencode 或 deveco)/ `.env` 凭据 / SKILL 目录 / 数据目录 / serve 服务连通性,缺什么会明确提示。除此之外还需要了解:
|
|
48
48
|
|
|
49
49
|
- **Node.js** >= 22
|
|
50
|
-
- **
|
|
50
|
+
- **AI CLI**(默认 `deveco`,`CLI_TYPE` 可切 `opencode`):`3rdloop` 会自动拉起对应的 `serve` 服务(在项目上一级目录运行),退出时清理进程树;已存在则复用,一般无需手动管理
|
|
51
51
|
- **LLM 凭据**:`doctor` 提示凭据缺失时,见下面"配置"一节
|
|
52
52
|
|
|
53
53
|
### 场景二:配置 —— 需要注意哪些配置项
|
|
@@ -78,8 +78,9 @@ npm i -g @ohos-cpf/3rdloop
|
|
|
78
78
|
# LLM 模型 id
|
|
79
79
|
3rdloop config set LLM_MODEL glm-5.2
|
|
80
80
|
|
|
81
|
-
# 默认 CLI
|
|
82
|
-
|
|
81
|
+
# 默认 CLI 类型(默认 deveco-code;如需切回 opencode)
|
|
82
|
+
# 切换后 doctor 按新类型检测,run/step/orch/workflow 拉起对应 serve 并连接
|
|
83
|
+
3rdloop config set CLI_TYPE opencode
|
|
83
84
|
|
|
84
85
|
# 数据存储目录(默认 ~/.3lib/3rdloop/db,如团队共享目录)
|
|
85
86
|
3rdloop config set 3LIB_DATA_DIR "D:\code\team\shared-db"
|
|
@@ -106,6 +107,8 @@ npm i -g @ohos-cpf/3rdloop
|
|
|
106
107
|
|
|
107
108
|
`run` 会自动完成"任务拆解 → 编排执行 → 准出审核"的完整大循环,多轮次自动重规划直到通过;退出码 `0` 即通过。
|
|
108
109
|
|
|
110
|
+
> **环境预检**:`run`/`submit`/`step run`/`orch run|start` 及工作流在正式执行前会自动做环境预检(Node 版本 / CLI_TYPE / AI CLI / LLM 凭据 / SKILL 目录 / 数据目录)。任一项不通过直接退出码 `1`,并打印对应修复命令(如 `3rdloop config set DASHSCOPE_API_KEY <sk-xxx>`);完整自检用 `3rdloop doctor`。`--print-taskdef` 等 dry-run 不预检。
|
|
111
|
+
|
|
109
112
|
任务比较耗时、不想干等?提交后立即返回 taskId(进程内继续跑,需保持进程存活),之后可用 `3rdloop progress/wait/result <taskId>` 跟进:
|
|
110
113
|
|
|
111
114
|
```bash
|
|
@@ -134,43 +137,59 @@ npm i -g @ohos-cpf/3rdloop
|
|
|
134
137
|
|
|
135
138
|
> 提 PR 是非幂等发布操作,失败不会自动重试;执行成功后报告 `ohos-lib-pr-push-report.md` 会自动复制到执行目录。先用 `--print-taskdef` dry-run 可以核对将执行的编排定义。
|
|
136
139
|
|
|
137
|
-
### 场景五:用 Web 界面操作(serve
|
|
138
|
-
|
|
139
|
-
除了命令行,也可以在浏览器里使用 Web 工作台(提交任务 / 查看循环进度 / PR 检视等),由两个命令提供支撑:
|
|
140
|
+
### 场景五:用 Web 界面操作(serve)
|
|
140
141
|
|
|
141
|
-
|
|
142
|
+
除了命令行,也可以在浏览器里使用 Web 工作台(提交任务 / 查看循环进度 / PR 检视等)。`3rdloop serve` 一条命令**同时启动** Server HTTP 后端(默认 3000)与 Web 前端(默认 8080,静态托管 + `/api/*` 反代到后端 + 扩展挂载):
|
|
142
143
|
|
|
143
144
|
```bash
|
|
144
|
-
#
|
|
145
|
+
# 后端(默认 http://127.0.0.1:3000)+ Web 前端(默认 http://localhost:8080)同时启动
|
|
145
146
|
3rdloop serve
|
|
146
147
|
|
|
147
|
-
#
|
|
148
|
-
3rdloop serve --
|
|
149
|
-
```
|
|
148
|
+
# 启动后自动打开浏览器
|
|
149
|
+
3rdloop serve --open
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
# 自定义端口(--port 后端 / --web-port 前端,也可用 3LIB_SERVER_PORT / 3LIB_WEB_PORT 覆盖)
|
|
152
|
+
3rdloop serve --port 3001 --web-port 8081
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
# 禁用全部扩展(纯核心工作台模式)
|
|
155
|
+
3rdloop serve --no-ext
|
|
156
|
+
```
|
|
154
157
|
|
|
155
|
-
|
|
156
|
-
# 启动并自动打开浏览器(--backend 默认指向 http://127.0.0.1:3000,配合 serve 使用)
|
|
157
|
-
3rdloop web --open
|
|
158
|
+
> CLI 的 `run`/`submit`/`wait` 等命令保持嵌入式模式,不经此后端。
|
|
158
159
|
|
|
159
|
-
|
|
160
|
-
3rdloop web --port 8081 --backend http://127.0.0.1:3000
|
|
160
|
+
扩展机制(tag / issue / prcheck 等二级目录功能以扩展形式按需安装,不随 npm 包分发):
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
3rdloop
|
|
162
|
+
```bash
|
|
163
|
+
3rdloop serve install-ext <扩展目录> # 安装扩展到 ~/.3lib/3rdloop/web-ext/
|
|
164
|
+
3rdloop serve list-ext # 列出可用扩展(含来源与挂载点)
|
|
165
|
+
3rdloop serve remove-ext <扩展名> # 移除已安装扩展
|
|
164
166
|
```
|
|
165
167
|
|
|
166
|
-
|
|
168
|
+
### 场景六:MCP Gateway 装配(kb 检索 / 覆盖率脚本等 AI 工具)
|
|
169
|
+
|
|
170
|
+
npm 包内置 MCP Gateway(`vendor/MCP`)、知识库检索引擎(`vendor/Archive`)与已知问题知识库种子(`vendor/BadCase`)。opencode / deveco-code serve 需要在**全局配置**注册 Gateway 才会在启动时自动 spawn:
|
|
167
171
|
|
|
168
172
|
```bash
|
|
169
|
-
3rdloop
|
|
170
|
-
3rdloop
|
|
171
|
-
3rdloop
|
|
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 # 重置用户级配置为包内默认
|
|
172
182
|
```
|
|
173
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
|
+
|
|
174
193
|
更多进阶用法(任务管理、`step` 单步执行、`orch` 自定义编排、工作流注册等),见仓库 `cli/README_DEVELOP.md` 或 `3rdloop <子命令> --help`。
|
|
175
194
|
|
|
176
195
|
|
package/lib/cli.js
CHANGED
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
resolveSkillDir,
|
|
35
35
|
generateTaskId,
|
|
36
36
|
getCliVersion,
|
|
37
|
-
checkNodeVersion,
|
|
38
37
|
} from './config.js';
|
|
39
38
|
import { EXIT, TERMINAL_LOOP_STATES } from './exit-codes.js';
|
|
40
39
|
|
|
@@ -109,7 +108,7 @@ export async function runCli(argv) {
|
|
|
109
108
|
return cmdVersion(jsonMode);
|
|
110
109
|
|
|
111
110
|
case 'doctor':
|
|
112
|
-
return cmdDoctor({ projectRoot, skillDir, dataDir, quiet });
|
|
111
|
+
return cmdDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, rest });
|
|
113
112
|
|
|
114
113
|
case 'run':
|
|
115
114
|
return cmdRun({ flags, rest, projectRoot, dataDir, skillDir, jsonMode, quiet, verbose, out, u });
|
|
@@ -144,17 +143,20 @@ export async function runCli(argv) {
|
|
|
144
143
|
case 'config':
|
|
145
144
|
return cmdConfig({ flags, rest, projectRoot, user3libHome, jsonMode, out });
|
|
146
145
|
|
|
146
|
+
case 'mcp':
|
|
147
|
+
return cmdMcpImpl({ rest, user3libHome, jsonMode });
|
|
148
|
+
|
|
147
149
|
case 'serve':
|
|
148
|
-
return cmdServe({
|
|
150
|
+
return cmdServe({ rest, jsonMode, dataDir, user3libHome });
|
|
149
151
|
|
|
150
152
|
case 'update':
|
|
151
153
|
return cmdUpdate({ flags, rest, jsonMode, out });
|
|
152
154
|
|
|
153
|
-
case 'web':
|
|
154
|
-
return cmdWeb({ flags, rest, user3libHome, dataDir, jsonMode, out });
|
|
155
|
-
|
|
156
155
|
default:
|
|
157
156
|
process.stderr.write(`未知命令: ${cmd}\n`);
|
|
157
|
+
if (cmd === 'web') {
|
|
158
|
+
process.stderr.write('提示: "3rdloop web" 已合并到 "3rdloop serve"(Web 前端随 serve 默认启动,扩展管理用 3rdloop serve install-ext/list-ext/remove-ext)\n');
|
|
159
|
+
}
|
|
158
160
|
printHelp();
|
|
159
161
|
return EXIT.ERROR;
|
|
160
162
|
}
|
|
@@ -174,12 +176,26 @@ function cmdVersion(jsonMode) {
|
|
|
174
176
|
|
|
175
177
|
// ─── doctor ───────────────────────────────────────────────────────
|
|
176
178
|
|
|
177
|
-
async function cmdDoctor({ projectRoot, skillDir, dataDir, quiet }) {
|
|
179
|
+
async function cmdDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, rest = [] }) {
|
|
178
180
|
const { runDoctor } = await import('./doctor.js');
|
|
179
|
-
const
|
|
181
|
+
const fix = !rest.includes('--no-fix');
|
|
182
|
+
const { ok } = await runDoctor({ projectRoot, skillDir, dataDir, user3libHome, quiet, fix });
|
|
180
183
|
return ok ? EXIT.OK : EXIT.ERROR;
|
|
181
184
|
}
|
|
182
185
|
|
|
186
|
+
/**
|
|
187
|
+
* 环境预检 + 失败报告(run/submit 等引擎命令共用)。
|
|
188
|
+
* 通过返回 true;失败打印各项修复提示(--json 时输出结构化结果)并返回 false。
|
|
189
|
+
*/
|
|
190
|
+
async function _precheckOrReport({ projectRoot, dataDir, skillDir, jsonMode, out }) {
|
|
191
|
+
const { precheckEnv, reportPrecheckFailures } = await import('./doctor.js');
|
|
192
|
+
const pre = await precheckEnv({ projectRoot, dataDir, skillDir });
|
|
193
|
+
if (pre.ok) return true;
|
|
194
|
+
if (jsonMode) out({ ok: false, error: '环境预检未通过', failures: pre.failures });
|
|
195
|
+
else reportPrecheckFailures(pre.failures);
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
// ─── workflows(列出已注册工作流) ────────────────────────────────
|
|
184
200
|
|
|
185
201
|
async function cmdWorkflows({ jsonMode, out }) {
|
|
@@ -212,6 +228,16 @@ async function cmdConfig({ flags, rest, projectRoot, user3libHome, jsonMode, out
|
|
|
212
228
|
return cmdConfigImpl({ projectRoot, user3libHome, jsonMode, out, rest });
|
|
213
229
|
}
|
|
214
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
|
+
|
|
215
241
|
// ─── update(自更新)─────────────────────────────────────────────
|
|
216
242
|
|
|
217
243
|
async function cmdUpdate({ flags, rest, jsonMode, out }) {
|
|
@@ -224,11 +250,11 @@ async function cmdUpdate({ flags, rest, jsonMode, out }) {
|
|
|
224
250
|
return result.ok ? EXIT.OK : EXIT.ERROR;
|
|
225
251
|
}
|
|
226
252
|
|
|
227
|
-
// ─── serve
|
|
253
|
+
// ─── serve(同时启动 Server HTTP 后端 + Web 前端)─────────────────
|
|
228
254
|
|
|
229
|
-
async function cmdServe({ flags, rest, jsonMode, dataDir }) {
|
|
255
|
+
async function cmdServe({ flags, rest, jsonMode, dataDir, user3libHome }) {
|
|
230
256
|
const { cmdServe: impl } = await import('./serve.js');
|
|
231
|
-
return impl({ rest: flags.rest, jsonMode, dataDir });
|
|
257
|
+
return impl({ rest: flags.rest, jsonMode, dataDir, user3libHome });
|
|
232
258
|
}
|
|
233
259
|
|
|
234
260
|
// ─── run / submit ──────────────────────────────────────────────────
|
|
@@ -267,6 +293,11 @@ async function submitAndRunImpl({ flags, rest, projectRoot, dataDir, skillDir, j
|
|
|
267
293
|
return EXIT.ERROR;
|
|
268
294
|
}
|
|
269
295
|
|
|
296
|
+
// ── 环境预检(引擎执行前快速失败:凭据/目录类问题直接退出码 1,
|
|
297
|
+
// 避免跑到一半才失败、被误报为任务失败退出码 2)──────────────────
|
|
298
|
+
const preOk = await _precheckOrReport({ projectRoot, dataDir, skillDir, jsonMode, out });
|
|
299
|
+
if (!preOk) return EXIT.ERROR;
|
|
300
|
+
|
|
270
301
|
// skill-dir 可能来自全局 flags 已在外部解析
|
|
271
302
|
const r = await runner();
|
|
272
303
|
const taskId = generateTaskId();
|
|
@@ -274,20 +305,19 @@ async function submitAndRunImpl({ flags, rest, projectRoot, dataDir, skillDir, j
|
|
|
274
305
|
projectRoot,
|
|
275
306
|
dataDir,
|
|
276
307
|
skillDir,
|
|
277
|
-
cliType: 'opencode',
|
|
278
308
|
verbose,
|
|
279
309
|
});
|
|
280
310
|
|
|
281
|
-
// 挂载 opencode
|
|
282
|
-
const {
|
|
283
|
-
const oc = new
|
|
311
|
+
// 挂载 AI CLI serve 生命周期(类型由 CLI_TYPE 决定:opencode | deveco-code)
|
|
312
|
+
const { CliServeManager } = await import('./opencode.js');
|
|
313
|
+
const oc = new CliServeManager({ projectRoot, cliType: ctx.cliType });
|
|
284
314
|
const ocHealth = await oc.ensureRunning();
|
|
285
315
|
if (!ocHealth.ok) {
|
|
286
316
|
if (jsonMode) {
|
|
287
317
|
process.stdout.write(JSON.stringify({ ok: false, error: ocHealth.message, taskId }, null, 2) + '\n');
|
|
288
318
|
}
|
|
289
319
|
process.stderr.write(`\n错误: ${ocHealth.message}\n`);
|
|
290
|
-
process.stderr.write(
|
|
320
|
+
process.stderr.write(`请先启动 ${oc.cliType} serve(项目上一级目录: ${oc.bin} serve)后重试。\n`);
|
|
291
321
|
await oc.stop();
|
|
292
322
|
return EXIT.ERROR;
|
|
293
323
|
}
|
|
@@ -623,14 +653,6 @@ async function cmdOrch({ flags, rest, projectRoot, dataDir, skillDir, jsonMode,
|
|
|
623
653
|
return impl({ flags, rest, projectRoot, dataDir, skillDir, jsonMode, quiet, verbose, out, u });
|
|
624
654
|
}
|
|
625
655
|
|
|
626
|
-
/**
|
|
627
|
-
* 3rdloop web 命令二段分发(转发到 lib/web.js:前端服务 + 扩展挂载)。
|
|
628
|
-
*/
|
|
629
|
-
async function cmdWeb({ flags, rest, user3libHome, dataDir, jsonMode, out }) {
|
|
630
|
-
const { cmdWeb: impl } = await import('./web.js');
|
|
631
|
-
return impl({ flags, rest, user3libHome, dataDir, jsonMode, out });
|
|
632
|
-
}
|
|
633
|
-
|
|
634
656
|
// ─── 帮助 ─────────────────────────────────────────────────────────
|
|
635
657
|
|
|
636
658
|
function printHelp() {
|
|
@@ -659,12 +681,15 @@ function printHelp() {
|
|
|
659
681
|
3rdloop workflows 列出已注册的固定编排工作流
|
|
660
682
|
3rdloop run <工作流名> [--flag <值> ...] 以固定编排执行工作流(阻塞到终态)
|
|
661
683
|
3rdloop config list|get|set|unset ... 配置 .env 配置项(默认读写 ~/.3lib/.env)
|
|
662
|
-
3rdloop
|
|
684
|
+
3rdloop mcp install [--cli opencode|deveco|all] 装配 MCP Gateway(注册到 AI CLI +
|
|
685
|
+
种子复制知识库数据/BadCase 到 ~/.3lib/3rdloop/,npm 安装态必需)
|
|
686
|
+
3rdloop mcp uninstall|status 移除注册 / 查看装配状态
|
|
687
|
+
3rdloop serve [--port N] [--web-port N] 启动 Server 后端 + Web 前端(同时启动)
|
|
688
|
+
[--web-root <dir>] [--ext-root <dir>] [--ext <name,...>] [--no-ext] [--open]
|
|
689
|
+
3rdloop serve install-ext <dir> 安装扩展(tag/issue/prcheck 等二级功能)
|
|
690
|
+
3rdloop serve list-ext | remove-ext <name> 扩展管理
|
|
663
691
|
3rdloop update [--check] [--yes] [--registry <url>] 自更新到 npm 最新版
|
|
664
|
-
3rdloop
|
|
665
|
-
3rdloop web install-ext <dir> 安装扩展(tag/issue/prcheck 等二级功能)
|
|
666
|
-
3rdloop web list-ext | remove-ext <name> 扩展管理
|
|
667
|
-
3rdloop doctor 环境自检
|
|
692
|
+
3rdloop doctor [--no-fix] 环境自检(默认自动装配 MCP Gateway;--no-fix 仅诊断)
|
|
668
693
|
3rdloop version 版本信息
|
|
669
694
|
|
|
670
695
|
工作流机制:
|
package/lib/config-cmd.js
CHANGED
|
@@ -90,7 +90,7 @@ export const ENV_KEYS = [
|
|
|
90
90
|
{ key: 'MAX_CONCURRENT_SESSIONS', label: 'AI Session 并发上限', description: '跨所有编排任务共享的全局并发信号量上限', default: '50', validate: validators.intPositive },
|
|
91
91
|
|
|
92
92
|
// ── CLI / AI 助手后端 ────────────────────────────────────────────
|
|
93
|
-
{ key: 'CLI_TYPE', label: '默认 CLI 类型', description: 'opencode | deveco-code', default: '
|
|
93
|
+
{ key: 'CLI_TYPE', label: '默认 CLI 类型', description: 'opencode | deveco-code', default: 'deveco-code', validate: validators.cliType },
|
|
94
94
|
{ key: 'OPENCODE_HOST', label: 'opencode 主机', description: '连接配置(可选)', default: 'localhost', validate: validators.nonEmpty },
|
|
95
95
|
{ key: 'OPENCODE_PORT', label: 'opencode 端口', description: '连接配置(可选,默认 4096)', default: '4096', validate: validators.portOrEmpty },
|
|
96
96
|
{ key: 'DEVECO_HOST', label: 'deveco 主机', description: '连接配置(可选)', default: 'localhost', validate: validators.nonEmpty },
|
package/lib/config.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - 定位数据目录(--data-dir > 3LIB_DATA_DIR > ~/.3lib/3rdloop/db)
|
|
8
8
|
* - 生成 clinic 安全唯一 taskId(随机位 8)
|
|
9
9
|
* - SKILL 目录优先级链(--skill-dir > 3LIB_SKILL_DIR > vendor/Skills)
|
|
10
|
+
* - 解析 AI CLI 类型(CLI_TYPE:opencode | deveco-code,默认 deveco-code)
|
|
10
11
|
*
|
|
11
12
|
* 数据目录策略:
|
|
12
13
|
* 用户级统一 ~/.3lib/3rdloop/db(跨平台,由 getUser3libHome 解析),
|
|
@@ -204,6 +205,37 @@ export function getUser3libHome() {
|
|
|
204
205
|
return path.join(home, '.3lib');
|
|
205
206
|
}
|
|
206
207
|
|
|
208
|
+
/** 支持的 AI CLI 类型 */
|
|
209
|
+
const CLI_TYPES = ['opencode', 'deveco-code'];
|
|
210
|
+
/** 默认 CLI 类型(本项目面向 HarmonyOS 三方库场景,默认 DevEco Code) */
|
|
211
|
+
const DEFAULT_CLI_TYPE = 'deveco-code';
|
|
212
|
+
let _warnedInvalidCliType = false;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* 解析当前生效的 AI CLI 类型(opencode | deveco-code)。
|
|
216
|
+
*
|
|
217
|
+
* 优先级:显式参数 > 环境变量 CLI_TYPE(含 loadEnvChain 注入的
|
|
218
|
+
* 系统环境变量 > ~/.3lib/.env > 项目 Server/.env 链)> 'deveco-code'(默认)。
|
|
219
|
+
* 与 Server/CLI/cli.js、check-env.mjs 的 resolveCliType 语义保持一致。
|
|
220
|
+
*
|
|
221
|
+
* CLI_TYPE 配了无效值时不崩溃:回退默认值并在 stderr 告警一次
|
|
222
|
+
* (doctor 会将其作为失败项显式报告)。
|
|
223
|
+
*
|
|
224
|
+
* @param {string} [override] - 显式类型(优先级最高)
|
|
225
|
+
* @returns {'opencode'|'deveco-code'}
|
|
226
|
+
*/
|
|
227
|
+
export function resolveCliType(override) {
|
|
228
|
+
const raw = String(override ?? process.env.CLI_TYPE ?? '').trim();
|
|
229
|
+
if (CLI_TYPES.includes(raw)) return raw;
|
|
230
|
+
if (raw && !_warnedInvalidCliType) {
|
|
231
|
+
_warnedInvalidCliType = true;
|
|
232
|
+
process.stderr.write(
|
|
233
|
+
`[3rdloop] 警告: CLI_TYPE="${raw}" 无效(可选值: ${CLI_TYPES.join(' | ')}),已回退 ${DEFAULT_CLI_TYPE}\n`
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
return DEFAULT_CLI_TYPE;
|
|
237
|
+
}
|
|
238
|
+
|
|
207
239
|
/**
|
|
208
240
|
* 确定数据目录。
|
|
209
241
|
*
|