feat: 飞书官方插件迁移 + 配对审批 + Gateway防卡死 + 微信升级修复 + 更新检测修复

- 飞书渠道从 @openclaw/feishu 迁移到 @larksuite/openclaw-lark 官方插件
- 保存飞书配置时自动禁用旧 feishu 插件,防止新旧插件冲突
- 所有主要渠道(飞书/Telegram/Discord/Slack)启用配对审批UI
- gateway_command 增加20s超时,超时后force-kill+fresh start
- 全平台启动前端口占用检查,防止Guardian无限拉起
- Linux gateway_command 补齐 Duration 导入和 cleanup_zombie 实现
- Guardian自动守护在Tauri桌面端也启用,轮询间隔30s→15s
- 微信渠道:升级操作不再弹出扫码二维码,按钮文案区分安装/升级
- 版本更新检测:CI不再将minAppVersion写死为当前版本
- 部署脚本增强OpenClaw检测,支持已安装的官方版
- 日间/夜间模式圆形扩散切换动画(View Transitions API)
- API错误信息完整展示(429限流等),URL自动转可点击链接
- 第三方API接入引导优化:移除内置密钥,引导式流程
- 修复全平台 Clippy 警告(strip_prefix/dead_code/unnecessary_unwrap等)
- Rust代码格式化修复(cargo fmt)
- toast组件支持HTML内容渲染
- Rust后端test_model返回详细错误信息
This commit is contained in:
晴天
2026-03-23 20:37:48 +08:00
parent dccb4b4dbf
commit 3687e26d5d
50 changed files with 8055 additions and 2715 deletions

View File

@@ -8,11 +8,23 @@ import { homedir } from 'os'
const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
// 读取 Gateway 端口(启动时读取一次)
// 注意Gateway 默认端口是 18789不是 18790
let gatewayPort = 18789
try {
const cfg = JSON.parse(fs.readFileSync(path.join(homedir(), '.openclaw', 'openclaw.json'), 'utf8'))
gatewayPort = cfg?.gateway?.port || 18789
} catch {}
const cfgPath = path.join(homedir(), '.openclaw', 'openclaw.json')
if (fs.existsSync(cfgPath)) {
const cfg = JSON.parse(fs.readFileSync(cfgPath, 'utf8'))
// 端口必须 > 0 且 < 65536
const port = cfg?.gateway?.port
if (port && typeof port === 'number' && port > 0 && port < 65536) {
gatewayPort = port
}
}
} catch (e) {
console.warn('[vite] 读取 Gateway 端口配置失败,使用默认端口 18789:', e.message)
}
console.log(`[vite] Gateway WebSocket 代理目标: ws://127.0.0.1:${gatewayPort}`)
export default defineConfig({
plugins: [devApiPlugin()],
@@ -27,8 +39,23 @@ export default defineConfig({
'/ws': {
target: `ws://127.0.0.1:${gatewayPort}`,
ws: true,
configure: (proxy) => {
proxy.on('error', () => {})
changeOrigin: true,
timeout: 30000,
configure: (proxy, options) => {
proxy.on('proxyReqWs', (proxyReq, req, socket) => {
socket.setTimeout(30000)
socket.on('timeout', () => {
console.warn('[vite/ws] WebSocket 超时,关闭连接')
socket.destroy()
})
})
proxy.on('error', (err, req, socket) => {
console.warn(`[vite/ws] 代理错误: ${err.code} ${err.message}`)
// WebSocket 升级后 socket 是 net.Socket无 headersSent
if (socket && !socket.destroyed) {
socket.destroy()
}
})
},
},
},