This file is the working guide for AI coding assistants in this repository.
MaaLogAnalyzer currently contains three deliverables:
- Web app (Vue 3 + TypeScript + Vite)
- Tauri desktop app (
src-tauri) - VS Code extension (
src-vscode)
The core purpose is to parse MaaFramework logs (maa.log, maa.bak.log, zip logs) and visualize task/node execution flow.
src/: main web app sourcepackages/maa-log-parser/src/core/logParser.ts: log parsing core implementationsrc/utils/fileDialog.ts: cross-platform file/folder open logic (Web/Tauri)src/views/ProcessView.vue: task list + flow entry interactionssrc/views/FlowchartView.vue: flowchart renderingsrc-tauri/: desktop app (Rust + Tauri 2)src-tauri/capabilities/default.json: Tauri permissions and fs scopesrc-vscode/src/extension.ts: extension entry + commands + webview bridge.github/workflows/: CI/CD pipelines
pnpm install
pnpm dev
pnpm build
pnpm tauri:dev
pnpm tauri:buildVS Code extension:
pnpm build:vscode
cd src-vscode && npm run compile- User opens file/folder/zip
LogParser.parseFile()parses in chunks (non-blocking)- OnEventNotify events are extracted and deduplicated
- Protocol events are reduced into a trace tree
- Tasks are projected from trace via
getTasksSnapshot()orconsumeTasks() - UI-specific node flow / recognition views are derived from projected task data
- UI renders Process/Detail/Flow/Search views
LogLineEventNotificationTaskInfoNodeInfoRecognitionAttempt
See src/types.ts for canonical definitions.
Compatibility note:
src/types.tsis now a compatibility type facade.- Canonical parser-owned type definitions live in
packages/maa-log-parser/src/types.ts. LogParser#getTasksSnapshot()is non-consuming and should be used for realtime/incremental reads.LogParser#consumeTasks()is consuming and clears buffered parser state after projection, which fits one-shot file parsing flows.
- Keep parser performance-first (avoid expensive per-line allocations)
- Preserve string pooling behavior (
packages/maa-log-parser/src/stringPool.ts) - Keep Web/Tauri behavior aligned for file and folder loading
- Do not introduce platform-specific behavior unless explicitly required
- Prefer incremental fixes over broad refactors in parser/view sync code
- Dialog and filesystem access are gated by capability config.
- Keep
src-tauri/capabilities/default.jsonin sync with frontend fs usage. - If
plugin-fspath checks fail, verifyfs:scopeallow rules first. - Current app expects users to open arbitrary log paths, so scope must allow selected paths.
- Extension commands and sidebar items are defined in
src-vscode/package.json. - Runtime logic is in
src-vscode/src/extension.ts. - Use
package.nls.json+package.nls.zh-cn.jsonfor i18n labels. - Windows-only features (Explorer context menu install/uninstall) should be hidden on non-Windows.
- Context-menu scripts live in
src-vscode/scripts/windows/.
deploy.ymlnow supports both branch pushes andv*tag pushes.- Version calculation uses
git describe --tags --match "v*". - To avoid wrong version in CI, ensure tags are fetched (
fetch-depth: 0,fetch-tags: true). - If commit is pushed before tag, tag push should trigger a second run with the expected version.
- Task selection sync issues can happen between watchers (
selectedTaskvsinitialTask). - Flowchart index display must follow global task execution order, not local node order.
- In Tauri folder-open flow, selecting the
debugfolder directly must work (check current folder first, thendebugsubfolder, then recursive search). - For VS Code webview CSP, avoid dynamic chunk loading unless nonce/CSP policy is configured for it.
- Run the smallest relevant build/check command.
- Verify no accidental encoding corruption (especially Chinese text files).
- Review
git difffor unrelated edits. - Confirm platform-specific behavior on at least one realistic path (log file/folder/zip).
- Treat terminal-rendered
???as potentially display-only corruption; verify file content before editing further. - Prefer
apply_patchfor text edits, especially in files containing Chinese text. - If scripting is required, avoid passing large non-ASCII blocks through shell strings.
- For scripted writes, use UTF-8 without BOM and verify the exact changed block after write.
- Do not perform broad block replacements when a line-level edit is enough.
- After any non-ASCII edit, always run:
git diffon touched files- direct file snippet check around changed lines
- If Chinese text appears corrupted in diff, stop and repair encoding/content before continuing any other changes.