@weinibuliu/maa-debugger 0.0.0-nightly.4.1.b8fb7d2
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/LICENSE +21 -0
- package/README.md +92 -0
- package/index.js +61 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 MaaXYZ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# MaaDebugger
|
|
2
|
+
|
|
3
|
+
由 MaaXYZ 团队开发与维护的 MaaFramework 调试器,拥有现代的 WebUI 和即时的任务反馈。
|
|
4
|
+
|
|
5
|
+
Official desktop debugger for MaaFramework, featuring a web-based UI and real-time task inspection.
|
|
6
|
+
|
|
7
|
+
## 安装方式
|
|
8
|
+
|
|
9
|
+
### 使用 npm (Node.js)
|
|
10
|
+
|
|
11
|
+
MaaDebugger 以 `maa-debugger` 的名称发布于 [npm](https://www.npmjs.com) 。你可以使用 npm 或其他包管理器(如 pnpm)安装、管理与使用。这里仅介绍 npm 用法。
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 全局安装
|
|
15
|
+
npm i -g maa-debugger
|
|
16
|
+
maa-debugger
|
|
17
|
+
# 非全局安装
|
|
18
|
+
npx maa-debugger
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
MaaDebugger 支持命令行参数,你可以通过 `--help` / `-H` 命令来获取帮助。
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx maa-debugger --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 使用 pip (Python)
|
|
28
|
+
|
|
29
|
+
MaaDebugger
|
|
30
|
+
将以 `MaaDebugger` 的名称发布于 [PyPI](https://pypi.org/project/MaaDebugger) 。你可以使用 pip 或其他包管理器(如 uv)安装、管理与使用。
|
|
31
|
+
>[!WARNING]
|
|
32
|
+
在早期开发阶段,我们**不会**发布至 PyPI,请自行使用其他渠道。
|
|
33
|
+
|
|
34
|
+
### 自行下载
|
|
35
|
+
|
|
36
|
+
我们也提供了 [Github Release](https://github.com/MaaXYZ/MaaDebugger/releases) 下载渠道,下载解压后即可使用。
|
|
37
|
+
>[!WARNING]
|
|
38
|
+
在早期开发阶段,我们**不会**提供 Release,而是仅在 [Actions](https://github.com/MaaXYZ/MaaDebugger/actions/workflows/publish.yml) 上传产物,请自行前往下载。
|
|
39
|
+
|
|
40
|
+
## 开发模式
|
|
41
|
+
|
|
42
|
+
在开发阶段需要同时启动**后端**和**前端**两个终端:
|
|
43
|
+
|
|
44
|
+
### Terminal 1: 后端 (Go Service)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd server
|
|
48
|
+
air # 支持热重载
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Terminal 2: 前端 (Web)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd web
|
|
55
|
+
pnpm i # 首次需要安装依赖
|
|
56
|
+
pnpm dev # 启动前端 (http://localhost:5173)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
然后打开浏览器访问 **<http://localhost:5173>** 即可。
|
|
60
|
+
|
|
61
|
+
前端会自动将 `/api` 和 `/ws` 请求代理到后端 `http://127.0.0.1:8011`。
|
|
62
|
+
|
|
63
|
+
## 生产构建
|
|
64
|
+
|
|
65
|
+
一键构建前端并嵌入到 Go 二进制文件中,最终产物为单个可执行文件:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node build.mjs # 构建当前平台
|
|
69
|
+
node build.mjs --os linux # 交叉编译 Linux
|
|
70
|
+
node build.mjs --os windows # 交叉编译 Windows
|
|
71
|
+
node build.mjs --os darwin # 交叉编译 macOS
|
|
72
|
+
node build.mjs --skip-frontend # 跳过前端构建(仅编译 Go)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
构建完成后,启动 `./MaaDebugger`(Windows 下为 `MaaDebugger.exe`),程序会自动选择可用端口(默认从 8011 开始)并打开浏览器。
|
|
76
|
+
|
|
77
|
+
> [!NOTE]
|
|
78
|
+
> 需要注意的是 `MaaDebugger` 将寻找 `./bin` 下的 MaaFramework 动态库。
|
|
79
|
+
|
|
80
|
+
## 环境变量
|
|
81
|
+
|
|
82
|
+
TODO
|
|
83
|
+
|
|
84
|
+
## 技术栈
|
|
85
|
+
|
|
86
|
+
| 层 | 技术 |
|
|
87
|
+
|----|------|
|
|
88
|
+
| 前端 | Vue 3 + Nuxt UI 4 + Pinia + Vite 7 + TypeScript |
|
|
89
|
+
| 后端 | Go + net/http + gorilla/websocket + zerolog |
|
|
90
|
+
| MaaFW | maa-framework-go (CGO binding) |
|
|
91
|
+
| 通信 | REST API + WebSocket |
|
|
92
|
+
| 嵌入 | Go `embed` (前端编译产物嵌入到 Go 二进制) |
|
package/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("node:child_process");
|
|
4
|
+
const { existsSync } = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const platformPackageName = `@weinibuliu/maa-debugger-${process.platform}-${process.arch}`;
|
|
8
|
+
|
|
9
|
+
let platformPackageRoot;
|
|
10
|
+
try {
|
|
11
|
+
platformPackageRoot = path.dirname(
|
|
12
|
+
require.resolve(`${platformPackageName}/package.json`),
|
|
13
|
+
);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error(
|
|
16
|
+
`[maa-debugger] Missing platform package: ${platformPackageName}`,
|
|
17
|
+
);
|
|
18
|
+
console.error(
|
|
19
|
+
`[maa-debugger] Reinstall the package on ${process.platform}-${process.arch} or choose a supported platform.`,
|
|
20
|
+
);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const isWindows = process.platform === "win32";
|
|
25
|
+
const executableName = `MaaDebugger${isWindows ? ".exe" : ""}`;
|
|
26
|
+
const exePath = path.join(platformPackageRoot, executableName);
|
|
27
|
+
if (!existsSync(exePath)) {
|
|
28
|
+
console.error(`[maa-debugger] Missing executable: ${exePath}`);
|
|
29
|
+
console.error(
|
|
30
|
+
`[maa-debugger] Expected binary name for current platform: ${executableName}`,
|
|
31
|
+
);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const nodePath = path.resolve(require.resolve("@maaxyz/maa-node"), "../../../");
|
|
36
|
+
const channelPath = path.join(
|
|
37
|
+
nodePath,
|
|
38
|
+
`maa-node-${process.platform}-${process.arch}`,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const child = spawn(exePath, process.argv.slice(2), {
|
|
42
|
+
stdio: "inherit",
|
|
43
|
+
env: {
|
|
44
|
+
...process.env,
|
|
45
|
+
MAADBG_CHANNEL: "npm",
|
|
46
|
+
MAADBG_CHANNEL_PATH: channelPath,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on("exit", (code, signal) => {
|
|
51
|
+
if (signal) {
|
|
52
|
+
process.kill(process.pid, signal);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
process.exit(code ?? 0);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
child.on("error", (err) => {
|
|
59
|
+
console.error(`[maa-debugger] Failed to start ${executableName}:`, err);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@weinibuliu/maa-debugger",
|
|
3
|
+
"version": "0.0.0-nightly.4.1.b8fb7d2",
|
|
4
|
+
"description": "Official desktop debugger for MaaFramework, with integrated web UI and real-time task inspection.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"maa-debugger": "./index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"index.js",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@maaxyz/maa-node": "5.8.0-beta.1"
|
|
18
|
+
},
|
|
19
|
+
"optionalDependencies": {
|
|
20
|
+
"@weinibuliu/maa-debugger-win32-x64": "0.0.0-nightly.4.1.b8fb7d2",
|
|
21
|
+
"@weinibuliu/maa-debugger-win32-arm64": "0.0.0-nightly.4.1.b8fb7d2",
|
|
22
|
+
"@weinibuliu/maa-debugger-linux-x64": "0.0.0-nightly.4.1.b8fb7d2",
|
|
23
|
+
"@weinibuliu/maa-debugger-linux-arm64": "0.0.0-nightly.4.1.b8fb7d2",
|
|
24
|
+
"@weinibuliu/maa-debugger-darwin-x64": "0.0.0-nightly.4.1.b8fb7d2",
|
|
25
|
+
"@weinibuliu/maa-debugger-darwin-arm64": "0.0.0-nightly.4.1.b8fb7d2"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "github",
|
|
29
|
+
"url": "git+https://github.com/MaaXYZ/MaaDebugger.git"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"provenance": true,
|
|
34
|
+
"tag": "nightly"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"maaframework",
|
|
38
|
+
"maa",
|
|
39
|
+
"debugger",
|
|
40
|
+
"automation",
|
|
41
|
+
"desktop"
|
|
42
|
+
],
|
|
43
|
+
"author": "MaaXYZ",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/MaaXYZ/MaaDebugger/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/MaaXYZ/MaaDebugger"
|
|
49
|
+
}
|