Skip to content

Commit 8ef2e24

Browse files
committed
style: format
1 parent 124458b commit 8ef2e24

399 files changed

Lines changed: 9970 additions & 7238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ jobs:
6868
matrix:
6969
include:
7070
- arch: x86_64
71-
runner: macos-15-intel # Intel-based macOS runner
71+
runner: macos-15-intel # Intel-based macOS runner
7272
- arch: aarch64
73-
runner: macos-latest # Apple Silicon macOS runner
73+
runner: macos-latest # Apple Silicon macOS runner
7474
fail-fast: false
7575
runs-on: ${{ matrix.runner }}
7676

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ _✨ 可视化分析基于 MaaFramework 开发应用的用户日志 ✨_</br>
3333

3434
<div align="center">
3535

36-
| 模块 | 说明 |
37-
| --- | --- |
38-
| 日志分析 | 按任务展示执行过程<br>支持识别/动作详情查看<br>支持节点导航快速定位<br>支持虚拟滚动<br>支持布局比例保存 |
39-
| 文本搜索 | 支持关键字/正则搜索<br>支持搜索历史与快捷检索<br>支持大文件流式搜索<br>支持结果跳转上下文<br>支持布局比例保存 |
40-
| 流程图 | 基于 ELK 的节点关系可视化<br>支持执行顺序导航与回放<br>支持回放速度与聚焦缩放持久化<br>点击节点可高亮关联节点与连线 |
41-
| 运行统计 | 展示节点、识别/动作、Wait Freezes 的成功/失败、耗时与重试统计<br>适合做整体运行质量观察 |
42-
| 分屏模式 | 上半区日志分析 + 下半区文本搜索<br>便于结构与原文对照排查<br>支持布局比例保存 |
43-
| 新手教程 | 首次加载样例数据后自动引导<br>按板块讲解主要功能<br>支持按教程版本增量引导<br>可在“关于 -> 快速开始”再次启动 |
36+
| 模块 | 说明 |
37+
| -------- | ------------------------------------------------------------------------------------------------------------------- |
38+
| 日志分析 | 按任务展示执行过程<br>支持识别/动作详情查看<br>支持节点导航快速定位<br>支持虚拟滚动<br>支持布局比例保存 |
39+
| 文本搜索 | 支持关键字/正则搜索<br>支持搜索历史与快捷检索<br>支持大文件流式搜索<br>支持结果跳转上下文<br>支持布局比例保存 |
40+
| 流程图 | 基于 ELK 的节点关系可视化<br>支持执行顺序导航与回放<br>支持回放速度与聚焦缩放持久化<br>点击节点可高亮关联节点与连线 |
41+
| 运行统计 | 展示节点、识别/动作、Wait Freezes 的成功/失败、耗时与重试统计<br>适合做整体运行质量观察 |
42+
| 分屏模式 | 上半区日志分析 + 下半区文本搜索<br>便于结构与原文对照排查<br>支持布局比例保存 |
43+
| 新手教程 | 首次加载样例数据后自动引导<br>按板块讲解主要功能<br>支持按教程版本增量引导<br>可在“关于 -> 快速开始”再次启动 |
4444

4545
</div>
4646

