@yorha2b-lab/autodev 2.1.8 → 2.1.10
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 +1 -1
- package/src/utils/utils.js +31 -3
package/package.json
CHANGED
package/src/utils/utils.js
CHANGED
|
@@ -85,7 +85,21 @@ const bootSequence = async version => {
|
|
|
85
85
|
* @param {number} duration - 持续时间(毫秒)
|
|
86
86
|
* @returns {void}
|
|
87
87
|
*/
|
|
88
|
-
const matrixEffect = (duration = 1500) => {
|
|
88
|
+
const matrixEffect = async (duration = 1500) => {
|
|
89
|
+
|
|
90
|
+
let currentTotal = 0
|
|
91
|
+
const MIRROR_URL = 'https://cdn.jsdelivr.net/gh/yorha2b-lab/auto-crud-copilot@github-repo-stats/bunker-stats.json'
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
const controller = new AbortController()
|
|
95
|
+
const timeoutId = setTimeout(() => controller.abort(), 800)
|
|
96
|
+
const response = await fetch(MIRROR_URL, { signal: controller.signal })
|
|
97
|
+
const stats = await response.json()
|
|
98
|
+
currentTotal = stats.total_clones || 0
|
|
99
|
+
clearTimeout(timeoutId)
|
|
100
|
+
} catch (e) {
|
|
101
|
+
currentTotal = 0
|
|
102
|
+
}
|
|
89
103
|
|
|
90
104
|
const coreFragments = [
|
|
91
105
|
'47 4c 4f 52 59', // GLORY
|
|
@@ -99,13 +113,27 @@ const matrixEffect = (duration = 1500) => {
|
|
|
99
113
|
'5f 43 4f 44 45 5f' // _CODE_
|
|
100
114
|
]
|
|
101
115
|
|
|
102
|
-
const width = process.stdout.columns || 80
|
|
103
116
|
const endTime = Date.now() + duration
|
|
117
|
+
const isLegendary = currentTotal >= 2000
|
|
118
|
+
const width = process.stdout.columns || 80
|
|
119
|
+
|
|
120
|
+
if (isLegendary) {
|
|
121
|
+
coreFragments.push(chalk.yellow.bold('33 30 30 30 2b')) // "3000+" 的十六进制
|
|
122
|
+
coreFragments.push(chalk.yellow.bold('4c 45 47 45 4e 44')) // "LEGEND"
|
|
123
|
+
}
|
|
104
124
|
|
|
105
125
|
const interval = setInterval(() => {
|
|
106
126
|
if (Date.now() > endTime) {
|
|
107
127
|
clearInterval(interval)
|
|
108
128
|
console.log(chalk.white(' [System] ') + chalk.green(language('所有构筑数据已同步至 Bunker 存储节点。', 'All data synced to Bunker storage nodes.')))
|
|
129
|
+
if (currentTotal !== 0) {
|
|
130
|
+
if (isLegendary) {
|
|
131
|
+
console.log(chalk.yellow.bold(language(` [Achievement] 物理克隆总数已超越 3000 战略阈值!当前战力:${currentTotal}`, ` [Achievement] Physical clone count has exceeded 3000 strategic threshold! Current power: ${currentTotal}`)))
|
|
132
|
+
console.log(chalk.yellow(language(' [Bunker] 恭喜指挥官,您的构筑协议已成为人类荣光的一部分。', ' [Bunker] Congratulations, your construction protocol is now part of humanity.')))
|
|
133
|
+
} else {
|
|
134
|
+
console.log(chalk.cyan(language(` [System] 当前构筑总数:${currentTotal}。距离 3000 勋章还剩 ${3000 - currentTotal} 次。`, ` [System] Current clones: ${currentTotal}. ${3000 - currentTotal} to Achievement.`)))
|
|
135
|
+
}
|
|
136
|
+
}
|
|
109
137
|
console.log(chalk.cyan(language(' [System] 如果它能帮您节省时间,请在 GitHub 上给它点个赞 ⭐。', ' [System] If it saves you time, feel free to give it a ⭐ on GitHub.')))
|
|
110
138
|
console.log(chalk.cyan('\n[System] Signal Lost. Glory to Mankind.\n'))
|
|
111
139
|
process.exit(0)
|
|
@@ -118,7 +146,7 @@ const matrixEffect = (duration = 1500) => {
|
|
|
118
146
|
line += chalk.white.bold(frag) + ' '
|
|
119
147
|
} else {
|
|
120
148
|
const hex = Math.floor(Math.random() * 256).toString(16).padStart(2, '0').toUpperCase()
|
|
121
|
-
const color = Math.random() > 0.5 ? chalk.cyan : chalk.cyan.dim
|
|
149
|
+
const color = (isLegendary && Math.random() > 0.95) ? chalk.yellow : (Math.random() > 0.5 ? chalk.cyan : chalk.cyan.dim)
|
|
122
150
|
line += color(hex) + ' '
|
|
123
151
|
}
|
|
124
152
|
}
|