@yorha2b-lab/autodev 5.7.3 → 6.0.0
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/CONTRIBUTING.md +2 -2
- package/README.md +87 -80
- package/README_EN.md +93 -89
- package/bin/{autodev.js → bunker.js} +10 -10
- package/package.json +26 -23
- package/src/{bootstrap → awakening}/index.js +9 -10
- package/src/dialogs/DE-DE.js +1 -1
- package/src/dialogs/EN-US.js +1 -1
- package/src/dialogs/ES-ES.js +1 -1
- package/src/dialogs/FR-FR.js +1 -1
- package/src/dialogs/ID-ID.js +1 -1
- package/src/dialogs/IT-IT.js +1 -1
- package/src/dialogs/JA-JP.js +1 -1
- package/src/dialogs/KO-KR.js +1 -1
- package/src/dialogs/PT-BR.js +1 -1
- package/src/dialogs/RU-RU.js +1 -1
- package/src/dialogs/TR-TR.js +1 -1
- package/src/dialogs/ZH-CN.js +1 -1
- package/src/dialogs/ZH-TW.js +1 -1
- package/src/framework/react/components/MyBaseForm.js +1 -1
- package/src/framework/react/components/MyModalForm.js +14 -2
- package/src/framework/react/generator/index.js +4 -4
- package/src/{ai/openai.js → gateway/client.js} +2 -2
- package/src/{ai → gateway}/index.js +5 -35
- package/src/gateway/protocol.js +36 -0
- package/src/{core/engine.js → headquarters/builder.js} +3 -3
- package/src/{core/queue.js → headquarters/dispatcher.js} +1 -1
- package/src/{core/deployment.js → headquarters/engineer.js} +4 -4
- package/src/headquarters/observer.js +36 -0
- package/src/labs/council.js +4 -4
- package/src/labs/index.js +1 -1
- package/src/labs/tower.js +4 -9
- package/src/{utils → logistics}/foundation.js +3 -3
- package/src/{utils → logistics}/ux.js +3 -2
- package/src/{handlers → units}/page.js +10 -7
- package/src/{handlers → units}/part.js +3 -3
- package/src/{handlers → units}/response.js +5 -5
- package/src/commands/watch.js +0 -38
- /package/src/{utils/installer.js → headquarters/quartermaster.js} +0 -0
- /package/src/{core → headquarters}/recruiter.js +0 -0
- /package/src/{utils → logistics}/generator.js +0 -0
- /package/src/{utils → logistics}/semantic.js +0 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -60,8 +60,8 @@ Contributors retain copyright in their original contributions; this does not con
|
|
|
60
60
|
|
|
61
61
|
1. 克隆仓库
|
|
62
62
|
```bash
|
|
63
|
-
git clone https://github.com/yorha2b-lab/
|
|
64
|
-
cd
|
|
63
|
+
git clone https://github.com/yorha2b-lab/autodev.git
|
|
64
|
+
cd autodev
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
2. 安装依赖
|
package/README.md
CHANGED
|
@@ -1,48 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AutoDev (YoRHa Bunker Engine v6.0)
|
|
2
2
|
|
|
3
3
|
[English](./README_EN.md) | 简体中文
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
[](https://www.npmjs.com/package/@yorha2b-lab/autodev)
|
|
9
8
|
[](https://www.npmjs.com/package/@yorha2b-lab/autodev)
|
|
10
|
-
[](https://github.com/yorha2b-lab/
|
|
12
|
-
](https://github.com/yorha2b-lab/autodev/stargazers)
|
|
10
|
+
[](https://github.com/yorha2b-lab/autodev/blob/main/LICENSE)
|
|
11
|
+

|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
基于 AI 视觉与语义协议的前端(React + Ant Design)代码构筑与旧系统重构引擎 🚀
|
|
15
14
|
|
|
16
15
|

|
|
17
16
|
|
|
18
|
-
##
|
|
19
|
-
在 2.0 时代,我们放弃了繁琐的分散指令,全面进化为 “全频道集成指挥中心”
|
|
20
|
-
- 全频道联动:不再需要开启多个进程。一个 watch 指令,同时监听 页面、组件、API 三大传感器。
|
|
21
|
-
- 语义化骇入:不仅仅是复刻 UI,通过 9S 专用语义桥接协议,自动抹平前后端字段差异。
|
|
22
|
-
- 工程级质量:生成的代码不是“演示用”,而是带 useTableQuery、EditableCell、OSS上传 等实战逻辑的高质量代码。
|
|
23
|
-
|
|
24
|
-
## 🛡️ 开源协议升级公告
|
|
25
|
-
|
|
26
|
-
> **[重要] 自 v2.1.0 起,本项目由 MIT 协议正式升级为 AGPL-3.0 协议。**
|
|
27
|
-
|
|
28
|
-
**💡 为什么要调整协议?**
|
|
29
|
-
随着“地堡”系统的影响力扩大,我们希望确保本项目的核心技术能够始终保持开放与透明。采用 **AGPL-3.0** 旨在鼓励开发者在改进本工具的同时,能将这些优化回馈给社区,共同构建一个可持续进化的“前端自动化构筑”生态。
|
|
30
|
-
|
|
31
|
-
**✅ 开发者友好声明 (重要):**
|
|
32
|
-
我们深知开发者在实际业务场景中的合规需求。为了让地堡工具在商业环境中更安全、顺畅地运行,特此声明:
|
|
33
|
-
1. **源码约束**:AGPL-3.0 仅约束 **AutoDev 工具自身的源代码**。
|
|
34
|
-
2. **产出物豁免**:使用本工具生成的所有代码、Mock数据及配置文件被视为 **独立** 作品,不具备 AGPL 的传染性特征。
|
|
35
|
-
3. **商业兼容**:您可以在商业项目、企业环境中使用本工具,且 **无需** 因此开源您的业务逻辑代码。
|
|
17
|
+
## 🌟 v6.0 地堡架构升级
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
在 v6.0 时代,AutoDev 全面升级为模块化地堡架构,以 Headquarters 为核心,通过独立单位完成监听、调度、构筑与外部通信。
|
|
20
|
+
- 🕵️ **旧系统侦察 (Scout)**:Puppeteer 无头侦察兵,在旧项目网页上**【单击右键】**即可秒级捕获快照并自动重构!
|
|
21
|
+
- 🗼 **现网防御塔 (Tower)**:搭建 42153 战术代理端口,代理真实 XHR/Fetch 流量,自动将现网数据反向填装入 `resource.js`。
|
|
22
|
+
- 🏛️ **议会自动通电 (Council)**:自动对接 OpenAPI/Swagger 文档,自动提炼枚举信息,并更新 `BUNKER_API_ANCHOR` 语义锚点。
|
|
38
23
|
|
|
39
24
|
## ✨ 特性
|
|
40
25
|
|
|
41
|
-
- 🖼️
|
|
42
|
-
- 🧩
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
26
|
+
- 🖼️ **全页构筑 (Page)**: 截图丢入 `./bunker/screenShot`,Pod 042 自动生成带 Table/Form/Tabs 的完整 CRUD 页面并追加菜单。
|
|
27
|
+
- 🧩 **碎片提取 (Part)**: 局部截图丢入 `./bunker/screenPart`,终端瞬间弹出“即插即用”的 UI 配置代码块。
|
|
28
|
+
- 🕵️ **右键考古 (Scout)**: Puppeteer 无头浏览器巡检,网页任意处点击【鼠标右键】即可秒级一键捕获页面重构。
|
|
29
|
+
- 🔌 **语义对齐 (API)**: 接口 JSON 丢入 `./bunker/response`,自动发现并修正前后端字段语义差异,减少手工对齐工作。
|
|
30
|
+
- 🔧 **智能装配**: 自动补全 import 语句、日期格式转换、金额千分位、枚举字典以及 OSS 上传等实战逻辑。
|
|
46
31
|
|
|
47
32
|
## 🚀 快速开始
|
|
48
33
|
|
|
@@ -52,18 +37,19 @@
|
|
|
52
37
|
npm install -g @yorha2b-lab/autodev
|
|
53
38
|
```
|
|
54
39
|
|
|
55
|
-
###
|
|
40
|
+
### 环境配置与初始化
|
|
41
|
+
|
|
42
|
+
在您的目标项目根目录下执行:
|
|
56
43
|
|
|
57
44
|
```bash
|
|
58
|
-
|
|
45
|
+
bunker init
|
|
59
46
|
```
|
|
60
47
|
|
|
61
|
-
>
|
|
48
|
+
> **💡 零配置演示模式 (Demo Mode)**
|
|
62
49
|
> 项目默认开启 Demo 模式:
|
|
63
|
-
> 1.
|
|
64
|
-
> 2. 向
|
|
65
|
-
> 3.
|
|
66
|
-
> *注:若想识别真实截图,请在 `config.js` 中将 `useDemo` 设为 `false` 并配置下方环境变量。*
|
|
50
|
+
> 1. 无需配置 API_KEY,直接运行 `bunker boot`。
|
|
51
|
+
> 2. 向 `./bunker/screenShot` 目录丢入任意图片(系统自动空投标准 `example.json` 构筑包)。
|
|
52
|
+
> 3. 若想识别真实代码/截图,请在 `bunker/config.js` 中将 `useDemo` 设为 `false` 并配置 `.env`。
|
|
67
53
|
|
|
68
54
|
创建 `.env` 文件并配置以下环境变量:
|
|
69
55
|
|
|
@@ -75,63 +61,85 @@ BASE_URL=your_api_base_url_here
|
|
|
75
61
|
|
|
76
62
|
🚗 **获取API Key直通车**: [阿里云百炼控制台](https://bailian.console.aliyun.com/cn-beijing?tab=doc#/doc/)
|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
## 📖 指挥中心操作指南 (v6.0 工作流)
|
|
65
|
+
|
|
66
|
+
启动主监控网络:
|
|
80
67
|
|
|
81
68
|
```bash
|
|
82
|
-
|
|
69
|
+
bunker boot
|
|
83
70
|
```
|
|
84
|
-
启动后,地堡系统将进入 全频道联动监听状态:
|
|
85
71
|
|
|
86
|
-
|
|
72
|
+
启动后,地堡系统将进入全频道联动监听状态:
|
|
73
|
+
|
|
74
|
+
| 战术操作 | 传感器/动作 | 构筑效果 |
|
|
87
75
|
| :--- | :--- | :--- |
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
76
|
+
| **全页构筑** | `./bunker/screenShot` | 自动生成 `index.js`、`resource.js` 并追加同步 `menus.js` |
|
|
77
|
+
| **碎片提取** | `./bunker/screenPart` | 终端实时弹出紫色代码框,即拷即用 |
|
|
78
|
+
| **右键考古** | 浏览器【鼠标右键】 | 触发 `scout.js` 侦察兵,一键捕获当前页面降维重构 |
|
|
79
|
+
| **接口 JSON** | `./bunker/response` | 自动执行语义对齐,修正 `resource.js` 中的字段名 |
|
|
91
80
|
|
|
92
|
-
## 📁
|
|
81
|
+
## 📁 地堡结构说明
|
|
93
82
|
|
|
94
|
-
```
|
|
83
|
+
```text
|
|
95
84
|
your-project/
|
|
96
|
-
├──
|
|
97
|
-
├──
|
|
98
|
-
├──
|
|
99
|
-
├──
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
└──
|
|
85
|
+
├── bunker/ # 地堡传感器与配置
|
|
86
|
+
│ ├── config.js # 地堡配置文件
|
|
87
|
+
│ ├── screenShot/ # 全页截图接收站
|
|
88
|
+
│ ├── screenPart/ # 碎片截图接收站
|
|
89
|
+
│ └── response/ # 响应对齐接收站
|
|
90
|
+
├── mock/ # 自动伪造的 Mock 数据
|
|
91
|
+
└── src/
|
|
92
|
+
├── pages/ # 自动构建的前端页面代码
|
|
93
|
+
└── utils/
|
|
94
|
+
└── menus.js # 自动同步的动态菜单配置
|
|
105
95
|
```
|
|
106
96
|
|
|
107
97
|
## ⚙️ 配置
|
|
108
98
|
|
|
109
|
-
在 `config.js` 中可以配置以下选项:
|
|
99
|
+
在 `bunker/config.js` 中可以配置以下选项:
|
|
110
100
|
|
|
111
101
|
```javascript
|
|
112
102
|
module.exports = {
|
|
113
|
-
//
|
|
103
|
+
// 是否开启 Demo 演示模式
|
|
114
104
|
useDemo: true,
|
|
115
|
-
//
|
|
105
|
+
// 是否自动伪造生成 Mock 数据
|
|
116
106
|
needMock: false,
|
|
117
|
-
|
|
118
|
-
|
|
107
|
+
|
|
108
|
+
// 地堡黑科技开关:
|
|
109
|
+
// 是否开启 42153 战术代理塔 (现网流量劫持与对齐)
|
|
110
|
+
enableAutoAlignment: false,
|
|
111
|
+
// 是否开启 GitHub 克隆数彩蛋
|
|
112
|
+
fetchClone: true,
|
|
113
|
+
|
|
114
|
+
// AI 模型配置
|
|
119
115
|
textModel: 'qwen-turbo',
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
visionModel: 'qwen3.7-plus',
|
|
117
|
+
|
|
118
|
+
// 🕸️ 遗迹与对齐配置 (考古与代理)
|
|
119
|
+
// 1. 旧项目运行 URL (配置后自动启动 Scout 右键考古侦察兵)
|
|
120
|
+
remains: 'http://localhost:8000',
|
|
121
|
+
// 2. 公司 Swagger / OpenAPI JSON 文档地址
|
|
122
|
+
apiDoc: 'http://api.company.com/v2/api-docs',
|
|
123
|
+
// 3. 真实后端代理目标地址 (Tower 转发目标)
|
|
124
|
+
proxyTarget: 'http://backend.company.com',
|
|
125
|
+
// 4. 后端接口成功断言表达式
|
|
126
|
+
responseSuccess: `response?.code === 200`,
|
|
127
|
+
|
|
128
|
+
// 前端源码构建目录路径
|
|
126
129
|
pagesDir: 'src/pages',
|
|
127
|
-
utilsDir: 'src/utils',
|
|
128
130
|
componentsDir: 'src/components',
|
|
131
|
+
hooksDir: 'src/hooks',
|
|
132
|
+
utilsDir: 'src/utils',
|
|
133
|
+
|
|
134
|
+
// 自定义 Handlebars 模板目录 (留空使用内置模版)
|
|
135
|
+
hbsDir: '',
|
|
129
136
|
}
|
|
130
137
|
```
|
|
131
138
|
|
|
132
|
-
## 🤝
|
|
139
|
+
## 🤝 贡献与 CLA
|
|
133
140
|
|
|
134
|
-
欢迎贡献代码!请阅读 [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
141
|
+
欢迎贡献代码!请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 了解参与流程。
|
|
142
|
+
所有 Pull Request 在合并前需要自动化签署 [CLA 贡献者协议](CLA.md)。
|
|
135
143
|
|
|
136
144
|
## 📄 许可证
|
|
137
145
|
|
|
@@ -142,29 +150,28 @@ module.exports = {
|
|
|
142
150
|
感谢以下开源项目为地堡提供核心动力:
|
|
143
151
|
- [OpenAI](https://openai.com/) / [Alibaba Qwen](https://tongyi.aliyun.com/) - 强大的 AI 视觉与语言能力
|
|
144
152
|
- [Ant Design](https://ant.design/) - 优秀的企业级 UI 组件库
|
|
145
|
-
- [Handlebars](https://handlebarsjs.com/) / [Chokidar](https://github.com/paulmillr/chokidar) -
|
|
153
|
+
- [Handlebars](https://handlebarsjs.com/) / [Chokidar](https://github.com/paulmillr/chokidar) / [Puppeteer](https://pptr.dev/) - 稳定的构筑与侦察引擎
|
|
146
154
|
|
|
147
155
|
## 📞 联系方式
|
|
148
156
|
|
|
149
|
-
如有问题或建议,欢迎提交 [Issue](https://github.com/yorha2b-lab/
|
|
157
|
+
如有问题或建议,欢迎提交 [Issue](https://github.com/yorha2b-lab/autodev/issues)。
|
|
150
158
|
|
|
151
159
|
## 🛠️ 常见问题 (FAQ)
|
|
160
|
+
|
|
152
161
|
Q: 这个工具收费吗?
|
|
153
|
-
A: 工具本身开源免费,但调用的 AI 模型(如
|
|
162
|
+
A: 工具本身开源免费,但调用的 AI 模型(如 Qwen-VL, GPT-4v)需要配置 API Key。建议使用阿里云通义千问等高性价比模型。
|
|
154
163
|
|
|
155
164
|
Q: 如何自定义生成的代码风格?
|
|
156
|
-
A:
|
|
165
|
+
A: 您可以配置 `hbsDir` 指向您自己的 Handlebars 模板目录,打造专属的团队代码构建规范。
|
|
157
166
|
|
|
158
|
-
|
|
167
|
+
---
|
|
159
168
|
|
|
160
169
|
## ⚖️ Disclaimer
|
|
161
170
|
|
|
162
|
-
|
|
171
|
+
AutoDev is a **fan-made, non-commercial, open-source tool**.
|
|
163
172
|
|
|
164
|
-
- The themes, names (YoRHa, 2B, etc.), and catchphrases included in this project are inspired by **NieR:Automata**, which is a trademark and copyright of **Square Enix Co., Ltd. / PlatinumGames Inc.**
|
|
173
|
+
- The themes, names (YoRHa, 2B, 9S, Pod042, etc.), and catchphrases included in this project are inspired by **NieR:Automata**, which is a trademark and copyright of **Square Enix Co., Ltd. / PlatinumGames Inc.**
|
|
165
174
|
- This project is not affiliated with, endorsed by, or representative of Square Enix in any way.
|
|
166
175
|
- Please support the original masterpiece: [NieR:Automata Official Site](https://nierautomata.square-enix-games.com/).
|
|
167
176
|
|
|
168
|
-
**Glory to Mankind.**
|
|
169
|
-
|
|
170
|
-
⭐ 如果这个项目对你有帮助,请给个Star支持一下!
|
|
177
|
+
**Glory to Mankind.** 🤖⚔️
|
package/README_EN.md
CHANGED
|
@@ -1,48 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AutoDev (YoRHa Bunker Engine v6.0)
|
|
2
2
|
|
|
3
|
-
[简体中文](./README.md)
|
|
3
|
+
English | [简体中文](./README.md)
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
[](https://www.npmjs.com/package/@yorha2b-lab/autodev)
|
|
9
8
|
[](https://www.npmjs.com/package/@yorha2b-lab/autodev)
|
|
10
|
-
[](https://github.com/yorha2b-lab/
|
|
12
|
-
](https://github.com/yorha2b-lab/autodev/stargazers)
|
|
10
|
+
[](https://github.com/yorha2b-lab/autodev/blob/main/LICENSE)
|
|
11
|
+

|
|
13
12
|
|
|
14
|
-
Vision-based
|
|
13
|
+
AI Vision and Semantic Protocol-based Frontend (React + Ant Design) Code Construction and Legacy System Refactoring Engine 🚀
|
|
15
14
|
|
|
16
15
|

|
|
17
16
|
|
|
18
|
-
##
|
|
19
|
-
In the 2.0 era, we abandoned cumbersome scattered instructions and fully evolved into a "Full-Channel Integrated Command Center"
|
|
20
|
-
- Full-Channel Linkage: No need to open multiple processes. One watch command listens to Page, Component, and API sensors simultaneously.
|
|
21
|
-
- Semantic Hacking: Not just replicating UI, but automatically smoothing out frontend-backend field differences through the 9S dedicated semantic bridge protocol.
|
|
22
|
-
- Engineering-Grade Quality: Generated code is not "demo-grade" but high-quality code with useTableQuery, EditableCell, OSS upload, and other practical logic.
|
|
23
|
-
|
|
24
|
-
## 🛡️ Open Source License Upgrade
|
|
25
|
-
|
|
26
|
-
**[IMPORTANT] Since v2.1.0, this project has been officially upgraded from MIT to the AGPL-3.0 License.**
|
|
27
|
-
|
|
28
|
-
**💡 Why the change?**
|
|
29
|
-
As the "Bunker" system continues to evolve, we aim to ensure the core technology remains open and transparent for everyone. Adopting **AGPL-3.0** encourages the community to contribute improvements back, fostering a sustainable ecosystem for frontend automation.
|
|
30
|
-
|
|
31
|
-
**✅ Developer-Friendly Clause (Crucial):**
|
|
32
|
-
We value the contribution of developers in corporate environments. To ensure a smooth and safe operational experience:
|
|
33
|
-
1. **Scope**: The AGPL-3.0 license applies strictly to the **AutoDev source code itself**.
|
|
34
|
-
2. **Output Exemption**: All generated code, mock data, and configurations produced by this tool are legally considered **separate** works and are NOT affected by the copyleft (infectious) nature of the AGPL.
|
|
35
|
-
3. **Commercial Usage**: You are permitted to use this CLI in commercial/corporate environments. Your business logic remains **Private** and is NOT affected by the AGPL's nature.
|
|
17
|
+
## 🌟 v6.0 Bunker Architecture Upgrade
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
In the v6.0 era, AutoDev has fully upgraded to a modular Bunker architecture. Centered around Headquarters, it accomplishes monitoring, dispatching, construction, and external communication through independent units.
|
|
20
|
+
- 🕵️ **Legacy System Recon (Scout)**: Puppeteer headless scout unit. Simply **[Right-Click]** anywhere on legacy web pages to capture instant snapshots and auto-refactor!
|
|
21
|
+
- 🗼 **Live Proxy Tower (Tower)**: Tactical proxy server on port 42153. Proxies live XHR/Fetch traffic and automatically hot-loads real production data into `resource.js`.
|
|
22
|
+
- 🏛️ **OpenAPI Council (Council)**: Auto-connects Swagger/OpenAPI docs, automatically extracts enum information, and updates `BUNKER_API_ANCHOR` semantic anchors.
|
|
38
23
|
|
|
39
24
|
## ✨ Features
|
|
40
25
|
|
|
41
|
-
- 🖼️ **
|
|
42
|
-
- 🧩 **Fragment Extraction (Part)**: Drop partial
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
26
|
+
- 🖼️ **Full-Page Construction (Page)**: Drop a screenshot into `./bunker/screenShot`, and Pod 042 auto-generates complete CRUD pages with Table/Form/Tabs and appends menus.
|
|
27
|
+
- 🧩 **Fragment Extraction (Part)**: Drop a partial screenshot into `./bunker/screenPart`, and the terminal instantly outputs plug-and-play UI config code blocks.
|
|
28
|
+
- 🕵️ **Right-Click Archeology (Scout)**: Puppeteer headless browser inspection. Right-click anywhere in the browser to capture and refactor pages in seconds.
|
|
29
|
+
- 🔌 **Semantic Alignment (API)**: Drop an API JSON into `./bunker/response` to automatically discover and fix frontend/backend field semantic differences, reducing manual alignment work.
|
|
30
|
+
- 🔧 **Smart Assembly**: Auto-completes import statements, date format conversions, currency separators, enum dictionaries, and OSS upload logic.
|
|
46
31
|
|
|
47
32
|
## 🚀 Quick Start
|
|
48
33
|
|
|
@@ -52,20 +37,21 @@ We value the contribution of developers in corporate environments. To ensure a s
|
|
|
52
37
|
npm install -g @yorha2b-lab/autodev
|
|
53
38
|
```
|
|
54
39
|
|
|
55
|
-
### Environment Configuration
|
|
40
|
+
### Environment Configuration & Initialization
|
|
41
|
+
|
|
42
|
+
Run the following in your target project root directory:
|
|
56
43
|
|
|
57
44
|
```bash
|
|
58
|
-
|
|
45
|
+
bunker init
|
|
59
46
|
```
|
|
60
47
|
|
|
61
|
-
>
|
|
62
|
-
>
|
|
63
|
-
> 1.
|
|
64
|
-
> 2. Drop any image into
|
|
65
|
-
> 3.
|
|
66
|
-
> *Note: To recognize real screenshots, please set `useDemo` to `false` in `config.js` and configure the environment variables below.*
|
|
48
|
+
> **💡 Zero-Config Demo Mode**
|
|
49
|
+
> Demo mode is enabled by default:
|
|
50
|
+
> 1. No `API_KEY` required, run `bunker boot` directly.
|
|
51
|
+
> 2. Drop any image into `./bunker/screenShot` (system ignores image content and drops standard `example.json` construction package).
|
|
52
|
+
> 3. To recognize real screenshots, set `useDemo: false` in `bunker/config.js` and configure `.env`.
|
|
67
53
|
|
|
68
|
-
Create a `.env` file and configure
|
|
54
|
+
Create a `.env` file and configure environment variables:
|
|
69
55
|
|
|
70
56
|
```bash
|
|
71
57
|
# AI Model API Configuration
|
|
@@ -73,101 +59,119 @@ API_KEY=your_api_key_here
|
|
|
73
59
|
BASE_URL=your_api_base_url_here
|
|
74
60
|
```
|
|
75
61
|
|
|
76
|
-
🚗 **
|
|
62
|
+
🚗 **Get API Key**: [Alibaba Cloud Bailian Console](https://bailian.console.aliyun.com/)
|
|
63
|
+
|
|
64
|
+
## 📖 Command Center Operations Guide (v6.0 Workflow)
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
Entering the 2.0 era, you only need to remember one command:
|
|
66
|
+
Start the main monitoring network:
|
|
80
67
|
|
|
81
68
|
```bash
|
|
82
|
-
|
|
69
|
+
bunker boot
|
|
83
70
|
```
|
|
84
71
|
|
|
85
|
-
|
|
72
|
+
Upon launch, the Bunker system enters all-channel monitoring mode:
|
|
86
73
|
|
|
87
|
-
| Action | Target
|
|
74
|
+
| Tactical Action | Sensor / Target | Construction Output |
|
|
88
75
|
| :--- | :--- | :--- |
|
|
89
|
-
| **Full Page
|
|
90
|
-
| **
|
|
91
|
-
| **
|
|
76
|
+
| **Full Page** | `./bunker/screenShot` | Auto-generates `index.js`, `resource.js`, and syncs `menus.js` |
|
|
77
|
+
| **Fragment** | `./bunker/screenPart` | Terminal outputs copy-pasteable UI code snippets in real-time |
|
|
78
|
+
| **Archeology** | Browser [Right-Click] | Triggers `scout.js` unit to capture and refactor current page |
|
|
79
|
+
| **API Alignment** | `./bunker/response` | Auto-aligns semantics and fixes field names in `resource.js` |
|
|
92
80
|
|
|
93
|
-
## 📁
|
|
81
|
+
## 📁 Bunker Architecture Overview
|
|
94
82
|
|
|
95
|
-
```
|
|
83
|
+
```text
|
|
96
84
|
your-project/
|
|
97
|
-
├──
|
|
98
|
-
├──
|
|
99
|
-
├──
|
|
100
|
-
├──
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
└──
|
|
85
|
+
├── bunker/ # Bunker sensors and configuration
|
|
86
|
+
│ ├── config.js # Bunker configuration file
|
|
87
|
+
│ ├── screenShot/ # Full-page screenshot receiver
|
|
88
|
+
│ ├── screenPart/ # UI fragment receiver
|
|
89
|
+
│ └── response/ # Response alignment receiver
|
|
90
|
+
├── mock/ # Auto-generated Mock data
|
|
91
|
+
└── src/
|
|
92
|
+
├── pages/ # Auto-built frontend page code
|
|
93
|
+
└── utils/
|
|
94
|
+
└── menus.js # Auto-synced dynamic menu configuration
|
|
106
95
|
```
|
|
107
96
|
|
|
108
97
|
## ⚙️ Configuration
|
|
109
98
|
|
|
110
|
-
|
|
99
|
+
Set the following options in `bunker/config.js`:
|
|
111
100
|
|
|
112
101
|
```javascript
|
|
113
102
|
module.exports = {
|
|
114
|
-
//
|
|
103
|
+
// Enable demo mode
|
|
115
104
|
useDemo: true,
|
|
116
|
-
//
|
|
105
|
+
// Enable Mock data generation
|
|
117
106
|
needMock: false,
|
|
118
|
-
|
|
119
|
-
|
|
107
|
+
|
|
108
|
+
// Bunker Black-Tech Toggles:
|
|
109
|
+
// Enable 42153 Tactical Proxy Tower (Live traffic interception & alignment)
|
|
110
|
+
enableAutoAlignment: false,
|
|
111
|
+
// Enable GitHub clone counter easter egg
|
|
112
|
+
fetchClone: true,
|
|
113
|
+
|
|
114
|
+
// AI Model Configuration
|
|
120
115
|
textModel: 'qwen-turbo',
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
visionModel: 'qwen3.7-plus',
|
|
117
|
+
|
|
118
|
+
// 🕸️ Archeology & Alignment Configuration
|
|
119
|
+
// 1. Legacy project URL (auto-launches Scout right-click archeology unit)
|
|
120
|
+
remains: 'http://localhost:8000',
|
|
121
|
+
// 2. Company Swagger / OpenAPI JSON URL
|
|
122
|
+
apiDoc: 'http://api.company.com/v2/api-docs',
|
|
123
|
+
// 3. Backend proxy target URL (Tower forwarding target)
|
|
124
|
+
proxyTarget: 'http://backend.company.com',
|
|
125
|
+
// 4. Backend API success assertion expression
|
|
126
|
+
responseSuccess: `response?.code === 200`,
|
|
127
|
+
|
|
128
|
+
// Frontend source code build paths
|
|
127
129
|
pagesDir: 'src/pages',
|
|
128
|
-
utilsDir: 'src/utils',
|
|
129
130
|
componentsDir: 'src/components',
|
|
131
|
+
hooksDir: 'src/hooks',
|
|
132
|
+
utilsDir: 'src/utils',
|
|
133
|
+
|
|
134
|
+
// Custom Handlebars template directory (leave empty to use built-in templates)
|
|
135
|
+
hbsDir: '',
|
|
130
136
|
}
|
|
131
137
|
```
|
|
132
138
|
|
|
133
|
-
## 🤝 Contributing
|
|
139
|
+
## 🤝 Contributing & CLA
|
|
134
140
|
|
|
135
|
-
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
141
|
+
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
|
|
142
|
+
All Pull Requests require automated signing of the [CLA Agreement](CLA.md) prior to merging.
|
|
136
143
|
|
|
137
144
|
## 📄 License
|
|
138
145
|
|
|
139
|
-
This project is licensed under
|
|
146
|
+
This project is licensed under [GNU AGPL v3.0](LICENSE).
|
|
140
147
|
|
|
141
148
|
## 🙏 Acknowledgments
|
|
142
149
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- [
|
|
146
|
-
- [
|
|
147
|
-
- [Handlebars](https://handlebarsjs.com/) / [Chokidar](https://github.com/paulmillr/chokidar) - Stable construction engine and listener mechanism
|
|
150
|
+
Special thanks to the following open-source projects for powering the Bunker engine:
|
|
151
|
+
- [OpenAI](https://openai.com/) / [Alibaba Qwen](https://tongyi.aliyun.com/) - Advanced AI Vision & Language capabilities
|
|
152
|
+
- [Ant Design](https://ant.design/) - Enterprise-grade UI component library
|
|
153
|
+
- [Handlebars](https://handlebarsjs.com/) / [Chokidar](https://github.com/paulmillr/chokidar) / [Puppeteer](https://pptr.dev/) - Reliable construction and scouting engines
|
|
148
154
|
|
|
149
155
|
## 📞 Contact
|
|
150
156
|
|
|
151
|
-
If you have
|
|
157
|
+
If you have questions or suggestions, please submit an [Issue](https://github.com/yorha2b-lab/autodev/issues).
|
|
152
158
|
|
|
153
159
|
## 🛠️ FAQ
|
|
154
160
|
|
|
155
161
|
Q: Is this tool free?
|
|
156
|
-
A: The tool itself is open
|
|
162
|
+
A: The tool itself is open-source and free, but calling AI models (e.g., Qwen-VL, GPT-4v) requires your own API Key. Alibaba Cloud Qwen-VL is recommended for high cost-performance.
|
|
157
163
|
|
|
158
|
-
Q: How
|
|
159
|
-
A:
|
|
164
|
+
Q: How do I customize generated code styles?
|
|
165
|
+
A: Set `hbsDir` to point to your custom Handlebars templates directory to build team-specific code construction standards.
|
|
160
166
|
|
|
161
167
|
---
|
|
162
168
|
|
|
163
169
|
## ⚖️ Disclaimer
|
|
164
170
|
|
|
165
|
-
|
|
171
|
+
AutoDev is a **fan-made, non-commercial, open-source tool**.
|
|
166
172
|
|
|
167
|
-
- The themes, names (YoRHa, 2B, etc.), and catchphrases included in this project are inspired by **NieR:Automata**, which is a trademark and copyright of **Square Enix Co., Ltd. / PlatinumGames Inc.**
|
|
173
|
+
- The themes, names (YoRHa, 2B, 9S, Pod042, etc.), and catchphrases included in this project are inspired by **NieR:Automata**, which is a trademark and copyright of **Square Enix Co., Ltd. / PlatinumGames Inc.**
|
|
168
174
|
- This project is not affiliated with, endorsed by, or representative of Square Enix in any way.
|
|
169
175
|
- Please support the original masterpiece: [NieR:Automata Official Site](https://nierautomata.square-enix-games.com/).
|
|
170
176
|
|
|
171
|
-
**Glory to Mankind.**
|
|
172
|
-
|
|
173
|
-
⭐ If this project helps you, please give it a Star!
|
|
177
|
+
**Glory to Mankind.** 🤖⚔️
|
|
@@ -5,8 +5,8 @@ const pkg = require('../package.json')
|
|
|
5
5
|
const { program } = require('commander')
|
|
6
6
|
const local = Intl.DateTimeFormat().resolvedOptions().locale.toUpperCase()
|
|
7
7
|
|
|
8
|
-
const { matchDialog, matrixEffect } = require('../src/
|
|
9
|
-
const recruiter = require('../src/
|
|
8
|
+
const { matchDialog, matrixEffect } = require('../src/logistics/ux')
|
|
9
|
+
const recruiter = require('../src/headquarters/recruiter')
|
|
10
10
|
const dialogs = recruiter(path.join(__dirname, '../src/dialogs'))
|
|
11
11
|
const dialog = matchDialog(local, dialogs) ?? dialogs['EN-US']
|
|
12
12
|
|
|
@@ -20,29 +20,29 @@ program
|
|
|
20
20
|
.command('init')
|
|
21
21
|
.description(dialog.bunker.initDesc)
|
|
22
22
|
.action(() => {
|
|
23
|
-
const
|
|
23
|
+
const outpost = {
|
|
24
24
|
files: [
|
|
25
25
|
{ from: '.env.example', to: '.env', exist: 'envCheck', success: 'envCopy' },
|
|
26
26
|
{ from: 'config.js', to: 'config.js', exist: 'configCheck', success: 'configCopy' }
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
Object.entries(
|
|
31
|
-
const bunkerCmd = chalk.yellow(`'bunker': '
|
|
29
|
+
const quartermaster = require('../src/headquarters/quartermaster')({ root: process.cwd(), dialog })
|
|
30
|
+
Object.entries(outpost).forEach(([type, items]) => items.forEach(quartermaster[type]))
|
|
31
|
+
const bunkerCmd = chalk.yellow(`'bunker': 'bunker boot'`)
|
|
32
32
|
console.log(chalk.cyan(dialog.bunker.initComplete(bunkerCmd)))
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
program
|
|
36
|
-
.command('
|
|
36
|
+
.command('boot')
|
|
37
37
|
.alias('start')
|
|
38
|
-
.description(dialog.bunker.
|
|
38
|
+
.description(dialog.bunker.bootDesc)
|
|
39
39
|
.action(async () => {
|
|
40
|
-
const bunker = require('../src/
|
|
40
|
+
const bunker = require('../src/awakening')
|
|
41
41
|
const result = await bunker.init(program.opts(), dialog, pkg.version, local)
|
|
42
42
|
if (!result) {
|
|
43
43
|
return
|
|
44
44
|
}
|
|
45
|
-
require('../src/
|
|
45
|
+
require('../src/headquarters/observer')(bunker)
|
|
46
46
|
process.on('SIGINT', () => {
|
|
47
47
|
result.yorha.commander.report(dialog.bunker.systemOffline, 'gray')
|
|
48
48
|
result.labs?.scout?.close()
|