feat: add simplified windows x86 support

This commit is contained in:
yankun
2026-06-27 18:33:59 +08:00
parent 7de0777748
commit 67c995db83
12 changed files with 400 additions and 84 deletions
+24 -2
View File
@@ -19,6 +19,7 @@ const { hasInternet, hasWiredInternetProbe, getLocalIps, getLocalNetworks } = re
const { applyFullProviderFromVps, removeProviderByName, refreshModelsIfChanged, isFullProvider } = require('./openclaw-provider');
const sysCall = require('./sys-call');
const led = require('./led');
const { IS_WINDOWS } = require('./platform-paths');
const MAX_BACKOFF_MS = 60_000;
/** 连续若干轮 ping 后仍无 pong 才判定死链(单轮易因调度/弱网误判) */
@@ -125,7 +126,7 @@ class ClawClient {
led.lan.start();
// 蓝牙状态监控(bluetoothctl);默认不启用,见 btMonitorEnabled()
if (btMonitorEnabled()) {
if (!IS_WINDOWS && btMonitorEnabled()) {
this._btMonitor = new BtMonitor();
this._btMonitor.start();
} else {
@@ -317,7 +318,8 @@ class ClawClient {
this._wsFailCount++;
log.warn('clawd', `连接断开 (${code}),失败次数=${this._wsFailCount}${this._backoff / 1000}s 后重连...`);
if (this._hasEverConnected && this._wsFailCount >= 3) {
led.display.showAP();
if (IS_WINDOWS) led.display.showErr0();
else led.display.showAP();
}
if (this._certTimeError) {
// NTP 未同步:固定 5s 重试,等时钟校正
@@ -388,6 +390,16 @@ class ClawClient {
local_networks: getLocalNetworks(),
external_ip: this._externalIp ?? null,
location: this._location ?? null,
platform: process.platform,
arch: process.arch,
device_model: IS_WINDOWS ? 'windows-x86' : null,
capabilities: IS_WINDOWS ? {
wifi_provisioning: false,
display: 'terminal',
dashboard_proxy: true,
terminal_proxy: false,
ap_mode: false,
} : undefined,
...this._dashInfo,
};
this._send(msg);
@@ -515,6 +527,11 @@ class ClawClient {
// ── Hostname ─────────────────────────────────────────────────────────────────
_setHostname(clawId) {
if (IS_WINDOWS) {
log.info('clawd', `Windows/x86 mode: skip hostname change for claw-${clawId}`);
return;
}
const hostname = `claw-${clawId}`;
// 运行时 hostname(无需文件权限)
@@ -683,6 +700,11 @@ class ClawClient {
}
async _handleUpgrade(msg) {
if (IS_WINDOWS) {
this._sendUpgradeProgress(0, 'failed', true, 'Windows/x86 self-upgrade is not implemented yet');
return;
}
const targetVersion = msg.version;
const installDir = path.dirname(__dirname); // /opt/clawd 或同等安装目录
const scriptPath = path.join(installDir, 'tools', 'update-clawd.sh');