@windsland52/maa-log-adapter 0.0.1

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/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @windsland52/maa-log-adapter
2
+
3
+ Repository-specific runtime adapter package for MaaLogAnalyzer.
4
+
5
+ ## Responsibility
6
+
7
+ - Bind `@windsland52/maa-log-runtime` adapter interface to current repository implementation
8
+ - Connect runtime parse flow to:
9
+ - `@windsland52/maa-log-parser`
10
+ - `@windsland52/maa-log-parser/node-statistics`
11
+
12
+ ## Exports
13
+
14
+ - `createMlaRuntimeAdapter()`
15
+ - `mlaRuntimeAdapter`
16
+
17
+ ## Notes
18
+
19
+ - This package is intentionally repository-coupled
20
+ - Keep generic runtime logic in `@windsland52/maa-log-runtime`
21
+ - Keep protocol/types in `@windsland52/maa-log-kernel`
@@ -0,0 +1,4 @@
1
+ import type { RuntimeExecutionAdapter } from '@windsland52/maa-log-runtime';
2
+ import type { TaskInfo as ParserTaskInfo } from '@windsland52/maa-log-parser/types';
3
+ export declare const createMlaRuntimeAdapter: () => RuntimeExecutionAdapter<ParserTaskInfo>;
4
+ export declare const mlaRuntimeAdapter: RuntimeExecutionAdapter<ParserTaskInfo>;
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ import { LogParser } from '@windsland52/maa-log-parser';
2
+ import { NodeStatisticsAnalyzer } from '@windsland52/maa-log-parser/node-statistics';
3
+ export const createMlaRuntimeAdapter = () => {
4
+ return {
5
+ async parse(input) {
6
+ const parser = new LogParser();
7
+ parser.setErrorImages(input.errorImages ?? new Map());
8
+ parser.setVisionImages(input.visionImages ?? new Map());
9
+ parser.setWaitFreezesImages(input.waitFreezesImages ?? new Map());
10
+ await parser.parseFile(input.content, undefined, input.parseOptions);
11
+ return {
12
+ tasks: parser.getTasksSnapshot(),
13
+ events: parser.getEventsSnapshot(),
14
+ };
15
+ },
16
+ buildStatistics(tasks) {
17
+ return {
18
+ nodes: NodeStatisticsAnalyzer.analyze(tasks),
19
+ recognitionActions: NodeStatisticsAnalyzer.analyzeRecognitionAction(tasks),
20
+ };
21
+ },
22
+ };
23
+ };
24
+ export const mlaRuntimeAdapter = createMlaRuntimeAdapter();
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@windsland52/maa-log-adapter",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "private": false,
6
+ "scripts": {
7
+ "typecheck": "tsc -p ./tsconfig.json",
8
+ "build": "pnpm run clean && tsc -p ./tsconfig.build.json && node ../../scripts/fix-esm-imports.mjs ./dist",
9
+ "clean": "node -e \"require('node:fs').rmSync('dist',{ recursive: true, force: true })\""
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "@windsland52/maa-log-kernel": "workspace:*",
19
+ "@windsland52/maa-log-parser": "workspace:*",
20
+ "@windsland52/maa-log-runtime": "workspace:*"
21
+ },
22
+ "engines": {
23
+ "node": ">=24.0.0"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md"
31
+ ]
32
+ }