@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 +0 -1
- package/package.json +5 -6
- package/src/awakening/index.js +1 -0
- package/src/gateway/protocol.js +2 -1
- package/src/labs/council.js +13 -2
- package/src/units/striker.js +2 -1
package/bin/bunker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yorha2b-lab/autodev",
|
|
3
|
-
"version": "7.5.
|
|
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
|
}
|
package/src/awakening/index.js
CHANGED
package/src/gateway/protocol.js
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|
package/src/labs/council.js
CHANGED
|
@@ -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
|
|
48
|
-
|
|
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) {
|
package/src/units/striker.js
CHANGED
|
@@ -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
|
-
|
|
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)) {
|