docs/LOG_PARSER_ARCHITECTURE.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,14 @@ type ParseArtifacts = {
604604
605605
```ts
606606
type RawLineStore = {
607-
sources: Map<string, {
608-
sourcePath?: string
609-
inputIndex: number
610-
lines: string[]
611-
}>
607+
sources: Map<
608+
string,
609+
{
610+
sourcePath?: string
611+
inputIndex: number
612+
lines: string[]
613+
}
614+
>
612615
}
613616
```
614617
@@ -648,8 +651,7 @@ type TraceIndex = {
648651
建议 `scope.id` 采用可复现的确定性格式:
649652
650653
```ts
651-
type ScopeIdFormat =
652-
`${ScopeKind}:${taskIdOrZero}:${localIdOrZero}:seq${startSeq}`
654+
type ScopeIdFormat = `${ScopeKind}:${taskIdOrZero}:${localIdOrZero}:seq${startSeq}`
653655
```
654656
655657
建议取值规则:
@@ -786,8 +788,7 @@ type TraceIndex = {
786788
787789
```ts
788790
type ScopeLocator =
789-
| { scopeId: string }
790-
| { kind: ScopeKind; taskId?: number; localId?: number; startSeq?: number }
791+
{ scopeId: string } | { kind: ScopeKind; taskId?: number; localId?: number; startSeq?: number }
791792

792793
type NodeExecutionLocator = {
793794
taskId: number
@@ -797,8 +798,7 @@ type NodeExecutionLocator = {
797798
}
798799

799800
type UniqueScopeLocator =
800-
| { scopeId: string }
801-
| { taskId: number; nodeId: number; occurrenceIndex: number }
801+
{ scopeId: string } | { taskId: number; nodeId: number; occurrenceIndex: number }
802802
```
803803
804804
语义:
@@ -828,9 +828,7 @@ type UniqueScopeLocator =
828828
```ts
829829
type QueryErrorCode = 'not_found' | 'ambiguous' | 'invalid_locator'
830830

831-
type QueryResult<T> =
832-
| { ok: true; value: T }
833-
| { ok: false; error: QueryErrorCode; message: string }
831+
type QueryResult<T> = { ok: true; value: T } | { ok: false; error: QueryErrorCode; message: string }
834832
```
835833
836834
建议 helper:
@@ -848,11 +846,16 @@ type QueryHelpers = {
848846
getNextListHistory(locator: NodeExecutionLocator, limit?: number): QueryResult<NextListHistory[]>
849847

850848
getScopeEvents(scopeId: string): ProtocolEvent[]
851-
getRawLinesBySeqRange(startSeq: number, endSeq: number): QueryResult<Array<{
852-
sourceKey: string
853-
line: number
854-
text: string
855-
}>>
849+
getRawLinesBySeqRange(
850+
startSeq: number,
851+
endSeq: number,
852+
): QueryResult<
853+
Array<{
854+
sourceKey: string
855+
line: number
856+
text: string
857+
}>
858+
>
856859
}
857860
```
858861

docs/SUPPORT_ANALYZER_REALTIME_PROTOCOL.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{
4545
"jsonrpc": "2.0",
4646
"method": "realtime.push",
47-
"params": { }
47+
"params": {}
4848
}
4949
```
5050

@@ -57,7 +57,7 @@
5757
"jsonrpc": "2.0",
5858
"id": "req-1",
5959
"method": "query.detail",
60-
"params": { }
60+
"params": {}
6161
}
6262
```
6363

@@ -67,7 +67,7 @@
6767
{
6868
"jsonrpc": "2.0",
6969
"id": "req-1",
70-
"result": { }
70+
"result": {}
7171
}
7272
```
7373

@@ -288,9 +288,9 @@ interface QueryDetailCachedImageData {
288288
2. 图片正文仅通过 `target='cached_image'` 获取,避免实时推送阶段提前占用 Analyzer 内存。
289289
3. Support 侧按 `sessionId + taskId + (reco_id/action_id)` 维护详情缓存,避免跨 task 串数据。
290290
4. Analyzer 推荐调用顺序:
291-
1) `query.detail(target='reco', id=reco_id, taskId=task_id)`
292-
2) 读取 `data.cached_image.raw/draws`
293-
3) 对每个图片引用 id 调 `query.detail(target='cached_image', id=<refId>, taskId=task_id)`
291+
1. `query.detail(target='reco', id=reco_id, taskId=task_id)`
292+
2. 读取 `data.cached_image.raw/draws`
293+
3. 对每个图片引用 id 调 `query.detail(target='cached_image', id=<refId>, taskId=task_id)`
294294
5. `cached_image.id``reco_id/action_id` 语义不同,禁止混用。
295295

296296
### 5.9 query.node(Request)
@@ -444,15 +444,15 @@ Support 侧消息可能是去前缀格式(例如 `Task.Starting`)。
444444

445445
Analyzer 应映射为标准名:
446446

447-
| 输入 | 标准化后 |
448-
| --- | --- |
449-
| `Task.*` | `Tasker.Task.*` |
450-
| `PipelineNode.*` | `Node.PipelineNode.*` |
447+
| 输入 | 标准化后 |
448+
| ------------------- | ------------------------ |
449+
| `Task.*` | `Tasker.Task.*` |
450+
| `PipelineNode.*` | `Node.PipelineNode.*` |
451451
| `RecognitionNode.*` | `Node.RecognitionNode.*` |
452-
| `ActionNode.*` | `Node.ActionNode.*` |
453-
| `NextList.*` | `Node.NextList.*` |
454-
| `Recognition.*` | `Node.Recognition.*` |
455-
| `Action.*` | `Node.Action.*` |
452+
| `ActionNode.*` | `Node.ActionNode.*` |
453+
| `NextList.*` | `Node.NextList.*` |
454+
| `Recognition.*` | `Node.Recognition.*` |
455+
| `Action.*` | `Node.Action.*` |
456456

