@harmonyos-arkts/d2h 0.1.36 → 0.1.37
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/plugins/marketplace.json +22 -0
- package/.claude-plugin/marketplace.json +21 -6
- package/.claude-plugin/plugin.json +9 -3
- package/.codex-plugin/plugin.json +37 -0
- package/README.md +1 -1
- package/agents/android-to-hmos-00-orchestrator.md +1 -1
- package/agents/d2h.md +13 -10
- package/docs/environment-check.md +2 -2
- package/package.json +3 -1
- package/schemas/migration-report-index.schema.json +6 -0
- package/skills/d2h-app-solution/SKILL.md +25 -6
- package/skills/d2h-app-solution/agents/openai.yaml +2 -2
- package/skills/d2h-app-solution/scripts/export_inventory_xlsx.py +377 -0
- package/skills/d2h-cloud-knowledge/SKILL.md +172 -58
- package/skills/d2h-cloud-knowledge/build-index.mjs +238 -0
- package/skills/d2h-cloud-knowledge/scenario-audit.mjs +212 -0
- package/skills/d2h-cloud-knowledge/scenario-map.json +72 -0
- package/skills/d2h-dashboard/SKILL.md +26 -1
- package/skills/d2h-dashboard/app/assets/Analysis-BT2XmI3C.js +1 -0
- package/skills/d2h-dashboard/app/assets/CodeAudit-BuyDgDM3.js +1 -0
- package/skills/d2h-dashboard/app/assets/CodeAudit-hkE0DSw-.css +1 -0
- package/skills/d2h-dashboard/app/assets/FeaturesList-C38X4yvD.js +1 -0
- package/skills/d2h-dashboard/app/assets/FeaturesList-DQldjxuT.css +1 -0
- package/skills/d2h-dashboard/app/assets/Overview-DcJSNtDr.js +1 -0
- package/skills/d2h-dashboard/app/assets/Overview-DfJtZ2zJ.css +1 -0
- package/skills/d2h-dashboard/app/assets/Project-CssSwlh6.js +1 -0
- package/skills/d2h-dashboard/app/assets/SpecDetail--ohkiDwo.css +1 -0
- package/skills/d2h-dashboard/app/assets/SpecDetail-DcAYGyNb.js +1 -0
- package/skills/d2h-dashboard/app/assets/SpecItemDetail-CJ-vmNJm.css +1 -0
- package/skills/d2h-dashboard/app/assets/{SpecItemDetail-BDl_Qqfx.js → SpecItemDetail-DTViQrsC.js} +9 -9
- package/skills/d2h-dashboard/app/assets/{index-CnjP19Vs.css → index-DmIexyDt.css} +1 -1
- package/skills/d2h-dashboard/app/assets/index-UvzKcmSu.js +3 -0
- package/skills/d2h-dashboard/app/assets/{navigation-BGPexEv8.js → navigation-CuZGAjCp.js} +1 -1
- package/skills/d2h-dashboard/app/dashboard.standalone.html +88 -0
- package/skills/d2h-dashboard/app/dataApi.mjs +133 -31
- package/skills/d2h-dashboard/app/index.html +2 -2
- package/skills/d2h-dashboard/app/serve.mjs +75 -1
- package/skills/d2h-dashboard/lib/data-subscription.mjs +106 -0
- package/skills/d2h-dashboard/lib/stage-timing.mjs +18 -0
- package/skills/d2h-hypium-forge/SKILL.md +0 -2
- package/skills/d2h-spec-develop/SKILL.md +1 -4
- package/skills/d2h-spec-generate/SKILL.md +1 -1
- package/skills/managing-d2h-toolchain/environment-requirements.json +2 -2
- package/skills/managing-d2h-toolchain/toolchain.json +2 -2
- package/skills/preparing-migration-workspace/SKILL.md +4 -3
- package/skills/d2h-dashboard/app/assets/Analysis-S3iFh2nP.js +0 -1
- package/skills/d2h-dashboard/app/assets/CodeAudit-BI5iNy2f.css +0 -1
- package/skills/d2h-dashboard/app/assets/CodeAudit-BeZMoO_s.js +0 -1
- package/skills/d2h-dashboard/app/assets/FeaturesList-CZ40orVY.css +0 -1
- package/skills/d2h-dashboard/app/assets/FeaturesList-CdKAoNw5.js +0 -1
- package/skills/d2h-dashboard/app/assets/Overview-C43KVHdP.js +0 -1
- package/skills/d2h-dashboard/app/assets/Overview-CzysQJHh.css +0 -1
- package/skills/d2h-dashboard/app/assets/Project-D5loWYjZ.js +0 -1
- package/skills/d2h-dashboard/app/assets/SpecDetail-BHB6smtT.css +0 -1
- package/skills/d2h-dashboard/app/assets/SpecDetail-XCDyawZ3.js +0 -1
- package/skills/d2h-dashboard/app/assets/SpecItemDetail-Bf4pGDEN.css +0 -1
- package/skills/d2h-dashboard/app/assets/datetime-DBOJn2GA.js +0 -1
- package/skills/d2h-dashboard/app/assets/index-C1bO3C02.js +0 -3
|
@@ -11,19 +11,102 @@ const MIME = {
|
|
|
11
11
|
|
|
12
12
|
/** 会话聚合虚拟文件(前端固定订阅路径) */
|
|
13
13
|
const SESSIONS_KEY = '.harmonybot/_summary.json'
|
|
14
|
+
const PROGRESS_KEY = 'progress.json'
|
|
15
|
+
const BATCH_REPORT_KEY = 'page-specs/batch_report.json'
|
|
16
|
+
const LIVE_PROGRESS_KEYS = [PROGRESS_KEY, BATCH_REPORT_KEY]
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
function fileStamp(stat) {
|
|
19
|
+
return {
|
|
20
|
+
mtimeMs: stat.mtimeMs,
|
|
21
|
+
size: stat.size,
|
|
22
|
+
revision: `${stat.ino}:${stat.ctimeMs}:${stat.mtimeMs}:${stat.size}`,
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function timestamp(value) {
|
|
27
|
+
return typeof value === 'string' ? Date.parse(value) || 0 : 0
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function projectProgress(body, readReport) {
|
|
31
|
+
try {
|
|
32
|
+
const progress = JSON.parse(body)
|
|
33
|
+
const stage = progress?.stages?.find(stage => stage.id === 'code-conversion')
|
|
34
|
+
if (stage?.status !== 'pending' || !progress.summary) return body
|
|
35
|
+
const report = readReport()
|
|
36
|
+
if (!Array.isArray(report?.tasks)) return body
|
|
37
|
+
|
|
38
|
+
let selected
|
|
39
|
+
if (report.planning != null) {
|
|
40
|
+
if (report.planning.phase !== 'bound' || !Array.isArray(report.planning.waves)) return body
|
|
41
|
+
selected = new Set(report.planning.waves.flatMap(wave => wave.task_ids ?? []))
|
|
42
|
+
}
|
|
43
|
+
const statuses = new Set(['in_progress', 'implemented', 'completed', 'blocked', 'failed'])
|
|
44
|
+
const resetTime = stage.lastUpdatedAt === progress.createdAt ? 0 : timestamp(stage.lastUpdatedAt)
|
|
45
|
+
let started = false
|
|
46
|
+
let firstStart = Infinity
|
|
47
|
+
let lastActivity = 0
|
|
48
|
+
for (const task of report.tasks) {
|
|
49
|
+
if (!statuses.has(task?.development) || (selected && !selected.has(task.task_id))) continue
|
|
50
|
+
const start = timestamp(task.started_at)
|
|
51
|
+
const activity = Math.max(start, timestamp(task.updated_at), timestamp(task.ended_at))
|
|
52
|
+
if (resetTime && activity <= resetTime) continue
|
|
53
|
+
started = true
|
|
54
|
+
if (start) firstStart = Math.min(firstStart, start)
|
|
55
|
+
lastActivity = Math.max(lastActivity, activity)
|
|
56
|
+
}
|
|
57
|
+
if (!started) return body
|
|
58
|
+
|
|
59
|
+
stage.status = 'in_progress'
|
|
60
|
+
stage.startedAt ??= Number.isFinite(firstStart) ? new Date(firstStart).toISOString() : null
|
|
61
|
+
if (lastActivity > timestamp(stage.lastUpdatedAt)) stage.lastUpdatedAt = new Date(lastActivity).toISOString()
|
|
62
|
+
if (lastActivity > timestamp(progress.updatedAt)) progress.updatedAt = new Date(lastActivity).toISOString()
|
|
63
|
+
progress.summary.pending--
|
|
64
|
+
progress.summary.inProgress++
|
|
65
|
+
progress.summary.currentStage = progress.stages.find(stage => ['in_progress', 'blocked'].includes(stage.status)).id
|
|
66
|
+
return JSON.stringify(progress)
|
|
67
|
+
} catch {
|
|
68
|
+
// 账本缺失、正在写入或旧格式时仍可读取原始阶段文件。
|
|
69
|
+
return body
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 自动探测会话目录:自数据目录向上最多 5 层。
|
|
75
|
+
* 近层(depth ≤ 2,即数据目录/工程根/工作目录层):查自身 + 直接子目录下的 .harmonybot;
|
|
76
|
+
* 外层(depth ≥ 3,多工程共居层):仅查自身,避免把兄弟工程的会话误聚合进来。最近命中优先。
|
|
77
|
+
*/
|
|
16
78
|
function detectSessionDir(root) {
|
|
17
|
-
|
|
18
|
-
path.join(root, '.harmonybot'),
|
|
19
|
-
path.join(root, '..', '.harmonybot'),
|
|
20
|
-
path.join(root, '..', '..', '.harmonybot'),
|
|
21
|
-
]) {
|
|
79
|
+
const tryDir = (dir) => {
|
|
22
80
|
try {
|
|
23
|
-
if (fs.statSync(
|
|
81
|
+
if (fs.statSync(dir).isDirectory()) return path.resolve(dir)
|
|
24
82
|
} catch {
|
|
25
|
-
//
|
|
83
|
+
// 不存在
|
|
26
84
|
}
|
|
85
|
+
return null
|
|
86
|
+
}
|
|
87
|
+
let cur = root
|
|
88
|
+
for (let depth = 0; depth < 5; depth++) {
|
|
89
|
+
// ① 该层自身
|
|
90
|
+
const self = tryDir(path.join(cur, '.harmonybot'))
|
|
91
|
+
if (self) return self
|
|
92
|
+
// ② 近层才扫直接子目录(字母序取第一个命中)
|
|
93
|
+
if (depth < 3) {
|
|
94
|
+
try {
|
|
95
|
+
const children = fs
|
|
96
|
+
.readdirSync(cur, { withFileTypes: true })
|
|
97
|
+
.filter((e) => e.isDirectory())
|
|
98
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
99
|
+
for (const child of children) {
|
|
100
|
+
const hit = tryDir(path.join(cur, child.name, '.harmonybot'))
|
|
101
|
+
if (hit) return hit
|
|
102
|
+
}
|
|
103
|
+
} catch {
|
|
104
|
+
// 目录不可读,继续向上
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const parent = path.dirname(cur)
|
|
108
|
+
if (parent === cur) break // 到达文件系统根
|
|
109
|
+
cur = parent
|
|
27
110
|
}
|
|
28
111
|
return null
|
|
29
112
|
}
|
|
@@ -111,10 +194,7 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
111
194
|
} else if (entry.isFile() && ALLOWED_EXT.has(path.extname(entry.name).toLowerCase())) {
|
|
112
195
|
try {
|
|
113
196
|
const stat = fs.statSync(abs)
|
|
114
|
-
out[path.relative(root, abs).split(path.sep).join('/')] =
|
|
115
|
-
mtimeMs: stat.mtimeMs,
|
|
116
|
-
size: stat.size,
|
|
117
|
-
}
|
|
197
|
+
out[path.relative(root, abs).split(path.sep).join('/')] = fileStamp(stat)
|
|
118
198
|
} catch {
|
|
119
199
|
// 文件在扫描间隙被删除,跳过
|
|
120
200
|
}
|
|
@@ -122,6 +202,9 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
122
202
|
}
|
|
123
203
|
}
|
|
124
204
|
walk(root)
|
|
205
|
+
if (out[PROGRESS_KEY]) {
|
|
206
|
+
out[PROGRESS_KEY].revision += `|${out[BATCH_REPORT_KEY]?.revision ?? ''}`
|
|
207
|
+
}
|
|
125
208
|
const sessions = sessionsSummary()
|
|
126
209
|
if (sessions) out[SESSIONS_KEY] = sessions.stamp
|
|
127
210
|
return out
|
|
@@ -310,7 +393,10 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
310
393
|
return true
|
|
311
394
|
}
|
|
312
395
|
try {
|
|
313
|
-
|
|
396
|
+
let data = fs.readFileSync(abs)
|
|
397
|
+
if (p === PROGRESS_KEY) {
|
|
398
|
+
data = projectProgress(data, () => JSON.parse(fs.readFileSync(path.join(root, BATCH_REPORT_KEY), 'utf8')))
|
|
399
|
+
}
|
|
314
400
|
res.statusCode = 200
|
|
315
401
|
res.setHeader('Content-Type', MIME[path.extname(abs).toLowerCase()] ?? 'application/octet-stream')
|
|
316
402
|
res.setHeader('Cache-Control', 'no-store')
|
|
@@ -330,9 +416,8 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
330
416
|
}
|
|
331
417
|
|
|
332
418
|
/**
|
|
333
|
-
*
|
|
419
|
+
* 聚合 150ms 内的文件变化;阶段和任务账本独立轮询,兼容原子替换和 watch 失败。
|
|
334
420
|
* 会话目录变化统一映射为 .harmonybot/_summary.json。
|
|
335
|
-
* 平台不支持 recursive watch 时返回 null(调用方退化为轮询)。
|
|
336
421
|
*/
|
|
337
422
|
const watch = (onChange) => {
|
|
338
423
|
const changed = new Set()
|
|
@@ -340,18 +425,37 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
340
425
|
const watchers = []
|
|
341
426
|
const dirs = sessionDir ? [root, sessionDir] : [root]
|
|
342
427
|
|
|
343
|
-
const
|
|
344
|
-
|
|
428
|
+
const enqueue = key => {
|
|
429
|
+
changed.add(key)
|
|
430
|
+
if (key === BATCH_REPORT_KEY) changed.add(PROGRESS_KEY)
|
|
431
|
+
if (timer) return
|
|
345
432
|
timer = setTimeout(() => {
|
|
346
433
|
const files = Array.from(changed)
|
|
347
434
|
changed.clear()
|
|
348
435
|
timer = null
|
|
349
|
-
|
|
350
|
-
},
|
|
436
|
+
onChange(files)
|
|
437
|
+
}, 150)
|
|
351
438
|
}
|
|
352
439
|
|
|
353
|
-
|
|
354
|
-
|
|
440
|
+
const revision = key => {
|
|
441
|
+
try {
|
|
442
|
+
return fileStamp(fs.statSync(path.join(root, key))).revision
|
|
443
|
+
} catch {
|
|
444
|
+
return null
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
const liveRevisions = new Map(LIVE_PROGRESS_KEYS.map(key => [key, revision(key)]))
|
|
448
|
+
const poll = setInterval(() => {
|
|
449
|
+
for (const [key, previous] of liveRevisions) {
|
|
450
|
+
const next = revision(key)
|
|
451
|
+
if (next === previous) continue
|
|
452
|
+
liveRevisions.set(key, next)
|
|
453
|
+
enqueue(key)
|
|
454
|
+
}
|
|
455
|
+
}, 500)
|
|
456
|
+
|
|
457
|
+
for (const dir of dirs) {
|
|
458
|
+
try {
|
|
355
459
|
const watcher = fs.watch(dir, { recursive: true }, (_event, filename) => {
|
|
356
460
|
if (!filename) return
|
|
357
461
|
const abs = path.isAbsolute(filename) ? filename : path.join(dir, filename)
|
|
@@ -359,25 +463,23 @@ export function createDataApi(dataDir, options = {}) {
|
|
|
359
463
|
if (dir === sessionDir) {
|
|
360
464
|
// 会话目录:任何 ses_*.json 变化都触发聚合文件更新
|
|
361
465
|
if (!/^ses_.*\.json$/.test(path.basename(abs))) return
|
|
362
|
-
|
|
466
|
+
enqueue(SESSIONS_KEY)
|
|
363
467
|
} else {
|
|
364
468
|
const rel = path.relative(root, abs).split(path.sep).join('/')
|
|
365
|
-
if (!ALLOWED_EXT.has(path.extname(rel).toLowerCase())) return
|
|
366
|
-
|
|
469
|
+
if (LIVE_PROGRESS_KEYS.includes(rel) || !ALLOWED_EXT.has(path.extname(rel).toLowerCase())) return
|
|
470
|
+
enqueue(rel)
|
|
367
471
|
}
|
|
368
|
-
flush()
|
|
369
|
-
})
|
|
370
|
-
watcher.on('close', () => {
|
|
371
|
-
if (timer) clearTimeout(timer)
|
|
372
472
|
})
|
|
473
|
+
watcher.on('error', () => watcher.close())
|
|
373
474
|
watchers.push(watcher)
|
|
475
|
+
} catch {
|
|
476
|
+
// 其他文件仍由客户端轮询,阶段和账本仍可走 SSE。
|
|
374
477
|
}
|
|
375
|
-
} catch {
|
|
376
|
-
for (const w of watchers) w.close()
|
|
377
|
-
return null
|
|
378
478
|
}
|
|
379
479
|
return {
|
|
380
480
|
close() {
|
|
481
|
+
clearInterval(poll)
|
|
482
|
+
clearTimeout(timer)
|
|
381
483
|
for (const w of watchers) w.close()
|
|
382
484
|
},
|
|
383
485
|
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>conversiondashboard</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-UvzKcmSu.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-B9l48Cov.js">
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DmIexyDt.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
// 独立迁移看板服务器(零依赖,Node >= 18):
|
|
3
3
|
// node server/serve.mjs --dataDir <project>/.migration [--port 8080] [--host 127.0.0.1] [--dir ../web]
|
|
4
4
|
// node server/serve.mjs --dataDir <project>/.migration --detach [--log-file <path>]
|
|
5
|
+
// node server/serve.mjs --dataDir <project>/.migration --export-snapshot [--out <path>]
|
|
5
6
|
// --detach:自守护启动——父进程 spawn 分离子进程(stdout/stderr 直写日志文件),
|
|
6
7
|
// 轮询日志直到子进程就绪后原样打印 stdout 契约并退出;调用方无需 shell 重定向/引号转义。
|
|
7
8
|
// 默认日志 %TEMP%/d2h-dashboard-<dataDir哈希8位>.log(每次启动截断重写,跨项目天然隔离)。
|
|
9
|
+
// --export-snapshot:枚举数据目录白名单文件(.json/.jsonl/.md,含会话汇总虚拟文件),
|
|
10
|
+
// 注入 dashboard.standalone.html 模板,写出单文件离线快照(默认 <dataDir>/dashboard.html)。
|
|
11
|
+
// 拷走整个 .migration 后双击该 HTML 即可离线查看当时进展;运行期服务器仍只读。
|
|
8
12
|
// stdout 契约(供 skill 解析):
|
|
9
13
|
// [dashboard] dataDir=<绝对路径>
|
|
10
14
|
// [dashboard] http://<host>:<实际端口>
|
|
@@ -44,6 +48,76 @@ if (!fs.existsSync(dataDir)) {
|
|
|
44
48
|
process.exit(1)
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
// ---- --export-snapshot:枚举数据目录白名单文件 → 注入 standalone 模板 → 写出单文件离线快照 ----
|
|
52
|
+
// 运行期服务器保持只读;本命令是唯一显式写出:默认产出 <dataDir>/dashboard.html(可 --out 覆盖)。
|
|
53
|
+
if (process.argv.includes('--export-snapshot')) {
|
|
54
|
+
const root = path.resolve(dataDir)
|
|
55
|
+
const outPath = path.resolve(argValue('out') ?? path.join(root, 'dashboard.html'))
|
|
56
|
+
const templatePath = [
|
|
57
|
+
path.resolve(__dirname, 'dashboard.standalone.html'), // 内嵌 skill 布局:与 serve.mjs 同目录(app/)
|
|
58
|
+
path.resolve(__dirname, '..', 'dashboard.standalone.html'), // npm 包布局:包根
|
|
59
|
+
].find((p) => fs.existsSync(p))
|
|
60
|
+
if (!templatePath) {
|
|
61
|
+
console.error('[dashboard] 缺少 dashboard.standalone.html 模板(包应含该文件;源码运行请先 npm run build)')
|
|
62
|
+
process.exit(1)
|
|
63
|
+
}
|
|
64
|
+
const exportApi = createDataApi(dataDir, {})
|
|
65
|
+
const stamps = exportApi.listFiles()
|
|
66
|
+
const files = {}
|
|
67
|
+
const skipped = []
|
|
68
|
+
const readVirtual = (rel) => new Promise((resolve) => {
|
|
69
|
+
const res = {
|
|
70
|
+
statusCode: 0,
|
|
71
|
+
chunks: [],
|
|
72
|
+
setHeader() {},
|
|
73
|
+
end(chunk) {
|
|
74
|
+
if (chunk) this.chunks.push(chunk)
|
|
75
|
+
resolve(this.statusCode === 200 ? this.chunks.join('') : null)
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
exportApi.handle({ url: `/api/data/file?p=${encodeURIComponent(rel)}` }, res)
|
|
79
|
+
})
|
|
80
|
+
for (const rel of Object.keys(stamps)) {
|
|
81
|
+
try {
|
|
82
|
+
let text = null
|
|
83
|
+
if (rel === '.harmonybot/_summary.json') {
|
|
84
|
+
text = await readVirtual(rel)
|
|
85
|
+
} else {
|
|
86
|
+
text = fs.readFileSync(path.resolve(root, rel), 'utf8')
|
|
87
|
+
}
|
|
88
|
+
if (text === null) { skipped.push(rel); continue }
|
|
89
|
+
files[rel] = { text, mtimeMs: stamps[rel].mtimeMs, size: stamps[rel].size }
|
|
90
|
+
} catch {
|
|
91
|
+
skipped.push(rel)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const payload = { generatedAt: new Date().toISOString(), root, files }
|
|
95
|
+
let payloadJson = JSON.stringify(payload)
|
|
96
|
+
for (const [source, escaped] of [['&', '\\u0026'], ['<', '\\u003c'], ['>', '\\u003e'], ['\u2028', '\\u2028'], ['\u2029', '\\u2029']]) {
|
|
97
|
+
payloadJson = payloadJson.split(source).join(escaped)
|
|
98
|
+
}
|
|
99
|
+
const template = fs.readFileSync(templatePath, 'utf8')
|
|
100
|
+
const marker = '/*__D2H_SNAPSHOT__*/null'
|
|
101
|
+
if (template.split(marker).length !== 2) {
|
|
102
|
+
console.error('[dashboard] 模板注入点异常(应恰好 1 处)')
|
|
103
|
+
process.exit(1)
|
|
104
|
+
}
|
|
105
|
+
const html = template.replace(marker, payloadJson)
|
|
106
|
+
fs.mkdirSync(path.dirname(outPath), { recursive: true })
|
|
107
|
+
const temp = `${outPath}.tmp-${process.pid}`
|
|
108
|
+
fs.writeFileSync(temp, html)
|
|
109
|
+
fs.renameSync(temp, outPath)
|
|
110
|
+
console.log(JSON.stringify({
|
|
111
|
+
ok: true,
|
|
112
|
+
out: outPath,
|
|
113
|
+
template: templatePath,
|
|
114
|
+
files: Object.keys(files).length,
|
|
115
|
+
skipped,
|
|
116
|
+
bytes: Buffer.byteLength(html),
|
|
117
|
+
}, null, 2))
|
|
118
|
+
process.exit(0)
|
|
119
|
+
}
|
|
120
|
+
|
|
47
121
|
// ---- --detach:spawn 分离子进程并等待就绪,然后父进程退出 ----
|
|
48
122
|
const isDetach = process.argv.includes('--detach')
|
|
49
123
|
if (isDetach) {
|
|
@@ -213,7 +287,7 @@ const server = http.createServer((req, res) => {
|
|
|
213
287
|
})
|
|
214
288
|
res.write(': connected\n\n')
|
|
215
289
|
sseClients.add(res)
|
|
216
|
-
|
|
290
|
+
res.on('close', () => sseClients.delete(res))
|
|
217
291
|
return
|
|
218
292
|
}
|
|
219
293
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const apiRoot = '/api/data'
|
|
2
|
+
const liveFiles = new Set(['progress.json', 'page-specs/batch_report.json'])
|
|
3
|
+
const subscriptions = new Set()
|
|
4
|
+
let eventSource
|
|
5
|
+
let pendingManifest
|
|
6
|
+
|
|
7
|
+
function connect() {
|
|
8
|
+
if (eventSource || typeof EventSource === 'undefined') return
|
|
9
|
+
eventSource = new EventSource(`${apiRoot}/events`)
|
|
10
|
+
eventSource.onopen = () => {
|
|
11
|
+
for (const subscription of subscriptions) subscription.refresh()
|
|
12
|
+
}
|
|
13
|
+
eventSource.onmessage = event => {
|
|
14
|
+
let files
|
|
15
|
+
try {
|
|
16
|
+
({ files } = JSON.parse(event.data))
|
|
17
|
+
} catch {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
if (!Array.isArray(files)) return
|
|
21
|
+
for (const subscription of subscriptions) {
|
|
22
|
+
if (files.includes(subscription.path)) subscription.refresh()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function loadManifest() {
|
|
28
|
+
pendingManifest ??= (async () => {
|
|
29
|
+
const response = await fetch(`${apiRoot}/manifest`, {
|
|
30
|
+
cache: 'no-store',
|
|
31
|
+
signal: AbortSignal.timeout(5_000),
|
|
32
|
+
})
|
|
33
|
+
if (!response.ok) throw new Error(`读取 manifest 失败 (HTTP ${response.status})`)
|
|
34
|
+
return response.json()
|
|
35
|
+
})().finally(() => { pendingManifest = undefined })
|
|
36
|
+
return pendingManifest
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function parseJsonLines(text) {
|
|
40
|
+
const rows = []
|
|
41
|
+
for (const line of text.split(/\r?\n/)) {
|
|
42
|
+
try { rows.push(JSON.parse(line)) } catch { /* 跳过空行或未写完的记录 */ }
|
|
43
|
+
}
|
|
44
|
+
return rows
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function subscribeToJson(path, onData, options = {}) {
|
|
48
|
+
const { pollMs = liveFiles.has(path) ? 2_000 : 10_000, immediate = true } = options
|
|
49
|
+
let revision
|
|
50
|
+
let loading = false
|
|
51
|
+
let refreshAgain = false
|
|
52
|
+
let closed = false
|
|
53
|
+
|
|
54
|
+
const refresh = async () => {
|
|
55
|
+
if (closed) return
|
|
56
|
+
if (loading) {
|
|
57
|
+
refreshAgain = true
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
loading = true
|
|
61
|
+
try {
|
|
62
|
+
const stamp = (await loadManifest()).files[path]
|
|
63
|
+
if (closed) return
|
|
64
|
+
if (!stamp) {
|
|
65
|
+
revision = undefined
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
const next = stamp.revision ?? `${stamp.mtimeMs}:${stamp.size}`
|
|
69
|
+
if (next === revision) return
|
|
70
|
+
const response = await fetch(`${apiRoot}/file?p=${encodeURIComponent(path)}`, {
|
|
71
|
+
cache: 'no-store',
|
|
72
|
+
signal: AbortSignal.timeout(5_000),
|
|
73
|
+
})
|
|
74
|
+
if (!response.ok) throw new Error(`读取失败 (HTTP ${response.status})`)
|
|
75
|
+
const payload = path.toLowerCase().endsWith('.jsonl')
|
|
76
|
+
? parseJsonLines(await response.text())
|
|
77
|
+
: await response.json()
|
|
78
|
+
if (closed) return
|
|
79
|
+
await onData(payload, { relPath: path, fetchedAt: Date.now(), mtimeMs: stamp.mtimeMs })
|
|
80
|
+
revision = next
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (!closed) console.warn(`读取 ${path} 失败`, error)
|
|
83
|
+
} finally {
|
|
84
|
+
loading = false
|
|
85
|
+
if (refreshAgain) {
|
|
86
|
+
refreshAgain = false
|
|
87
|
+
void refresh()
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const subscription = { path, refresh }
|
|
93
|
+
subscriptions.add(subscription)
|
|
94
|
+
connect()
|
|
95
|
+
if (immediate) void refresh()
|
|
96
|
+
const timer = setInterval(refresh, pollMs)
|
|
97
|
+
return () => {
|
|
98
|
+
closed = true
|
|
99
|
+
clearInterval(timer)
|
|
100
|
+
subscriptions.delete(subscription)
|
|
101
|
+
if (!subscriptions.size && eventSource) {
|
|
102
|
+
eventSource.close()
|
|
103
|
+
eventSource = undefined
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function formatStageTiming(stage, formatDate, formatDuration) {
|
|
2
|
+
const started = Date.parse(stage.startedAt)
|
|
3
|
+
const ended = Date.parse(stage.endedAt)
|
|
4
|
+
const hasEnd = Number.isFinite(ended)
|
|
5
|
+
const elapsed = ended - started
|
|
6
|
+
|
|
7
|
+
// progress update completed 会为没有开始记录的旧阶段写入相同的起止时间。
|
|
8
|
+
const hasStart = Number.isFinite(started) && (!hasEnd || elapsed > 0)
|
|
9
|
+
const start = hasStart
|
|
10
|
+
? `开始 ${formatDate(stage.startedAt)}`
|
|
11
|
+
: stage.status === 'pending' ? '未开始' : '开始时间未记录'
|
|
12
|
+
if (!hasEnd) return { start, end: '' }
|
|
13
|
+
|
|
14
|
+
const finished = `完成 ${formatDate(stage.endedAt)}`
|
|
15
|
+
if (!hasStart) return { start, end: `${finished} · 用时未记录` }
|
|
16
|
+
const duration = elapsed < 1000 ? '用时不足 1 秒' : `用时 ${formatDuration(elapsed)}`
|
|
17
|
+
return { start, end: `${finished} · ${duration}` }
|
|
18
|
+
}
|
|
@@ -209,8 +209,6 @@ python3 $F/forge_report.py # 产出 test-report.html(Allure 风格:概况
|
|
|
209
209
|
```
|
|
210
210
|
铁律:修 1 个用例 ≠ 重跑 24 个。run_direct 汇总后 FAIL>0 会直接打印下一步命令——照抄执行。
|
|
211
211
|
|
|
212
|
-
**调用契约(Windows 管道悬挂防护)**:run_direct/probe 与 `droid2hmos test harmony` 派生的 hdc 常驻服务持有会话输出管道——CLI 已打印结果退出,工具调用却等到自身超时(结果其实已成功)。Windows 下命令末尾一律追加 `; $rc=$LASTEXITCODE; hdc kill; exit $rc`(杀掉持有者即返回,保留退出码;PowerShell 原生 `>` 重定向无效);hdc 不在 PATH 或仍悬挂时用 `cmd /c "… > <log> 2>&1"` 兜底。工具调用超时须大于 runner/CLI 总超时;`timedOut` ≠ 失败——先读落盘 `results.json`/报告定性,仅在证明本次未跑或失败时才重跑(盲目重跑会重复安装 HAP、重复设备测试)。
|
|
213
|
-
|
|
214
212
|
**范围回归(touched,产品代码变更后的默认门禁策略)**:
|
|
215
213
|
`--retry-failed` 检测到产品代码变更时不再一律全量——按 `results.meta.json` 的**逐文件指纹**
|
|
216
214
|
diff 出改动集,若全部是 ids.json 可定位的 UI 文件,则只重跑 `FAIL/SKIP + 引用这些文件的用例`
|
|
@@ -59,7 +59,7 @@ If independent page-worker execution is unavailable, return that the required mo
|
|
|
59
59
|
|
|
60
60
|
- Confirm the task is the earliest incomplete eligible task in ledger planning (or legacy task order when allowed) and no other page is being implemented or awaiting parent acceptance.
|
|
61
61
|
- Compare the checkout with the dispatch baseline. Preserve and avoid unrelated dirty files; if ownership conflicts with a build-affecting file, return the exact conflict instead of overwriting it.
|
|
62
|
-
-
|
|
62
|
+
- Before implementation, mark only the selected task `in_progress` in `batch_report.json`. Record its start and update times and update the batch summary in the same atomic write so the dashboard sees the claim immediately.
|
|
63
63
|
- Read the complete `spec.md`, the referenced `.migration/utg/page.json` node, every cited Fact, and every cited Android source file. Follow handlers, state transitions, repositories, navigation, persistence, error paths, and platform side effects far enough to establish the observable result.
|
|
64
64
|
- Inspect the HarmonyOS architecture, routes, resources, shared components, tests, and current implementation. Load `arkts-mvvm-architecture` before planning or writing ArkTS.
|
|
65
65
|
- Build a private checklist mapping every `F-xxx` to reachable code, a stable semantic locator, an appropriate development check, and an observable result. Do not create another planning file.
|
|
@@ -78,8 +78,6 @@ If independent page-worker execution is unavailable, return that the required mo
|
|
|
78
78
|
### 3. Managed build
|
|
79
79
|
|
|
80
80
|
- Run a fresh, non-interactive, bounded build through `droid2hmos build harmony <ANDROID_PROJECT>` using the resolved project configuration.
|
|
81
|
-
- Bound the invocation: tool-call `timeout` > CLI `--timeout-ms` > per-case watchdog; never rely on the tool default (suggested: build 15 min / `--timeout-ms 780000`, test 20 min / `--timeout-ms 1080000`).
|
|
82
|
-
- On Windows the CLI's lingering hdc server holds the session pipes after the CLI exits, hanging the tool call despite a printed result. Invoke `droid2hmos.cmd` (the `.ps1` shim is policy-blocked) with the kill suffix: `droid2hmos.cmd build harmony <ANDROID_PROJECT> --timeout-ms 780000; $rc=$LASTEXITCODE; hdc kill; exit $rc`. If hdc is not on PATH or the call still hangs, fall back to `cmd /c "droid2hmos.cmd ... > <evidence>/build.log 2>&1"` and read the file back (PowerShell-native redirection does not help). A tool timeout is not a failure verdict: read the on-disk JSON result/report before re-running.
|
|
83
81
|
- Save the exact command, exit status, timestamps, relevant log, produced HAP path, and HAP SHA-256 in the task evidence directory.
|
|
84
82
|
- Fix compilation errors caused or exposed by the implementation within this worker until the build passes.
|
|
85
83
|
- An older HAP, static analysis result, direct Hvigor run, or previous log is not current build evidence.
|
|
@@ -103,7 +101,6 @@ The worker runs necessary focused checks during development; the parent reviews
|
|
|
103
101
|
- The parent reviews the implementation and current check evidence; rerun or add focused checks only for a failure, a material evidence gap, or a subsequent code change.
|
|
104
102
|
- Do not load `d2h-hypium-forge`, generate Python Hypium test assets, or start a separate page test cycle by default. Run device/end-to-end tests only when the user explicitly requests them; then load the applicable testing Skill and use managed test entry points.
|
|
105
103
|
- Record actual commands, results and evidence in the task evidence directory. A build pass does not prove runtime behavior; unexecuted checks are not passed.
|
|
106
|
-
- Apply the same timeout ladder and Windows kill-suffix rule to `droid2hmos test harmony`; treat a tool timeout as unverified and read the on-disk Hypium results before re-running.
|
|
107
104
|
- Fix failures in the current implementation and repeat the affected checks and managed build as needed before handoff or parent approval.
|
|
108
105
|
|
|
109
106
|
## Parent report and commits
|
|
@@ -76,7 +76,7 @@ Before writing Specs, create pages.json with `schema_version: d2h-page-plan/v1`.
|
|
|
76
76
|
3. Use `page.json` navigation steps, selectors, guards, expected-arrival rules, required state, and depth to reconstruct the semantic arrival path. Source-derived reachability is planning evidence, not runtime confirmation.
|
|
77
77
|
4. Translate selectors into semantic control names only when Facts, resources, or Android source support the mapping. Keep missing or ambiguous selectors explicitly unresolved.
|
|
78
78
|
5. Verify every listed Android path exists under `android_root`. Verify every HarmonyOS path marked `existing` exists under `harmony_root`; otherwise mark it `planned`.
|
|
79
|
-
6. When page features touch platform capabilities (camera, location, files, notifications, Bluetooth, share, Web, background tasks, etc.) or uncertain HarmonyOS APIs (`@kit.*` Kit imports or `@ohos.*` modules), confirm the corresponding Kit/API availability and system-capability limits before writing: read supplied knowledge evidence
|
|
79
|
+
6. When page features touch platform capabilities (camera, location, files, notifications, Bluetooth, share, Web, background tasks, etc.) or uncertain HarmonyOS APIs (`@kit.*` Kit imports or `@ohos.*` modules), confirm the corresponding Kit/API availability and system-capability limits before writing: read supplied knowledge evidence first; on a gap return knowledgeRequests with the capability, source and question to the caller. Cite confirmed doc `title`/`uri` in「未决项与平台差异」or the supporting feature item. Do not assume API availability or load another Skill here.
|
|
80
80
|
|
|
81
81
|
### 5. Write only `spec.md`
|
|
82
82
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"npm": null,
|
|
8
8
|
"java": null,
|
|
9
9
|
"python-json5": null,
|
|
10
|
-
"appgraph": { "minimum": "0.0.
|
|
11
|
-
"droid2hmos": { "minimum": "0.0.
|
|
10
|
+
"appgraph": { "minimum": "0.0.12", "maximumExclusive": "0.0.13" },
|
|
11
|
+
"droid2hmos": { "minimum": "0.0.19", "maximumExclusive": "0.0.20" },
|
|
12
12
|
"hvigor": null,
|
|
13
13
|
"ohpm": null,
|
|
14
14
|
"devecocli": null
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"tools": {
|
|
5
5
|
"appgraph": {
|
|
6
6
|
"package": "@harmonyos-arkts/appgraph",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.12",
|
|
8
8
|
"capabilities": { "build-android": ["build", "--help"], "spec-analysis": ["spec-analysis", "--help"] }
|
|
9
9
|
},
|
|
10
10
|
"droid2hmos": {
|
|
11
11
|
"package": "@harmonyos-arkts/droid2hmos",
|
|
12
|
-
"version": "0.0.
|
|
12
|
+
"version": "0.0.19",
|
|
13
13
|
"capabilities": { "analyze-android": ["--help"], "preflight": ["--help"], "status": ["--help"] }
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -25,12 +25,13 @@ droid2hmos progress init <ANDROID_PROJECT>
|
|
|
25
25
|
|
|
26
26
|
1. 初始化工程(`workspace-initialization`)
|
|
27
27
|
2. 功能清单生成(`feature-inventory`)
|
|
28
|
-
3.
|
|
29
|
-
4.
|
|
28
|
+
3. HarmonyOS 工程架构设计(`harmony-architecture`)
|
|
29
|
+
4. Android 工程分析(`android-analysis`)
|
|
30
30
|
5. spec 设计与生成(`spec-design-generation`)
|
|
31
31
|
6. 代码转换(`code-conversion`)
|
|
32
|
+
7. 测试与交付(`testing-delivery`)
|
|
32
33
|
|
|
33
|
-
每个阶段记录 `status`、`startedAt`、`endedAt`、`completed`、`lastUpdatedAt`、`details` 和 `blockers`;顶层 `summary`
|
|
34
|
+
每个阶段记录 `status`、`startedAt`、`endedAt`、`completed`、`lastUpdatedAt`、`details` 和 `blockers`;顶层 `summary` 以 `total`、`pending`、`inProgress`、`blocked`、`completed` 和 `currentStage` 汇总状态。所有时间使用带时区偏移的 ISO 8601。初始化时“初始化工程”为 `in_progress`,其余阶段为 `pending`。
|
|
34
35
|
|
|
35
36
|
本 Skill 只更新“初始化工程”阶段。Preflight 和配置准备达到 `baselineReady=true` 时执行:
|
|
36
37
|
|
|
@@ -1 +0,0 @@
|
|
|
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-C1bO3C02.js";import{t as b}from"./PageHeading-B5I3tpO8.js";import{a as x,r as S}from"./datetime-DBOJn2GA.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.section-index[data-v-a06cb940]{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-a06cb940]{border-collapse:collapse;width:100%;margin:16px 0;font-size:13px}.compare-table th[data-v-a06cb940],.compare-table td[data-v-a06cb940]{text-align:left;border-bottom:1px solid #edf0f4;padding:10px 12px}.compare-table thead th[data-v-a06cb940]{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-a06cb940]{border-bottom:0}.compare-table tbody tr:hover td[data-v-a06cb940]{background:#f8faff}.compare-label[data-v-a06cb940]{color:#34445c;width:40%;font-weight:600}.compare-value[data-v-a06cb940]{white-space:nowrap;font-size:18px;font-weight:650}.android-value[data-v-a06cb940]{color:#3766dc}.harmony-value[data-v-a06cb940]{color:#168168}.meta-list[data-v-a06cb940]{gap:2px;margin-top:4px;display:grid}.meta-item[data-v-a06cb940]{border-top:1px solid #edf0f4;gap:16px;padding:7px 0;font-size:13px;display:flex}.meta-item[data-v-a06cb940]:first-child{border-top:0}.meta-item small[data-v-a06cb940]{flex-shrink:0;width:80px}.meta-value[data-v-a06cb940]{color:#34445c;overflow-wrap:anywhere}.side-panel[data-v-a06cb940]{border-top:3px solid #65a7a3}.summary-counts[data-v-a06cb940]{grid-template-columns:repeat(5,1fr);gap:8px;margin:16px 0;display:grid}.summary-counts strong[data-v-a06cb940]{font-size:24px;font-weight:650;display:block}.summary-counts small[data-v-a06cb940]{font-size:11px}.summary-counts>div[data-v-a06cb940]{background:#f4f6fa;border-radius:8px;padding:8px 10px}.module-pills[data-v-a06cb940],.ext-pills[data-v-a06cb940]{flex-wrap:wrap;gap:7px;margin:4px 0 14px;display:flex}.module-tag[data-v-a06cb940]{color:#48736e;background:#edf5f2}.ext-tag[data-v-a06cb940]{color:#61728a;background:#f1f3f7}.block-label[data-v-a06cb940]{color:var(--muted);letter-spacing:1px;margin:18px 0 8px;font-size:11px;display:block}.lang-table[data-v-a06cb940]{gap:6px;display:grid}.lang-row[data-v-a06cb940]{grid-template-columns:110px 90px 90px 1fr;align-items:center;gap:10px;font-size:13px;display:grid}.lang-name[data-v-a06cb940]{color:#34445c;font-weight:600}.lang-files[data-v-a06cb940],.lang-lines[data-v-a06cb940]{color:#61728a;font-size:12px}.lang-bar[data-v-a06cb940]{background:#edf1f7;border-radius:8px;height:8px;overflow:hidden}.lang-bar i[data-v-a06cb940]{background:var(--blue);border-radius:8px;height:100%;display:block}.dep-list[data-v-a06cb940]{display:grid}.dep-group[data-v-a06cb940]{border:1px solid #edf0f4;border-radius:8px;margin-top:18px;overflow:hidden}.dep-group>summary[data-v-a06cb940]{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-a06cb940]::-webkit-details-marker{display:none}.dep-group>summary[data-v-a06cb940]:before{content:"▸";color:#8191a8;font-size:13px;transition:transform .15s}.dep-group[open]>summary[data-v-a06cb940]:before{transform:rotate(90deg)}.dep-group>summary[data-v-a06cb940]:hover{color:var(--blue)}.dep-group-label[data-v-a06cb940]{min-width:0}.dep-group .dep-list[data-v-a06cb940]{padding:4px 14px 10px}.dep-item[data-v-a06cb940]{border-top:1px solid #edf0f4;padding:6px 0}.dep-item[data-v-a06cb940]:first-child{border-top:0}.dep-item summary[data-v-a06cb940]{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-a06cb940]::-webkit-details-marker{display:none}.dep-item summary[data-v-a06cb940]:before{content:"▸";color:#8191a8;font-size:12px;transition:transform .15s}.dep-item[open] summary[data-v-a06cb940]:before{transform:rotate(90deg)}.dep-item summary[data-v-a06cb940]:hover{color:var(--blue)}.dep-item summary code[data-v-a06cb940]{color:#2d59c2;overflow-wrap:anywhere;font-size:12px}.dep-decls[data-v-a06cb940]{gap:4px;padding:0 4px 8px 24px;display:grid}.dep-decl[data-v-a06cb940]{color:#61728a;overflow-wrap:anywhere;font-size:12px}.muted-tag[data-v-a06cb940]{color:#61728a;background:#f1f3f7}.oversized-list[data-v-a06cb940]{gap:6px;display:grid}.oversized-item[data-v-a06cb940]{align-items:center;gap:10px;font-size:13px;display:flex}.oversized-item code[data-v-a06cb940]{color:#b54545;overflow-wrap:anywhere}.question-list[data-v-a06cb940]{color:#48586f;margin:4px 0 0;padding-left:18px;font-size:13px;line-height:1.7}.question-list li[data-v-a06cb940]{overflow-wrap:anywhere;margin:4px 0}.empty-inline[data-v-a06cb940]{color:var(--muted);font-size:13px}.timeline[data-v-a06cb940]{align-items:stretch;padding:16px 0 4px;display:flex;overflow-x:auto}.tl-node[data-v-a06cb940]{border-top:2px solid #e3e9f2;flex:160px;min-width:160px;padding:12px 14px 0 2px;position:relative}.tl-dot[data-v-a06cb940]{background:#8aa0c4;border:2px solid #fff;border-radius:50%;width:10px;height:10px;position:absolute;top:-6px;left:0;box-shadow:0 0 0 1px #c9d6ea}.tl-node.tl-history .tl-dot[data-v-a06cb940]{background:#6f8bb5}.tl-node.active .tl-dot[data-v-a06cb940]{background:var(--blue);box-shadow:0 0 0 3px #dce8ff}.tl-node.ghost[data-v-a06cb940]{opacity:.55}.tl-node.ghost .tl-dot[data-v-a06cb940]{background:#d3dbe6;box-shadow:0 0 0 1px #e2e8f1}.tl-body[data-v-a06cb940]{gap:2px;font-size:12px;display:grid}.tl-body strong[data-v-a06cb940]{color:#34445c;font-size:13px}.tl-node.active .tl-body strong[data-v-a06cb940]{color:var(--blue)}.tl-body small[data-v-a06cb940]{color:var(--muted)}.tl-lines[data-v-a06cb940]{color:#48586f}.tl-rev[data-v-a06cb940]{overflow-wrap:anywhere;font-size:11px}.delta-grid[data-v-a06cb940]{grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;margin:14px 0 4px;display:grid}.delta-side[data-v-a06cb940]{border:1px solid #edf0f4;border-radius:10px;padding:14px}.delta-side.is-android[data-v-a06cb940]{border-top:3px solid #3766dc}.delta-side.is-harmony[data-v-a06cb940]{border-top:3px solid #168168}.delta-side-head[data-v-a06cb940]{justify-content:space-between;margin-bottom:10px}.delta-side-head strong[data-v-a06cb940]{color:#34445c;font-size:14px}.delta-kpis[data-v-a06cb940]{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.kpi[data-v-a06cb940]{background:#f4f6fa;border-radius:8px;padding:8px 10px}.kpi strong[data-v-a06cb940]{font-size:20px;font-weight:650;display:block}.kpi small[data-v-a06cb940]{color:var(--muted);font-size:11px}.tone-pos[data-v-a06cb940]{color:#2463eb}.tone-neg[data-v-a06cb940]{color:#b54545}.tone-zero[data-v-a06cb940]{color:var(--muted)}.delta-detail[data-v-a06cb940]{margin-top:12px}.delta-row[data-v-a06cb940]{color:#48586f;overflow-wrap:anywhere;padding:4px 0;font-size:12.5px}.delta-row.row-module[data-v-a06cb940]{color:#48736e}.delta-row.row-muted[data-v-a06cb940]{color:var(--muted)}.delta-row.row-oversized-bad[data-v-a06cb940]{color:#b54545}.delta-row.row-oversized-good[data-v-a06cb940]{color:#15825e}.delta-comparison[data-v-a06cb940]{margin-top:6px}.cd-chips[data-v-a06cb940]{flex-wrap:wrap;gap:7px;display:flex}.delta-notes[data-v-a06cb940]{margin-top:10px}@media (width<=700px){.delta-kpis[data-v-a06cb940]{grid-template-columns:repeat(1,1fr)}.summary-counts[data-v-a06cb940]{grid-template-columns:repeat(2,1fr)}.lang-row[data-v-a06cb940]{grid-template-columns:90px 70px 70px 1fr;gap:6px}.compare-table th[data-v-a06cb940],.compare-table td[data-v-a06cb940]{padding:8px 9px}.compare-value[data-v-a06cb940]{font-size:15px}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e,X as t,Y as n,Z as r,_ as i,a,c as o,d as s,f as ee,i as c,j as l,n as u,p as te,s as d,t as f,v as ne,x as p,y as m}from"./_plugin-vue_export-helper-B9l48Cov.js";import{i as re,t as h}from"./index-C1bO3C02.js";import{t as ie}from"./PageHeading-B5I3tpO8.js";import{a as g,i as ae,n as _,o as oe,r as se}from"./datetime-DBOJn2GA.js";var ce={key:0,class:`panel placeholder`},le={class:`panel`},ue={class:`row`},de={class:`tag muted-tag`},fe={class:`timeline`},pe={class:`tl-body`},me={key:0},he={class:`tl-lines`},ge={key:1,class:`tl-rev`},_e={key:0,class:`empty-inline`},ve={key:1,class:`empty-inline`},ye={key:0,class:`panel`},be={class:`row`},xe={class:`tag`},v={class:`delta-grid`},y={class:`row delta-side-head`},b={class:`tag muted-tag`},x={class:`delta-kpis`},S={class:`kpi`},C={class:`kpi`},w={class:`kpi`},T={key:0,class:`dep-group delta-detail`},E={class:`tag muted-tag`},D={class:`dep-list`},O={key:0,class:`delta-comparison`},k={class:`cd-chips`},A={key:1,class:`question-list delta-notes`},j={key:1,class:`panel`},M={class:`panel`},Se={class:`row`},Ce={class:`tag`},we={class:`compare-table`},Te={class:`compare-label`},Ee={class:`compare-value android-value`},De={class:`compare-value harmony-value`},Oe={class:`meta-list`},ke={class:`meta-value`},Ae={class:`row`},je={class:`section-index`},Me={class:`tag`},Ne={class:`summary-counts`},Pe={class:`module-pills`},Fe={class:`lang-table`},Ie={class:`lang-name`},Le={class:`lang-files`},Re={class:`lang-lines`},ze={class:`lang-bar`},Be={class:`ext-pills`},Ve=[`open`],He={class:`tag muted-tag`},Ue={class:`dep-list`},We={class:`tag muted-tag`},Ge={class:`dep-decls`},Ke={key:1,class:`tag muted-tag`},qe={class:`oversized-list`},Je={class:`tag orange`},Ye={key:4,class:`empty-inline`},Xe={class:`panel`},Ze={class:`row`},Qe={class:`section-index`},$e={key:0,class:`tag orange`},et={key:0,class:`question-list`},tt={key:1,class:`empty-inline`},nt=`code-audit/history/`,N=f(te({__name:`CodeAudit`,setup(te){let f=h.codeStats,N=h.codeStatsBaselineAndroid,rt=h.codeStatsBaselineHarmony,it=h.incrementDelta,P=e(null),F=e(null),I=e(null),L=e(null),R=e(null),z=e([]),B;async function V(){try{let e=await ae(nt),t=await Promise.all(e.map(async({relPath:e})=>{try{return{relPath:e,data:await oe(e)}}catch{return null}}));z.value=t.filter(e=>e!==null).sort((e,t)=>(e.data.generated_at||``).localeCompare(t.data.generated_at||``))}catch(e){console.warn(`[CodeAudit] 读取 history 归档失败:`,e)}}i(()=>{let e=[g(f,(e,t)=>{P.value=e,F.value=t.mtimeMs??null,V()}),g(N,e=>{I.value=e}),g(rt,e=>{L.value=e}),g(it,e=>{R.value=e})];B=()=>e.forEach(e=>e()),V()}),ne(()=>B?.());let at=c(()=>se(P.value,F.value)),H=[`android`,`harmony`],U=c(()=>P.value?.sides?H.filter(e=>P.value?.sides[e]).map(e=>({key:e,...P.value.sides[e]})):[]),W=e=>P.value?.repositories.find(t=>t.id===e)?.label??(e===`android`?`Android`:`HarmonyOS`),ot=e=>e?`${e.code.total_files} 文件 / ${e.code.total_lines} 行`:re,st=(e,t)=>{let n=Math.max(1,...e.code.by_language.map(e=>e.lines));return`${Math.round(100*t/n)}%`},ct=c(()=>{let e=P.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:`超大文件(≥${P.value.thresholds.oversized_file_lines} 行)`,values:[e.oversized.android_count,e.oversized.harmony_count]}]:[]}),G=e=>e.repositories.map(e=>`${e.id}: ${e.revision||`unknown`}`).join(` · `),K=e=>H.filter(t=>e.sides?.[t]).map(t=>`${t===`android`?`A`:`H`} ${e.sides[t].code.total_lines.toLocaleString()} 行`).join(` / `)||`unknown`,q=c(()=>{let e=[];return I.value&&e.push({key:`b-android`,kind:`baseline`,title:`Android 基线`,time:_(I.value.generated_at),revision:G(I.value),lines:K(I.value)}),e.push(L.value?{key:`b-harmony`,kind:`baseline`,title:`HarmonyOS 基线`,time:_(L.value.generated_at),revision:G(L.value),lines:K(L.value)}:{key:`b-harmony`,kind:`baseline`,title:`HarmonyOS 基线`,time:``,revision:``,lines:`未生成(全新迁移或未到阶段)`,ghost:!0}),z.value.forEach((t,n)=>{e.push({key:t.relPath,kind:`history`,title:`第 ${n+1} 轮终检`,time:_(t.data.generated_at),revision:G(t.data),lines:K(t.data)})}),P.value&&e.push({key:`current`,kind:`current`,title:`当前终检`,time:_(P.value.generated_at),revision:G(P.value),lines:K(P.value),active:!0}),e}),lt=c(()=>!!(P.value||I.value||L.value||z.value.length)),J={"baseline-android":`Android 基线`,"baseline-harmony":`HarmonyOS 基线`,"history-final":`上一轮终检`,external:`外部快照`},Y=e=>e>0?`+${e}`:`${e}`,X=e=>e>0?`tone-pos`:e<0?`tone-neg`:`tone-zero`,ut=c(()=>H.filter(e=>R.value?.sides?.[e]).map(e=>({key:e,side:R.value.sides[e]}))),dt=e=>{let t=R.value?.inputs.previous_by_side?.[e];return t?`对比${J[t.source_kind]??t.source_kind} · ${_(t.generated_at)}`:`无对比快照(该侧未计算)`},Z=e=>e.third_party_dependencies.added.length-e.third_party_dependencies.removed.length,ft=e=>e.oversized_files.added.length+e.oversized_files.persisted.length,Q=e=>{let t=[];for(let n of e.modules.added)t.push({cls:`row-module`,text:`新增模块 ${n.name} · ${n.kind}`});for(let n of e.modules.removed)t.push({cls:`row-muted`,text:`移除模块 ${n}`});for(let n of e.third_party_dependencies.added)t.push({cls:`row-dep`,text:`新增依赖 ${n.name}${n.version?` @ ${n.version}`:``}`});for(let n of e.third_party_dependencies.version_changed)t.push({cls:`row-dep`,text:`依赖升级 ${n.name} ${n.from??`unknown`} → ${n.to??`unknown`}`});for(let n of e.third_party_dependencies.removed)t.push({cls:`row-muted`,text:`移除依赖 ${n}`});for(let n of e.native_libraries.added)t.push({cls:`row-dep`,text:`新增原生库 ${n}`});for(let n of e.native_libraries.removed)t.push({cls:`row-muted`,text:`移除原生库 ${n}`});for(let n of e.oversized_files.added)t.push({cls:`row-oversized-bad`,text:`超大新增 ${n.path} · ${n.lines} 行${n.module&&n.module!==`unknown`?`(${n.module})`:``}`});for(let n of e.oversized_files.persisted)t.push({cls:`row-oversized-bad`,text:`超大恶化 ${n.path} · ${Y(n.lines_delta)} 行`});for(let n of e.oversized_files.removed)t.push({cls:`row-oversized-good`,text:`超大消除 ${n}`});return t},$=c(()=>{let e=R.value?.comparison_delta;return e?[{label:`物理行数`,a:e.total_lines.android,h:e.total_lines.harmony},{label:`模块`,a:e.modules.android,h:e.modules.harmony},{label:`三方依赖`,a:e.third_party_dependencies.android,h:e.third_party_dependencies.harmony},{label:`原生库`,a:e.native_libraries.android,h:e.native_libraries.harmony},{label:`超大文件`,a:e.oversized.android_count,h:e.oversized.harmony_count}]:[]});return(e,i)=>(m(),o(u,null,[ee(ie,{kicker:`D2H / code-audit`,title:`代码静态分析`,note:`双端代码规模 · 模块 · 依赖 · 超大文件 · ${l(f)} 实时渲染`},null,8,[`note`]),lt.value?(m(),o(u,{key:1},[a(`section`,le,[a(`div`,ue,[i[2]||=a(`h2`,null,[a(`span`,{class:`section-index`},`00`),s(`分析快照`)],-1),a(`span`,de,r(q.value.length)+` 份`,1)]),a(`div`,fe,[(m(!0),o(u,null,p(q.value,e=>(m(),o(`div`,{key:e.key,class:n([`tl-node`,[`tl-${e.kind}`,{ghost:e.ghost,active:e.active}]])},[i[3]||=a(`div`,{class:`tl-dot`},null,-1),a(`div`,pe,[a(`strong`,null,r(e.title),1),e.ghost?d(``,!0):(m(),o(`small`,me,r(e.time),1)),a(`small`,he,r(e.lines),1),e.revision?(m(),o(`small`,ge,r(e.revision),1)):d(``,!0)])],2))),128))]),z.value.length?(m(),o(`small`,_e,` 历史归档 `+r(z.value.length)+` 份(code-audit/history/);节点为概要,完整明细仅展示当前终检 `,1)):(m(),o(`small`,ve,`暂无历史归档;增量轮重扫前上一轮终检会移入 history/`))]),R.value?(m(),o(`section`,ye,[a(`div`,be,[i[4]||=a(`h2`,null,[a(`span`,{class:`section-index`},`01`),s(`本轮分析`)],-1),a(`span`,xe,`生成于 `+r(l(_)(R.value.generated_at)),1)]),a(`div`,v,[(m(!0),o(u,null,p(ut.value,e=>(m(),o(`div`,{key:e.key,class:n([`delta-side`,e.key===`android`?`is-android`:`is-harmony`])},[a(`div`,y,[a(`strong`,null,r(W(e.key)),1),a(`span`,b,r(dt(e.key)),1)]),a(`div`,x,[a(`div`,S,[a(`strong`,{class:n(X(e.side.code.total_lines_delta))},r(Y(e.side.code.total_lines_delta)),3),a(`small`,null,`行数(`+r(Y(e.side.code.total_files_delta))+` 文件)`,1)]),a(`div`,C,[a(`strong`,{class:n(X(Z(e.side)))},r(Y(Z(e.side))),3),a(`small`,null,`依赖 +`+r(e.side.third_party_dependencies.added.length)+` −`+r(e.side.third_party_dependencies.removed.length)+` ~`+r(e.side.third_party_dependencies.version_changed.length),1)]),a(`div`,w,[a(`strong`,{class:n(ft(e.side)?`tone-neg`:`tone-zero`)},`+`+r(e.side.oversized_files.added.length)+` ↗`+r(e.side.oversized_files.persisted.length),3),a(`small`,null,`超大新增/恶化 · ✓`+r(e.side.oversized_files.removed.length)+` 消除`,1)])]),Q(e.side).length?(m(),o(`details`,T,[a(`summary`,null,[i[5]||=a(`span`,{class:`dep-group-label`},`本轮明细`,-1),a(`span`,E,r(Q(e.side).length)+` 条`,1)]),a(`div`,D,[(m(!0),o(u,null,p(Q(e.side),(e,t)=>(m(),o(`div`,{key:t,class:n([`delta-row`,e.cls])},r(e.text),3))),128))])])):d(``,!0)],2))),128))]),$.value.length?(m(),o(`div`,O,[i[6]||=a(`small`,{class:`block-label`},`双端差距变化(当前 − 对比基准)`,-1),a(`div`,k,[(m(!0),o(u,null,p($.value,e=>(m(),o(`span`,{key:e.label,class:`tag`},r(e.label)+` A `+r(Y(e.a))+` / H `+r(Y(e.h)),1))),128))])])):d(``,!0),R.value.notes.length?(m(),o(`ul`,A,[(m(!0),o(u,null,p(R.value.notes,(e,t)=>(m(),o(`li`,{key:t},r(e),1))),128))])):d(``,!0)])):P.value?(m(),o(`section`,j,[...i[7]||=[a(`div`,{class:`row`},[a(`h2`,null,[a(`span`,{class:`section-index`},`01`),s(`本轮分析`)])],-1),a(`div`,{class:`empty-inline`},`本轮差量尚未生成(本轮终检后由 increment_delta.py 产出 increment-delta.json)`,-1)]])):d(``,!0),P.value?(m(),o(u,{key:2},[a(`section`,M,[a(`div`,Se,[i[8]||=a(`h2`,null,[a(`span`,{class:`section-index`},`02`),s(`双端对照`)],-1),a(`span`,Ce,`更新于 `+r(at.value),1)]),a(`table`,we,[i[9]||=a(`thead`,null,[a(`tr`,null,[a(`th`,null,`指标`),a(`th`,null,`Android`),a(`th`,null,`HarmonyOS`)])],-1),a(`tbody`,null,[(m(!0),o(u,null,p(ct.value,e=>(m(),o(`tr`,{key:e.label},[a(`td`,Te,r(e.label),1),a(`td`,Ee,r(e.values[0]),1),a(`td`,De,r(e.values[1]),1)]))),128))])]),a(`div`,Oe,[(m(!0),o(u,null,p(P.value.repositories,e=>(m(),o(`div`,{key:e.id,class:`meta-item`},[a(`small`,null,r(e.label),1),a(`span`,ke,r(e.path)+` · rev `+r(e.revision||l(`unknown`)),1)]))),128))])]),(m(!0),o(u,null,p(U.value,(e,n)=>(m(),o(`section`,{key:e.key,class:`panel side-panel`},[a(`div`,Ae,[a(`h2`,null,[a(`span`,je,r(String(n+3).padStart(2,`0`)),1),s(r(W(e.key))+` 代码规模`,1)]),a(`span`,Me,r(ot(e)),1)]),a(`div`,Ne,[a(`div`,null,[a(`strong`,null,r(e.code.total_files),1),i[10]||=a(`small`,null,`总文件`,-1)]),a(`div`,null,[a(`strong`,null,r(e.code.total_lines),1),i[11]||=a(`small`,null,`总行数`,-1)]),a(`div`,null,[a(`strong`,null,r(e.module_count),1),i[12]||=a(`small`,null,`模块`,-1)]),a(`div`,null,[a(`strong`,null,r(e.third_party_dependency_count),1),i[13]||=a(`small`,null,`三方依赖`,-1)]),a(`div`,null,[a(`strong`,null,r(e.native_library_count),1),i[14]||=a(`small`,null,`原生库`,-1)])]),a(`div`,Pe,[(m(!0),o(u,null,p(e.modules,e=>(m(),o(`span`,{key:e.name,class:`tag module-tag`},r(e.name)+` · `+r(e.kind),1))),128))]),e.code.by_language.length?(m(),o(u,{key:0},[i[15]||=a(`small`,{class:`block-label`},`按语言`,-1),a(`div`,Fe,[(m(!0),o(u,null,p(e.code.by_language,n=>(m(),o(`div`,{key:n.language,class:`lang-row`},[a(`span`,Ie,r(n.language),1),a(`span`,Le,r(n.files)+` 文件`,1),a(`span`,Re,r(n.lines)+` 行`,1),a(`div`,ze,[a(`i`,{style:t({width:st(e,n.lines)})},null,4)])]))),128))])],64)):d(``,!0),e.code.other_extensions.length?(m(),o(u,{key:1},[i[16]||=a(`small`,{class:`block-label`},`其他扩展名(未映射到核心语言桶)`,-1),a(`div`,Be,[(m(!0),o(u,null,p(e.code.other_extensions,e=>(m(),o(`span`,{key:e.extension,class:`tag ext-tag`},r(e.extension||`(无扩展名)`)+` · `+r(e.files)+` 文件 / `+r(e.lines)+` 行 `,1))),128))])],64)):d(``,!0),e.third_party_dependencies.length?(m(),o(`details`,{key:2,class:`dep-group`,open:e.key===`android`},[a(`summary`,null,[i[17]||=a(`span`,{class:`dep-group-label`},`三方依赖`,-1),a(`span`,He,r(e.third_party_dependency_count),1)]),a(`div`,Ue,[(m(!0),o(u,null,p(e.third_party_dependencies,e=>(m(),o(`details`,{key:e.name,class:`dep-item`},[a(`summary`,null,[a(`code`,null,r(e.name),1),i[18]||=s(),a(`span`,We,r(e.version),1)]),a(`div`,Ge,[(m(!0),o(u,null,p(e.declarations,(e,t)=>(m(),o(`div`,{key:t,class:`dep-decl`},[s(r(e.path),1),e.line_start?(m(),o(u,{key:0},[s(`:`+r(e.line_start),1)],64)):d(``,!0),e.scope?(m(),o(`span`,Ke,r(e.scope),1)):d(``,!0)]))),128))])]))),128))])],8,Ve)):d(``,!0),e.oversized_files.length?(m(),o(u,{key:3},[i[20]||=a(`small`,{class:`block-label`},`超大文件`,-1),a(`div`,qe,[(m(!0),o(u,null,p(e.oversized_files,e=>(m(),o(`div`,{key:e.path,class:`oversized-item`},[a(`code`,null,r(e.path),1),i[19]||=s(),a(`span`,Je,r(e.lines)+` 行`,1)]))),128))])],64)):(m(),o(`small`,Ye,`无超大文件(阈值 `+r(P.value.thresholds.oversized_file_lines)+` 行)`,1))]))),128)),a(`section`,Xe,[a(`div`,Ze,[a(`h2`,null,[a(`span`,Qe,r(String(U.value.length+3).padStart(2,`0`)),1),i[21]||=s(`注意事项`,-1)]),P.value.notes.length?(m(),o(`span`,$e,r(P.value.notes.length)+` 项`,1)):d(``,!0)]),P.value.notes.length?(m(),o(`ul`,et,[(m(!0),o(u,null,p(P.value.notes,(e,t)=>(m(),o(`li`,{key:t},r(e),1))),128))])):(m(),o(`div`,tt,`无注意事项`))])],64)):d(``,!0)],64)):(m(),o(`section`,ce,[i[0]||=a(`span`,{class:`glyph`},`∑`,-1),i[1]||=a(`strong`,null,`等待数据`,-1),a(`small`,null,`正在读取 `+r(l(f))+`…(尚未生成代码静态分析报告时此页为空)`,1)]))],64))}}),[[`__scopeId`,`data-v-a06cb940`]]);export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.summary-counts[data-v-5d54f747]{grid-template-columns:repeat(6,1fr);gap:6px;margin:18px 0 4px;display:grid}.summary-counts strong[data-v-5d54f747]{font-size:24px;font-weight:650;display:block}.summary-counts small[data-v-5d54f747]{font-size:11px}.stat-card[data-v-5d54f747]{cursor:pointer;outline-offset:2px;border-radius:7px;margin:-6px -8px;padding:6px 8px;transition:background .15s}.stat-card[data-v-5d54f747]:hover,.stat-card[data-v-5d54f747]:focus-visible{background:#f0f4fc}.scroll-anchor[data-v-5d54f747]{scroll-margin-top:16px}.blue-number[data-v-5d54f747]{color:var(--blue)}.orange-number[data-v-5d54f747]{color:#986221}.red-number[data-v-5d54f747]{color:#b14646}.toolbar[data-v-5d54f747]{flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 18px;display:flex}.toolbar select[data-v-5d54f747]{color:#34445c;background:#fff;border:1px solid #dce3ec;border-radius:6px;padding:5px 8px}.table-wrap[data-v-5d54f747]{overflow:auto}table[data-v-5d54f747]{border-collapse:collapse;text-align:left;width:100%;font-size:13px}th[data-v-5d54f747]{color:var(--muted);white-space:nowrap;background:#f9fafc;font-size:12px;font-weight:500}td[data-v-5d54f747],th[data-v-5d54f747]{vertical-align:top;border-bottom:1px solid #edf0f4;padding:12px}td small[data-v-5d54f747]{margin-top:2px;display:block}td.title[data-v-5d54f747]{min-width:160px}td.title strong[data-v-5d54f747]{color:#26364d;font-size:13px}td.scope[data-v-5d54f747]{color:#61728a;padding-left:36px;font-size:12px}td.scope[data-v-5d54f747]:before{content:"—";color:#acb6c5;margin-right:9px}.empty[data-v-5d54f747]{text-align:center;color:var(--muted);padding:35px}.check-col[data-v-5d54f747]{width:44px}input[type=checkbox][data-v-5d54f747]{accent-color:var(--blue);cursor:pointer;width:15px;height:15px}.toolbar button[data-v-5d54f747]{font-size:13px}.toolbar button.active[data-v-5d54f747]{color:#2463eb;background:#edf3ff;border-color:#90b2f9;font-weight:600}.selected-info[data-v-5d54f747]{color:var(--muted);white-space:nowrap;margin-left:auto;font-size:12px}.toolbar button.confirm[data-v-5d54f747]{background:var(--blue);color:#fff;border-color:var(--blue);font-weight:600}.toolbar button.confirm[data-v-5d54f747]:disabled{opacity:.45;cursor:default}.toolbar button[data-v-5d54f747]:disabled,select[data-v-5d54f747]:disabled{opacity:.5;cursor:not-allowed}select.prio[data-v-5d54f747]{color:#34445c;background:#fff;border:1px solid #dce3ec;border-radius:5px;padding:3px 6px;font-size:12px}select.prio.modified[data-v-5d54f747]{color:#2463eb;background:#f0f5ff;border-color:#90b2f9;font-weight:600}.empty-inline[data-v-5d54f747]{color:var(--muted);font-size:13px}.pagination[data-v-5d54f747]{justify-content:flex-end;align-items:center;gap:12px;margin-top:16px;display:flex}.pagination button[data-v-5d54f747]:disabled{opacity:.45;cursor:default}.page-info[data-v-5d54f747]{color:var(--muted);font-size:12px}.question-list[data-v-5d54f747]{gap:2px;display:grid}.question-item[data-v-5d54f747]{border-top:1px solid #edf0f4;align-items:flex-start;gap:12px;padding:10px 0;font-size:13px;display:flex}.question-item[data-v-5d54f747]:first-child{border-top:0}.summary-no[data-v-5d54f747]{color:#986221;background:#fff0da;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:22px;height:22px;font-size:12px;font-weight:650;display:inline-flex}.excluded-list[data-v-5d54f747]{gap:4px;display:grid}.excluded-item[data-v-5d54f747]{border-top:1px solid #edf0f4;padding:12px 0}.excluded-item[data-v-5d54f747]:first-child{border-top:0}.excluded-item strong[data-v-5d54f747]{font-size:13px}.excluded-item p[data-v-5d54f747]{color:#34445c;margin:4px 0;font-size:12px}@media (width<=900px){.summary-counts[data-v-5d54f747]{grid-template-columns:repeat(3,1fr)}td.scope[data-v-5d54f747]{padding-left:22px}}@media (width<=560px){.summary-counts[data-v-5d54f747]{grid-template-columns:repeat(3,1fr);gap:4px}.summary-counts strong[data-v-5d54f747]{font-size:20px}}
|