@ohos-cpf/3rdloop 0.0.1
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 +425 -0
- package/bin/3rdloop.mjs +48 -0
- package/lib/cli.js +741 -0
- package/lib/config.js +318 -0
- package/lib/doctor.js +114 -0
- package/lib/exit-codes.js +31 -0
- package/lib/opencode.js +156 -0
- package/lib/orch.js +427 -0
- package/lib/queries.js +264 -0
- package/lib/runner.js +979 -0
- package/lib/step.js +326 -0
- package/lib/ui.js +223 -0
- package/lib/workflow.js +291 -0
- package/lib/workflows.js +132 -0
- package/package.json +50 -0
- package/vendor/Server/Agent/SkillSelector/README.md +344 -0
- package/vendor/Server/Agent/SkillSelector/core/Agent.js +207 -0
- package/vendor/Server/Agent/SkillSelector/index.js +14 -0
- package/vendor/Server/Agent/SkillSelector/llm/llmClient.js +313 -0
- package/vendor/Server/Agent/SkillSelector/llm/prompts.js +161 -0
- package/vendor/Server/Agent/SkillSelector/llm/reactSteps.js +144 -0
- package/vendor/Server/Agent/SkillSelector/matcher/fuzzyMatcher.js +433 -0
- package/vendor/Server/Agent/SkillSelector/scanner/skillScanner.js +382 -0
- package/vendor/Server/Agent/SkillSelector/types.js +63 -0
- package/vendor/Server/Agent/SkillSelector/utils/actionWords.js +60 -0
- package/vendor/Server/Brain/AnalysisStrategies.js +422 -0
- package/vendor/Server/Brain/Brain.js +686 -0
- package/vendor/Server/Brain/DecompositionStrategies.js +621 -0
- package/vendor/Server/Brain/PlanPersistence.js +196 -0
- package/vendor/Server/Brain/SkillExecutor.js +251 -0
- package/vendor/Server/Brain/index.js +11 -0
- package/vendor/Server/CLI/cli.js +243 -0
- package/vendor/Server/CLI/opencode/index.js +804 -0
- package/vendor/Server/CLI/opencode.js +5 -0
- package/vendor/Server/DbUse/MessageArchive.js +61 -0
- package/vendor/Server/DbUse/StorageManager.js +107 -0
- package/vendor/Server/DbUse/adapters/BaseAdapter.js +94 -0
- package/vendor/Server/DbUse/adapters/FileAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonlAdapter.js +114 -0
- package/vendor/Server/DbUse/adapters/SqliteAdapter.js +157 -0
- package/vendor/Server/DbUse/index.js +160 -0
- package/vendor/Server/DbUse/stores/SessionStore.js +279 -0
- package/vendor/Server/DbUse/stores/TaskExecutionStore.js +133 -0
- package/vendor/Server/DbUse/stores/TaskRegistryStore.js +262 -0
- package/vendor/Server/DbUse/stores/TaskStepStore.js +279 -0
- package/vendor/Server/FlexRunner/FlexRunner.js +1759 -0
- package/vendor/Server/FlexRunner/index.js +12 -0
- package/vendor/Server/Knowledge/KnowledgeImporter.js +523 -0
- package/vendor/Server/Knowledge/KnowledgeManager.js +341 -0
- package/vendor/Server/Knowledge/index.js +33 -0
- package/vendor/Server/LoopEngine/LoopEngine.js +1133 -0
- package/vendor/Server/LoopEngine/index.js +11 -0
- package/vendor/Server/Orchestrator/Orchestrator.js +1425 -0
- package/vendor/Server/Orchestrator/StepNode.js +312 -0
- package/vendor/Server/Orchestrator/index.js +13 -0
- package/vendor/Server/Routes/controllers/BrainController.js +241 -0
- package/vendor/Server/Routes/controllers/FlexRunnerController.js +1125 -0
- package/vendor/Server/Routes/controllers/HealthController.js +44 -0
- package/vendor/Server/Routes/controllers/KnowledgeImportController.js +355 -0
- package/vendor/Server/Routes/controllers/LoopEngineController.js +788 -0
- package/vendor/Server/Routes/controllers/OrchestratorController.js +911 -0
- package/vendor/Server/Routes/controllers/StatsController.js +57 -0
- package/vendor/Server/Routes/controllers/StreamController.js +67 -0
- package/vendor/Server/Routes/library/logger.js +179 -0
- package/vendor/Server/Routes/library/zipArchive.js +172 -0
- package/vendor/Server/Routes/router/Router.js +204 -0
- package/vendor/Server/Routes/routes/brain.js +47 -0
- package/vendor/Server/Routes/routes/flexrunner.js +72 -0
- package/vendor/Server/Routes/routes/health.js +28 -0
- package/vendor/Server/Routes/routes/index.js +57 -0
- package/vendor/Server/Routes/routes/knowledge.js +55 -0
- package/vendor/Server/Routes/routes/loopengine.js +58 -0
- package/vendor/Server/Routes/routes/orchestrator.js +61 -0
- package/vendor/Server/Routes/routes/registry.js +98 -0
- package/vendor/Server/Routes/routes/stats.js +23 -0
- package/vendor/Server/Routes/routes/stream.js +30 -0
- package/vendor/Server/Routes/server.js +202 -0
- package/vendor/Server/Routes/sse/SseHub.js +308 -0
- package/vendor/Server/Skills/acceptance-check/SKILL.md +174 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE1_ARTIFACT_COLLECTION.md +52 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE2_CRITERIA_EVALUATION.md +77 -0
- package/vendor/Server/Skills/arkts-code-check/SKILL.md +314 -0
- package/vendor/Server/Skills/arkts-code-check/references/CODE_CHECK_GUIDE.md +160 -0
- package/vendor/Server/Skills/arkts-code-check/references/FILE_TYPE_GUIDE.md +29 -0
- package/vendor/Server/Skills/arkts-code-check/references/PHASE1_INFO_COLLECTION.md +222 -0
- package/vendor/Server/Skills/arkts-code-check/references/REPORT_TEMPLATE.md +220 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/SKILL.md +329 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-code/SKILL.md +291 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/API_SIGNATURE_CHECKS.md +68 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/BUILD_VALIDATION.md +184 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/CODE_STANDARDS.md +337 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/EXAMPLES.md +400 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/SYSTEM_API_LOOKUP.md +99 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/TEMPLATE.md +544 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-coverage/SKILL.md +174 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/SKILL.md +321 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/EXAMPLES.md +100 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/TEMPLATE.md +185 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/SKILL.md +234 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +103 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/CHECK_DIMENSIONS.md +89 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/COMPLIANCE_CHECKLIST.md +62 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/KB_QUERY_GUIDE.md +108 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/MCP_TOOL_DISCOVERY.md +124 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/REPORT_TEMPLATE.md +90 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/SCORING_FORMULA.md +57 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/arkts-library-interface-spec/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-memory-leak-check/SKILL.md +392 -0
- package/vendor/Server/Skills/arkts-library-source-clone/SKILL.md +113 -0
- package/vendor/Server/Skills/arkts-library-stability-check/SKILL.md +313 -0
- package/vendor/Server/Skills/arkts-library-stability-check/assets/REPORT_TEMPLATE.md +154 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CHECKLIST.md +166 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CODE_EXAMPLES.md +309 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/SCORING_RULES.md +90 -0
- package/vendor/Server/Skills/arkts-library-stability-check/scripts/validate-skill.cjs +282 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/SKILL.md +361 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/assets/REPORT_TEMPLATE.md +146 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/CHECKLIST.md +253 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +115 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/scripts/validate-skill.cjs +263 -0
- package/vendor/Server/Skills/arkts-library-xts-code/SKILL.md +455 -0
- package/vendor/Server/Skills/arkts-library-xts-code/assets/report-template.md +60 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/ACCESS_MODIFIER_PRECHECK.md +76 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/BUILD_VERIFICATION.md +200 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/CODE_STANDARDS.md +519 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SUBAGENT_PROMPT_TEMPLATE.md +276 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SYSTEM_API_LOOKUP.md +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/XTS_TEMPLATE.md +767 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/precheck-access-modifiers.cjs +221 -0
- package/vendor/Server/Skills/arkts-library-xts-code-fix/SKILL.md +229 -0
- package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/SKILL.md +194 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/EXAMPLES.md +576 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TEMPLATE.md +575 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TESTABILITY_GUIDE.md +182 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/SKILL.md +491 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/references/error-fixing-examples.md +217 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/flutter-code-check/SKILL.md +299 -0
- package/vendor/Server/Skills/flutter-code-check/assets/OUTPUT_TEMPLATE.md +312 -0
- package/vendor/Server/Skills/flutter-code-check/references/CHECKLIST.md +190 -0
- package/vendor/Server/Skills/flutter-code-check/references/PLATFORMS.md +134 -0
- package/vendor/Server/Skills/flutter-code-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/flutter-interface/README.md +75 -0
- package/vendor/Server/Skills/flutter-interface/SKILL.md +291 -0
- package/vendor/Server/Skills/flutter-interface/references/EXAMPLES.md +336 -0
- package/vendor/Server/Skills/flutter-interface/references/GIT_CLONE_GUIDE.md +190 -0
- package/vendor/Server/Skills/flutter-interface/references/SCRIPT_REFERENCE.md +258 -0
- package/vendor/Server/Skills/flutter-interface/references/TEMPLATE.md +254 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/SKILL.md +518 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/CHECKLIST.md +382 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +342 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/PLATFORM_LIMITATION_GUIDE.md +71 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/SKILL.md +519 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/references/CHECKLIST.md +407 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/SKILL.md +653 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/references/CHECKLIST.md +397 -0
- package/vendor/Server/Skills/flutter-library-stability-check/SKILL.md +745 -0
- package/vendor/Server/Skills/flutter-library-stability-check/references/CHECKLIST.md +721 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/SKILL.md +414 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/assets/REPORT_TEMPLATE.md +150 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/CHECKLIST.md +304 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCORING_RULES.md +265 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCRIPT_USAGE.md +286 -0
- package/vendor/Server/Skills/knowledge-import/SKILL.md +383 -0
- package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +165 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_LOCATOR_GUIDE.md +91 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_OPTIMIZATION_GUIDE.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +301 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/assets/PR_ISSUE_TEMPLATE.md +105 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/references/GITCODE_API.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/scripts/gitcode-api.cjs +208 -0
- package/vendor/Server/Skills/rn-code-check/SKILL.md +321 -0
- package/vendor/Server/Skills/rn-code-check/references/API-GUIDE.md +235 -0
- package/vendor/Server/Skills/rn-code-check/references/CHECKLIST.md +189 -0
- package/vendor/Server/Skills/rn-code-check/references/REPORT-TEMPLATE.md +247 -0
- package/vendor/Server/Skills/rn-lib-add-example/SKILL.md +198 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/APP_RENAME_GUIDE.md +40 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/SHELL_ADAPTATION_CHECKLIST.md +78 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/TEMPLATE_REPO_GUIDE.md +70 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/VERIFICATION_GUIDE.md +47 -0
- package/vendor/Server/Skills/rn-lib-add-example/scripts/create-example.cjs +252 -0
- package/vendor/Server/Skills/rn-lib-update-doc/SKILL.md +176 -0
- package/vendor/Server/Skills/rn-lib-update-doc/config.json +5 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/changelog-template.md +35 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/format-diff.md +137 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/link-registry.json +33 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2-overview.md +40 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2.md +429 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/detect-readme-format.cjs +105 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/find-usage-doc.cjs +90 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/link-verify.cjs +213 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-changelog.cjs +73 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-package-meta.cjs +258 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-readme-links.cjs +341 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/resolve-usage-docs.cjs +67 -0
- package/vendor/Server/Skills/rn-library-consistency-check/SKILL.md +299 -0
- package/vendor/Server/Skills/rn-library-consistency-check/assets/REPORT_TEMPLATE.md +293 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_COMPONENT_CHECK_GUIDE.md +857 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_TURBOMODULE_CHECK_GUIDE.md +856 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CHECKLIST.md +157 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_COMPONENT_CHECK_GUIDE.md +801 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_TURBOMODULE_CHECK_GUIDE.md +684 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +233 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/NATIVE_COMPONENT_IDENTIFICATION.md +1373 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/SCORING_STANDARD.md +220 -0
- package/vendor/Server/Skills/rn-library-consistency-check/scripts/validate-skill.py +245 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL.md +414 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL_en.md +413 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +311 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CHECK_CHECKLIST.md +355 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CROSS_VALIDATION_GUIDE.md +115 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/DOC_COLLECTION_GUIDE.md +139 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/EXAMPLES.md +586 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/GOTCHAS.md +57 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/scripts/validate-skill.py +259 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/SKILL.md +301 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/assets/REPORT_TEMPLATE.md +148 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/DOC_ANNOTATION_GUIDE.md +118 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/SCRIPT_USAGE_GUIDE.md +168 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/URL_PARSING_RULES.md +176 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +274 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/case-template.md +45 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/rule-template.md +25 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/PR_FETCH_GUIDE.md +61 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/RULE_TEMPLATE_GUIDE.md +165 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/scripts/fetch-pr-info.py +239 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/assets/REPORT_TEMPLATE.md +96 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/COMPLIANCE_CHECKLIST.md +58 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/INSPECTION_GUIDE.md +99 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/PRESCREEN_GUIDE.md +64 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/SOURCE_PREP_GUIDE.md +75 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/scripts/validate-known-issue-report.py +164 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/SKILL.md +339 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/assets/REPORT_TEMPLATE.md +83 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/CHECKLIST.md +859 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/HARMONY_CODE_PATTERNS.md +122 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/scripts/scan_harmony_code.py +279 -0
- package/vendor/Server/Skills/rn-library-stability-check/SKILL.md +273 -0
- package/vendor/Server/Skills/rn-library-stability-check/assets/REPORT_TEMPLATE.md +129 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/CHECKLIST.md +581 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/SCORING_RULES.md +138 -0
- package/vendor/Server/Skills/rn-library-stability-check/scripts/scan-harmony-code.py +168 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/SKILL.md +506 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/CHECKLIST.md +280 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/DEMO_LOCATION.md +221 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/REPORT_TEMPLATE.md +209 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/SCRIPT_USAGE.md +325 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/SKILL.md +279 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/assets/TEST_FILE_TEMPLATES.md +404 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_TROUBLESHOOTING.md +185 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_WORKFLOW.md +265 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COMMON_CONFIG.md +189 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/CONFIG_GUIDE.md +203 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COVERAGE_ANALYZER.md +147 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/DESIGN_DOC_GUIDE.md +148 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_FLOW.md +165 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_STRATEGY.md +195 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/HARMONY_SCANNER.md +249 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/JEST_FRAMEWORK.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/PLATFORM_COMPAT.md +161 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/RN_TEST_PATTERNS.md +413 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/SOURCE_PARSER.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TEST_CONVENTIONS.md +245 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TROUBLESHOOTING.md +282 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/USAGE_GUIDE.md +251 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/SKILL.md +469 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/CPTF_TEST_TEMPLATE.md +310 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/DEMO_PAGE_TEMPLATE.md +303 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/CPTF_TEST_GENERATION_GUIDE.md +421 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/DEMO_GENERATION_GUIDE.md +358 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/QUALITY_CHECKLIST.md +114 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/SPEC_PARSING_GUIDE.md +274 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/scripts/validate-rnoh-cptf-api-test.sh +185 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/SKILL.md +191 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/assets/TEST_TEMPLATE.md +216 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/CPTF_SETUP.md +107 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/DEMO_ANALYSIS.md +120 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/scripts/validate-rnoh-cptf-test.sh +108 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/SKILL.md +237 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/references/DEBUG_PLAYBOOK.md +261 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/scripts/validate-run-env.sh +112 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/SKILL.md +498 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/adapt-checklist.md +270 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/api-migration-checklist.md +164 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/common-compile-errors.md +556 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/deveco-cli-tools.md +459 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/edge-cases.md +65 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/har-tgz-build.md +512 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/version-compat-matrix.md +132 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/scripts/auto-integrate.sh +424 -0
- package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/SKILL.md +306 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/DEMO_PAGE_TEMPLATE.md +485 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/INDEX_TEMPLATE.md +172 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/DEMO_CODE_RULES.md +422 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/QUALITY_CHECKLIST.md +95 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/SOURCE_EXPLORATION.md +169 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/SKILL.md +554 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/assets/DEMO_DOC_TEMPLATE.md +106 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/COVERAGE_INCREMENTAL.md +216 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/DEMO_DESIGN_RULES.md +413 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/OUTPUT_FORMAT.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/QUALITY_CHECKLIST.md +98 -0
- package/vendor/Server/Skills/rnoh-lib-func-test/SKILL.md +337 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/SKILL.md +722 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/assets/PORT_REPORT_TEMPLATE.md +219 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/DEMO_PORTING_GUIDE.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/PORT_VERIFICATION.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/RNT_PROJECT_STRUCTURE.md +173 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/analyze-demo-deps.cjs +267 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/detect-rnoh-version.cjs +174 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/find-rnt-demo.sh +111 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/port-demo.sh +186 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/read-lib-meta.cjs +150 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/SKILL.md +296 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/jest-troubleshooting.md +371 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +212 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/runtime-troubleshooting.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/unit-test-template.md +223 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/scripts/port-test-demo.sh +1053 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/SKILL.md +255 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_ADAPTATION.md +77 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_API_LOOKUP.md +224 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/script-reference.md +174 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/detect-upstream-version.js +967 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/generate-diff.js +1798 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/package.json +5 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/templates/report-template.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +145 -0
- package/vendor/Server/Skills/skill-generator/SKILL.md +365 -0
- package/vendor/Server/Skills/skill-generator/assets/SKILL_TEMPLATE.md +183 -0
- package/vendor/Server/Skills/skill-generator/references/COMPLIANCE_CHECKLIST.md +82 -0
- package/vendor/Server/Skills/skill-generator/references/KB_QUERY_GUIDE.md +110 -0
- package/vendor/Server/Skills/skill-generator/references/MCP_TOOL_DISCOVERY.md +122 -0
- package/vendor/Server/Skills/skill-generator/references/SKILL_SPEC.md +121 -0
- package/vendor/Server/Skills/skill-generator/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/task-analysis/SKILL.md +234 -0
- package/vendor/Server/Skills/task-analysis/assets/OUTPUT_EXAMPLES.md +160 -0
- package/vendor/Server/Skills/task-analysis/references/ACCEPTANCE_CRITERIA_GUIDE.md +190 -0
- package/vendor/Server/Skills/task-analysis/references/ANALYSIS_SCHEMA.md +224 -0
- package/vendor/Server/Skills/task-analysis/references/INTEGRATION_CONTEXT.md +162 -0
- package/vendor/Server/Skills/task-analysis/references/LESSONS_LEARNED.md +55 -0
- package/vendor/Server/Skills/task-analysis/references/REPLAN_CONTEXT_GUIDE.md +126 -0
- package/vendor/Server/Skills/task-analysis/scripts/validate-analysis-output.sh +256 -0
- package/vendor/Server/Skills/task-decomposition/SKILL.md +529 -0
- package/vendor/Server/Skills/task-decomposition/assets/OUTPUT_EXAMPLES.md +451 -0
- package/vendor/Server/Skills/task-decomposition/references/ACCEPTANCE_CRITERIA_GUIDE.md +179 -0
- package/vendor/Server/Skills/task-decomposition/references/DEPENDENCY_GRAPH_GUIDE.md +152 -0
- package/vendor/Server/Skills/task-decomposition/references/INTEGRATION_CONTEXT.md +175 -0
- package/vendor/Server/Skills/task-decomposition/references/REPLAN_CONTEXT_GUIDE.md +195 -0
- package/vendor/Server/Skills/task-decomposition/references/TASK_DECOMPOSITION_TEMPLATES.md +226 -0
- package/vendor/Server/Skills/task-decomposition/scripts/list-available-skills.cjs +263 -0
- package/vendor/Server/Skills/task-decomposition/scripts/skill-blacklist.json +29 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-decomposition-output.cjs +376 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-param-consistency.cjs +259 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-specified-skills.cjs +216 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-step-graph.cjs +425 -0
- package/vendor/Server/Skills/tpc-cpp-check/SKILL.md +427 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/CHECKLIST.md +214 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/HPKBUILD_GUIDE.md +235 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/REPORT_TEMPLATE.md +250 -0
- package/vendor/Server/TestCheck/TestCheck.js +775 -0
- package/vendor/Server/TestCheck/index.js +11 -0
- package/vendor/Server/library/McpToolGuide.js +280 -0
- package/vendor/Server/library/StatsService.js +127 -0
- package/vendor/Server/library/cstTime.js +16 -0
- package/vendor/Server/package.json +17 -0
- package/vendor/VERSION +3 -0
- package/workflows/pr-check.mjs +106 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# 函数级一致性对比指南
|
|
2
|
+
|
|
3
|
+
本文档定义一致性检视中**函数级对比**的具体操作规范,确保每个对比项包含可定位的函数信息而非模糊的文字描述。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 函数级对比的核心原则
|
|
8
|
+
|
|
9
|
+
> ⚠️ **核心原则**:功能一致性对比**必须以具体函数为粒度**,而非以"连接管理"等模糊文字描述为粒度。每个对比项必须包含函数名、签名、文件位置、代码片段,确保检视结果可直接定位到代码问题。
|
|
10
|
+
|
|
11
|
+
### 1.1 对比粒度要求
|
|
12
|
+
|
|
13
|
+
| 粒度 | 说明 | 是否允许 | 原因 |
|
|
14
|
+
|------|------|----------|------|
|
|
15
|
+
| 模块级 | 如"连接管理功能一致" | ❌ **不允许** | 无法定位具体问题 |
|
|
16
|
+
| 功能级 | 如"BLE扫描功能一致" | ❌ **不允许** | 无法定位具体问题 |
|
|
17
|
+
| 函数级 | 如"`connectToDevice(deviceId)` 方法一致" | ✅ **必须** | 可定位、可验证、可修复 |
|
|
18
|
+
| 参数级 | 如"`force_indications` 参数类型 bool→string" | ✅ **必须** | 可定位致命错误 |
|
|
19
|
+
|
|
20
|
+
### 1.2 每个对比项必须包含的信息
|
|
21
|
+
|
|
22
|
+
每个函数级对比项**必须包含以下全部字段**:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
必填字段清单:
|
|
26
|
+
├── 函数名称 # 如 connectToDevice、removeBond、setNotifyValue
|
|
27
|
+
├── 函数签名 # 如 connectToDevice(deviceId: string): Promise<boolean>
|
|
28
|
+
├── 所在文件 # 如 ohos/ets/plugin.ets:234、android/src/main/java/BluetoothPlugin.java:156
|
|
29
|
+
├── Dart 接口定义 # 对应的 MethodChannel 名称或 Dart 接口
|
|
30
|
+
├── 代码片段 # 关键实现代码(至少3行)
|
|
31
|
+
├── 对比状态 # ✅ 一致 / ❌ 不一致 / ⚠️ Stub / ⛔ 缺失 / 🔶 平台差异
|
|
32
|
+
├── 问题描述 # 具体差异描述(必须引用具体代码行)
|
|
33
|
+
└── 扣分 # 根据扣分规则计算的扣分值
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. 函数提取与对比流程
|
|
39
|
+
|
|
40
|
+
### 2.1 从源码中提取函数清单
|
|
41
|
+
|
|
42
|
+
**步骤 1:提取 Dart 层接口定义**
|
|
43
|
+
|
|
44
|
+
从 `lib/` 目录下的 Dart 代码中提取所有 MethodChannel 调用和公开接口:
|
|
45
|
+
|
|
46
|
+
```dart
|
|
47
|
+
// 示例:从 Dart 代码提取的方法列表
|
|
48
|
+
// 文件:lib/src/bluetooth_plugin.dart
|
|
49
|
+
|
|
50
|
+
static const MethodChannel _channel = MethodChannel('flutter_bluetooth');
|
|
51
|
+
|
|
52
|
+
// 提取的所有方法:
|
|
53
|
+
1. Future<bool> connectToDevice(String deviceId) → Method: 'connectToDevice'
|
|
54
|
+
2. Future<void> disconnect(String deviceId) → Method: 'disconnect'
|
|
55
|
+
3. Future<bool> removeBond(String deviceId) → Method: 'removeBond'
|
|
56
|
+
4. Future<void> setNotifyValue({bool force_indications}) → Method: 'setNotifyValue'
|
|
57
|
+
5. Future<String> getAdapterName() → Method: 'getAdapterName'
|
|
58
|
+
6. Future<void> requestConnectionPriority({String priority}) → Method: 'requestConnectionPriority'
|
|
59
|
+
7. Future<void> clearGattCache(String deviceId) → Method: 'clearGattCache'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**步骤 2:提取 Android 层方法实现**
|
|
63
|
+
|
|
64
|
+
从 `android/src/main/java/` 或 `kotlin/` 目录提取所有公开方法:
|
|
65
|
+
|
|
66
|
+
```java
|
|
67
|
+
// 示例:从 Android 代码提取的方法列表
|
|
68
|
+
// 文件:android/src/main/java/BluetoothPlugin.java
|
|
69
|
+
|
|
70
|
+
1. public boolean connectToDevice(String deviceId) → line 156
|
|
71
|
+
2. public void disconnect(String deviceId, int reason) → line 203
|
|
72
|
+
3. public boolean removeBond(String deviceId) → line 278
|
|
73
|
+
4. public void setNotifyValue(boolean force_indications) → line 342
|
|
74
|
+
5. public String getAdapterName() → line 410
|
|
75
|
+
6. public void requestConnectionPriority(String priority) → line 455
|
|
76
|
+
7. public void clearGattCache(String deviceId) → line 502
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**步骤 3:提取 iOS 层方法实现**
|
|
80
|
+
|
|
81
|
+
从 `ios/Classes/` 目录提取所有公开方法:
|
|
82
|
+
|
|
83
|
+
```swift
|
|
84
|
+
// 示例:从 iOS 代码提取的方法列表
|
|
85
|
+
// 文件:ios/Classes/FlutterBluetoothPlugin.m
|
|
86
|
+
|
|
87
|
+
1. - (BOOL)connectToDevice:(NSString *)deviceId → line 89
|
|
88
|
+
2. - (void)disconnect:(NSString *)deviceId → line 134
|
|
89
|
+
3. - (BOOL)removeBond:(NSString *)deviceId → line 176 // iOS 有系统限制
|
|
90
|
+
4. - (void)setNotifyValue:(BOOL)forceIndications → line 210
|
|
91
|
+
5. - (NSString *)getAdapterName → line 256
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**步骤 4:提取 OHOS 层方法实现**
|
|
95
|
+
|
|
96
|
+
从鸿蒙代码(ohos/ets/ 或其他定位到的目录)提取所有方法:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
// 示例:从 OHOS 代码提取的方法列表
|
|
100
|
+
// 文件:ohos/ets/plugin.ets
|
|
101
|
+
|
|
102
|
+
1. connectToDevice(deviceId: string): Promise<boolean> → line 89
|
|
103
|
+
2. disconnect(deviceId: string): Promise<void> → line 134
|
|
104
|
+
3. removeBond(deviceId: string): Promise<boolean> → line 278 // ⚠️ Stub
|
|
105
|
+
4. setNotifyValue(force_indications: string): Promise<void> → line 342 // ⚠️ 类型错误
|
|
106
|
+
5. getAdapterName(): Promise<string> → line 410 // ⛔ 返回错误
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2.2 构建函数级对比矩阵
|
|
110
|
+
|
|
111
|
+
将四个平台的方法提取结果构建为**函数级对比矩阵**:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
| # | Dart 接口 | Android 实现 | iOS 实现 | OHOS 实现 | 对比状态 |
|
|
115
|
+
|---|-----------|-------------|---------|----------|----------|
|
|
116
|
+
| 1 | `connectToDevice(deviceId)` → `connect` | `BluetoothPlugin.java:156` `public boolean connectToDevice(String)` | `FlutterBluetoothPlugin.m:89` `-(BOOL)connectToDevice:(NSString*)` | `plugin.ets:89` `connectToDevice(deviceId: string)` | ✅ 签名一致 |
|
|
117
|
+
| 2 | `disconnect(deviceId)` → `disconnect` | `BluetoothPlugin.java:203` `public void disconnect(String, int)` | `FlutterBluetoothPlugin.m:134` `-(void)disconnect:(NSString*)` | `plugin.ets:134` `disconnect(deviceId: string)` | ⚠️ Android 多 reason 参数 |
|
|
118
|
+
| 3 | `removeBond(deviceId)` → `removeBond` | `BluetoothPlugin.java:278` `public boolean removeBond(String)` | `FlutterBluetoothPlugin.m:176` `-(BOOL)removeBond:(NSString*)` iOS限制 | `plugin.ets:278` stub `return true` | ❌ OHOS Stub |
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 2.3 逐函数深度对比分析
|
|
122
|
+
|
|
123
|
+
对每个函数进行**四维对比**:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
函数级四维对比:
|
|
127
|
+
├── 维度 1:方法签名
|
|
128
|
+
│ ├── 方法名是否一致
|
|
129
|
+
│ ├── 参数数量是否一致
|
|
130
|
+
│ ├── 参数顺序是否一致
|
|
131
|
+
│ └── 参数类型是否一致
|
|
132
|
+
├── 维度 2:参数类型映射
|
|
133
|
+
│ ├── bool → boolean(致命:bool→string)
|
|
134
|
+
│ ├── int → number
|
|
135
|
+
│ ├── String → string
|
|
136
|
+
│ ├── List → Array
|
|
137
|
+
│ └── Map → Record/Object
|
|
138
|
+
├── 维度 3:返回值语义
|
|
139
|
+
│ ├── 返回类型是否匹配
|
|
140
|
+
│ ├── 返回语义是否一致
|
|
141
|
+
│ ├── void 方法是否正确处理
|
|
142
|
+
│ └── 错误返回是否标准格式
|
|
143
|
+
├── 维度 4:实现行为
|
|
144
|
+
│ ├── 是否调用实际系统 API
|
|
145
|
+
│ ├── 是否为 stub(返回固定值)
|
|
146
|
+
│ ├── 是否返回错误消息
|
|
147
|
+
│ ├── 核心逻辑是否一致
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 3. 函数级对比报告格式
|
|
153
|
+
|
|
154
|
+
### 3.1 API 契约函数级对比表
|
|
155
|
+
|
|
156
|
+
**必须使用以下格式**,每个对比项包含函数名、签名、文件位置:
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
### 1.1 方法签名函数级对比
|
|
160
|
+
|
|
161
|
+
| # | 函数名 | Dart 签名 | OHOS 签名 | OHOS 文件:行号 | 状态 | 扣分 |
|
|
162
|
+
|---|--------|-----------|-----------|---------------|------|------|
|
|
163
|
+
| 1 | `connectToDevice` | `Future<bool> connectToDevice(String deviceId)` | `connectToDevice(deviceId: string): Promise<boolean>` | `plugin.ets:89` | ✅ 一致 | 0 |
|
|
164
|
+
| 2 | `setNotifyValue` | `Future<void> setNotifyValue({bool force_indications})` | `setNotifyValue(force_indications: string): Promise<void>` | `plugin.ets:342` | ❌ 参数类型错误 | -15 |
|
|
165
|
+
| 3 | `removeBond` | `Future<bool> removeBond(String deviceId)` | `removeBond(deviceId: string): Promise<boolean>` | `plugin.ets:278` | ⚠️ Stub | -8 |
|
|
166
|
+
| 4 | `getAdapterName` | `Future<String> getAdapterName()` | `getAdapterName(): Promise<string>` | `plugin.ets:410` | ⛔ 返回错误 | -10 |
|
|
167
|
+
| 5 | `requestConnectionPriority` | `Future<void> requestConnectionPriority({String priority})` | — | — | ⛔ 方法缺失 | -10 |
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 3.2 参数类型函数级对比表
|
|
171
|
+
|
|
172
|
+
**必须列出每个参数的具体类型映射**:
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
### 1.2 参数类型函数级对比
|
|
176
|
+
|
|
177
|
+
| # | 函数名 | 参数名 | Dart 类型 | OHOS 解析类型 | OHOS 代码行 | as 语句 | 状态 | 扣分 |
|
|
178
|
+
|---|--------|--------|-----------|-------------|------------|---------|------|------|
|
|
179
|
+
| 1 | `setNotifyValue` | `force_indications` | `bool` | `string` ❌ | `plugin.ets:344` | `as string` | ❌ 致命类型错误 | -15 |
|
|
180
|
+
| 2 | `connectToDevice` | `deviceId` | `String` | `string` | `plugin.ets:91` | `as string` | ✅ 正确 | 0 |
|
|
181
|
+
| 3 | `disconnect` | `deviceId` | `String` | `string` | `plugin.ets:136` | `as string` | ✅ 正确 | 0 |
|
|
182
|
+
| 4 | `setNotifyValue` | `force_indications` | `bool` | — | — | — | ⛔ 缺失参数 | -8 |
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 3.3 返回值函数级对比表
|
|
186
|
+
|
|
187
|
+
```markdown
|
|
188
|
+
### 1.3 返回值函数级对比
|
|
189
|
+
|
|
190
|
+
| # | 函数名 | Dart 期望返回 | OHOS 实际返回 | OHOS 代码行 | 代码片段 | 状态 | 扣分 |
|
|
191
|
+
|---|--------|-------------|-------------|------------|----------|------|------|
|
|
192
|
+
| 1 | `setOptions` | `void` | `Map<string, Object>` ❌ | `plugin.ets:502` | `return mConnectedDevices;` | ❌ 语义错误 | -8 |
|
|
193
|
+
| 2 | `connectToDevice` | `bool` | `boolean` | `plugin.ets:89` | `return result;` | ✅ 正确 | 0 |
|
|
194
|
+
| 3 | `removeBond` | `bool` | `boolean` (固定 true) | `plugin.ets:278` | `return true; // stub` | ⚠️ Stub | -8 |
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 3.4 平台功能函数级对比表
|
|
198
|
+
|
|
199
|
+
**这是最关键的对比维度**,必须列出每个函数在三个平台的实现状态:
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
### 2.1 Android vs OHOS 函数级功能对比
|
|
203
|
+
|
|
204
|
+
| # | 函数名 | Android 文件:行号 | Android 实现 | OHOS 文件:行号 | OHOS 实现 | 对比状态 | 扣分 |
|
|
205
|
+
|---|--------|------------------|-------------|---------------|----------|----------|------|
|
|
206
|
+
| 1 | `connectToDevice` | `BluetoothPlugin.java:156` | ✅ 实际调用 BluetoothGatt.connect() | `plugin.ets:89` | ✅ 实际调用 @ohos.bluetooth.ble | ✅ 一致 | 0 |
|
|
207
|
+
| 2 | `removeBond` | `BluetoothPlugin.java:278` | ✅ 实际调用 BluetoothDevice.removeBond() | `plugin.ets:278` | ❌ Stub: `return true;` 无实际操作 | ❌ 致命不一致 | -15 |
|
|
208
|
+
| 3 | `setNotifyValue` | `BluetoothPlugin.java:342` | ✅ 实际调用 gatt.setCharacteristicNotification() + write descriptor | `plugin.ets:342` | ⚠️ force_indications 类型错误导致功能失效 | ❌ 致命不一致 | -15 |
|
|
209
|
+
| 4 | `getAdapterName` | `BluetoothPlugin.java:410` | ✅ 返回 BluetoothAdapter.getName() | `plugin.ets:410` | ⛔ 返回 "not supported" 错误消息 | ⛔ 功能缺失 | -15 |
|
|
210
|
+
| 5 | `clearGattCache` | `BluetoothPlugin.java:502` | ✅ 实际清理缓存 | `plugin.ets:502` | ❌ Stub: `return true;` | ❌ 严重不一致 | -12 |
|
|
211
|
+
| 4 | `requestConnectionPriority` | `BluetoothPlugin.java:455` | ✅ 实际调用 gatt.requestConnectionPriority() | — | ⛔ 方法不存在 | 🔶 平台限制 | 0 |
|
|
212
|
+
|
|
213
|
+
> **🔶 平台限制判定说明**:`requestConnectionPriority` 经查阅 `@ohos.bluetooth.ble` 官方文档确认无此接口,且无替代 API 可实现相同功能,iOS 亦存在类似限制,因此判定为平台限制,**不扣分**。但要求代码中添加注释说明该限制。
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 3.5 函数级 Stub 检测表
|
|
217
|
+
|
|
218
|
+
```markdown
|
|
219
|
+
### Stub 方法函数级检测
|
|
220
|
+
|
|
221
|
+
| # | 函数名 | OHOS 文件:行号 | Stub 代码片段 | 缺失的 @ohos API 调用 | 缺失的业务逻辑 | 扣分 |
|
|
222
|
+
|---|--------|---------------|--------------|---------------------|---------------|------|
|
|
223
|
+
| 1 | `removeBond` | `plugin.ets:278` | `if (!connected) return false; return true;` | `connection.unpairDevice()` | 实际解绑操作 | -8 |
|
|
224
|
+
| 2 | `clearGattCache` | `plugin.ets:502` | `return true;` | 无对应 API | 缓存清理操作 | 🔶 平台限制 0 |
|
|
225
|
+
| 3 | `requestConnectionPriority` | — | 方法不存在 | `@ohos.bluetooth.ble` 无此接口 | 连接优先级设置 | 🔶 平台限制 0 |
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 4. 函数级代码片段引用规范
|
|
231
|
+
|
|
232
|
+
### 4.1 代码片段必须包含的关键信息
|
|
233
|
+
|
|
234
|
+
每个代码片段引用必须包含:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
代码片段引用规范:
|
|
238
|
+
├── 文件路径 # 如 ohos/ets/plugin.ets
|
|
239
|
+
├── 行号范围 # 如 :278-282
|
|
240
|
+
├── 函数签名 # 如 removeBond(deviceId: string): Promise<boolean>
|
|
241
|
+
├── 关键代码行 # 至少 3 行实际代码
|
|
242
|
+
├── 问题标注 # 在代码片段中标注问题所在行
|
|
243
|
+
└── 修复示例 # 展示正确实现的代码
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 4.2 代码片段格式示例
|
|
247
|
+
|
|
248
|
+
**致命问题代码片段格式**:
|
|
249
|
+
|
|
250
|
+
```markdown
|
|
251
|
+
**问题**:`removeBond` 方法为 Stub 实现,未调用实际解绑 API
|
|
252
|
+
|
|
253
|
+
**文件位置**:`ohos/ets/plugin.ets:278-282`
|
|
254
|
+
|
|
255
|
+
**问题代码**:
|
|
256
|
+
```typescript
|
|
257
|
+
async removeBond(deviceId: string): Promise<boolean> {
|
|
258
|
+
if (!this.isConnected(deviceId)) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
return true; // ❌ Stub: 未调用 unpairDevice,始终返回 true
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Android 参考实现**(`BluetoothPlugin.java:278-285`):
|
|
266
|
+
```java
|
|
267
|
+
public boolean removeBond(String deviceId) {
|
|
268
|
+
BluetoothDevice device = bluetoothAdapter.getRemoteDevice(deviceId);
|
|
269
|
+
return device.removeBond(); // ✅ 实际调用解绑方法
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**修复方案**:
|
|
274
|
+
```typescript
|
|
275
|
+
async removeBond(deviceId: string): Promise<boolean> {
|
|
276
|
+
if (!this.isConnected(deviceId)) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
try {
|
|
280
|
+
return await connection.unpairDevice(deviceId); // ✅ 调用 OHOS 解绑 API
|
|
281
|
+
} catch (err) {
|
|
282
|
+
throw new PlatformException('removeBond failed', err.code, err.message);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### 4.3 禁止使用的模糊描述
|
|
289
|
+
|
|
290
|
+
| ❌ 禁止格式 | ✅ 必须格式 | 原因 |
|
|
291
|
+
|------------|-----------|------|
|
|
292
|
+
| "连接管理功能一致" | "`connectToDevice(deviceId: string): Promise<boolean>` — Android `BluetoothPlugin.java:156` 实际调用 `BluetoothGatt.connect()`,OHOS `plugin.ets:89` 实际调用 `@ohos.bluetooth.ble.connect()`,核心行为一致" | 模糊描述无法定位和验证 |
|
|
293
|
+
| "BLE扫描功能缺失" | "`startScan(filter: ScanFilter)` — Android `BluetoothPlugin.java:89` 实际调用 `BluetoothLeScanner.startScan()`,OHOS 未实现该方法" | 必须指明具体缺失的函数 |
|
|
294
|
+
| "通知订阅不一致" | "`setNotifyValue(force_indications: bool)` → OHOS 解析为 `string` — `plugin.ets:344` `as string` 导致功能失效" | 必须指明具体参数和类型错误 |
|
|
295
|
+
| "绑定管理有问题" | "`removeBond(deviceId)` → `plugin.ets:278` 为 Stub,返回固定 `true`,未调用 `connection.unpairDevice()`" | 必须指明具体函数和问题 |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 5. 函数级对比的评分应用
|
|
300
|
+
|
|
301
|
+
### 5.1 每个函数独立评分
|
|
302
|
+
|
|
303
|
+
每个函数的对比结果独立计算扣分,而非按功能模块统一扣分:
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
函数级独立扣分:
|
|
307
|
+
├── 函数 A: connectToDevice
|
|
308
|
+
│ ├── 签名一致 → 0 分扣减
|
|
309
|
+
│ ├── 参数类型正确 → 0 分扣减
|
|
310
|
+
│ └── 行为一致 → 0 分扣减
|
|
311
|
+
│ └── 总扣分:0 分
|
|
312
|
+
├── 函数 B: setNotifyValue
|
|
313
|
+
│ ├── 签名一致 → 0 分扣减
|
|
314
|
+
│ ├── 参数类型致命错误 (bool→string) → -15 分
|
|
315
|
+
│ ├── 行为致命不一致 → -15 分
|
|
316
|
+
│ └── 总扣分:-30 分
|
|
317
|
+
├── 函数 C: removeBond
|
|
318
|
+
│ ├── 签名一致 → 0 分扣减
|
|
319
|
+
│ ├── Stub 实现 → -8 分
|
|
320
|
+
│ ├── 总扣分:-8 分
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### 5.2 扣分规则与函数级映射
|
|
324
|
+
|
|
325
|
+
| 扣分类别 | 函数级判定 | 扣分值 | 示例 |
|
|
326
|
+
|----------|-----------|--------|------|
|
|
327
|
+
| 致命-方法缺失 | 函数在 OHOS 中不存在(适配缺陷) | -10 分 | `getAdapterName` 方法不存在于 `plugin.ets` |
|
|
328
|
+
| 🔶 平台限制-方法缺失 | 函数在 OHOS 中不存在且鸿蒙无对应系统 API 且无替代路径 | **0 分** | `requestConnectionPriority` 因 `@ohos.bluetooth.ble` 无此接口,判定为平台限制 |
|
|
329
|
+
| 致命-类型错误 | 参数类型映射致命错误 | -15 分 | `force_indications` 在 `plugin.ets:344` 解析为 `string` 而非 `boolean` |
|
|
330
|
+
| 致命-Stub实现 | 方法返回固定值无实际操作 | -8 分 | `removeBond` 在 `plugin.ets:278` 仅返回 `true` |
|
|
331
|
+
| 致命-返回错误 | 方法返回错误消息而非实现 | -10 分 | `getAdapterName` 在 `plugin.ets:410` 返回 "not supported" |
|
|
332
|
+
| 严重-行为不一致 | 函数核心逻辑差异 | -12 分 | `disconnect` 在 Android 传递 reason 码,OHOS 硬编码 `code: 1` |
|
|
333
|
+
| 中等-参数数量 | 参数数量不匹配 | -8 分 | Android `disconnect` 有 reason 参数,OHOS 无 |
|
|
334
|
+
| 轻微-命名不规范 | 函数名不符合规范 | -3 分 | `OnDiscoveredServices` 应为 `onDiscoveredServices` |
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
**文档版本**:v3.1
|
|
339
|
+
**更新时间**:2026-07-03
|
|
340
|
+
**适用范围**:Flutter 三方库一致性检视函数级对比
|
|
341
|
+
|
|
342
|
+
> 🔶 **鸿蒙平台限制判定规则**:详见 [PLATFORM_LIMITATION_GUIDE.md](PLATFORM_LIMITATION_GUIDE.md)。确认无法鸿蒙化的接口直接不扣分,无需检查文档化状态。
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 鸿蒙平台限制判定指南
|
|
2
|
+
|
|
3
|
+
本文档定义一致性检视中**鸿蒙平台不可实现能力**的判定规则。当某个函数在鸿蒙平台确实无法实现时,标记为 🔶 平台限制,**不扣分**。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 核心原则
|
|
8
|
+
|
|
9
|
+
**确认无法鸿蒙化的接口 → 直接不扣分**,不需要检查文档化状态。平台限制是客观事实,不应因文档缺失而惩罚适配者。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. 判定条件
|
|
14
|
+
|
|
15
|
+
标记为 🔶 平台限制需满足以下条件:
|
|
16
|
+
|
|
17
|
+
| # | 条件 | 判定方法 | 说明 |
|
|
18
|
+
|---|------|----------|------|
|
|
19
|
+
| ① | 鸿蒙系统 API 不存在 | 查阅 `@ohos.*` 官方文档,确认目标 API 不存在或不提供该能力 | 需在报告中引用官方文档作为证据 |
|
|
20
|
+
| ② | 无替代实现路径 | 确认鸿蒙平台无其他 API 可实现相同功能 | 如有替代 API 可实现则不属于平台限制,属于适配缺陷 |
|
|
21
|
+
|
|
22
|
+
> 条件 ①② **同时满足**即可标记为 🔶 平台限制,无需额外检查文档化或 Dart 层降级。
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 3. 判定流程
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
函数在 OHOS 中缺失或为 Stub
|
|
30
|
+
↓
|
|
31
|
+
├─ 鸿蒙系统 API 是否存在对应能力?
|
|
32
|
+
│ ├── 是 → 该函数可实现但未实现 → ❌ 扣分(适配缺陷)
|
|
33
|
+
│ └── 否 → 继续判定
|
|
34
|
+
│ ├── 是否有替代 API 可实现?
|
|
35
|
+
│ │ ├── 是 → 未使用替代 API → ❌ 扣分(适配缺陷)
|
|
36
|
+
│ │ └── 否 → 🔶 平台限制,不扣分
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 4. 常见鸿蒙平台限制示例
|
|
42
|
+
|
|
43
|
+
| 功能 | Android API | 鸿蒙 API 状态 | 判定 |
|
|
44
|
+
|------|------------|-------------|------|
|
|
45
|
+
| BLE 连接优先级请求 | `BluetoothGatt.requestConnectionPriority()` | `@ohos.bluetooth.ble` 无此接口 | 🔶 平台限制 |
|
|
46
|
+
| GATT 缓存清理 | `BluetoothGatt.refresh()` | 无对应 API | 🔶 平台限制 |
|
|
47
|
+
| 蓝牙设备解绑 | `BluetoothDevice.removeBond()` | `@ohos.bluetooth.connection` 有 `unpairDevice()` | ❌ 适配缺陷 |
|
|
48
|
+
| NFC 主机卡模拟 | `HostApduService` | `@ohos.nfc.cardEmulation` 有 `HceService` | ❌ 适配缺陷 |
|
|
49
|
+
| WiFi P2P 群组移除 | `WifiP2pManager.removeGroup()` | `@ohos.wifi.p2p` 有 `removeGroup()` | ❌ 适配缺陷 |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 5. 报告中平台限制的呈现
|
|
54
|
+
|
|
55
|
+
经判定属于 🔶 平台限制的函数,在报告中需单独列出:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
### 🔶 鸿蒙平台限制函数清单
|
|
59
|
+
|
|
60
|
+
> 以下函数经判定属于鸿蒙平台限制(鸿蒙系统无对应 API 且无替代实现路径),不纳入扣分计算。
|
|
61
|
+
|
|
62
|
+
| # | 函数名 | Android API | 鸿蒙 API 状态 | 判定依据 | 备注 |
|
|
63
|
+
|---|--------|------------|-------------|----------|------|
|
|
64
|
+
| 1 | `requestConnectionPriority` | `BluetoothGatt.requestConnectionPriority()` | `@ohos.bluetooth.ble` 无此接口 | 查阅 API 10 文档确认 | iOS 亦有限制 |
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
**文档版本**:v1.0
|
|
70
|
+
**更新时间**:2026-07-03
|
|
71
|
+
**适用范围**:Flutter 三方库一致性检视 — 鸿蒙平台限制判定
|