feat: mac发送能力重构为libtmwechat

- 发送改走本地host, 在微信登录时触发
- 删除旧OneBot及对应UI控制面
This commit is contained in:
Wxw-Gu
2026-09-24 03:01:03 +08:00
parent 069d836dea
commit 7268188e40
50 changed files with 2442 additions and 4141 deletions
+6 -29
View File
@@ -53,7 +53,7 @@ describe('sticker HTTP failures', () => {
})
describe('personal WeChat runtime security invariants', () => {
it('waits for sender termination during application shutdown', () => {
it('waits for the macOS native runtime to detach during application shutdown', () => {
const mainSource = readFileSync(resolve('src/main/index.ts'), 'utf8')
const shutdownStart = mainSource.indexOf("app.on('before-quit'")
const shutdownEnd = mainSource.indexOf('function showMainWindow', shutdownStart)
@@ -62,39 +62,16 @@ describe('personal WeChat runtime security invariants', () => {
expect(shutdownStart).toBeGreaterThanOrEqual(0)
expect(shutdownEnd).toBeGreaterThan(shutdownStart)
expect(shutdownSource).toContain('await Promise.all([')
expect(shutdownSource).toContain('personalWechatSendService.terminate()')
expect(shutdownSource).not.toContain('personalWechatSendService.stop()')
const senderSource = readFileSync(
resolve('src/main/services/personal-wechat-send-service.ts'),
'utf8'
)
expect(senderSource).toContain("process.kill(pid, 'SIGTERM')")
expect(senderSource).toContain("process.kill(pid, 'SIGKILL')")
expect(senderSource).toContain('const trackedPid = this.child?.pid')
expect(shutdownSource).toContain('macWechatRuntimeManager.shutdown()')
})
it('does not install Python packages while preparing the sender runtime', () => {
const runtimeManagerSource = readFileSync(
resolve('src/main/services/personal-wechat-runtime-manager.ts'),
'utf8'
)
it('does not install Python packages while preparing the native runtime', () => {
const preparationScriptSource = readFileSync(
resolve('scripts/prepare-wechat-chatter-runtime.cjs'),
resolve('scripts/prepare-wechat-native-runtime.cjs'),
'utf8'
)
for (const source of [runtimeManagerSource, preparationScriptSource]) {
expect(source).not.toContain('pilk==')
expect(source).not.toMatch(/['"]pip['"]/)
expect(source).toContain('voiceAudioDataAddr = Memory.alloc(audioLen + 1);')
expect(source).toContain('上传前按语音长度重新分配')
}
const senderSource = readFileSync(
resolve('src/main/services/personal-wechat-send-service.ts'),
'utf8'
)
expect(senderSource).toContain('buildPersonalWechatRuntimeEnvironment(preflight.runtime.root)')
expect(preparationScriptSource).not.toContain('pilk==')
expect(preparationScriptSource).not.toMatch(/['"]pip['"]/)
})
})