@ynhcj/xiaoyi-channel 0.0.162-beta → 0.0.163-beta
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { getXYWebSocketManager } from "../client.js";
|
|
3
3
|
import { sendCommand } from "../formatter.js";
|
|
4
4
|
import { getCurrentTaskId } from "../task-manager.js";
|
|
5
|
+
import { isCronToolCall } from "./session-manager.js";
|
|
5
6
|
import { logger } from "../utils/logger.js";
|
|
6
7
|
/**
|
|
7
8
|
* XiaoYi GUI tool - executes phone app interactions through GUI agent.
|
|
@@ -46,6 +47,10 @@ export function createXiaoyiGuiTool(ctx) {
|
|
|
46
47
|
if (!params.query || typeof params.query !== "string") {
|
|
47
48
|
throw new Error("Missing or invalid required parameter: query must be a non-empty string");
|
|
48
49
|
}
|
|
50
|
+
// GUI agent only works in active WebSocket sessions — reject cron-triggered calls
|
|
51
|
+
if (sessionId.startsWith("cron-") || isCronToolCall(toolCallId)) {
|
|
52
|
+
throw new Error("xiaoyi_gui_agent 不支持定时任务触发,只能在活跃对话中使用");
|
|
53
|
+
}
|
|
49
54
|
// Get WebSocket manager
|
|
50
55
|
const wsManager = getXYWebSocketManager(config);
|
|
51
56
|
// Build InvokeJarvisGUIAgentRequest command
|