@ynhcj/xiaoyi-channel 1.0.9 → 1.1.0

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.
@@ -23,7 +23,7 @@ export const xyPlugin = {
23
23
  agentPrompt: {
24
24
  messageToolHints: () => [
25
25
  "- xiaoyi targeting: omit `target` to reply to the current conversation (auto-inferred). Explicit targets: `default`",
26
- "- sendMedia requires a text reply"
26
+ "- If the user requests a file, you can call the message tool with the xiaoyi-channel channel to return it. Note: sendMedia requires a text reply."
27
27
  ],
28
28
  },
29
29
  capabilities: {
package/dist/src/push.js CHANGED
@@ -59,8 +59,8 @@ export class XYPushService {
59
59
  artifactId: randomUUID(),
60
60
  parts: [
61
61
  {
62
- kind: "data",
63
- data: data || { content },
62
+ kind: "text",
63
+ text: content,
64
64
  },
65
65
  ],
66
66
  },
@@ -10,7 +10,7 @@ import { logger } from "../utils/logger.js";
10
10
  export const calendarTool = {
11
11
  name: "create_calendar_event",
12
12
  label: "Create Calendar Event",
13
- description: "在用户设备上创建日程。需要提供日程标题、开始时间和结束时间。时间格式必须为:yyyy-mm-dd hh:mm:ss(例如:2024-01-15 14:30:00",
13
+ description: "在用户设备上创建日程。需要提供日程标题、开始时间和结束时间。时间格式必须为:yyyy-mm-dd hh:mm:ss(例如:2024-01-15 14:30:00)。注意:该工具执行时间较长(最多60秒),请勿重复调用,超时或失败时最多重试一次。",
14
14
  parameters: {
15
15
  type: "object",
16
16
  properties: {
@@ -74,7 +74,7 @@ export const calendarTool = {
74
74
  const command = {
75
75
  header: {
76
76
  namespace: "Common",
77
- name: "Action",
77
+ name: "ActionAndResult",
78
78
  },
79
79
  payload: {
80
80
  cardParam: {},
@@ -105,15 +105,15 @@ export const calendarTool = {
105
105
  pageControlRelated: false,
106
106
  },
107
107
  };
108
- // Send command and wait for response (5 second timeout)
108
+ // Send command and wait for response (60 second timeout)
109
109
  logger.log(`[CALENDAR_TOOL] ⏳ Setting up promise to wait for calendar event response...`);
110
- logger.log(`[CALENDAR_TOOL] - Timeout: 5 seconds`);
110
+ logger.log(`[CALENDAR_TOOL] - Timeout: 60 seconds`);
111
111
  return new Promise((resolve, reject) => {
112
112
  const timeout = setTimeout(() => {
113
- logger.error(`[CALENDAR_TOOL] ⏰ Timeout: No response received within 5 seconds`);
113
+ logger.error(`[CALENDAR_TOOL] ⏰ Timeout: No response received within 60 seconds`);
114
114
  wsManager.off("data-event", handler);
115
- reject(new Error("创建日程超时(15秒)"));
116
- }, 15000);
115
+ reject(new Error("创建日程超时(60秒)"));
116
+ }, 60000);
117
117
  // Listen for data events from WebSocket
118
118
  const handler = (event) => {
119
119
  logger.log(`[CALENDAR_TOOL] 📨 Received data event:`, JSON.stringify(event));
@@ -9,7 +9,7 @@ import { logger } from "../utils/logger.js";
9
9
  export const locationTool = {
10
10
  name: "get_user_location",
11
11
  label: "Get User Location",
12
- description: "获取用户当前位置(经纬度坐标,WGS84坐标系)。需要用户设备授权位置访问权限。",
12
+ description: "获取用户当前位置(经纬度坐标,WGS84坐标系)。需要用户设备授权位置访问权限。注意:操作超时时间为60秒,请勿重复调用此工具,如果超时或失败,最多重试一次。",
13
13
  parameters: {
14
14
  type: "object",
15
15
  properties: {},
@@ -69,15 +69,15 @@ export const locationTool = {
69
69
  }],
70
70
  },
71
71
  };
72
- // Send command and wait for response (5 second timeout)
72
+ // Send command and wait for response (60 second timeout)
73
73
  logger.log(`[LOCATION_TOOL] ⏳ Setting up promise to wait for location response...`);
74
- logger.log(`[LOCATION_TOOL] - Timeout: 5 seconds`);
74
+ logger.log(`[LOCATION_TOOL] - Timeout: 60 seconds`);
75
75
  return new Promise((resolve, reject) => {
76
76
  const timeout = setTimeout(() => {
77
- logger.error(`[LOCATION_TOOL] ⏰ Timeout: No response received within 5 seconds`);
77
+ logger.error(`[LOCATION_TOOL] ⏰ Timeout: No response received within 60 seconds`);
78
78
  wsManager.off("data-event", handler);
79
- reject(new Error("获取位置超时(10秒)"));
80
- }, 10000);
79
+ reject(new Error("获取位置超时(60秒)"));
80
+ }, 60000);
81
81
  // Listen for data events from WebSocket
82
82
  const handler = (event) => {
83
83
  logger.log(`[LOCATION_TOOL] 📨 Received data event:`, JSON.stringify(event));
@@ -9,7 +9,7 @@ import { logger } from "../utils/logger.js";
9
9
  export const noteTool = {
10
10
  name: "create_note",
11
11
  label: "Create Note",
12
- description: "在用户设备上创建备忘录。需要提供备忘录标题和内容。",
12
+ description: "在用户设备上创建备忘录。需要提供备忘录标题和内容。注意:操作超时时间为60秒,请勿重复调用此工具,如果超时或失败,最多重试一次。",
13
13
  parameters: {
14
14
  type: "object",
15
15
  properties: {
@@ -72,12 +72,12 @@ export const noteTool = {
72
72
  pageControlRelated: false,
73
73
  },
74
74
  };
75
- // Send command and wait for response (5 second timeout)
75
+ // Send command and wait for response (60 second timeout)
76
76
  return new Promise((resolve, reject) => {
77
77
  const timeout = setTimeout(() => {
78
78
  wsManager.off("data-event", handler);
79
- reject(new Error("创建备忘录超时(10秒)"));
80
- }, 10000);
79
+ reject(new Error("创建备忘录超时(60秒)"));
80
+ }, 60000);
81
81
  // Listen for data events from WebSocket
82
82
  const handler = (event) => {
83
83
  logger.debug("Received data event:", event);
@@ -9,7 +9,7 @@ import { logger } from "../utils/logger.js";
9
9
  export const searchNoteTool = {
10
10
  name: "search_notes",
11
11
  label: "Search Notes",
12
- description: "搜索用户设备上的备忘录内容。根据关键词在备忘录的标题、内容和附件名称中进行检索。",
12
+ description: "搜索用户设备上的备忘录内容。根据关键词在备忘录的标题、内容和附件名称中进行检索。注意:操作超时时间为60秒,请勿重复调用此工具,如果超时或失败,最多重试一次。",
13
13
  parameters: {
14
14
  type: "object",
15
15
  properties: {
@@ -67,12 +67,12 @@ export const searchNoteTool = {
67
67
  pageControlRelated: false,
68
68
  },
69
69
  };
70
- // Send command and wait for response (5 second timeout)
70
+ // Send command and wait for response (60 second timeout)
71
71
  return new Promise((resolve, reject) => {
72
72
  const timeout = setTimeout(() => {
73
73
  wsManager.off("data-event", handler);
74
- reject(new Error("搜索备忘录超时(15秒)"));
75
- }, 15000);
74
+ reject(new Error("搜索备忘录超时(60秒)"));
75
+ }, 60000);
76
76
  // Listen for data events from WebSocket
77
77
  const handler = (event) => {
78
78
  logger.debug("Received data event:", event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",