@yorha2b-lab/autodev 7.5.3 → 7.5.5

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/bin/bunker.js CHANGED
@@ -61,7 +61,6 @@ program
61
61
  return
62
62
  }
63
63
  require('../src/headquarters/observer')(bunker)
64
- result.yorha.operator6O.report(dialog.operator6O.call2B)
65
64
  process.on('SIGINT', async () => {
66
65
  if (isTerminating) return
67
66
  isTerminating = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yorha2b-lab/autodev",
3
- "version": "7.5.3",
3
+ "version": "7.5.5",
4
4
  "description": "基于 AI 视觉与语义协议的前端 (React+Antd) 代码构筑与旧系统重构引擎",
5
5
  "bin": {
6
6
  "bunker": "bin/bunker.js"
@@ -44,13 +44,12 @@
44
44
  "figlet": "^1.10.0",
45
45
  "openai": "^6.24.0",
46
46
  "chokidar": "^5.0.0",
47
+ "segmentit": "^2.0.3",
47
48
  "commander": "^14.0.3",
48
49
  "handlebars": "^4.7.8",
50
+ "puppeteer": "^25.4.0",
51
+ "http-proxy": "^1.18.1",
49
52
  "json-stringify-pretty-compact": "^4.0.0"
50
53
  },
51
- "devDependencies": {
52
- "http-proxy": "^1.18.1",
53
- "puppeteer": "^25.4.0",
54
- "segmentit": "^2.0.3"
55
- }
54
+ "devDependencies": {}
56
55
  }
@@ -33,6 +33,7 @@ module.exports = {
33
33
 
34
34
  if (version) {
35
35
  await logistics.presenter.bootSequence(version, local)
36
+ yorha.operator6O.report(dialog.operator6O.call2B)
36
37
  }
37
38
 
38
39
  const llm = require('../gateway')(accessPoint)
@@ -29,7 +29,8 @@ module.exports = ({ yorha, sleep, dialog, openAI }) => {
29
29
  }
30
30
 
31
31
  yorha.commander.report(dialog.bunker.networkInstability(retryCount + 1))
32
- await sleep(1000)
32
+ const delay = Math.min(1000 * Math.pow(2, retryCount), 10000)
33
+ await sleep(delay)
33
34
  return askAI({ model, messages, response_format, retryCount: retryCount + 1 })
34
35
  }
35
36
  }
@@ -44,8 +44,19 @@ module.exports = async ({ llm, yorha, dialog, logistics }) => {
44
44
  const anchors = code.match(/BUNKER_API_ANCHOR_\w+/g) || []
45
45
  anchors.forEach(a => allAnchors.add(a))
46
46
 
47
- const chinese = code.match(/[\u4e00-\u9fa5][\u4e00-\u9fa5A-Za-z0-9?。,、:;!() ]*/g) || []
48
- allSemantics.push(...chinese)
47
+ const textMatches = code.match(/(?:['"`]([^'"`\n]{2,})['"`]|>([^<>{}\n]{2,})<)/g) || []
48
+ const uiSemantics = textMatches
49
+ .map(str => str.replace(/['"`><]/g, '').trim())
50
+ // 过滤掉纯代码路径(/api/xxx)、锚点占位符、纯数字和空字符
51
+ .filter(text => (
52
+ text.length >= 2 &&
53
+ !text.startsWith('/') &&
54
+ !text.startsWith('http') &&
55
+ !text.includes('BUNKER_API_ANCHOR') &&
56
+ !/^[0-9]+$/.test(text)
57
+ ))
58
+
59
+ allSemantics.push(...uiSemantics)
49
60
  }
50
61
 
51
62
  if (allAnchors.size > 0) {
@@ -53,7 +53,8 @@ module.exports = {
53
53
  pod042.update(spinner, dialog.pod042.uploadVisualMetadata)
54
54
  pageConfig = await recognizePage({ prompt: striker, filePath: mission.input, schema: require(`../workshop/${template}/protocols/striker.json`) })
55
55
  const { similarity } = await nameSimilarity({ fileName, english: pageConfig.title?.english })
56
- if (similarity === 0) {
56
+ const isGarbageName = /^(image|img|screen|capture|pic|temp|test|新建|未命名|[\d_-]+$)/i.test(fileName)
57
+ if (similarity < 0.3 || isGarbageName) {
57
58
  fileName = pageConfig.title?.english
58
59
  targetDir = path.join(process.cwd(), pagesDir, pageConfig.title?.english)
59
60
  if (fs.existsSync(targetDir)) {