@yorha2b-lab/autodev 5.7.3 → 6.0.1
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/scout.js +6 -3
- 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
|
@@ -68,10 +68,10 @@ const bootSequence = async (version, local) => {
|
|
|
68
68
|
const matrixEffect = async (duration = 1500, dialog, result) => {
|
|
69
69
|
|
|
70
70
|
let currentTotal = 0
|
|
71
|
-
const MIRROR_URL = 'https://cdn.jsdelivr.net/gh/yorha2b-lab/
|
|
71
|
+
const MIRROR_URL = 'https://cdn.jsdelivr.net/gh/yorha2b-lab/autodev@github-repo-stats/bunker-stats.json'
|
|
72
72
|
|
|
73
73
|
try {
|
|
74
|
-
if (result.
|
|
74
|
+
if (result.logistics.foundation.getConfig().fetchClone) {
|
|
75
75
|
const controller = new AbortController()
|
|
76
76
|
const timeoutId = setTimeout(() => controller.abort(), 800)
|
|
77
77
|
const response = await fetch(MIRROR_URL, { signal: controller.signal })
|
|
@@ -138,6 +138,7 @@ const matrixEffect = async (duration = 1500, dialog, result) => {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
module.exports = {
|
|
141
|
+
sleep,
|
|
141
142
|
yorha,
|
|
142
143
|
matchDialog,
|
|
143
144
|
bootSequence,
|
|
@@ -2,17 +2,17 @@ const fs = require('fs')
|
|
|
2
2
|
const path = require('path')
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
|
|
5
|
+
station: 'screenShot',
|
|
6
6
|
async handle(filePath) {
|
|
7
7
|
|
|
8
|
-
const { llm,
|
|
8
|
+
const { llm, yorha, dialog, prompts, template, generator, logistics } = require('../awakening').get()
|
|
9
9
|
|
|
10
10
|
const { page } = prompts
|
|
11
11
|
const { nineS, pod042 } = yorha
|
|
12
12
|
const { index, resource } = generator
|
|
13
|
-
const { contextStringify } =
|
|
13
|
+
const { contextStringify } = logistics.generator
|
|
14
14
|
const { generateMock, recognizePage, nameSimilarity } = llm
|
|
15
|
-
const { useDemo, pagesDir, utilsDir, needMock } =
|
|
15
|
+
const { useDemo, pagesDir, utilsDir, needMock } = logistics.foundation.getConfig()
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const startTime = Date.now()
|
|
@@ -36,10 +36,13 @@ module.exports = {
|
|
|
36
36
|
pageConfig = await recognizePage({ prompt: page, filePath, schema: require(`../framework/${template}/schema/page.json`) })
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const {
|
|
40
|
-
if (
|
|
39
|
+
const { similarity } = await nameSimilarity({ fileName, english: pageConfig.title.english })
|
|
40
|
+
if (similarity === 0) {
|
|
41
41
|
fileName = pageConfig.title.english
|
|
42
42
|
targetDir = path.join(process.cwd(), pagesDir, pageConfig.title.english)
|
|
43
|
+
if (fs.existsSync(targetDir)) {
|
|
44
|
+
targetDir = `${targetDir}_temp`
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
if (!fs.existsSync(targetDir)) fs.mkdirSync(targetDir, { recursive: true })
|
|
@@ -62,7 +65,7 @@ module.exports = {
|
|
|
62
65
|
fs.unlinkSync(filePath)
|
|
63
66
|
const cwdUtilsDir = path.join(process.cwd(), utilsDir)
|
|
64
67
|
if (!fs.existsSync(cwdUtilsDir)) fs.mkdirSync(cwdUtilsDir, { recursive: true })
|
|
65
|
-
fs.writeFileSync(path.join(cwdUtilsDir, 'menus.js'), `export const menus = ${contextStringify({ context:
|
|
68
|
+
fs.writeFileSync(path.join(cwdUtilsDir, 'menus.js'), `export const menus = ${contextStringify({ context: logistics.foundation.getExistingMenus(pagesDir), maxLength: 50 })}`)
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
} catch (error) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
|
|
4
|
+
station: 'screenPart',
|
|
5
5
|
async handle(filePath) {
|
|
6
6
|
|
|
7
7
|
const chalk = require('chalk')
|
|
8
|
-
const { llm,
|
|
8
|
+
const { llm, yorha, dialog, prompts, generator, logistics } = require('../awakening').get()
|
|
9
9
|
|
|
10
10
|
const { pod042 } = yorha
|
|
11
11
|
const { recognizePage } = llm
|
|
12
12
|
const { part: prompt } = prompts
|
|
13
13
|
const { formatFormItemAndColumns } = generator
|
|
14
|
-
const { cleanCode, contextStringify } =
|
|
14
|
+
const { cleanCode, contextStringify } = logistics.generator
|
|
15
15
|
|
|
16
16
|
const startTime = Date.now()
|
|
17
17
|
|
|
@@ -2,17 +2,17 @@ const fs = require('fs')
|
|
|
2
2
|
const path = require('path')
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
|
|
5
|
+
station: 'response',
|
|
6
6
|
async handle(filePath, liveResponse = null) {
|
|
7
7
|
|
|
8
8
|
const chalk = require('chalk')
|
|
9
|
-
const { llm,
|
|
9
|
+
const { llm, labs, yorha, dialog, logistics } = require('../awakening').get()
|
|
10
10
|
|
|
11
11
|
const { nineS, pod153 } = yorha
|
|
12
12
|
const { alignResponseFields } = llm
|
|
13
|
-
const { cleanCode } =
|
|
14
|
-
const { unwrapSignal } =
|
|
15
|
-
const { pagesDir } =
|
|
13
|
+
const { cleanCode } = logistics.generator
|
|
14
|
+
const { unwrapSignal } = logistics.semantic
|
|
15
|
+
const { pagesDir } = logistics.foundation.getConfig()
|
|
16
16
|
|
|
17
17
|
const startTime = Date.now()
|
|
18
18
|
const fileName = liveResponse?.fileName ?? path.basename(filePath, path.extname(filePath))
|
package/src/commands/watch.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module.exports = () => {
|
|
2
|
-
|
|
3
|
-
const chokidar = require('chokidar')
|
|
4
|
-
|
|
5
|
-
const bootstrap = require('../bootstrap')
|
|
6
|
-
|
|
7
|
-
const ctx = bootstrap.get()
|
|
8
|
-
const routes = Object.values(ctx.handlers)
|
|
9
|
-
const queue = require('../core/queue')(2, ctx)
|
|
10
|
-
|
|
11
|
-
queue.onIdle(() => ctx.yorha.commander.report(ctx.dialog.bunker.systemStandby, 'gray'))
|
|
12
|
-
|
|
13
|
-
const options = {
|
|
14
|
-
persistent: true,
|
|
15
|
-
ignoreInitial: true,
|
|
16
|
-
ignored: /(^|[\/\\])\../,
|
|
17
|
-
awaitWriteFinish: { stabilityThreshold: 500, pollInterval: 100 }
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const settingWatcher = chokidar.watch(['./bunker/config.js'], options)
|
|
21
|
-
const fileWatcher = chokidar.watch(routes.map(route => `./bunker/${route.watch}`), options)
|
|
22
|
-
|
|
23
|
-
ctx.yorha.operator6O.report(ctx.dialog.operator6O.call2B)
|
|
24
|
-
|
|
25
|
-
fileWatcher.on('add', filePath => {
|
|
26
|
-
const route = ctx.utils.foundation.findRoute(routes, filePath)
|
|
27
|
-
if (route) {
|
|
28
|
-
queue.add(() => route.handle(filePath))
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
settingWatcher.on('change', file => {
|
|
33
|
-
if (file.endsWith('config.js')) {
|
|
34
|
-
bootstrap.reboot()
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|