@harmonyos-arkts/d2h 0.1.29 → 0.1.33
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/.claude-plugin/plugin.json +1 -1
- package/README.md +6 -2
- package/agents/d2h.md +23 -14
- package/dist/bin/install-opencode.js +17 -4
- package/dist/src/install-opencode.js +6 -4
- package/dist/src/install-tui-extension.js +1 -1
- package/dist/src/metrics-plugin.js +4 -3
- package/dist/src/poc.js +53 -0
- package/docs/architecture-plan-guide.zh-CN.md +30 -46
- package/docs/poc-rule-evaluation.md +38 -0
- package/package.json +3 -2
- package/schemas/code-stats.schema.json +245 -0
- package/skills/android2hmos_resources_convert/SKILL.md +1 -9
- package/skills/d2h-app-solution/SKILL.md +3 -3
- package/skills/d2h-app-solution/references/inventory-schema.md +2 -2
- package/skills/d2h-architecture-plan/SKILL.md +23 -22
- package/skills/d2h-architecture-plan/references/architecture-plan.example.json +650 -76
- package/skills/d2h-architecture-plan/references/directory-creation.md +7 -7
- package/skills/d2h-architecture-plan/references/hybrid-design.md +63 -63
- package/skills/d2h-architecture-plan/references/json-contract.md +42 -27
- package/skills/d2h-architecture-plan/references/layout-reference.md +25 -72
- package/skills/d2h-architecture-plan/references/plan-contract.md +24 -34
- package/skills/d2h-architecture-plan/references/source-review.md +10 -7
- package/skills/d2h-architecture-plan/scripts/architecture_plan.py +50 -16
- package/skills/d2h-code-audit/SKILL.md +68 -0
- package/skills/d2h-code-audit/references/code-stats-schema.md +260 -0
- package/skills/d2h-code-audit/references/metrics.md +94 -0
- package/skills/d2h-code-audit/scripts/code_stats.py +600 -0
- package/skills/d2h-code-audit/scripts/validate_code_stats.py +446 -0
- package/skills/d2h-dashboard/SKILL.md +59 -33
- package/skills/d2h-dashboard/app/assets/Analysis-9GrmuIjp.css +1 -0
- package/skills/d2h-dashboard/app/assets/Analysis-Dj-4QEJi.js +1 -0
- package/skills/d2h-dashboard/app/assets/CodeAudit-Ctt3XEec.css +1 -0
- package/skills/d2h-dashboard/app/assets/CodeAudit-TcIcLwQL.js +1 -0
- package/skills/d2h-dashboard/app/assets/FeaturesList-C5yGUbRo.js +1 -0
- package/skills/d2h-dashboard/app/assets/FeaturesList-CZ40orVY.css +1 -0
- package/skills/d2h-dashboard/app/assets/Overview-CNkA3J9F.js +1 -0
- package/skills/d2h-dashboard/app/assets/Overview-Cmz8yjX-.css +1 -0
- package/skills/d2h-dashboard/app/assets/PageHeading-B5I3tpO8.js +1 -0
- package/skills/d2h-dashboard/app/assets/PageHeading-BIDu_a9G.css +1 -0
- package/skills/d2h-dashboard/app/assets/Project-BC9Tz1WY.js +1 -0
- package/skills/d2h-dashboard/app/assets/Project-BRyXCzsB.css +1 -0
- package/skills/d2h-dashboard/app/assets/Review-BfWvqlU9.js +1 -0
- package/skills/d2h-dashboard/app/assets/SpecDetail-BHB6smtT.css +1 -0
- package/skills/d2h-dashboard/app/assets/SpecDetail-DguVmqAE.js +1 -0
- package/skills/d2h-dashboard/app/assets/SpecItemDetail-7s7SaF3O.js +69 -0
- package/skills/d2h-dashboard/app/assets/SpecItemDetail-Bf4pGDEN.css +1 -0
- package/skills/d2h-dashboard/app/assets/_plugin-vue_export-helper-B9l48Cov.js +1 -0
- package/skills/d2h-dashboard/app/assets/batchReport-B3IzPnHF.js +1 -0
- package/skills/d2h-dashboard/app/assets/datetime-CHrzCsjX.js +1 -0
- package/skills/d2h-dashboard/app/assets/index-B3nfIPBm.js +3 -0
- package/skills/d2h-dashboard/app/assets/index-CnjP19Vs.css +1 -0
- package/skills/d2h-dashboard/app/assets/navigation-d1Uf6TR4.js +1 -0
- package/skills/d2h-dashboard/app/dataApi.mjs +387 -0
- package/skills/d2h-dashboard/app/index.html +14 -0
- package/skills/d2h-dashboard/app/package.json +12 -0
- package/skills/d2h-dashboard/app/serve.mjs +310 -0
- package/skills/d2h-hypium-forge/SKILL.md +6 -1
- package/skills/d2h-spec-develop/SKILL.md +24 -25
- package/skills/d2h-spec-develop/scripts/__pycache__/check_acceptance.cpython-313.pyc +0 -0
- package/skills/d2h-spec-develop/scripts/check_acceptance.py +66 -0
- package/skills/d2h-spec-generate/SKILL.md +2 -0
- package/skills/d2h-spec-plan/SKILL.md +6 -0
- package/skills/d2h-ui-alignment/SKILL.md +30 -0
- package/skills/d2h-ui-alignment/references/device-validation.md +15 -0
- package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/__pycache__/native_common.cpython-313.pyc +0 -0
- package/skills/d2h-architecture-plan/scripts/test_architecture_plan.py +0 -241
- package/skills/d2h-spec-generate/assets/spec-template.md +0 -109
- package/skills/d2h-spec-generate/references/from-plan.md +0 -27
- package/skills/d2h-spec-generate/references/spec-content.md +0 -32
- package/skills/maintaining-migration-report/SKILL.md +0 -144
- package/skills/maintaining-migration-report/references/final-acceptance.md +0 -48
- package/skills/maintaining-migration-report/references/source-provenance.md +0 -66
- /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/SKILL.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/scripts/analyse-android-so.py +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-build/SKILL.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/build-config-mapping.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/jni-to-napi-mapping.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-build/scripts/check-android-so.py +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/SKILL.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-build-sign-run.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/app.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/resources/base/element/string.json +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/README.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/build-profile.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/build-profile.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/hvigorfile.ts +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/oh-package.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/entryability/EntryAbility.ets +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/Index.ets +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/NativeVerifyDemo.ets +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/module.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/color.json +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/string.json +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/profile/main_pages.json +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/FFmpegVerify.test.ets +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/List.test.ets +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/module.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigor/hvigor-config.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigorfile.ts +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/oh-package.json5 +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-template.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/hypium-test-template.md +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/device-verify.py +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/native_common.py +0 -0
- /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/verify-ohos-native.py +0 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate code-stats.json structure, citations, counts, and line re-verification."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import re
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
SCHEMA_VERSION = "1.0"
|
|
13
|
+
KNOWN_LANGUAGES = {"kotlin", "java", "arkts", "typescript", "javascript", "dart", "vue", "cpp", "xml"}
|
|
14
|
+
LANGUAGE_RE = re.compile(r"^[a-z][a-z0-9-]*$")
|
|
15
|
+
MODULE_KINDS = {
|
|
16
|
+
"android": {"app", "library", "unknown"},
|
|
17
|
+
"harmony": {"entry", "feature", "library", "unknown"},
|
|
18
|
+
}
|
|
19
|
+
NATIVE_KINDS = {"so", "jar", "aar"}
|
|
20
|
+
PLATFORM_BY_ID = {"android": "android", "harmony": "harmonyos"}
|
|
21
|
+
|
|
22
|
+
_line_cache: dict = {}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def file_line_count(path: Path) -> int:
|
|
26
|
+
if path not in _line_cache:
|
|
27
|
+
try:
|
|
28
|
+
data = path.read_bytes()
|
|
29
|
+
except OSError:
|
|
30
|
+
_line_cache[path] = -1
|
|
31
|
+
return _line_cache[path]
|
|
32
|
+
lines = data.count(b"\n")
|
|
33
|
+
if data and not data.endswith(b"\n"):
|
|
34
|
+
lines += 1
|
|
35
|
+
_line_cache[path] = lines
|
|
36
|
+
return _line_cache[path]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def rel_path_ok(rel) -> bool:
|
|
40
|
+
if not isinstance(rel, str) or not rel:
|
|
41
|
+
return False
|
|
42
|
+
candidate = Path(rel)
|
|
43
|
+
return not candidate.is_absolute() and ".." not in candidate.parts
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def check_side(side_id: str, side, repo_root: Path | None, threshold: int, errors: list, warnings: list):
|
|
47
|
+
label = "sides.{}".format(side_id)
|
|
48
|
+
|
|
49
|
+
modules = side.get("modules")
|
|
50
|
+
if not isinstance(modules, list):
|
|
51
|
+
errors.append("{}.modules must be an array".format(label))
|
|
52
|
+
modules = []
|
|
53
|
+
module_names = set()
|
|
54
|
+
module_paths = set()
|
|
55
|
+
for index, module in enumerate(modules):
|
|
56
|
+
m_label = "{}.modules[{}]".format(label, index)
|
|
57
|
+
if not isinstance(module, dict):
|
|
58
|
+
errors.append("{} must be an object".format(m_label))
|
|
59
|
+
continue
|
|
60
|
+
name = module.get("name")
|
|
61
|
+
path = module.get("path")
|
|
62
|
+
if not isinstance(name, str) or not name:
|
|
63
|
+
errors.append("{}.name is required".format(m_label))
|
|
64
|
+
else:
|
|
65
|
+
if name in module_names:
|
|
66
|
+
errors.append("{} duplicate module name: {}".format(m_label, name))
|
|
67
|
+
module_names.add(name)
|
|
68
|
+
if not isinstance(path, str) or not path:
|
|
69
|
+
errors.append("{}.path is required".format(m_label))
|
|
70
|
+
else:
|
|
71
|
+
if path in module_paths:
|
|
72
|
+
errors.append("{} duplicate module path: {}".format(m_label, path))
|
|
73
|
+
module_paths.add(path)
|
|
74
|
+
if repo_root is not None and not (repo_root / path).is_dir():
|
|
75
|
+
errors.append("{} directory not found: {}".format(m_label, repo_root / path))
|
|
76
|
+
kind = module.get("kind")
|
|
77
|
+
if kind not in MODULE_KINDS[side_id]:
|
|
78
|
+
errors.append("{}.kind invalid for {}: {}".format(m_label, side_id, kind))
|
|
79
|
+
if side.get("module_count") != len(modules):
|
|
80
|
+
errors.append("{}.module_count != len(modules)".format(label))
|
|
81
|
+
|
|
82
|
+
deps = side.get("third_party_dependencies")
|
|
83
|
+
if not isinstance(deps, list):
|
|
84
|
+
errors.append("{}.third_party_dependencies must be an array".format(label))
|
|
85
|
+
deps = []
|
|
86
|
+
dep_names = set()
|
|
87
|
+
for index, dep in enumerate(deps):
|
|
88
|
+
d_label = "{}.third_party_dependencies[{}]".format(label, index)
|
|
89
|
+
if not isinstance(dep, dict):
|
|
90
|
+
errors.append("{} must be an object".format(d_label))
|
|
91
|
+
continue
|
|
92
|
+
name = dep.get("name")
|
|
93
|
+
if not isinstance(name, str) or not name:
|
|
94
|
+
errors.append("{}.name is required".format(d_label))
|
|
95
|
+
elif name in dep_names:
|
|
96
|
+
errors.append("{} duplicate dependency name: {}".format(d_label, name))
|
|
97
|
+
else:
|
|
98
|
+
dep_names.add(name)
|
|
99
|
+
version = dep.get("version")
|
|
100
|
+
if not isinstance(version, str) or not version:
|
|
101
|
+
warnings.append("{}.version missing for {}".format(d_label, name))
|
|
102
|
+
declarations = dep.get("declarations")
|
|
103
|
+
if not isinstance(declarations, list) or not declarations:
|
|
104
|
+
errors.append("{}.declarations must be a non-empty array".format(d_label))
|
|
105
|
+
continue
|
|
106
|
+
for dec_index, declaration in enumerate(declarations):
|
|
107
|
+
dec_label = "{}.declarations[{}]".format(d_label, dec_index)
|
|
108
|
+
if not isinstance(declaration, dict):
|
|
109
|
+
errors.append("{} must be an object".format(dec_label))
|
|
110
|
+
continue
|
|
111
|
+
rel = declaration.get("path")
|
|
112
|
+
if not rel_path_ok(rel):
|
|
113
|
+
errors.append("{}.path must be repository-relative".format(dec_label))
|
|
114
|
+
elif repo_root is not None:
|
|
115
|
+
source = repo_root / rel
|
|
116
|
+
if not source.is_file():
|
|
117
|
+
errors.append("{} source not found: {}".format(dec_label, source))
|
|
118
|
+
else:
|
|
119
|
+
line_start = declaration.get("line_start")
|
|
120
|
+
if line_start is not None:
|
|
121
|
+
actual = file_line_count(source)
|
|
122
|
+
if not isinstance(line_start, int) or line_start < 1:
|
|
123
|
+
errors.append("{}.line_start must be >= 1".format(dec_label))
|
|
124
|
+
elif actual >= 0 and line_start > actual:
|
|
125
|
+
errors.append("{}.line_start exceeds file length".format(dec_label))
|
|
126
|
+
if not isinstance(declaration.get("scope"), str) or not declaration.get("scope"):
|
|
127
|
+
errors.append("{}.scope is required".format(dec_label))
|
|
128
|
+
dec_version = declaration.get("version")
|
|
129
|
+
if not isinstance(dec_version, str) or not dec_version:
|
|
130
|
+
errors.append("{}.version is required".format(dec_label))
|
|
131
|
+
if side.get("third_party_dependency_count") != len(deps):
|
|
132
|
+
errors.append("{}.third_party_dependency_count != len(third_party_dependencies)".format(label))
|
|
133
|
+
|
|
134
|
+
native = side.get("native_libraries")
|
|
135
|
+
if not isinstance(native, list):
|
|
136
|
+
errors.append("{}.native_libraries must be an array".format(label))
|
|
137
|
+
native = []
|
|
138
|
+
native_names = set()
|
|
139
|
+
for index, item in enumerate(native):
|
|
140
|
+
n_label = "{}.native_libraries[{}]".format(label, index)
|
|
141
|
+
if not isinstance(item, dict):
|
|
142
|
+
errors.append("{} must be an object".format(n_label))
|
|
143
|
+
continue
|
|
144
|
+
if not isinstance(item.get("name"), str) or not item.get("name"):
|
|
145
|
+
errors.append("{}.name is required".format(n_label))
|
|
146
|
+
else:
|
|
147
|
+
native_names.add(item["name"])
|
|
148
|
+
if item.get("kind") not in NATIVE_KINDS:
|
|
149
|
+
errors.append("{}.kind invalid: {}".format(n_label, item.get("kind")))
|
|
150
|
+
abi = item.get("abi")
|
|
151
|
+
if not isinstance(abi, str) or not abi:
|
|
152
|
+
errors.append("{}.abi is required".format(n_label))
|
|
153
|
+
if not isinstance(item.get("size_bytes"), int) or item.get("size_bytes", -1) < 0:
|
|
154
|
+
errors.append("{}.size_bytes must be a non-negative integer".format(n_label))
|
|
155
|
+
rel = item.get("path")
|
|
156
|
+
if not rel_path_ok(rel):
|
|
157
|
+
errors.append("{}.path must be repository-relative".format(n_label))
|
|
158
|
+
elif repo_root is not None and not (repo_root / rel).is_file():
|
|
159
|
+
errors.append("{} source not found: {}".format(n_label, repo_root / rel))
|
|
160
|
+
declared_native_count = side.get("native_library_count")
|
|
161
|
+
if declared_native_count != len(native_names):
|
|
162
|
+
errors.append(
|
|
163
|
+
"{}.native_library_count ({}) != unique native library names ({})".format(
|
|
164
|
+
label, declared_native_count, len(native_names)
|
|
165
|
+
)
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
code = side.get("code")
|
|
169
|
+
if not isinstance(code, dict):
|
|
170
|
+
errors.append("{}.code must be an object".format(label))
|
|
171
|
+
code = {}
|
|
172
|
+
by_language = code.get("by_language")
|
|
173
|
+
if not isinstance(by_language, list):
|
|
174
|
+
errors.append("{}.code.by_language must be an array".format(label))
|
|
175
|
+
by_language = []
|
|
176
|
+
languages = set()
|
|
177
|
+
core_files = 0
|
|
178
|
+
core_lines = 0
|
|
179
|
+
for index, bucket in enumerate(by_language):
|
|
180
|
+
b_label = "{}.code.by_language[{}]".format(label, index)
|
|
181
|
+
if not isinstance(bucket, dict):
|
|
182
|
+
errors.append("{} must be an object".format(b_label))
|
|
183
|
+
continue
|
|
184
|
+
language = bucket.get("language")
|
|
185
|
+
if not isinstance(language, str) or not LANGUAGE_RE.match(language):
|
|
186
|
+
errors.append("{}.language invalid: {}".format(b_label, language))
|
|
187
|
+
else:
|
|
188
|
+
if language in languages:
|
|
189
|
+
errors.append("{} duplicate language: {}".format(b_label, language))
|
|
190
|
+
languages.add(language)
|
|
191
|
+
if language not in KNOWN_LANGUAGES:
|
|
192
|
+
warnings.append("{} uses non-core language '{}' (check --map-ext additions)".format(b_label, language))
|
|
193
|
+
for field in ("files", "lines"):
|
|
194
|
+
value = bucket.get(field)
|
|
195
|
+
if not isinstance(value, int) or value < 0:
|
|
196
|
+
errors.append("{}.{} must be a non-negative integer".format(b_label, field))
|
|
197
|
+
core_files += bucket.get("files") or 0
|
|
198
|
+
core_lines += bucket.get("lines") or 0
|
|
199
|
+
|
|
200
|
+
other = code.get("other_extensions")
|
|
201
|
+
if not isinstance(other, list):
|
|
202
|
+
errors.append("{}.code.other_extensions must be an array".format(label))
|
|
203
|
+
other = []
|
|
204
|
+
other_files = 0
|
|
205
|
+
other_lines = 0
|
|
206
|
+
seen_exts = set()
|
|
207
|
+
for index, bucket in enumerate(other):
|
|
208
|
+
o_label = "{}.code.other_extensions[{}]".format(label, index)
|
|
209
|
+
if not isinstance(bucket, dict):
|
|
210
|
+
errors.append("{} must be an object".format(o_label))
|
|
211
|
+
continue
|
|
212
|
+
ext = bucket.get("extension")
|
|
213
|
+
if not isinstance(ext, str) or (ext != "" and not ext.startswith(".")):
|
|
214
|
+
errors.append("{}.extension must be '' or start with '.'".format(o_label))
|
|
215
|
+
elif ext in seen_exts:
|
|
216
|
+
errors.append("{} duplicate extension: {}".format(o_label, ext))
|
|
217
|
+
else:
|
|
218
|
+
seen_exts.add(ext)
|
|
219
|
+
other_files += bucket.get("files") or 0
|
|
220
|
+
other_lines += bucket.get("lines") or 0
|
|
221
|
+
|
|
222
|
+
skipped = code.get("skipped_binary")
|
|
223
|
+
if not isinstance(skipped, list):
|
|
224
|
+
errors.append("{}.code.skipped_binary must be an array".format(label))
|
|
225
|
+
skipped = []
|
|
226
|
+
skipped_exts = set()
|
|
227
|
+
for index, bucket in enumerate(skipped):
|
|
228
|
+
s_label = "{}.code.skipped_binary[{}]".format(label, index)
|
|
229
|
+
if not isinstance(bucket, dict):
|
|
230
|
+
errors.append("{} must be an object".format(s_label))
|
|
231
|
+
continue
|
|
232
|
+
ext = bucket.get("extension")
|
|
233
|
+
if not isinstance(ext, str) or not ext.startswith("."):
|
|
234
|
+
errors.append("{}.extension must start with '.'".format(s_label))
|
|
235
|
+
elif ext in skipped_exts:
|
|
236
|
+
errors.append("{} duplicate extension: {}".format(s_label, ext))
|
|
237
|
+
else:
|
|
238
|
+
skipped_exts.add(ext)
|
|
239
|
+
if not isinstance(bucket.get("files"), int) or bucket.get("files", -1) < 0:
|
|
240
|
+
errors.append("{}.files must be a non-negative integer".format(s_label))
|
|
241
|
+
|
|
242
|
+
if code.get("total_files") != core_files + other_files:
|
|
243
|
+
errors.append(
|
|
244
|
+
"{}.code.total_files ({}) != by_language + other_extensions files ({})".format(
|
|
245
|
+
label, code.get("total_files"), core_files + other_files
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
if code.get("total_lines") != core_lines + other_lines:
|
|
249
|
+
errors.append(
|
|
250
|
+
"{}.code.total_lines ({}) != by_language + other_extensions lines ({})".format(
|
|
251
|
+
label, code.get("total_lines"), core_lines + other_lines
|
|
252
|
+
)
|
|
253
|
+
)
|
|
254
|
+
scanned = code.get("scanned_extensions")
|
|
255
|
+
if not isinstance(scanned, list) or not all(isinstance(e, str) and e.startswith(".") for e in scanned):
|
|
256
|
+
errors.append("{}.code.scanned_extensions must be an array of dot-prefixed strings".format(label))
|
|
257
|
+
excluded = code.get("excluded_patterns")
|
|
258
|
+
if not isinstance(excluded, list) or not all(isinstance(e, str) and e for e in excluded):
|
|
259
|
+
errors.append("{}.code.excluded_patterns must be an array of non-empty strings".format(label))
|
|
260
|
+
|
|
261
|
+
oversized = side.get("oversized_files")
|
|
262
|
+
if not isinstance(oversized, list):
|
|
263
|
+
errors.append("{}.oversized_files must be an array".format(label))
|
|
264
|
+
oversized = []
|
|
265
|
+
seen_paths = set()
|
|
266
|
+
for index, entry in enumerate(oversized):
|
|
267
|
+
o_label = "{}.oversized_files[{}]".format(label, index)
|
|
268
|
+
if not isinstance(entry, dict):
|
|
269
|
+
errors.append("{} must be an object".format(o_label))
|
|
270
|
+
continue
|
|
271
|
+
rel = entry.get("path")
|
|
272
|
+
if not rel_path_ok(rel):
|
|
273
|
+
errors.append("{}.path must be repository-relative".format(o_label))
|
|
274
|
+
continue
|
|
275
|
+
if rel in seen_paths:
|
|
276
|
+
errors.append("{} duplicate path: {}".format(o_label, rel))
|
|
277
|
+
seen_paths.add(rel)
|
|
278
|
+
declared_lines = entry.get("lines")
|
|
279
|
+
if not isinstance(declared_lines, int) or declared_lines < threshold:
|
|
280
|
+
errors.append(
|
|
281
|
+
"{}.lines ({}) must be >= threshold ({})".format(o_label, declared_lines, threshold)
|
|
282
|
+
)
|
|
283
|
+
if repo_root is not None:
|
|
284
|
+
source = repo_root / rel
|
|
285
|
+
if not source.is_file():
|
|
286
|
+
errors.append("{} source not found: {}".format(o_label, source))
|
|
287
|
+
else:
|
|
288
|
+
actual = file_line_count(source)
|
|
289
|
+
if actual >= 0 and declared_lines != actual:
|
|
290
|
+
errors.append(
|
|
291
|
+
"{}.lines ({}) != actual physical lines ({})".format(o_label, declared_lines, actual)
|
|
292
|
+
)
|
|
293
|
+
language = entry.get("language")
|
|
294
|
+
if language == "other":
|
|
295
|
+
ext = entry.get("extension")
|
|
296
|
+
if not isinstance(ext, str) or (ext != "" and not ext.startswith(".")):
|
|
297
|
+
errors.append("{}.extension required for language 'other'".format(o_label))
|
|
298
|
+
elif ext != "" and not rel.lower().endswith(ext.lower()):
|
|
299
|
+
errors.append("{}.extension ({}) does not match file path".format(o_label, ext))
|
|
300
|
+
elif language not in languages:
|
|
301
|
+
errors.append("{}.language ({}) not present in code.by_language".format(o_label, language))
|
|
302
|
+
module = entry.get("module")
|
|
303
|
+
if module != "unknown" and module not in module_names:
|
|
304
|
+
errors.append("{}.module ({}) not in modules and not 'unknown'".format(o_label, module))
|
|
305
|
+
if module == "unknown":
|
|
306
|
+
warnings.append("{}.module is 'unknown' for {}".format(o_label, rel))
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def main() -> int:
|
|
310
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
311
|
+
parser.add_argument("stats", type=Path, help="code-stats.json 路径")
|
|
312
|
+
parser.add_argument("--strict", action="store_true", help="warning 也视为失败")
|
|
313
|
+
args = parser.parse_args()
|
|
314
|
+
|
|
315
|
+
try:
|
|
316
|
+
data = json.loads(args.stats.read_text(encoding="utf-8"))
|
|
317
|
+
except (OSError, json.JSONDecodeError) as exc:
|
|
318
|
+
print("无法读取 JSON:{}".format(exc), file=sys.stderr)
|
|
319
|
+
return 1
|
|
320
|
+
|
|
321
|
+
errors: list = []
|
|
322
|
+
warnings: list = []
|
|
323
|
+
|
|
324
|
+
if data.get("schema_version") != SCHEMA_VERSION:
|
|
325
|
+
errors.append("schema_version must be '{}'".format(SCHEMA_VERSION))
|
|
326
|
+
for field in ("title", "language", "generated_by", "generated_at"):
|
|
327
|
+
if not isinstance(data.get(field), str) or not data.get(field):
|
|
328
|
+
errors.append("{} is required".format(field))
|
|
329
|
+
thresholds = data.get("thresholds")
|
|
330
|
+
if not isinstance(thresholds, dict):
|
|
331
|
+
errors.append("thresholds must be an object")
|
|
332
|
+
thresholds = {}
|
|
333
|
+
threshold = thresholds.get("oversized_file_lines")
|
|
334
|
+
if not isinstance(threshold, int) or threshold <= 0:
|
|
335
|
+
errors.append("thresholds.oversized_file_lines must be a positive integer")
|
|
336
|
+
threshold = 1
|
|
337
|
+
|
|
338
|
+
repositories = data.get("repositories")
|
|
339
|
+
if not isinstance(repositories, list) or not repositories:
|
|
340
|
+
errors.append("repositories must be a non-empty array")
|
|
341
|
+
repositories = []
|
|
342
|
+
repo_roots = {}
|
|
343
|
+
repo_ids = set()
|
|
344
|
+
for index, repo in enumerate(repositories):
|
|
345
|
+
r_label = "repositories[{}]".format(index)
|
|
346
|
+
if not isinstance(repo, dict):
|
|
347
|
+
errors.append("{} must be an object".format(r_label))
|
|
348
|
+
continue
|
|
349
|
+
repo_id = repo.get("id")
|
|
350
|
+
if repo_id not in PLATFORM_BY_ID:
|
|
351
|
+
errors.append("{}.id must be one of android/harmony: {}".format(r_label, repo_id))
|
|
352
|
+
continue
|
|
353
|
+
if repo_id in repo_ids:
|
|
354
|
+
errors.append("{} duplicate repository id: {}".format(r_label, repo_id))
|
|
355
|
+
repo_ids.add(repo_id)
|
|
356
|
+
if repo.get("platform") != PLATFORM_BY_ID[repo_id]:
|
|
357
|
+
errors.append("{}.platform must be '{}'".format(r_label, PLATFORM_BY_ID[repo_id]))
|
|
358
|
+
if not isinstance(repo.get("revision"), str) or not repo.get("revision"):
|
|
359
|
+
errors.append("{}.revision is required".format(r_label))
|
|
360
|
+
path = Path(str(repo.get("path", "")))
|
|
361
|
+
if not path.is_absolute() or not path.is_dir():
|
|
362
|
+
errors.append("{}.path must be an existing absolute directory: {}".format(r_label, path))
|
|
363
|
+
else:
|
|
364
|
+
repo_roots[repo_id] = path
|
|
365
|
+
|
|
366
|
+
sides = data.get("sides")
|
|
367
|
+
if not isinstance(sides, dict) or not sides:
|
|
368
|
+
errors.append("sides must be a non-empty object")
|
|
369
|
+
sides = {}
|
|
370
|
+
for side_id in sides:
|
|
371
|
+
if side_id not in PLATFORM_BY_ID:
|
|
372
|
+
errors.append("sides has unknown key: {}".format(side_id))
|
|
373
|
+
if set(sides.keys()) != repo_ids:
|
|
374
|
+
errors.append("sides keys {} != repository ids {}".format(sorted(sides.keys()), sorted(repo_ids)))
|
|
375
|
+
|
|
376
|
+
for side_id, side in sides.items():
|
|
377
|
+
if not isinstance(side, dict):
|
|
378
|
+
errors.append("sides.{} must be an object".format(side_id))
|
|
379
|
+
continue
|
|
380
|
+
check_side(side_id, side, repo_roots.get(side_id), threshold, errors, warnings)
|
|
381
|
+
|
|
382
|
+
comparison = data.get("comparison")
|
|
383
|
+
both_present = {"android", "harmony"} <= set(sides.keys())
|
|
384
|
+
if both_present:
|
|
385
|
+
if not isinstance(comparison, dict):
|
|
386
|
+
errors.append("comparison must be an object when both sides are present")
|
|
387
|
+
comparison = {}
|
|
388
|
+
else:
|
|
389
|
+
expected = {
|
|
390
|
+
"modules": (
|
|
391
|
+
sides["android"].get("module_count"),
|
|
392
|
+
sides["harmony"].get("module_count"),
|
|
393
|
+
),
|
|
394
|
+
"third_party_dependencies": (
|
|
395
|
+
sides["android"].get("third_party_dependency_count"),
|
|
396
|
+
sides["harmony"].get("third_party_dependency_count"),
|
|
397
|
+
),
|
|
398
|
+
"native_libraries": (
|
|
399
|
+
sides["android"].get("native_library_count"),
|
|
400
|
+
sides["harmony"].get("native_library_count"),
|
|
401
|
+
),
|
|
402
|
+
"total_lines": (
|
|
403
|
+
sides["android"].get("code", {}).get("total_lines"),
|
|
404
|
+
sides["harmony"].get("code", {}).get("total_lines"),
|
|
405
|
+
),
|
|
406
|
+
}
|
|
407
|
+
for key, (android_value, harmony_value) in expected.items():
|
|
408
|
+
section = comparison.get(key)
|
|
409
|
+
if not isinstance(section, dict):
|
|
410
|
+
errors.append("comparison.{} must be an object".format(key))
|
|
411
|
+
continue
|
|
412
|
+
if section.get("android") != android_value or section.get("harmony") != harmony_value:
|
|
413
|
+
errors.append(
|
|
414
|
+
"comparison.{} ({}/{}) does not match sides ({}/{})".format(
|
|
415
|
+
key, section.get("android"), section.get("harmony"), android_value, harmony_value
|
|
416
|
+
)
|
|
417
|
+
)
|
|
418
|
+
oversized_section = comparison.get("oversized")
|
|
419
|
+
if not isinstance(oversized_section, dict):
|
|
420
|
+
errors.append("comparison.oversized must be an object")
|
|
421
|
+
else:
|
|
422
|
+
android_oversized = len(sides["android"].get("oversized_files", []))
|
|
423
|
+
harmony_oversized = len(sides["harmony"].get("oversized_files", []))
|
|
424
|
+
if oversized_section.get("android_count") != android_oversized:
|
|
425
|
+
errors.append("comparison.oversized.android_count mismatch")
|
|
426
|
+
if oversized_section.get("harmony_count") != harmony_oversized:
|
|
427
|
+
errors.append("comparison.oversized.harmony_count mismatch")
|
|
428
|
+
elif comparison is not None:
|
|
429
|
+
errors.append("comparison must be absent when only one side is present")
|
|
430
|
+
|
|
431
|
+
notes = data.get("notes")
|
|
432
|
+
if not isinstance(notes, list) or not all(isinstance(q, str) and q for q in notes):
|
|
433
|
+
errors.append("notes must be an array of non-empty strings")
|
|
434
|
+
|
|
435
|
+
for message in warnings:
|
|
436
|
+
print("warning: {}".format(message))
|
|
437
|
+
for message in errors:
|
|
438
|
+
print("error: {}".format(message))
|
|
439
|
+
print("校验完成:{} errors, {} warnings".format(len(errors), len(warnings)))
|
|
440
|
+
if errors or (args.strict and warnings):
|
|
441
|
+
return 1
|
|
442
|
+
return 0
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
if __name__ == "__main__":
|
|
446
|
+
sys.exit(main())
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: d2h-dashboard
|
|
3
|
-
description: 迁移实时看板:启动本地看板服务器实时查看整个转换流程。progress.json 就绪后由主 Agent
|
|
3
|
+
description: 迁移实时看板:启动本地看板服务器实时查看整个转换流程。progress.json 就绪后由主 Agent 自动启动并打开网页;用户要求"看板""dashboard""查看迁移进度/转换流程""实时看板"时亦触发。服务器与前端内嵌于本 Skill 的 app/ 目录(零依赖 Node),无需 npm 安装。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 迁移实时看板(d2h-dashboard)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
服务器与前端内嵌于本 Skill 的 `app/` 目录(`serve.mjs` 零依赖 Node + Vue 构建产物),与 d2h 同仓同版本——skill 改数据字段时看板渲染同步更新,无版本漂移。唯一固定契约是 `--dataDir <项目>/.migration`(绝对路径)。
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
## 生命周期
|
|
11
|
+
|
|
12
|
+
- **自动启动**:`.migration/progress.json` 出现或恢复会话已存在 → 后台启动并打开浏览器,每轮会话一次;已在运行则复用、不重复打开。启动/打开失败只记录,下次阶段更新重试一次。
|
|
13
|
+
- **更新横幅**:与打开浏览器同一步原子完成(「探测→打开→横幅一条龙」命令块,`set` 不得拆分省略);启动、复用、端口漂移均触发。
|
|
14
|
+
- **停止触发(满足任一)**:
|
|
15
|
+
- 用户显式要求(「关闭看板」「关闭 XX 项目看板」);
|
|
16
|
+
- 转换流程全部结束:本次确认范围通过 `agents/d2h.md`「完成条件」全部要求且主 Agent 正式宣布完成(内核 `migration-status` 的 `completion.eligible=true` 为辅证);伪完成、范围中断、阶段暂停、单轮/单页完成不触发。
|
|
17
|
+
- **停止后**:执行横幅 `clear`(置空隐藏)。所有命令失败/超时只记录不阻塞迁移与完成宣布。
|
|
18
|
+
- **URL 告知规范**:URL 单独成行或反引号包裹,其后不得紧跟任何文字(含中文括号说明),说明放下一行。
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
- 启动链:npx 拉包并执行 bin → `node …/server/serve.mjs` 常驻,同时托管前端与 `/api/data/*`。
|
|
16
|
-
- 成功后 stdout 固定两行,实际 URL 以第二行为准:`[dashboard] dataDir=<绝对路径>`、`[dashboard] http://<host>:<实际端口>`。
|
|
20
|
+
## 归属判定铁律
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
实例唯一事实源 = 端口探测的 manifest `root`(8080–8090 逐个探测,1s 超时):`root` 等于目标 dataDir 才属本流程;仅 root 匹配但 `GET /` 非 200 属损坏实例,按停止命令杀掉后重启;root 不匹配一律跳过(其他流程的服务器)。禁止用日志内容判定归属或端口;启动后必须轮询探测成功才算就绪,禁止只看启动输出宣布就绪。
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
- 启动或打开失败只记录不阻塞迁移,下次阶段更新重试一次。
|
|
22
|
-
- 确认 `$url` 后按「TUI 常驻横幅」一节更新横幅;端口漂移(重启落到新端口)同样触发更新。
|
|
24
|
+
## 命令参考
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
Windows 用 PowerShell 版,macOS/Linux 用 bash 版。`<skillDir>` = 本 Skill 的安装目录(agent 从 skill 加载路径自动获知)。
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
**后台启动**(自守护,日志按项目隔离)。agent shell 中执行必须设 ≤30s 超时;超时不判失败——detached 子进程可能已存活,继续走下方探测步确认。`--icon` 可选:传入 Android 应用图标路径(png/svg/jpg 或 http URL),前端通过 `/app-icon` 显示应用头像;从 Android 工程的 `res/mipmap-*/ic_launcher.png` 或 `res/drawable/ic_launcher*.png` 自动探测,找不到则省略该参数:
|
|
27
29
|
|
|
28
30
|
```powershell
|
|
29
|
-
|
|
30
|
-
npx.cmd --yes d2h-dashboard@latest --dataDir "$dataDir" --detach
|
|
31
|
+
node "<skillDir>/app/serve.mjs" --dataDir "$dataDir" --icon "<iconPath>" --detach
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
```bash
|
|
34
|
-
|
|
35
|
-
npx --yes d2h-dashboard@latest --dataDir "$DATA_DIR" --detach
|
|
35
|
+
node "<skillDir>/app/serve.mjs" --dataDir "$DATA_DIR" --icon "<iconPath>" --detach
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
**探测→打开→横幅一条龙**(得到 `$url` 后三件事一次做完:开浏览器 + set 横幅;必须整块执行,不得拆分省略 set。停止前的归属判定同法,仅取探测部分):
|
|
39
39
|
|
|
40
40
|
```powershell
|
|
41
41
|
$deadline = (Get-Date).AddSeconds(20); $url = $null
|
|
@@ -46,25 +46,51 @@ do {
|
|
|
46
46
|
if ($j.root -eq $dataDir) { $url = "http://127.0.0.1:$p"; break } } catch {}
|
|
47
47
|
}
|
|
48
48
|
} while (-not $url -and (Get-Date) -lt $deadline)
|
|
49
|
+
if ($url) {
|
|
50
|
+
cmd /c start "" "$url"
|
|
51
|
+
Start-Process cmd.exe -ArgumentList "/c opencode-tui-extension.cmd set `"$url`"" -NoNewWindow -PassThru | Wait-Process -Timeout 10 -ErrorAction SilentlyContinue
|
|
52
|
+
Write-Output "OPENED+SET $url"
|
|
53
|
+
} else { Write-Output "NOT_RUNNING" }
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
```bash
|
|
57
|
+
url=$(DATA_DIR="$DATA_DIR" node -e "(async()=>{const d=process.env.DATA_DIR,dl=Date.now()+2e4;for(;;){for(let p=8080;p<=8090;p++){try{const j=await(await fetch('http://127.0.0.1:'+p+'/api/data/manifest')).json();if(j.root===d){console.log('http://127.0.0.1:'+p);return}}catch{}}if(Date.now()>dl)return;await new Promise(r=>setTimeout(r,500))}})()")
|
|
58
|
+
if [ -n "$url" ]; then
|
|
59
|
+
(open "$url" 2>/dev/null || xdg-open "$url")
|
|
60
|
+
timeout 10 opencode-tui-extension set "$url"
|
|
61
|
+
echo "OPENED+SET $url"
|
|
62
|
+
else
|
|
63
|
+
echo "NOT_RUNNING"
|
|
64
|
+
fi
|
|
65
|
+
```
|
|
52
66
|
|
|
53
|
-
|
|
67
|
+
**横幅清空**(停止看板后执行;10s 超时防卡死):
|
|
54
68
|
|
|
55
|
-
|
|
69
|
+
```powershell
|
|
70
|
+
Start-Process cmd.exe -ArgumentList '/c opencode-tui-extension.cmd clear' -NoNewWindow -PassThru | Wait-Process -Timeout 10 -ErrorAction SilentlyContinue
|
|
71
|
+
```
|
|
56
72
|
|
|
57
|
-
|
|
73
|
+
```bash
|
|
74
|
+
timeout 10 opencode-tui-extension clear
|
|
75
|
+
```
|
|
58
76
|
|
|
59
|
-
|
|
60
|
-
```powershell
|
|
61
|
-
Start-Process cmd.exe -ArgumentList '/c opencode-tui-extension.cmd set "<url>"' -NoNewWindow -PassThru | Wait-Process -Timeout 10 -ErrorAction SilentlyContinue
|
|
62
|
-
```
|
|
63
|
-
bash:`timeout 10 opencode-tui-extension set "<url>"`
|
|
64
|
-
- 停止看板后同法执行 `clear`
|
|
65
|
-
- 失败/超时/命令不存在:只记录不阻塞,降级为 URL 单独成行输出;安装注册由 `d2h install` 负责,本 skill 不做初始化
|
|
77
|
+
**停止实例**(归属判定通过后执行;杀真实 node PID,包装进程 PID 无效;未找到监听 → 报告未在运行):
|
|
66
78
|
|
|
67
|
-
|
|
79
|
+
```powershell
|
|
80
|
+
Get-NetTCPConnection -LocalPort <port> -State Listen | ForEach-Object { Stop-Process -Id $_.OwningProcess }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
lsof -ti tcp:<port> | xargs kill
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 前端开发与发布
|
|
88
|
+
|
|
89
|
+
Vue 源码在独立仓 `ConversionDashboard` 开发;发布到本 Skill:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
cd ConversionDashboard
|
|
93
|
+
npm run release -- --target <d2h仓>/skills/d2h-dashboard
|
|
94
|
+
```
|
|
68
95
|
|
|
69
|
-
|
|
70
|
-
- **停止**:仅用户显式要求(「关闭看板」「关闭 XX 项目看板」)才执行,且必须 root 归属校验通过:Windows `Get-NetTCPConnection -LocalPort <port> -State Listen | ForEach-Object { Stop-Process -Id $_.OwningProcess }`(杀 node 真实 PID,cmd 包装 PID 无效);bash `kill <pid>`。未找到 → 报告未在运行;root 不匹配 → 跳过并说明属于其他流程。停止成功后按「TUI 常驻横幅」执行 `clear`。
|
|
96
|
+
一条命令完成 vite build + 拷贝 dist/serve.mjs/dataApi.mjs 到 `app/`。发布后 d2h 仓 commit → `d2h install` 自动分发。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.node-row[data-v-d73ec2a5]{border-radius:6px;grid-template-columns:28px minmax(150px,210px) 1fr;align-items:center;gap:8px;min-width:0;min-height:30px;padding:1px 4px 1px 0;line-height:1.45;display:grid}.node-row[data-v-d73ec2a5]:not(.leaf){cursor:pointer}.node-row[data-v-d73ec2a5]:not(.leaf):hover{background:#f0f5ff}.caret-btn[data-v-d73ec2a5]{color:#6d83a9;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:7px;justify-content:center;align-items:center;width:28px;height:28px;padding:0;display:inline-flex}.caret-btn[data-v-d73ec2a5]:disabled{cursor:default;color:#c3cddb}.caret-btn[data-v-d73ec2a5]:not(:disabled):hover{color:var(--blue);background:#e2ebfc;border-color:#c3d5f4}.caret-icon[data-v-d73ec2a5]{font-size:13px;line-height:1}.node-name[data-v-d73ec2a5]{color:#34445c;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:550;overflow:hidden}.node-desc[data-v-d73ec2a5]{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;text-align:left;min-width:0;font-size:11.5px;overflow:hidden}.node-children[data-v-d73ec2a5]{border-left:1px dashed #d6deeb;margin-left:8px;padding-left:10px}.sec-nav[data-v-fdcc2af8]{z-index:5;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:linear-gradient(#eef3fd,#e8eefa);border:1px solid #cfdef7;border-radius:10px;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:20px;padding:10px 12px;display:flex;position:sticky;top:0;box-shadow:0 2px 8px #29456a10}.sec-link[data-v-fdcc2af8]{color:#2d59c2;background:#fff;border-color:#c8d8f2;border-radius:7px;padding:6px 12px;font-size:13px}.sec-link[data-v-fdcc2af8]:hover{border-color:var(--blue);color:var(--blue);background:#fff}.nav-updated[data-v-fdcc2af8]{color:#4d638b;background:#ffffffb3;margin-left:auto}.sec-anchor[data-v-fdcc2af8]{scroll-margin-top:64px}.proposal-grid[data-v-fdcc2af8]{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:20px;display:grid}.proposal-panel[data-v-fdcc2af8]{flex-direction:column;min-width:0;margin-bottom:0;display:flex}.proposal-panel .tree-wrap[data-v-fdcc2af8]{flex:1;min-height:0;max-height:560px}.project-name[data-v-fdcc2af8]{margin:0 0 6px;font-size:17px;font-weight:650}.project-summary[data-v-fdcc2af8]{color:#48586f;margin:0 0 12px;line-height:1.65}.roots[data-v-fdcc2af8]{grid-template-columns:repeat(2,1fr);gap:10px;margin:0 0 12px;display:grid}.root-item[data-v-fdcc2af8]{border:1px solid var(--line);background:#f9fbfe;border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:8px 10px;display:flex}.root-item small[data-v-fdcc2af8]{font-size:11px}.root-item span[data-v-fdcc2af8]{color:#34445c;overflow-wrap:anywhere;font-size:12px}.scope-list[data-v-fdcc2af8]{color:#48586f;margin:0;padding-left:18px;font-size:13px;line-height:1.7}.proposal-id[data-v-fdcc2af8]{color:var(--muted);background:#f0f4fa;border-radius:5px;padding:2px 7px;font-size:11px}.proposal-summary[data-v-fdcc2af8]{color:#48586f;margin:0 0 12px;font-size:13px;line-height:1.65}.block-label[data-v-fdcc2af8]{color:var(--muted);letter-spacing:1px;margin-bottom:6px;font-size:11px;display:block}.decisions[data-v-fdcc2af8]{margin:0 0 14px}.decision-item[data-v-fdcc2af8]{border-top:1px solid #edf0f4;padding:0}.decision-item[data-v-fdcc2af8]:first-of-type{border-top:0}.decision-item summary[data-v-fdcc2af8]{cursor:pointer;color:#34445c;border-radius:6px;align-items:center;gap:8px;padding:8px 4px;font-size:13px;font-weight:600;list-style:none;display:flex}.decision-item summary[data-v-fdcc2af8]::-webkit-details-marker{display:none}.decision-item summary[data-v-fdcc2af8]:before{content:"▸";color:#8191a8;flex-shrink:0;font-size:12px;transition:transform .15s}.decision-item[open] summary[data-v-fdcc2af8]:before{transform:rotate(90deg)}.decision-item summary[data-v-fdcc2af8]:hover{color:var(--blue);background:#f5f8fe}.decision-item p[data-v-fdcc2af8]{color:#48586f;margin:2px 0 8px;padding:0 4px 0 24px;font-size:12px;line-height:1.65}.tree-wrap[data-v-fdcc2af8]{border:1px dashed var(--line);background:#fafbfe;border-radius:8px;max-height:480px;padding:10px 12px;overflow:auto}.attention-list[data-v-fdcc2af8]{gap:4px;display:grid}.attention-item[data-v-fdcc2af8]{border-top:1px solid #edf0f4;padding:0}.attention-item[data-v-fdcc2af8]:first-child{border-top:0}.attention-item summary[data-v-fdcc2af8]{cursor:pointer;color:#34445c;border-radius:6px;align-items:center;gap:8px;padding:8px 4px;font-size:13px;font-weight:600;list-style:none;display:flex}.attention-item summary[data-v-fdcc2af8]::-webkit-details-marker{display:none}.attention-item summary[data-v-fdcc2af8]:before{content:"▸";color:#8191a8;flex-shrink:0;font-size:12px;transition:transform .15s}.attention-item[open] summary[data-v-fdcc2af8]:before{transform:rotate(90deg)}.attention-item summary[data-v-fdcc2af8]:hover{color:var(--blue);background:#f5f8fe}.attention-item p[data-v-fdcc2af8]{color:#48586f;margin:2px 0 8px;padding:0 4px 0 24px;font-size:12px;line-height:1.65}.empty-inline[data-v-fdcc2af8]{color:var(--muted);font-size:13px}@media (width<=1100px){.proposal-grid[data-v-fdcc2af8]{grid-template-columns:1fr}}@media (width<=700px){.roots[data-v-fdcc2af8]{grid-template-columns:1fr}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,O as t,Y as n,Z as r,_ as i,a,c as o,f as s,i as c,j as l,n as u,o as d,p as f,s as p,t as m,v as h,x as g,y as _}from"./_plugin-vue_export-helper-B9l48Cov.js";import{d as v,t as y}from"./index-B3nfIPBm.js";import{t as b}from"./PageHeading-B5I3tpO8.js";import{i as x,r as S}from"./datetime-CHrzCsjX.js";var C={class:`tree-node`},w=[`disabled`,`aria-expanded`,`title`],T={class:`caret-icon`},E=[`title`],D=[`title`],O={key:0,class:`node-children`},k=m(f({__name:`DirectoryTree`,props:{node:{},depth:{},defaultExpandDepth:{}},setup(i){let s=i,l=t(s.depth<(s.defaultExpandDepth??0)),f=c(()=>(s.node.children?.length??0)>0),m=()=>{f.value&&(l.value=!l.value)};return(t,s)=>{let c=e(`DirectoryTree`,!0);return _(),o(`div`,C,[a(`div`,{class:n([`node-row`,{leaf:!f.value}]),onClick:m},[a(`button`,{type:`button`,class:n([`caret-btn`,{open:l.value}]),disabled:!f.value,"aria-expanded":f.value?l.value:void 0,title:f.value?l.value?`收起`:`展开`:void 0,onClick:v(m,[`stop`])},[a(`span`,T,r(f.value?l.value?`▾`:`▸`:`·`),1)],10,w),a(`span`,{class:`node-name`,title:i.node.name},r(i.node.name),9,E),i.node.description?(_(),o(`span`,{key:0,class:`node-desc`,title:i.node.description},r(i.node.description),9,D)):p(``,!0)],2),l.value&&f.value?(_(),o(`div`,O,[(_(!0),o(u,null,g(i.node.children,(e,t)=>(_(),d(c,{key:`${e.path}-${t}`,node:e,depth:i.depth+1,"default-expand-depth":i.defaultExpandDepth},null,8,[`node`,`depth`,`default-expand-depth`]))),128))])):p(``,!0)])}}}),[[`__scopeId`,`data-v-d73ec2a5`]]),A={key:0,class:`panel placeholder`},j={class:`sec-nav`,"aria-label":`页内模块导航`},M=[`title`,`onClick`],N={class:`tag nav-updated`},P={id:`sec-project`,class:`panel sec-anchor`},F={class:`row`},I={class:`tag`},L={class:`project-name`},ee={class:`project-summary`},R={key:0,class:`roots`},z={class:`root-item`},B={class:`root-item`},V={key:1,class:`scope-list`},H={key:0,class:`proposal-grid`,"aria-label":`架构方案对照`},U=[`id`],W={class:`row`},G={class:`proposal-id`},K={class:`proposal-summary`},q={key:0,class:`decisions`},J={key:1,class:`tree-wrap`},Y={id:`sec-attention`,class:`panel sec-anchor`},X={class:`row`},Z={key:0,class:`tag orange`},Q={key:0,class:`attention-list`},$={key:1,class:`empty-inline`},te=2,ne=m(f({__name:`Analysis`,setup(e){let n=y.architecturePlan,d=t(null),f=t(null),m;i(()=>{m=x(n,(e,t)=>{d.value=e,f.value=t.mtimeMs??null})}),h(()=>m?.());let v=c(()=>S(d.value,f.value)),C=c(()=>d.value?.proposals??[]),w=c(()=>[{id:`sec-project`,label:`项目概览`},...C.value.map((e,t)=>({id:`sec-proposal-${t}`,label:e.name})),{id:`sec-attention`,label:`风险与注意`}]),T=e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})};return(e,t)=>(_(),o(u,null,[s(b,{kicker:`D2H / analysis`,title:`架构分析与设计`,note:`结构分析 · 方案对照 · ${l(n)} 实时渲染`},null,8,[`note`]),d.value?(_(),o(u,{key:1},[a(`nav`,j,[(_(!0),o(u,null,g(w.value,e=>(_(),o(`button`,{key:e.id,type:`button`,class:`sec-link`,title:e.label,onClick:t=>T(e.id)},r(e.label),9,M))),128)),a(`span`,N,`更新于 `+r(v.value),1)]),a(`section`,P,[a(`div`,F,[t[2]||=a(`h2`,null,`项目概览`,-1),a(`span`,I,`更新于 `+r(v.value),1)]),a(`p`,L,r(d.value.project?.name||`未命名项目`),1),a(`p`,ee,r(d.value.project?.summary),1),d.value.project?.androidRoot||d.value.project?.targetRoot?(_(),o(`div`,R,[a(`div`,z,[t[3]||=a(`small`,null,`Android 源工程`,-1),a(`span`,null,r(d.value.project.androidRoot||`—`),1)]),a(`div`,B,[t[4]||=a(`small`,null,`HarmonyOS 目标工程`,-1),a(`span`,null,r(d.value.project.targetRoot||`—`),1)])])):p(``,!0),d.value.project?.scope?.length?(_(),o(`ul`,V,[(_(!0),o(u,null,g(d.value.project.scope,(e,t)=>(_(),o(`li`,{key:t},r(e),1))),128))])):p(``,!0)]),C.value.length?(_(),o(`div`,H,[(_(!0),o(u,null,g(C.value,(e,n)=>(_(),o(`section`,{id:`sec-proposal-${n}`,key:e.id,class:`panel sec-anchor proposal-panel`},[a(`div`,W,[a(`h2`,null,r(e.name),1),a(`code`,G,r(e.id),1)]),a(`p`,K,r(e.summary),1),e.decisions?.length?(_(),o(`div`,q,[t[5]||=a(`small`,{class:`block-label`},`关键决策(点击展开详情)`,-1),(_(!0),o(u,null,g(e.decisions,(e,t)=>(_(),o(`details`,{key:t,class:`decision-item`},[a(`summary`,null,r(e.title),1),a(`p`,null,r(e.description),1)]))),128))])):p(``,!0),e.directoryTree?(_(),o(`div`,J,[t[6]||=a(`small`,{class:`block-label`},`目录树`,-1),s(k,{node:e.directoryTree,depth:0,"default-expand-depth":te},null,8,[`node`])])):p(``,!0)],8,U))),128))])):p(``,!0),a(`section`,Y,[a(`div`,X,[t[7]||=a(`h2`,null,`风险与注意`,-1),d.value.attentionPoints?.length?(_(),o(`span`,Z,r(d.value.attentionPoints.length)+` 项`,1)):p(``,!0)]),d.value.attentionPoints?.length?(_(),o(`div`,Q,[(_(!0),o(u,null,g(d.value.attentionPoints,(e,t)=>(_(),o(`details`,{key:t,class:`attention-item`},[a(`summary`,null,r(e.title),1),a(`p`,null,r(e.description),1)]))),128))])):(_(),o(`div`,$,`暂无风险记录`))])],64)):(_(),o(`section`,A,[t[0]||=a(`span`,{class:`glyph`},`⌕`,-1),t[1]||=a(`strong`,null,`等待数据`,-1),a(`small`,null,`正在读取 `+r(l(n))+`…(尚未生成架构规划时此页为空)`,1)]))],64))}}),[[`__scopeId`,`data-v-fdcc2af8`]]);export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.section-index[data-v-05ad7363]{color:#4c77dc;background:#eaf1ff;border-radius:6px;justify-content:center;align-items:center;min-width:22px;height:22px;margin-right:8px;padding:0 6px;font-size:12px;display:inline-flex}.compare-table[data-v-05ad7363]{border-collapse:collapse;width:100%;margin:16px 0;font-size:13px}.compare-table th[data-v-05ad7363],.compare-table td[data-v-05ad7363]{text-align:left;border-bottom:1px solid #edf0f4;padding:10px 12px}.compare-table thead th[data-v-05ad7363]{color:var(--muted);letter-spacing:.5px;background:#f7f9fc;border-bottom:2px solid #e3e9f2;font-size:11px;font-weight:600}.compare-table tbody tr:last-child td[data-v-05ad7363]{border-bottom:0}.compare-table tbody tr:hover td[data-v-05ad7363]{background:#f8faff}.compare-label[data-v-05ad7363]{color:#34445c;width:40%;font-weight:600}.compare-value[data-v-05ad7363]{white-space:nowrap;font-size:18px;font-weight:650}.android-value[data-v-05ad7363]{color:#3766dc}.harmony-value[data-v-05ad7363]{color:#168168}.meta-list[data-v-05ad7363]{gap:2px;margin-top:4px;display:grid}.meta-item[data-v-05ad7363]{border-top:1px solid #edf0f4;gap:16px;padding:7px 0;font-size:13px;display:flex}.meta-item[data-v-05ad7363]:first-child{border-top:0}.meta-item small[data-v-05ad7363]{flex-shrink:0;width:80px}.meta-value[data-v-05ad7363]{color:#34445c;overflow-wrap:anywhere}.side-panel[data-v-05ad7363]{border-top:3px solid #65a7a3}.summary-counts[data-v-05ad7363]{grid-template-columns:repeat(5,1fr);gap:8px;margin:16px 0;display:grid}.summary-counts strong[data-v-05ad7363]{font-size:24px;font-weight:650;display:block}.summary-counts small[data-v-05ad7363]{font-size:11px}.summary-counts>div[data-v-05ad7363]{background:#f4f6fa;border-radius:8px;padding:8px 10px}.module-pills[data-v-05ad7363],.ext-pills[data-v-05ad7363]{flex-wrap:wrap;gap:7px;margin:4px 0 14px;display:flex}.module-tag[data-v-05ad7363]{color:#48736e;background:#edf5f2}.ext-tag[data-v-05ad7363]{color:#61728a;background:#f1f3f7}.block-label[data-v-05ad7363]{color:var(--muted);letter-spacing:1px;margin:18px 0 8px;font-size:11px;display:block}.lang-table[data-v-05ad7363]{gap:6px;display:grid}.lang-row[data-v-05ad7363]{grid-template-columns:110px 90px 90px 1fr;align-items:center;gap:10px;font-size:13px;display:grid}.lang-name[data-v-05ad7363]{color:#34445c;font-weight:600}.lang-files[data-v-05ad7363],.lang-lines[data-v-05ad7363]{color:#61728a;font-size:12px}.lang-bar[data-v-05ad7363]{background:#edf1f7;border-radius:8px;height:8px;overflow:hidden}.lang-bar i[data-v-05ad7363]{background:var(--blue);border-radius:8px;height:100%;display:block}.dep-list[data-v-05ad7363]{display:grid}.dep-group[data-v-05ad7363]{border:1px solid #edf0f4;border-radius:8px;margin-top:18px;overflow:hidden}.dep-group>summary[data-v-05ad7363]{cursor:pointer;color:#34445c;background:#f7f9fc;align-items:center;gap:10px;padding:11px 14px;font-size:13px;font-weight:650;list-style:none;display:flex}.dep-group>summary[data-v-05ad7363]::-webkit-details-marker{display:none}.dep-group>summary[data-v-05ad7363]:before{content:"▸";color:#8191a8;font-size:13px;transition:transform .15s}.dep-group[open]>summary[data-v-05ad7363]:before{transform:rotate(90deg)}.dep-group>summary[data-v-05ad7363]:hover{color:var(--blue)}.dep-group-label[data-v-05ad7363]{min-width:0}.dep-group .dep-list[data-v-05ad7363]{padding:4px 14px 10px}.dep-item[data-v-05ad7363]{border-top:1px solid #edf0f4;padding:6px 0}.dep-item[data-v-05ad7363]:first-child{border-top:0}.dep-item summary[data-v-05ad7363]{cursor:pointer;color:#34445c;align-items:center;gap:8px;padding:6px 4px;font-size:13px;list-style:none;display:flex}.dep-item summary[data-v-05ad7363]::-webkit-details-marker{display:none}.dep-item summary[data-v-05ad7363]:before{content:"▸";color:#8191a8;font-size:12px;transition:transform .15s}.dep-item[open] summary[data-v-05ad7363]:before{transform:rotate(90deg)}.dep-item summary[data-v-05ad7363]:hover{color:var(--blue)}.dep-item summary code[data-v-05ad7363]{color:#2d59c2;overflow-wrap:anywhere;font-size:12px}.dep-decls[data-v-05ad7363]{gap:4px;padding:0 4px 8px 24px;display:grid}.dep-decl[data-v-05ad7363]{color:#61728a;overflow-wrap:anywhere;font-size:12px}.muted-tag[data-v-05ad7363]{color:#61728a;background:#f1f3f7}.oversized-list[data-v-05ad7363]{gap:6px;display:grid}.oversized-item[data-v-05ad7363]{align-items:center;gap:10px;font-size:13px;display:flex}.oversized-item code[data-v-05ad7363]{color:#b54545;overflow-wrap:anywhere}.question-list[data-v-05ad7363]{color:#48586f;margin:4px 0 0;padding-left:18px;font-size:13px;line-height:1.7}.question-list li[data-v-05ad7363]{overflow-wrap:anywhere;margin:4px 0}.empty-inline[data-v-05ad7363]{color:var(--muted);font-size:13px}@media (width<=700px){.summary-counts[data-v-05ad7363]{grid-template-columns:repeat(2,1fr)}.lang-row[data-v-05ad7363]{grid-template-columns:90px 70px 70px 1fr;gap:6px}.compare-table th[data-v-05ad7363],.compare-table td[data-v-05ad7363]{padding:8px 9px}.compare-value[data-v-05ad7363]{font-size:15px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,X as t,Z as n,_ as r,a as i,c as a,d as o,f as s,i as c,j as l,n as u,p as d,s as f,t as p,v as ee,x as m,y as h}from"./_plugin-vue_export-helper-B9l48Cov.js";import{i as g,t as te}from"./index-B3nfIPBm.js";import{t as ne}from"./PageHeading-B5I3tpO8.js";import{i as re,r as _}from"./datetime-CHrzCsjX.js";var v={key:0,class:`panel placeholder`},y={class:`panel`},b={class:`row`},x={class:`tag`},S={class:`compare-table`},C={class:`compare-label`},w={class:`compare-value android-value`},T={class:`compare-value harmony-value`},E={class:`meta-list`},D={class:`meta-value`},O={class:`row`},k={class:`section-index`},A={class:`tag`},j={class:`summary-counts`},M={class:`module-pills`},N={class:`lang-table`},P={class:`lang-name`},F={class:`lang-files`},I={class:`lang-lines`},L={class:`lang-bar`},R={class:`ext-pills`},z=[`open`],ie={class:`tag muted-tag`},B={class:`dep-list`},V={class:`tag muted-tag`},H={class:`dep-decls`},U={key:1,class:`tag muted-tag`},W={class:`oversized-list`},G={class:`tag orange`},K={key:4,class:`empty-inline`},q={class:`panel`},J={class:`row`},Y={class:`section-index`},ae={key:0,class:`tag orange`},oe={key:0,class:`question-list`},se={key:1,class:`empty-inline`},X=p(d({__name:`CodeAudit`,setup(d){let p=te.codeStats,X=e(null),Z=e(null),Q;r(()=>{Q=re(p,(e,t)=>{X.value=e,Z.value=t.mtimeMs??null})}),ee(()=>Q?.());let ce=c(()=>_(X.value,Z.value)),le=[`android`,`harmony`],$=c(()=>X.value?.sides?le.filter(e=>X.value?.sides[e]).map(e=>({key:e,...X.value.sides[e]})):[]),ue=e=>X.value?.repositories.find(t=>t.id===e)?.label??(e===`android`?`Android`:`HarmonyOS`),de=e=>e?`${e.code.total_files} 文件 / ${e.code.total_lines} 行`:g,fe=(e,t)=>{let n=Math.max(1,...e.code.by_language.map(e=>e.lines));return`${Math.round(100*t/n)}%`},pe=c(()=>{let e=X.value?.comparison;return e?[{label:`模块数`,values:[e.modules.android,e.modules.harmony]},{label:`三方依赖`,values:[e.third_party_dependencies.android,e.third_party_dependencies.harmony]},{label:`原生库`,values:[e.native_libraries.android,e.native_libraries.harmony]},{label:`物理行数`,values:[e.total_lines.android,e.total_lines.harmony]},{label:`超大文件(≥${X.value.thresholds.oversized_file_lines} 行)`,values:[e.oversized.android_count,e.oversized.harmony_count]}]:[]});return(e,r)=>(h(),a(u,null,[s(ne,{kicker:`D2H / code-audit`,title:`代码审计`,note:`双端代码规模 · 模块 · 依赖 · 超大文件 · ${l(p)} 实时渲染`},null,8,[`note`]),X.value?(h(),a(u,{key:1},[i(`section`,y,[i(`div`,b,[r[2]||=i(`h2`,null,[i(`span`,{class:`section-index`},`01`),o(`双端对照`)],-1),i(`span`,x,`更新于 `+n(ce.value),1)]),i(`table`,S,[r[3]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`指标`),i(`th`,null,`Android`),i(`th`,null,`HarmonyOS`)])],-1),i(`tbody`,null,[(h(!0),a(u,null,m(pe.value,e=>(h(),a(`tr`,{key:e.label},[i(`td`,C,n(e.label),1),i(`td`,w,n(e.values[0]),1),i(`td`,T,n(e.values[1]),1)]))),128))])]),i(`div`,E,[(h(!0),a(u,null,m(X.value.repositories,e=>(h(),a(`div`,{key:e.id,class:`meta-item`},[i(`small`,null,n(e.label),1),i(`span`,D,n(e.path)+` · rev `+n(e.revision||l(`unknown`)),1)]))),128))])]),(h(!0),a(u,null,m($.value,(e,s)=>(h(),a(`section`,{key:e.key,class:`panel side-panel`},[i(`div`,O,[i(`h2`,null,[i(`span`,k,n(String(s+2).padStart(2,`0`)),1),o(n(ue(e.key))+` 代码规模`,1)]),i(`span`,A,n(de(e)),1)]),i(`div`,j,[i(`div`,null,[i(`strong`,null,n(e.code.total_files),1),r[4]||=i(`small`,null,`总文件`,-1)]),i(`div`,null,[i(`strong`,null,n(e.code.total_lines),1),r[5]||=i(`small`,null,`总行数`,-1)]),i(`div`,null,[i(`strong`,null,n(e.module_count),1),r[6]||=i(`small`,null,`模块`,-1)]),i(`div`,null,[i(`strong`,null,n(e.third_party_dependency_count),1),r[7]||=i(`small`,null,`三方依赖`,-1)]),i(`div`,null,[i(`strong`,null,n(e.native_library_count),1),r[8]||=i(`small`,null,`原生库`,-1)])]),i(`div`,M,[(h(!0),a(u,null,m(e.modules,e=>(h(),a(`span`,{key:e.name,class:`tag module-tag`},n(e.name)+` · `+n(e.kind),1))),128))]),e.code.by_language.length?(h(),a(u,{key:0},[r[9]||=i(`small`,{class:`block-label`},`按语言`,-1),i(`div`,N,[(h(!0),a(u,null,m(e.code.by_language,r=>(h(),a(`div`,{key:r.language,class:`lang-row`},[i(`span`,P,n(r.language),1),i(`span`,F,n(r.files)+` 文件`,1),i(`span`,I,n(r.lines)+` 行`,1),i(`div`,L,[i(`i`,{style:t({width:fe(e,r.lines)})},null,4)])]))),128))])],64)):f(``,!0),e.code.other_extensions.length?(h(),a(u,{key:1},[r[10]||=i(`small`,{class:`block-label`},`其他扩展名(未映射到核心语言桶)`,-1),i(`div`,R,[(h(!0),a(u,null,m(e.code.other_extensions,e=>(h(),a(`span`,{key:e.extension,class:`tag ext-tag`},n(e.extension||`(无扩展名)`)+` · `+n(e.files)+` 文件 / `+n(e.lines)+` 行 `,1))),128))])],64)):f(``,!0),e.third_party_dependencies.length?(h(),a(`details`,{key:2,class:`dep-group`,open:e.key===`android`},[i(`summary`,null,[r[11]||=i(`span`,{class:`dep-group-label`},`三方依赖`,-1),i(`span`,ie,n(e.third_party_dependency_count),1)]),i(`div`,B,[(h(!0),a(u,null,m(e.third_party_dependencies,e=>(h(),a(`details`,{key:e.name,class:`dep-item`},[i(`summary`,null,[i(`code`,null,n(e.name),1),r[12]||=o(),i(`span`,V,n(e.version),1)]),i(`div`,H,[(h(!0),a(u,null,m(e.declarations,(e,t)=>(h(),a(`div`,{key:t,class:`dep-decl`},[o(n(e.path),1),e.line_start?(h(),a(u,{key:0},[o(`:`+n(e.line_start),1)],64)):f(``,!0),e.scope?(h(),a(`span`,U,n(e.scope),1)):f(``,!0)]))),128))])]))),128))])],8,z)):f(``,!0),e.oversized_files.length?(h(),a(u,{key:3},[r[14]||=i(`small`,{class:`block-label`},`超大文件`,-1),i(`div`,W,[(h(!0),a(u,null,m(e.oversized_files,e=>(h(),a(`div`,{key:e.path,class:`oversized-item`},[i(`code`,null,n(e.path),1),r[13]||=o(),i(`span`,G,n(e.lines)+` 行`,1)]))),128))])],64)):(h(),a(`small`,K,`无超大文件(阈值 `+n(X.value.thresholds.oversized_file_lines)+` 行)`,1))]))),128)),i(`section`,q,[i(`div`,J,[i(`h2`,null,[i(`span`,Y,n(String($.value.length+2).padStart(2,`0`)),1),r[15]||=o(`注意事项`,-1)]),X.value.notes.length?(h(),a(`span`,ae,n(X.value.notes.length)+` 项`,1)):f(``,!0)]),X.value.notes.length?(h(),a(`ul`,oe,[(h(!0),a(u,null,m(X.value.notes,(e,t)=>(h(),a(`li`,{key:t},n(e),1))),128))])):(h(),a(`div`,se,`无注意事项`))])],64)):(h(),a(`section`,v,[r[0]||=i(`span`,{class:`glyph`},`∑`,-1),r[1]||=i(`strong`,null,`等待数据`,-1),i(`small`,null,`正在读取 `+n(l(p))+`…(尚未生成代码审计报告时此页为空)`,1)]))],64))}}),[[`__scopeId`,`data-v-05ad7363`]]);export{X as default};
|