feat: 修复定时日报错误通知微信机器人功能

增加定时日报debug
修复定时日报历史头像显示并区分定时日报标题
This commit is contained in:
Wxw-Gu
2026-09-02 15:01:03 +08:00
parent 1c8bbae1f0
commit 7c8b45a24a
32 changed files with 2975 additions and 213 deletions
+37
View File
@@ -0,0 +1,37 @@
/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/explicit-function-return-type */
const { execFileSync } = require('node:child_process')
const fs = require('node:fs')
const path = require('node:path')
const projectRoot = path.resolve(__dirname, '..')
const defaultRuntimeRoot = path.join(projectRoot, 'node_modules', 'sherpa-onnx-win-x64')
const requiredFiles = ['package.json', 'sherpa-onnx.node']
function hasWindowsSherpaRuntime(runtimeRoot = defaultRuntimeRoot) {
return requiredFiles.every((fileName) => fs.existsSync(path.join(runtimeRoot, fileName)))
}
function ensureWindowsSherpaRuntime() {
if (hasWindowsSherpaRuntime()) {
console.log('[prepare-win-runtime] sherpa-onnx-win-x64 is ready')
return
}
console.log('[prepare-win-runtime] installing cross-platform optional dependencies')
execFileSync(
process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm',
['install', '--force', '--ignore-scripts'],
{
cwd: projectRoot,
stdio: 'inherit'
}
)
if (!hasWindowsSherpaRuntime()) {
throw new Error(`Missing Windows sherpa runtime: ${defaultRuntimeRoot}`)
}
}
if (require.main === module) ensureWindowsSherpaRuntime()
module.exports = { hasWindowsSherpaRuntime, ensureWindowsSherpaRuntime }