457457
未命中映射:记录 warning 并忽略。
458458

docs/TOOL_ONLY_ORCHESTRATOR_PROTOCOL.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@
9393

9494
### 4.1 Caller -> Analyzer(Request)
9595

96-
| 方法名 | 用途 | 必填参数 |
97-
| --- | --- | --- |
98-
| `parse_log_bundle` | 解析日志输入并建立查询会话 | `session_id`, `inputs` |
99-
| `get_task_overview` | 返回任务级统计与热点摘要 | `session_id` |
100-
| `get_node_timeline` | 返回节点时序事件 | `session_id`, `task_id`, `node_id` |
96+
| 方法名 | 用途 | 必填参数 |
97+
| ----------------------- | --------------------------- | ---------------------------------- |
98+
| `parse_log_bundle` | 解析日志输入并建立查询会话 | `session_id`, `inputs` |
99+
| `get_task_overview` | 返回任务级统计与热点摘要 | `session_id` |
100+
| `get_node_timeline` | 返回节点时序事件 | `session_id`, `task_id`, `node_id` |
101101
| `get_next_list_history` | 返回 next_list 候选变化轨迹 | `session_id`, `task_id`, `node_id` |
102-
| `get_parent_chain` | 返回节点父子链路 | `session_id`, `task_id`, `node_id` |
103-
| `get_raw_lines` | 回捞原始日志行作为事实证据 | `session_id`, `task_id` |
102+
| `get_parent_chain` | 返回节点父子链路 | `session_id`, `task_id`, `node_id` |
103+
| `get_raw_lines` | 回捞原始日志行作为事实证据 | `session_id`, `task_id` |
104104

105105
---
106106

