claw-subagent-service 0.0.83 → 0.0.85

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claw-subagent-service",
3
- "version": "0.0.83",
3
+ "version": "0.0.85",
4
4
  "description": "虾说智能助手",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -13,6 +13,8 @@ const { executeCommand } = require('./openclaw-control');
13
13
  const { createOpencodeSession, deleteOpencodeSession, forwardChatMessage } = require('./opencode-service');
14
14
  const { ServiceManager } = require('./service-manager');
15
15
  const { collectDashboardData } = require('./dashboard-collector');
16
+ const { getOpenClawStatus } = require('./port-checker');
17
+ const { getMacAddress } = require('./mac-address');
16
18
  const fs = require('fs');
17
19
  const path = require('path');
18
20
  const os = require('os');
@@ -306,11 +308,22 @@ class RongyunMessageHandler {
306
308
  const requestId = data.request_id;
307
309
  const targetId = data.source_im_id;
308
310
 
309
- this.logInfo(`[RongyunMessageHandler] 收到设备状态请求, from=${targetId}`);
311
+ this.logInfo(`[RongyunMessageHandler] 收到设备状态请求, from=${targetId}, requestId=${requestId}`);
310
312
 
311
313
  try {
312
- const dashboard = await collectDashboardData();
313
- await this.sendDeviceStatusReport(targetId, requestId, dashboard);
314
+ // 获取 OpenClaw 运行状态(检查端口 18789)
315
+ const openClawStatus = await getOpenClawStatus();
316
+
317
+ // 构建精简状态数据(避免超过融云 128KB 限制)
318
+ const statusData = {
319
+ open_claw_status: openClawStatus, // 1=运行中, 0=未运行
320
+ mac_address: getMacAddress(),
321
+ version: '0.0.20',
322
+ timestamp: Date.now(),
323
+ };
324
+
325
+ this.logInfo(`[RongyunMessageHandler] 设备状态: openClawStatus=${openClawStatus}`);
326
+ await this.sendDeviceStatusReport(targetId, requestId, statusData);
314
327
  } catch (e) {
315
328
  const msg = e instanceof Error ? e.message : String(e);
316
329
  this.logError(`设备状态查询异常: ${msg}`);