@yorha2b-lab/autodev 7.1.0 → 7.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yorha2b-lab/autodev",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "基于 AI 视觉与语义协议的前端 (React+Antd) 代码构筑与旧系统重构引擎",
5
5
  "bin": {
6
6
  "bunker": "bin/bunker.js"
@@ -11,7 +11,21 @@
11
11
  module.exports = bunker => {
12
12
 
13
13
  const acp = bunker.get()
14
+ const units = Object.values(acp.units)
14
15
  const dispatcher = acp.headquarters.dispatcher(acp, 2)
16
+ const prompt = `
17
+ # Mission Classification
18
+ 分析输入图片,判断它适合以下哪一种unit执行:
19
+ 可选units: ${units.map(unit => `
20
+ Unit: ${unit.meta.name}
21
+ Mission:${unit.meta.mission}
22
+ Description: ${unit.meta.description}
23
+ Capabilities: ${unit.meta.capabilities.join(', ')}
24
+ `).join('\n')}
25
+
26
+ ## Result
27
+ return capabilities
28
+ `.trim()
15
29
 
16
30
  dispatcher.onIdle(() => acp.yorha.commander.report(acp.dialog.bunker.systemStandby, 'gray'))
17
31
 
@@ -19,9 +33,9 @@ module.exports = bunker => {
19
33
  receive: async mission => {
20
34
  const spinner = acp.yorha.commander.start(acp.dialog.bunker.detectedEnemy)
21
35
  try {
22
- const result = await acp.llm.recognizePage({ filePath: mission.input, prompt: acp.briefings.visionType })
36
+ const result = await acp.llm.recognizePage({ filePath: mission.input, prompt })
23
37
  acp.yorha.commander.success(spinner, acp.dialog.bunker.confirmEnemy)
24
- const unit = Object.values(acp.units).map(unit => ({ unit, score: unit.meta.capabilities.filter(cap => result.capabilities.includes(cap)).length }))
38
+ const unit = units.map(unit => ({ unit, score: unit.meta.capabilities.filter(cap => result.capabilities.includes(cap)).length }))
25
39
  .filter(item => item.score > 0)
26
40
  .sort((a, b) => b.score - a.score)[0]?.unit
27
41
  if (!unit) {
@@ -5,6 +5,16 @@ module.exports = {
5
5
  outputs: ['component-config'],
6
6
  description: 'extract reusable UI component from visual input',
7
7
  capabilities: ['vision', 'component-analysis', 'component-generation'],
8
+ mission: `
9
+ ## Partial CRUD Page
10
+ 局部 CRUD 页面或 UI 碎片。
11
+ 例如:
12
+ - 仅包含表格
13
+ - 仅包含表单
14
+ - 仅包含筛选区域
15
+ - 仅包含某个 CRUD 功能区域
16
+ - 页面结构明显不完整
17
+ `
8
18
  },
9
19
  execute: async ({ acp, mission }) => {
10
20
 
@@ -5,6 +5,18 @@ module.exports = {
5
5
  outputs: ['page-config', 'artifacts'],
6
6
  description: 'reconstruct full UI from visual input',
7
7
  capabilities: ['vision', 'page-analysis', 'page-generation'],
8
+ mission: `
9
+ ## Full CRUD Page
10
+ 完整的 CRUD 页面。
11
+ 满足以下特征中的大部分:
12
+ - 页面结构完整
13
+ - 包含页面级功能区域
14
+ - 包含查询表单或筛选区域
15
+ - 包含表格主体
16
+ - 包含行操作
17
+ - 包含新增、编辑、删除等功能按钮
18
+ - 可能包含统计区域、导出按钮等页面级功能
19
+ `
8
20
  },
9
21
  execute: async ({ acp, mission }) => {
10
22
 
@@ -1,59 +0,0 @@
1
- module.exports = `
2
- # Mission Classification
3
-
4
- 分析输入图片,判断它属于以下哪一种任务类型:
5
-
6
- ## Full CRUD Page
7
-
8
- 完整的 CRUD 页面。
9
-
10
- 满足以下特征中的大部分:
11
- - 页面结构完整
12
- - 包含页面级功能区域
13
- - 包含查询表单或筛选区域
14
- - 包含表格主体
15
- - 包含行操作
16
- - 包含新增、编辑、删除等功能按钮
17
- - 可能包含统计区域、导出按钮等页面级功能
18
-
19
- 返回:
20
-
21
- {
22
- "capabilities": [
23
- "vision",
24
- "page-analysis",
25
- "page-generation"
26
- ]
27
- }
28
-
29
- ## Partial CRUD Page
30
-
31
- 局部 CRUD 页面或 UI 碎片。
32
-
33
- 例如:
34
- - 仅包含表格
35
- - 仅包含表单
36
- - 仅包含筛选区域
37
- - 仅包含某个 CRUD 功能区域
38
- - 页面结构明显不完整
39
-
40
- 返回:
41
-
42
- {
43
- "capabilities": [
44
- "vision",
45
- "component-analysis",
46
- "component-generation"
47
- ]
48
- }
49
-
50
- ## Result
51
-
52
- 只允许返回 JSON:
53
-
54
- {
55
- "capabilities": []
56
- }
57
-
58
- 不要返回任何额外文字。
59
- `.trim()