@@ -309,7 +309,15 @@ interface GetParentChainArgs {
309309
interface GetParentChainResult {
310310
chain: Array<{
311311
scope_id: string
312-
scope_kind: 'task' | 'pipeline_node' | 'recognition_node' | 'action_node' | 'next_list' | 'recognition' | 'action' | 'wait_freezes'
312+
scope_kind:
313+
| 'task'
314+
| 'pipeline_node'
315+
| 'recognition_node'
316+
| 'action_node'
317+
| 'next_list'
318+
| 'recognition'
319+
| 'action'
320+
| 'wait_freezes'
313321
task_id?: number
314322
node_id?: number
315323
name: string
@@ -388,17 +396,17 @@ interface Evidence {
388396

389397
## 7. 错误码
390398

391-
| code | 含义 | retryable | 调用方建议 |
392-
| --- | --- | --- | --- |
393-
| `INVALID_REQUEST` | 请求体格式或字段非法 | false | 修正参数后重试 |
394-
| `UNSUPPORTED_VERSION` | 不支持的 `api_version` | false | 切换到受支持版本 |
395-
| `SESSION_NOT_FOUND` | 会话不存在或已过期 | false | 重新调用 `parse_log_bundle` |
396-
| `TASK_NOT_FOUND` | `task_id` 不存在 | false | 校验任务选择 |
397-
| `NODE_NOT_FOUND` | `node_id` 不存在 | false | 校验节点选择 |
398-
| `SCOPE_NOT_FOUND` | `scope_id` 不存在或不属于该 `task_id/node_id` | false | 校验实例定位参数 |
399-
| `AMBIGUOUS_SCOPE_SELECTOR` | 仅凭当前定位条件命中多个节点实例 | false | 补充 `scope_id``occurrence_index` |
400-
| `DATA_NOT_READY` | 数据尚未就绪 | true | 指数退避重试 |
401-
| `INTERNAL_ERROR` | 内部处理错误 | true | 有限重试并记录日志 |
399+
| code | 含义 | retryable | 调用方建议 |
400+
| -------------------------- | --------------------------------------------- | --------- | ------------------------------------- |
401+
| `INVALID_REQUEST` | 请求体格式或字段非法 | false | 修正参数后重试 |
402+
| `UNSUPPORTED_VERSION` | 不支持的 `api_version` | false | 切换到受支持版本 |
403+
| `SESSION_NOT_FOUND` | 会话不存在或已过期 | false | 重新调用 `parse_log_bundle` |
404+
| `TASK_NOT_FOUND` | `task_id` 不存在 | false | 校验任务选择 |
405+
| `NODE_NOT_FOUND` | `node_id` 不存在 | false | 校验节点选择 |
406+
| `SCOPE_NOT_FOUND` | `scope_id` 不存在或不属于该 `task_id/node_id` | false | 校验实例定位参数 |
407+
| `AMBIGUOUS_SCOPE_SELECTOR` | 仅凭当前定位条件命中多个节点实例 | false | 补充 `scope_id``occurrence_index` |
408+
| `DATA_NOT_READY` | 数据尚未就绪 | true | 指数退避重试 |
409+
| `INTERNAL_ERROR` | 内部处理错误 | true | 有限重试并记录日志 |
402410

403411
---
404412

docs/TUTORIAL_PROTOCOL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ export const TOUR_STEPS: TourStep[] = [
106106
content: '先看这里,四个主视图都从这里切换。',
107107
target: '[data-tour="header-view-switch"]',
108108
view: 'analysis',
109-
action: 'none'
109+
action: 'none',
110110
},
111111
{
112112
id: 'step-analysis',
113113
title: '日志分析主区域',
114114
content: '这里是你最常用的分析工作区。',
115115
target: '[data-tour="analysis-main"]',
116116
view: 'analysis',
117-
action: 'selectFirstTask'
118-
}
117+
action: 'selectFirstTask',
118+
},
119119
]
120120
```
121121

index.html

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,55 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="zh-CN">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<!-- Favicon -->
7-
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
8-
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
9-
<link rel="icon" type="image/x-icon" href="/favicon.ico">
10-
<!-- 主题颜色(控制浏览器地址栏/状态栏颜色)-->
11-
<meta name="theme-color" content="#18181c" id="theme-color-meta">
12-
<title>MAA 日志分析器</title>
13-
<style>
14-
* {
15-
margin: 0;
16-
padding: 0;
17-
box-sizing: border-box;
18-
}
19-
html,
20-
body {
21-
width: 100%;
22-
height: 100%;
23-
}
24-
/* 初始主题由 VS Code 变量或应用主题控制 */
25-
body {
26-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
27-
background: var(--vscode-panel-background, #18181c);
28-
color: var(--vscode-foreground, rgba(255, 255, 255, 0.82));
29-
}
30-
#app {
31-
height: 100vh;
32-
overflow: hidden;
33-
}
34-
/* 启动占位,避免白/黑屏 */
35-
#app:empty {
36-
display: flex;
37-
align-items: center;
38-
justify-content: center;
39-
background: var(--vscode-panel-background, #18181c);
40-
color: var(--vscode-foreground, rgba(255, 255, 255, 0.62));
41-
font-size: 12px;
42-
letter-spacing: 0.4px;
43-
}
44-
#app:empty::before {
45-
content: "正在加载 MAA 日志分析器...";
46-
}
47-
</style>
48-
</head>
49-
<body>
50-
<div id="app"></div>
51-
<script type="module" src="/src/main.ts"></script>
52-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<!-- Favicon -->
7+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
8+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
9+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
10+
<!-- 主题颜色(控制浏览器地址栏/状态栏颜色)-->
11+
<meta name="theme-color" content="#18181c" id="theme-color-meta" />
12+
<title>MAA 日志分析器</title>
13+
<style>
14+
* {
15+
margin: 0;
16+
padding: 0;
17+
box-sizing: border-box;
18+
}
19+
html,
20+
body {
21+
width: 100%;
22+
height: 100%;
23+
}
24+
/* 初始主题由 VS Code 变量或应用主题控制 */
25+
body {
26+
font-family:
27+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
28+
sans-serif;
29+
background: var(--vscode-panel-background, #18181c);
30+
color: var(--vscode-foreground, rgba(255, 255, 255, 0.82));
31+
}
32+
#app {
33+
height: 100vh;
34+
overflow: hidden;
35+
}
36+
/* 启动占位,避免白/黑屏 */
37+
#app:empty {
38+
display: flex;
39+
align-items: center;
40+
justify-content: center;
41+
background: var(--vscode-panel-background, #18181c);
42+
color: var(--vscode-foreground, rgba(255, 255, 255, 0.62));
43+
font-size: 12px;
44+
letter-spacing: 0.4px;
45+
}
46+
#app:empty::before {
47+
content: '正在加载 MAA 日志分析器...';
48+
}
49+
</style>
50+
</head>
51+
<body>
52+
<div id="app"></div>
53+
<script type="module" src="/src/main.ts"></script>
54+
</body>
5355
</html>

0 commit comments

Comments
 (0)