android2harmony 0.1.7 → 0.1.8
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/agents/api-analyzer.md +113 -0
- package/agents/app-action.md +122 -0
- package/agents/code-reviewer.md +191 -295
- package/agents/coder.md +377 -0
- package/agents/self-tester.md +8 -8
- package/agents/spec-designer.md +56 -0
- package/package.json +1 -1
- package/skills/a2h-app-req-gen/SKILL.md +174 -0
- package/skills/a2h-app-req-gen/references/spec-handoff.md +99 -0
- package/skills/a2h-app-req-gen/references/subagent-render.md +115 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/build.gradle.kts +41 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle.properties +3 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew +251 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew.bat +94 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/settings.gradle.kts +17 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawAnalysisDetector.java +1911 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawIssueRegistry.java +37 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawJson.java +146 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawLocation.java +96 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawRecordWriter.java +227 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/dev/reqgen/analyzer/jvm/raw-record-v1.schema.json +93 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/assets/dashboard.html +151 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-lint.init.gradle +60 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-model.init.gradle +204 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/package.json +14 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/backend.js +323 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/cli.js +811 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/gap-audit-link.js +62 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/index.js +66 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/merge.js +605 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/name-trace.js +153 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/orchestrate.js +1324 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/output-parse.js +50 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/overview.js +10 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/pool.js +23 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/post-merge-fix.js +146 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt-loader.js +51 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt.js +967 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompts.md +301 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/serve.js +78 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/short-id.js +46 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/snapshot.js +267 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/validate.js +122 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/callback-call-sites.js +62 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/build.js +1291 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/area-ownership.js +392 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/build.js +1995 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/callback-flow.js +277 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/component-variants.js +725 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/index.js +15 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/index.js +12 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/policy.js +469 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/traceability.js +468 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/build.js +1066 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.js +174 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android.js +1062 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/area-titles.js +678 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/builder.js +350 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-api-registry.js +395 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-call-sites.js +2008 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose.js +9059 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/dynamic-repeated-call-sites.js +529 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/interaction-effects.js +1149 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/jvm.js +6272 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/normalize.js +33 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/pending-intents.js +565 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/resource-id.js +42 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/route-state-variants.js +781 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/state.js +234 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/extract.js +40 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/index.js +6 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/manifest.js +513 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/resources.js +398 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/views.js +447 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/xml-parser.js +175 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/cli.js +398 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/area-graph.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/artifact.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/common.js +16 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/diagnostic.js +10 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/gap-audit.js +14 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/index.js +11 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/name-traceability.js +26 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/raw-fact.js +40 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/req-model.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/run.js +19 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/semantic-completeness.js +11 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/source-facts.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/core/output-guard.js +41 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/core/stable-id.js +92 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dashboard-cli.js +169 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/diagnostics.js +104 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/dump.js +1028 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump-cli.js +251 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/artifacts.js +49 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/index.js +18 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/quality-report.js +125 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/render.js +353 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/types.js +2 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/graph/paths.js +474 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/index.js +15 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/protocol.js +408 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/runner.js +452 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/index.js +8 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/output.js +165 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/run-stage1.js +891 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/discovery.js +299 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-model.js +358 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-runner.js +165 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/resource-profile.js +60 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff-cli.js +151 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff.js +1004 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-cli.js +109 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-input.js +419 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-name-trace-input.js +95 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/area-graph.js +444 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/index.js +7 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-model.js +580 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-text.js +195 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/semantic-area-graph.js +1431 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen-audit.mjs +298 -0
- package/skills/a2h-app-req-gen/scripts/reqgen-selfcheck.mjs +555 -0
- package/skills/a2h-code-review/SKILL.md +379 -0
- package/skills/{hmos-integration-test → a2h-integration-test}/README.md +6 -6
- package/skills/{hmos-integration-test → a2h-integration-test}/SKILL.md +6 -6
- package/skills/{hmos-integration-test → a2h-integration-test}/scripts/report-tool.mjs +1 -1
- package/skills/a2h-spec-design/SKILL.md +330 -0
- package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +207 -0
- package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +198 -0
- package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +256 -0
- package/skills/a2h-spec-generate/SKILL.md +696 -0
- package/skills/a2h-spec-generate/references/trace-template.md +115 -0
- package/skills/a2h-spec-generate/scripts/parse_requirements.mjs +537 -0
- package/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/skills/a2h-spec-implement/SKILL.md +548 -0
- package/skills/a2h-spec-implement/references/harmony-pitfalls.md +186 -0
- package/skills/a2h-spec-implement/references/l1-unit-test.md +185 -0
- package/skills/a2h-spec-implement/references/l3-e2e-uitest.md +167 -0
- package/skills/a2h-spec-implement/references/test-core.md +132 -0
- package/skills/a2h-spec-implement/rules/arkts/arkts-standards.md +184 -0
- package/skills/a2h-spec-implement/rules/arkts/conventions/coding-style.md +96 -0
- package/skills/a2h-spec-implement/rules/arkts/conventions/security.md +126 -0
- package/skills/a2h-spec-implement/rules/arkts/language/arkts-rules.md +650 -0
- package/skills/a2h-spec-implement/rules/arkts/language/arkui-structure-rules.md +173 -0
- package/skills/a2h-spec-implement/rules/arkts/language/ts-to-arkts-rewrites.md +58 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2089 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +903 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +355 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +216 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +442 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +169 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +763 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +2088 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1258 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Once/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +175 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Param/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +850 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +862 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +110 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +301 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1411 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1392 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/getTarget/346/216/245/345/217/243/357/274/232/350/216/267/345/217/226/347/212/266/346/200/201/347/256/241/347/220/206/346/241/206/346/236/266/344/273/243/347/220/206/345/211/215/347/232/204/345/216/237/345/247/213/345/257/271/350/261/241.md +288 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/makeObserved/346/216/245/345/217/243/357/274/232/345/260/206/351/235/236/350/247/202/345/257/237/346/225/260/346/215/256/345/217/230/344/270/272/345/217/257/350/247/202/345/257/237/346/225/260/346/215/256.md +768 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/222/214V2/346/267/267/347/224/250/346/214/207/345/257/274/357/274/210API version 19/345/217/212/344/271/213/345/220/216/357/274/211.md" +829 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206/346/246/202/350/277/260.md +184 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/component-cookbook.md +431 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/state-management.md +152 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/ui-quality.md +67 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/ui-runtime-diagnosis.md +32 -0
- package/skills/a2h-spec-implement/rules/pipeline/build/package-set-collection.md +43 -0
- package/skills/a2h-spec-implement/scripts/_lib/common.mjs +97 -0
- package/skills/a2h-spec-implement/scripts/_lib/config.mjs +70 -0
- package/skills/a2h-spec-implement/scripts/_lib/lessons_cli.mjs +48 -0
- package/skills/a2h-spec-implement/scripts/build_lessons.mjs +24 -0
- package/skills/a2h-spec-implement/scripts/code_pattern_lessons.mjs +26 -0
- package/skills/a2h-spec-implement/scripts/device_ui.mjs +433 -0
- package/skills/a2h-spec-implement/scripts/device_ui_core.mjs +895 -0
- package/skills/a2h-spec-implement/scripts/ledger/aggregate_run.mjs +207 -0
- package/skills/a2h-spec-implement/scripts/manifest/emit_summary_line.mjs +37 -0
- package/skills/a2h-spec-implement/scripts/manifest/finalize_run.mjs +115 -0
- package/skills/a2h-spec-implement/scripts/manifest/render_final_summary.mjs +78 -0
- package/skills/a2h-spec-implement/scripts/manifest/root_mirror.mjs +137 -0
- package/skills/a2h-spec-implement/scripts/package.json +12 -0
- package/skills/a2h-spec-implement/scripts/state_propagation_check.mjs +676 -0
- package/skills/a2h-spec-implement/scripts/test/l2_run.mjs +244 -0
- package/skills/a2h-spec-implement/scripts/test/tp_coverage.mjs +231 -0
- package/skills/a2h-spec-implement/scripts/ui_memory.mjs +161 -0
- package/skills/a2h-spec-implement/scripts/utils/ensure_app.mjs +134 -0
- package/skills/a2h-ui-transfer/SKILL.md +2 -2
- package/skills/hmos-convert-pipeline/SKILL.md +7 -5
- package/skills/hmos-incremental-ui-align/README.md +7 -7
- package/skills/hmos-incremental-ui-align/SKILL.md +1 -1
- package/skills/hmos-incremental-ui-align/page_align.md +1 -1
- package/skills/hmos-spec-generate/SKILL.md +2 -2
- package/skills/hmos-spec-generate/scripts/parse_requirements.mjs +537 -0
- package/skills/hmos-fix-build-errors/SKILL.md +0 -266
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +0 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +0 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +0 -131
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +0 -515
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/resolve-metadata-tool.mjs +0 -0
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/self-test-runner.mjs +0 -0
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/testcases-tool.mjs +0 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
export const DEFAULT_MAX_GRAPH_STATES = 50_000;
|
|
2
|
+
export const GRAPH_STATE_BUDGET_EXHAUSTED = "GRAPH_STATE_BUDGET_EXHAUSTED";
|
|
3
|
+
export class GraphStateBudgetExceededError extends Error {
|
|
4
|
+
code = GRAPH_STATE_BUDGET_EXHAUSTED;
|
|
5
|
+
stage = "paths";
|
|
6
|
+
maxGraphStates;
|
|
7
|
+
statesUsed;
|
|
8
|
+
attemptedState;
|
|
9
|
+
constructor(maxGraphStates, statesUsed) {
|
|
10
|
+
super(
|
|
11
|
+
`Area path search exceeded the global ${maxGraphStates}-state budget.`,
|
|
12
|
+
);
|
|
13
|
+
this.name = "GraphStateBudgetExceededError";
|
|
14
|
+
this.maxGraphStates = maxGraphStates;
|
|
15
|
+
this.statesUsed = statesUsed;
|
|
16
|
+
this.attemptedState = statesUsed + 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function uniqueSorted(values) {
|
|
20
|
+
return [...new Set(values)].sort((left, right) =>
|
|
21
|
+
left.localeCompare(right, "en"),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function stripOuterParentheses(value) {
|
|
25
|
+
let result = value.trim();
|
|
26
|
+
while (result.startsWith("(") && result.endsWith(")")) {
|
|
27
|
+
let depth = 0;
|
|
28
|
+
let wrapsWholeExpression = true;
|
|
29
|
+
for (let index = 0; index < result.length; index += 1) {
|
|
30
|
+
const character = result[index];
|
|
31
|
+
if (character === "(") depth += 1;
|
|
32
|
+
if (character === ")") depth -= 1;
|
|
33
|
+
if (depth === 0 && index < result.length - 1) {
|
|
34
|
+
wrapsWholeExpression = false;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (depth < 0) {
|
|
38
|
+
wrapsWholeExpression = false;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (!wrapsWholeExpression || depth !== 0) break;
|
|
43
|
+
result = result.slice(1, -1).trim();
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
function conditionConstraint(expression) {
|
|
48
|
+
const compact = stripOuterParentheses(expression).replace(/\s+/gu, "");
|
|
49
|
+
if (compact.startsWith("!(") && compact.endsWith(")")) {
|
|
50
|
+
const inner = conditionConstraint(compact.slice(2, -1));
|
|
51
|
+
if (inner.relation === "equals") {
|
|
52
|
+
return { ...inner, relation: "not-equals" };
|
|
53
|
+
}
|
|
54
|
+
if (inner.relation === "not-equals") {
|
|
55
|
+
return { ...inner, relation: "equals" };
|
|
56
|
+
}
|
|
57
|
+
if (inner.relation === "truthy") {
|
|
58
|
+
return { ...inner, relation: "not" };
|
|
59
|
+
}
|
|
60
|
+
if (inner.relation === "not") {
|
|
61
|
+
return { ...inner, relation: "truthy" };
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
subject: compact.slice(2, -1),
|
|
65
|
+
relation: "not",
|
|
66
|
+
values: [],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (compact.startsWith("!") && !compact.startsWith("!=")) {
|
|
70
|
+
return {
|
|
71
|
+
subject: stripOuterParentheses(compact.slice(1)),
|
|
72
|
+
relation: "not",
|
|
73
|
+
values: [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const membership = /^(.+?)in\((.*)\)$/u.exec(compact);
|
|
77
|
+
if (membership) {
|
|
78
|
+
return {
|
|
79
|
+
subject: stripOuterParentheses(membership[1]),
|
|
80
|
+
relation: "member",
|
|
81
|
+
values: membership[2]
|
|
82
|
+
.split(",")
|
|
83
|
+
.map((value) => stripOuterParentheses(value))
|
|
84
|
+
.filter((value) => value.length > 0)
|
|
85
|
+
.sort((left, right) => left.localeCompare(right, "en")),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const comparison = /^(.+?)(===|!==|==|!=)(.+)$/u.exec(compact);
|
|
89
|
+
if (comparison) {
|
|
90
|
+
const left = stripOuterParentheses(comparison[1]);
|
|
91
|
+
const right = stripOuterParentheses(comparison[3]);
|
|
92
|
+
return {
|
|
93
|
+
subject: left,
|
|
94
|
+
relation: comparison[2].includes("!") ? "not-equals" : "equals",
|
|
95
|
+
values: [right],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const assignment = /^(.+?)=(?!=)(.+)$/u.exec(compact);
|
|
99
|
+
if (assignment && !/[!<>=]$/u.test(assignment[1])) {
|
|
100
|
+
return {
|
|
101
|
+
subject: stripOuterParentheses(assignment[1]),
|
|
102
|
+
relation: "equals",
|
|
103
|
+
values: [stripOuterParentheses(assignment[2])],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
subject: compact,
|
|
108
|
+
relation: "truthy",
|
|
109
|
+
values: [],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function constraintsContradict(left, right) {
|
|
113
|
+
if (left.subject !== right.subject) return false;
|
|
114
|
+
if (
|
|
115
|
+
(left.relation === "truthy" && right.relation === "not") ||
|
|
116
|
+
(left.relation === "not" && right.relation === "truthy")
|
|
117
|
+
)
|
|
118
|
+
return true;
|
|
119
|
+
if (left.relation === "equals" && right.relation === "equals") {
|
|
120
|
+
return left.values[0] !== right.values[0];
|
|
121
|
+
}
|
|
122
|
+
if (left.relation === "member" && right.relation === "member") {
|
|
123
|
+
const rightValues = new Set(right.values);
|
|
124
|
+
return !left.values.some((value) => rightValues.has(value));
|
|
125
|
+
}
|
|
126
|
+
if (left.relation === "equals" && right.relation === "member") {
|
|
127
|
+
return !right.values.includes(left.values[0]);
|
|
128
|
+
}
|
|
129
|
+
if (left.relation === "member" && right.relation === "equals") {
|
|
130
|
+
return !left.values.includes(right.values[0]);
|
|
131
|
+
}
|
|
132
|
+
if (left.relation === "equals" && right.relation === "not-equals")
|
|
133
|
+
return left.values[0] === right.values[0];
|
|
134
|
+
if (left.relation === "not-equals" && right.relation === "equals")
|
|
135
|
+
return left.values[0] === right.values[0];
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
export function conditionsAreCompatible(conditionRefs, expressions) {
|
|
139
|
+
if (!expressions) return true;
|
|
140
|
+
const constraints = uniqueSorted(conditionRefs).flatMap((ref) => {
|
|
141
|
+
const expression = expressions.get(ref)?.trim();
|
|
142
|
+
return expression ? [conditionConstraint(expression)] : [];
|
|
143
|
+
});
|
|
144
|
+
for (let left = 0; left < constraints.length; left += 1) {
|
|
145
|
+
for (let right = left + 1; right < constraints.length; right += 1) {
|
|
146
|
+
if (constraintsContradict(constraints[left], constraints[right])) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
function deterministicActivationSubject(conditionRef, expressions) {
|
|
154
|
+
const expression = expressions?.get(conditionRef)?.trim();
|
|
155
|
+
if (!expression) return undefined;
|
|
156
|
+
const constraint = conditionConstraint(expression);
|
|
157
|
+
if (
|
|
158
|
+
constraint.relation === "equals" ||
|
|
159
|
+
constraint.relation === "truthy" ||
|
|
160
|
+
constraint.relation === "not" ||
|
|
161
|
+
(constraint.relation === "member" && constraint.values.length === 1)
|
|
162
|
+
)
|
|
163
|
+
return constraint.subject;
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Entering a conditioned target Area establishes that Area's deterministic
|
|
168
|
+
* activation state. Only those post-state dimensions replace prior routing
|
|
169
|
+
* constraints. Edge conditions themselves remain guards and can never erase
|
|
170
|
+
* a conflict merely because they mention the same subject.
|
|
171
|
+
*/
|
|
172
|
+
function applyTargetActivation(
|
|
173
|
+
routingConditions,
|
|
174
|
+
targetConditions,
|
|
175
|
+
expressions,
|
|
176
|
+
) {
|
|
177
|
+
const replacedSubjects = new Set(
|
|
178
|
+
targetConditions.flatMap((conditionRef) => {
|
|
179
|
+
const subject = deterministicActivationSubject(conditionRef, expressions);
|
|
180
|
+
return subject ? [subject] : [];
|
|
181
|
+
}),
|
|
182
|
+
);
|
|
183
|
+
const retained =
|
|
184
|
+
replacedSubjects.size === 0
|
|
185
|
+
? routingConditions
|
|
186
|
+
: routingConditions.filter((conditionRef) => {
|
|
187
|
+
const expression = expressions?.get(conditionRef)?.trim();
|
|
188
|
+
return (
|
|
189
|
+
!expression ||
|
|
190
|
+
!replacedSubjects.has(conditionConstraint(expression).subject)
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
return uniqueSorted([...retained, ...targetConditions]);
|
|
194
|
+
}
|
|
195
|
+
function edgeConditionChoices(edge) {
|
|
196
|
+
const alternatives = edge.conditionAlternatives ?? [];
|
|
197
|
+
if (alternatives.length === 0) return [uniqueSorted(edge.conditions)];
|
|
198
|
+
const alternativeRefs = new Set(
|
|
199
|
+
alternatives.flatMap((alternative) => alternative.conditionRefs),
|
|
200
|
+
);
|
|
201
|
+
const common = edge.conditions.filter((ref) => !alternativeRefs.has(ref));
|
|
202
|
+
return alternatives.map((alternative) =>
|
|
203
|
+
uniqueSorted([...common, ...alternative.conditionRefs]),
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function stepFrom(edge) {
|
|
207
|
+
if ("status" in edge.target || edge.target.kind !== "area") {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
edgeRef: edge.id,
|
|
212
|
+
sourceAreaRef: edge.sourceAreaRef,
|
|
213
|
+
controlRef: edge.controlRef,
|
|
214
|
+
actionRef: edge.actionRef,
|
|
215
|
+
targetAreaRef: edge.target.ref,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function candidateKey(candidate) {
|
|
219
|
+
return [
|
|
220
|
+
candidate.entry.id,
|
|
221
|
+
candidate.steps.map((step) => step.edgeRef).join("\u0000"),
|
|
222
|
+
].join("\u0001");
|
|
223
|
+
}
|
|
224
|
+
function startupRank(entry) {
|
|
225
|
+
switch (entry.startupRole) {
|
|
226
|
+
case "default":
|
|
227
|
+
return 0;
|
|
228
|
+
case "conditional":
|
|
229
|
+
return 1;
|
|
230
|
+
case "override":
|
|
231
|
+
return 2;
|
|
232
|
+
default:
|
|
233
|
+
return 0;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function compareCandidateCost(left, right) {
|
|
237
|
+
return (
|
|
238
|
+
startupRank(left.entry) - startupRank(right.entry) ||
|
|
239
|
+
left.steps.length - right.steps.length ||
|
|
240
|
+
left.preconditions.length - right.preconditions.length
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
function compareCandidate(left, right) {
|
|
244
|
+
return (
|
|
245
|
+
compareCandidateCost(left, right) ||
|
|
246
|
+
candidateKey(left).localeCompare(candidateKey(right), "en")
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function retainState(budget, candidate) {
|
|
250
|
+
if (budget.used >= budget.limit) {
|
|
251
|
+
throw new GraphStateBudgetExceededError(budget.limit, budget.used);
|
|
252
|
+
}
|
|
253
|
+
budget.used += 1;
|
|
254
|
+
return candidate;
|
|
255
|
+
}
|
|
256
|
+
function shortestCandidates(
|
|
257
|
+
areas,
|
|
258
|
+
conditionsByArea,
|
|
259
|
+
edges,
|
|
260
|
+
entries,
|
|
261
|
+
budget,
|
|
262
|
+
conditionExpressions,
|
|
263
|
+
) {
|
|
264
|
+
const bySource = new Map();
|
|
265
|
+
for (const edge of edges) {
|
|
266
|
+
const step = stepFrom(edge);
|
|
267
|
+
if (!step) {
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const outgoing = bySource.get(edge.sourceAreaRef) ?? [];
|
|
271
|
+
outgoing.push(edge);
|
|
272
|
+
bySource.set(edge.sourceAreaRef, outgoing);
|
|
273
|
+
}
|
|
274
|
+
for (const outgoing of bySource.values()) {
|
|
275
|
+
outgoing.sort((left, right) => left.id.localeCompare(right.id, "en"));
|
|
276
|
+
}
|
|
277
|
+
const queue = entries.flatMap((entry) =>
|
|
278
|
+
[...entry.rootAreaRefs]
|
|
279
|
+
.sort((left, right) => left.localeCompare(right, "en"))
|
|
280
|
+
.flatMap((area) => {
|
|
281
|
+
const routingConditions = uniqueSorted([
|
|
282
|
+
...entry.conditions,
|
|
283
|
+
...(conditionsByArea.get(area) ?? []),
|
|
284
|
+
]);
|
|
285
|
+
if (!conditionsAreCompatible(routingConditions, conditionExpressions))
|
|
286
|
+
return [];
|
|
287
|
+
return [
|
|
288
|
+
retainState(budget, {
|
|
289
|
+
entry,
|
|
290
|
+
area,
|
|
291
|
+
preconditions: uniqueSorted(
|
|
292
|
+
entry.preconditions ?? entry.conditions,
|
|
293
|
+
),
|
|
294
|
+
routingConditions,
|
|
295
|
+
steps: [],
|
|
296
|
+
visited: new Set([area]),
|
|
297
|
+
}),
|
|
298
|
+
];
|
|
299
|
+
}),
|
|
300
|
+
);
|
|
301
|
+
const result = new Map();
|
|
302
|
+
const best = new Map();
|
|
303
|
+
let cursor = 0;
|
|
304
|
+
while (cursor < queue.length) {
|
|
305
|
+
const candidate = queue[cursor++];
|
|
306
|
+
const known = best.get(candidate.area);
|
|
307
|
+
const comparison =
|
|
308
|
+
known === undefined ? -1 : compareCandidateCost(candidate, known);
|
|
309
|
+
if (known === undefined || comparison < 0) {
|
|
310
|
+
best.set(candidate.area, candidate);
|
|
311
|
+
result.set(candidate.area, [candidate]);
|
|
312
|
+
} else if (comparison === 0) {
|
|
313
|
+
const candidates = result.get(candidate.area) ?? [];
|
|
314
|
+
if (
|
|
315
|
+
!candidates.some(
|
|
316
|
+
(item) => candidateKey(item) === candidateKey(candidate),
|
|
317
|
+
)
|
|
318
|
+
) {
|
|
319
|
+
candidates.push(candidate);
|
|
320
|
+
result.set(candidate.area, candidates);
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
for (const edge of bySource.get(candidate.area) ?? []) {
|
|
326
|
+
const step = stepFrom(edge);
|
|
327
|
+
if (!step || candidate.visited.has(step.targetAreaRef)) {
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
for (const edgeConditions of edgeConditionChoices(edge)) {
|
|
331
|
+
const guardedConditions = uniqueSorted([
|
|
332
|
+
...candidate.routingConditions,
|
|
333
|
+
...edgeConditions,
|
|
334
|
+
...edge.preconditions,
|
|
335
|
+
]);
|
|
336
|
+
if (!conditionsAreCompatible(guardedConditions, conditionExpressions))
|
|
337
|
+
continue;
|
|
338
|
+
const routingConditions = applyTargetActivation(
|
|
339
|
+
guardedConditions,
|
|
340
|
+
conditionsByArea.get(step.targetAreaRef) ?? [],
|
|
341
|
+
conditionExpressions,
|
|
342
|
+
);
|
|
343
|
+
if (!conditionsAreCompatible(routingConditions, conditionExpressions))
|
|
344
|
+
continue;
|
|
345
|
+
const next = {
|
|
346
|
+
entry: candidate.entry,
|
|
347
|
+
area: step.targetAreaRef,
|
|
348
|
+
preconditions: uniqueSorted([
|
|
349
|
+
...candidate.preconditions,
|
|
350
|
+
...edge.preconditions,
|
|
351
|
+
]),
|
|
352
|
+
routingConditions,
|
|
353
|
+
steps: [...candidate.steps, step],
|
|
354
|
+
visited: new Set([...candidate.visited, step.targetAreaRef]),
|
|
355
|
+
};
|
|
356
|
+
const knownTarget = best.get(step.targetAreaRef);
|
|
357
|
+
if (
|
|
358
|
+
knownTarget !== undefined &&
|
|
359
|
+
compareCandidateCost(next, knownTarget) > 0
|
|
360
|
+
)
|
|
361
|
+
continue;
|
|
362
|
+
queue.push(retainState(budget, next));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
for (const area of areas) {
|
|
367
|
+
const candidates = result.get(area);
|
|
368
|
+
candidates?.sort(compareCandidate);
|
|
369
|
+
}
|
|
370
|
+
return result;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Compute path semantics without inventing prose or IDs. Normal launcher roots
|
|
374
|
+
* are solved independently from alternate roots, so an alternate deep link can
|
|
375
|
+
* never replace a canonical launcher path.
|
|
376
|
+
*/
|
|
377
|
+
export function computePaths(graph, options = {}) {
|
|
378
|
+
const areaIds = graph.areas.map((area) => area.id);
|
|
379
|
+
const conditionsByArea = new Map(
|
|
380
|
+
graph.areas.map((area) => [area.id, area.conditions]),
|
|
381
|
+
);
|
|
382
|
+
const maxGraphStates = options.maxGraphStates ?? DEFAULT_MAX_GRAPH_STATES;
|
|
383
|
+
if (!Number.isSafeInteger(maxGraphStates) || maxGraphStates <= 0) {
|
|
384
|
+
throw new RangeError(
|
|
385
|
+
`maxGraphStates must be a positive safe integer, got ${maxGraphStates}.`,
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
const budget = {
|
|
389
|
+
limit: maxGraphStates,
|
|
390
|
+
used: 0,
|
|
391
|
+
};
|
|
392
|
+
const byEntryId = (left, right) => left.id.localeCompare(right.id, "en");
|
|
393
|
+
const normalEntries = graph.entryPoints
|
|
394
|
+
.filter((entry) => entry.category === "normal")
|
|
395
|
+
.sort(byEntryId);
|
|
396
|
+
const alternateEntries = graph.entryPoints
|
|
397
|
+
.filter((entry) => entry.category === "alternate")
|
|
398
|
+
.sort(byEntryId);
|
|
399
|
+
const normal = shortestCandidates(
|
|
400
|
+
areaIds,
|
|
401
|
+
conditionsByArea,
|
|
402
|
+
graph.edges,
|
|
403
|
+
normalEntries,
|
|
404
|
+
budget,
|
|
405
|
+
options.conditionExpressions,
|
|
406
|
+
);
|
|
407
|
+
// Preserve the shortest route from every alternate root independently.
|
|
408
|
+
// A direct deep link must not erase a widget -> detail route merely because
|
|
409
|
+
// both are alternate ways to enter the app. All searches share one budget.
|
|
410
|
+
const alternateByRoot = alternateEntries.flatMap((entry) =>
|
|
411
|
+
[...entry.rootAreaRefs]
|
|
412
|
+
.sort((left, right) => left.localeCompare(right, "en"))
|
|
413
|
+
.map((rootAreaRef) =>
|
|
414
|
+
shortestCandidates(
|
|
415
|
+
areaIds,
|
|
416
|
+
conditionsByArea,
|
|
417
|
+
graph.edges,
|
|
418
|
+
[{ ...entry, rootAreaRefs: [rootAreaRef] }],
|
|
419
|
+
budget,
|
|
420
|
+
options.conditionExpressions,
|
|
421
|
+
),
|
|
422
|
+
),
|
|
423
|
+
);
|
|
424
|
+
const paths = [];
|
|
425
|
+
for (const area of areaIds) {
|
|
426
|
+
const normalCandidates = normal.get(area) ?? [];
|
|
427
|
+
if (normalCandidates.length === 0) {
|
|
428
|
+
paths.push({
|
|
429
|
+
kind: "unreachable",
|
|
430
|
+
reachability: "unreachable",
|
|
431
|
+
targetAreaRef: area,
|
|
432
|
+
preconditions: [],
|
|
433
|
+
steps: [],
|
|
434
|
+
});
|
|
435
|
+
} else {
|
|
436
|
+
normalCandidates.forEach((candidate, index) => {
|
|
437
|
+
paths.push({
|
|
438
|
+
kind: index === 0 ? "canonical" : "equivalent",
|
|
439
|
+
reachability:
|
|
440
|
+
candidate.preconditions.length > 0
|
|
441
|
+
? "conditional"
|
|
442
|
+
: "unconditional",
|
|
443
|
+
targetAreaRef: area,
|
|
444
|
+
rootEntryRef: candidate.entry.id,
|
|
445
|
+
preconditions: candidate.preconditions,
|
|
446
|
+
steps: candidate.steps,
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
const alternateCandidates = alternateByRoot
|
|
451
|
+
.flatMap((byArea) => byArea.get(area) ?? [])
|
|
452
|
+
.sort(compareCandidate);
|
|
453
|
+
for (const candidate of alternateCandidates) {
|
|
454
|
+
paths.push({
|
|
455
|
+
kind: "alternate",
|
|
456
|
+
reachability:
|
|
457
|
+
candidate.preconditions.length > 0 ? "conditional" : "unconditional",
|
|
458
|
+
targetAreaRef: area,
|
|
459
|
+
rootEntryRef: candidate.entry.id,
|
|
460
|
+
preconditions: candidate.preconditions,
|
|
461
|
+
steps: candidate.steps,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return paths;
|
|
466
|
+
}
|
|
467
|
+
export function pathSignature(path) {
|
|
468
|
+
return JSON.stringify([
|
|
469
|
+
path.kind,
|
|
470
|
+
path.targetAreaRef,
|
|
471
|
+
path.rootEntryRef ?? null,
|
|
472
|
+
path.steps.map((step) => step.edgeRef),
|
|
473
|
+
]);
|
|
474
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {
|
|
2
|
+
JVM_RAW_PROTOCOL,
|
|
3
|
+
JVM_RAW_SCHEMA_VERSION,
|
|
4
|
+
jvmKnownEventKinds,
|
|
5
|
+
jvmProtocolErrorCodes,
|
|
6
|
+
parseJvmNdjson,
|
|
7
|
+
readJvmNdjsonFile,
|
|
8
|
+
} from "./protocol.js";
|
|
9
|
+
export {
|
|
10
|
+
RAW_JVM_FILE_NAME,
|
|
11
|
+
buildJvmAnalyzer,
|
|
12
|
+
jvmLintTask,
|
|
13
|
+
jvmRunnerErrorCodes,
|
|
14
|
+
runJvmAnalysis,
|
|
15
|
+
} from "./runner.js";
|