@yorha2b-lab/autodev 7.5.3 → 7.5.4
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 +1 -1
- 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
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)) {
|