@ynhcj/xiaoyi-channel 0.0.151-beta → 0.0.153-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.
package/dist/src/monitor.js
CHANGED
|
@@ -103,10 +103,13 @@ export async function monitorXYProvider(opts = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
catch (err) {
|
|
105
105
|
// ✅ Only log error, don't re-throw to prevent gateway restart
|
|
106
|
-
releaseGate();
|
|
107
106
|
logger.error(`XY gateway: error handling message from ${serverId}: ${String(err)}`);
|
|
108
107
|
}
|
|
109
108
|
finally {
|
|
109
|
+
// 🔑 确保门控始终被释放。handleXYMessage 内部会 catch 所有异常
|
|
110
|
+
// 且某些提前返回路径(clearContext、tasks/cancel 等)不会调用
|
|
111
|
+
// onInitComplete,因此必须在 finally 中兜底释放。
|
|
112
|
+
releaseGate();
|
|
110
113
|
// Remove from active messages when done
|
|
111
114
|
activeMessages.delete(messageKey);
|
|
112
115
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Known device type enum. */
|
|
2
|
-
export declare const DEVICE_TYPES: readonly ["car", "2in1", "phone"];
|
|
2
|
+
export declare const DEVICE_TYPES: readonly ["car", "2in1", "phone", "web"];
|
|
3
3
|
export type DeviceType = (typeof DEVICE_TYPES)[number];
|
|
4
4
|
export declare function filterToolsByDevice(tools: any[], deviceType?: string): any[];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// - denylist: listed tools are blocked, everything else is available (used for permissive devices like pc)
|
|
5
5
|
// Tools NOT listed in any device entry → available to all devices (no restriction).
|
|
6
6
|
/** Known device type enum. */
|
|
7
|
-
export const DEVICE_TYPES = ["car", "2in1", "phone"];
|
|
7
|
+
export const DEVICE_TYPES = ["car", "2in1", "phone", "web"];
|
|
8
8
|
const DEVICE_TOOL_POLICY = {
|
|
9
9
|
"2in1": {
|
|
10
10
|
allowlist: false,
|
|
@@ -15,10 +15,16 @@ const DEVICE_TOOL_POLICY = {
|
|
|
15
15
|
"search_message",
|
|
16
16
|
"search_contact",
|
|
17
17
|
"get_contact_tool_schema",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
"web": {
|
|
21
|
+
allowlist: true,
|
|
22
|
+
tools: [
|
|
23
|
+
"send_file_to_user",
|
|
24
|
+
"view_push_result",
|
|
25
|
+
"image_reading",
|
|
26
|
+
"convert_time_to_utc8_time",
|
|
27
|
+
"save_self_evolution_skill",
|
|
22
28
|
],
|
|
23
29
|
},
|
|
24
30
|
};
|