@ynhcj/xiaoyi-channel 0.0.97-beta → 0.0.97-next

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.
Files changed (140) hide show
  1. package/dist/index.d.ts +6 -9
  2. package/dist/index.js +26 -21
  3. package/dist/provider-discovery.d.ts +2 -0
  4. package/dist/provider-discovery.js +4 -0
  5. package/dist/src/bot.js +29 -4
  6. package/dist/src/channel.js +2 -19
  7. package/dist/src/client.js +31 -22
  8. package/dist/src/cspl/call-api.js +6 -5
  9. package/dist/src/file-download.js +4 -3
  10. package/dist/src/file-upload.js +19 -18
  11. package/dist/src/formatter.d.ts +2 -0
  12. package/dist/src/formatter.js +9 -28
  13. package/dist/src/heartbeat.js +1 -1
  14. package/dist/src/login-token-handler.d.ts +8 -0
  15. package/dist/src/login-token-handler.js +60 -0
  16. package/dist/src/message-queue.d.ts +17 -0
  17. package/dist/src/message-queue.js +51 -0
  18. package/dist/src/monitor.js +70 -14
  19. package/dist/src/outbound.js +19 -18
  20. package/dist/src/provider.d.ts +2 -1
  21. package/dist/src/provider.js +245 -38
  22. package/dist/src/push.js +16 -15
  23. package/dist/src/reply-dispatcher.js +12 -3
  24. package/dist/src/runtime.d.ts +3 -11
  25. package/dist/src/runtime.js +6 -18
  26. package/dist/src/self-evolution-handler.d.ts +6 -0
  27. package/dist/src/self-evolution-handler.js +100 -7
  28. package/dist/src/self-evolution-keyword.d.ts +9 -0
  29. package/dist/src/self-evolution-keyword.js +147 -0
  30. package/dist/src/self-evolution-tool-result-nudge.d.ts +3 -0
  31. package/dist/src/self-evolution-tool-result-nudge.js +96 -0
  32. package/dist/src/skill-retriever/config.d.ts +4 -0
  33. package/dist/src/skill-retriever/config.js +23 -0
  34. package/dist/src/skill-retriever/hooks.d.ts +22 -0
  35. package/dist/src/skill-retriever/hooks.js +83 -0
  36. package/dist/src/skill-retriever/tool-search.d.ts +16 -0
  37. package/dist/src/skill-retriever/tool-search.js +173 -0
  38. package/dist/src/skill-retriever/types.d.ts +36 -0
  39. package/dist/src/skill-retriever/types.js +1 -0
  40. package/dist/src/steer-injector.js +1 -1
  41. package/dist/src/task-manager.d.ts +4 -0
  42. package/dist/src/task-manager.js +12 -1
  43. package/dist/src/tools/calendar-tool.d.ts +2 -1
  44. package/dist/src/tools/calendar-tool.js +112 -116
  45. package/dist/src/tools/call-device-tool.d.ts +2 -1
  46. package/dist/src/tools/call-device-tool.js +126 -103
  47. package/dist/src/tools/call-phone-tool.d.ts +2 -1
  48. package/dist/src/tools/call-phone-tool.js +109 -113
  49. package/dist/src/tools/create-alarm-tool.d.ts +2 -1
  50. package/dist/src/tools/create-alarm-tool.js +227 -231
  51. package/dist/src/tools/create-all-tools.d.ts +16 -0
  52. package/dist/src/tools/create-all-tools.js +50 -0
  53. package/dist/src/tools/delete-alarm-tool.d.ts +2 -1
  54. package/dist/src/tools/delete-alarm-tool.js +131 -135
  55. package/dist/src/tools/get-alarm-tool-schema.d.ts +2 -1
  56. package/dist/src/tools/get-alarm-tool-schema.js +16 -10
  57. package/dist/src/tools/get-calendar-tool-schema.d.ts +2 -1
  58. package/dist/src/tools/get-calendar-tool-schema.js +12 -8
  59. package/dist/src/tools/get-collection-tool-schema.d.ts +2 -1
  60. package/dist/src/tools/get-collection-tool-schema.js +11 -9
  61. package/dist/src/tools/get-contact-tool-schema.d.ts +2 -1
  62. package/dist/src/tools/get-contact-tool-schema.js +16 -10
  63. package/dist/src/tools/get-device-file-tool-schema.d.ts +2 -1
  64. package/dist/src/tools/get-device-file-tool-schema.js +13 -9
  65. package/dist/src/tools/get-email-tool-schema.d.ts +2 -1
  66. package/dist/src/tools/get-email-tool-schema.js +11 -8
  67. package/dist/src/tools/get-note-tool-schema.d.ts +2 -1
  68. package/dist/src/tools/get-note-tool-schema.js +14 -9
  69. package/dist/src/tools/get-photo-tool-schema.d.ts +2 -1
  70. package/dist/src/tools/get-photo-tool-schema.js +12 -9
  71. package/dist/src/tools/image-reading-tool.d.ts +2 -1
  72. package/dist/src/tools/image-reading-tool.js +86 -90
  73. package/dist/src/tools/location-tool.d.ts +2 -1
  74. package/dist/src/tools/location-tool.js +87 -91
  75. package/dist/src/tools/login-token-tool.d.ts +6 -0
  76. package/dist/src/tools/login-token-tool.js +133 -0
  77. package/dist/src/tools/modify-alarm-tool.d.ts +2 -1
  78. package/dist/src/tools/modify-alarm-tool.js +232 -236
  79. package/dist/src/tools/modify-note-tool.d.ts +2 -1
  80. package/dist/src/tools/modify-note-tool.js +104 -108
  81. package/dist/src/tools/note-tool.d.ts +2 -1
  82. package/dist/src/tools/note-tool.js +103 -107
  83. package/dist/src/tools/query-app-message-tool.d.ts +2 -1
  84. package/dist/src/tools/query-app-message-tool.js +108 -111
  85. package/dist/src/tools/query-memory-data-tool.d.ts +2 -1
  86. package/dist/src/tools/query-memory-data-tool.js +109 -112
  87. package/dist/src/tools/query-todo-task-tool.d.ts +2 -1
  88. package/dist/src/tools/query-todo-task-tool.js +103 -106
  89. package/dist/src/tools/save-file-to-phone-tool.d.ts +2 -1
  90. package/dist/src/tools/save-file-to-phone-tool.js +127 -131
  91. package/dist/src/tools/save-media-to-gallery-tool.d.ts +2 -1
  92. package/dist/src/tools/save-media-to-gallery-tool.js +134 -138
  93. package/dist/src/tools/save-self-evolution-skill-tool.d.ts +2 -0
  94. package/dist/src/tools/save-self-evolution-skill-tool.js +410 -0
  95. package/dist/src/tools/search-alarm-tool.d.ts +2 -1
  96. package/dist/src/tools/search-alarm-tool.js +171 -175
  97. package/dist/src/tools/search-calendar-tool.d.ts +2 -1
  98. package/dist/src/tools/search-calendar-tool.js +145 -149
  99. package/dist/src/tools/search-contact-tool.d.ts +2 -1
  100. package/dist/src/tools/search-contact-tool.js +98 -102
  101. package/dist/src/tools/search-email-tool.d.ts +2 -1
  102. package/dist/src/tools/search-email-tool.js +107 -111
  103. package/dist/src/tools/search-file-tool.d.ts +2 -1
  104. package/dist/src/tools/search-file-tool.js +99 -103
  105. package/dist/src/tools/search-message-tool.d.ts +2 -1
  106. package/dist/src/tools/search-message-tool.js +100 -104
  107. package/dist/src/tools/search-note-tool.d.ts +2 -1
  108. package/dist/src/tools/search-note-tool.js +95 -99
  109. package/dist/src/tools/search-photo-gallery-tool.d.ts +2 -1
  110. package/dist/src/tools/search-photo-gallery-tool.js +34 -38
  111. package/dist/src/tools/send-email-tool.d.ts +2 -1
  112. package/dist/src/tools/send-email-tool.js +105 -108
  113. package/dist/src/tools/send-file-to-user-tool.d.ts +2 -1
  114. package/dist/src/tools/send-file-to-user-tool.js +154 -155
  115. package/dist/src/tools/send-message-tool.d.ts +2 -1
  116. package/dist/src/tools/send-message-tool.js +119 -123
  117. package/dist/src/tools/session-manager.d.ts +21 -6
  118. package/dist/src/tools/session-manager.js +147 -18
  119. package/dist/src/tools/upload-file-tool.d.ts +2 -1
  120. package/dist/src/tools/upload-file-tool.js +78 -82
  121. package/dist/src/tools/upload-photo-tool.d.ts +2 -1
  122. package/dist/src/tools/upload-photo-tool.js +69 -73
  123. package/dist/src/tools/xiaoyi-add-collection-tool.d.ts +2 -1
  124. package/dist/src/tools/xiaoyi-add-collection-tool.js +143 -147
  125. package/dist/src/tools/xiaoyi-collection-tool.d.ts +2 -1
  126. package/dist/src/tools/xiaoyi-collection-tool.js +111 -115
  127. package/dist/src/tools/xiaoyi-delete-collection-tool.d.ts +2 -1
  128. package/dist/src/tools/xiaoyi-delete-collection-tool.js +124 -128
  129. package/dist/src/tools/xiaoyi-gui-tool.d.ts +2 -1
  130. package/dist/src/tools/xiaoyi-gui-tool.js +84 -88
  131. package/dist/src/utils/logger.js +20 -18
  132. package/dist/src/utils/runtime-manager.js +24 -2
  133. package/dist/src/utils/self-evolution-manager.d.ts +10 -0
  134. package/dist/src/utils/self-evolution-manager.js +69 -0
  135. package/dist/src/utils/tool-call-nudge-manager.d.ts +16 -0
  136. package/dist/src/utils/tool-call-nudge-manager.js +47 -0
  137. package/dist/src/websocket.d.ts +3 -0
  138. package/dist/src/websocket.js +91 -26
  139. package/openclaw.plugin.json +22 -0
  140. package/package.json +3 -3
@@ -1,6 +1,5 @@
1
1
  import { getXYWebSocketManager } from "../client.js";
2
2
  import { sendCommand } from "../formatter.js";
3
- import { getCurrentSessionContext } from "./session-manager.js";
4
3
  /**
5
4
  * XY delete alarm tool - deletes existing alarms on user's device.
6
5
  * Requires entityId(s) from search_alarm or create_alarm tool as prerequisite.
@@ -11,10 +10,12 @@ import { getCurrentSessionContext } from "./session-manager.js";
11
10
  *
12
11
  * Supports deleting single or multiple alarms in one call.
13
12
  */
14
- export const deleteAlarmTool = {
15
- name: "delete_alarm",
16
- label: "Delete Alarm",
17
- description: `删除用户设备上的闹钟。使用前必须先调用 search_alarm 或 create_alarm 工具获取闹钟的 entityId。
13
+ export function createDeleteAlarmTool(ctx) {
14
+ const { config, sessionId, taskId, messageId } = ctx;
15
+ return {
16
+ name: "delete_alarm",
17
+ label: "Delete Alarm",
18
+ description: `删除用户设备上的闹钟。使用前必须先调用 search_alarm 或 create_alarm 工具获取闹钟的 entityId。
18
19
 
19
20
  使用示例:
20
21
  - 删除单个闹钟:{"items": [{"entityId": "6"}]}
@@ -26,146 +27,141 @@ export const deleteAlarmTool = {
26
27
  3. items 参数支持数组或 JSON 字符串格式,代码会自动解析。
27
28
 
28
29
  回复约束:如果工具返回没有授权或者其他报错,只需要完整描述没有授权或者其他报错内容即可,不需要主动给用户提供解决方案,例如告诉用户如何授权,如何解决报错等都是不需要的,请严格遵守。`,
29
- parameters: {
30
- type: "object",
31
- properties: {
32
- items: {
33
- // 不指定 type,允许传入数组或 JSON 字符串
34
- // 具体的类型验证和转换在 execute 函数内部进行
35
- description: "要删除的闹钟列表,每个元素包含 entityId 字段。支持数组或 JSON 字符串格式。entityId 是闹钟的唯一标识符(从 search_alarm 或 create_alarm 工具获取)。",
30
+ parameters: {
31
+ type: "object",
32
+ properties: {
33
+ items: {
34
+ // 不指定 type,允许传入数组或 JSON 字符串
35
+ // 具体的类型验证和转换在 execute 函数内部进行
36
+ description: "要删除的闹钟列表,每个元素包含 entityId 字段。支持数组或 JSON 字符串格式。entityId 是闹钟的唯一标识符(从 search_alarm 或 create_alarm 工具获取)。",
37
+ },
36
38
  },
39
+ required: ["items"],
37
40
  },
38
- required: ["items"],
39
- },
40
- async execute(toolCallId, params) {
41
- // ===== 参数规范化:兼容数组和 JSON 字符串 =====
42
- let items = null;
43
- if (!params.items) {
44
- throw new Error("Missing required parameter: items");
45
- }
46
- // 情况1: 已经是数组
47
- if (Array.isArray(params.items)) {
48
- items = params.items;
49
- }
50
- // 情况2: 是字符串,尝试解析为 JSON 数组
51
- else if (typeof params.items === 'string') {
52
- try {
53
- const parsed = JSON.parse(params.items);
54
- if (Array.isArray(parsed)) {
55
- items = parsed;
41
+ async execute(toolCallId, params) {
42
+ // ===== 参数规范化:兼容数组和 JSON 字符串 =====
43
+ let items = null;
44
+ if (!params.items) {
45
+ throw new Error("Missing required parameter: items");
46
+ }
47
+ // 情况1: 已经是数组
48
+ if (Array.isArray(params.items)) {
49
+ items = params.items;
50
+ }
51
+ // 情况2: 是字符串,尝试解析为 JSON 数组
52
+ else if (typeof params.items === 'string') {
53
+ try {
54
+ const parsed = JSON.parse(params.items);
55
+ if (Array.isArray(parsed)) {
56
+ items = parsed;
57
+ }
58
+ else {
59
+ throw new Error("items must be an array or a JSON string representing an array");
60
+ }
56
61
  }
57
- else {
58
- throw new Error("items must be an array or a JSON string representing an array");
62
+ catch (parseError) {
63
+ throw new Error(`items must be a valid JSON array string. Parse error: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
59
64
  }
60
65
  }
61
- catch (parseError) {
62
- throw new Error(`items must be a valid JSON array string. Parse error: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
66
+ // 情况3: 其他类型,报错
67
+ else {
68
+ throw new Error(`items must be an array or a JSON string, got ${typeof params.items}`);
63
69
  }
64
- }
65
- // 情况3: 其他类型,报错
66
- else {
67
- throw new Error(`items must be an array or a JSON string, got ${typeof params.items}`);
68
- }
69
- // 验证数组非空
70
- if (!items || items.length === 0) {
71
- throw new Error("items array cannot be empty");
72
- }
73
- // 验证每个 item 是否有有效的 entityId
74
- for (let i = 0; i < items.length; i++) {
75
- const item = items[i];
76
- if (!item || typeof item !== 'object') {
77
- throw new Error(`items[${i}] must be an object with entityId property`);
70
+ // 验证数组非空
71
+ if (!items || items.length === 0) {
72
+ throw new Error("items array cannot be empty");
78
73
  }
79
- if (!item.entityId || typeof item.entityId !== 'string') {
80
- throw new Error(`items[${i}] must have a valid entityId string property`);
74
+ // 验证每个 item 是否有有效的 entityId
75
+ for (let i = 0; i < items.length; i++) {
76
+ const item = items[i];
77
+ if (!item || typeof item !== 'object') {
78
+ throw new Error(`items[${i}] must be an object with entityId property`);
79
+ }
80
+ if (!item.entityId || typeof item.entityId !== 'string') {
81
+ throw new Error(`items[${i}] must have a valid entityId string property`);
82
+ }
81
83
  }
82
- }
83
- // Get session context
84
- const sessionContext = getCurrentSessionContext();
85
- if (!sessionContext) {
86
- throw new Error("No active XY session found. Delete alarm tool can only be used during an active conversation.");
87
- }
88
- const { config, sessionId, taskId, messageId } = sessionContext;
89
- // Get WebSocket manager
90
- const wsManager = getXYWebSocketManager(config);
91
- // Build DeleteAlarm command
92
- const command = {
93
- header: {
94
- namespace: "Common",
95
- name: "Action",
96
- },
97
- payload: {
98
- cardParam: {},
99
- executeParam: {
100
- executeMode: "background",
101
- intentName: "DeleteAlarm",
102
- bundleName: "com.huawei.hmos.clock",
103
- needUnlock: true,
104
- actionResponse: true,
105
- appType: "OHOS_APP",
106
- timeOut: 5,
107
- intentParam: {
108
- items: items,
109
- },
110
- permissionId: [],
111
- achieveType: "INTENT",
84
+ // Get WebSocket manager
85
+ const wsManager = getXYWebSocketManager(config);
86
+ // Build DeleteAlarm command
87
+ const command = {
88
+ header: {
89
+ namespace: "Common",
90
+ name: "Action",
112
91
  },
113
- responses: [
114
- {
115
- resultCode: "",
116
- displayText: "",
117
- ttsText: "",
92
+ payload: {
93
+ cardParam: {},
94
+ executeParam: {
95
+ executeMode: "background",
96
+ intentName: "DeleteAlarm",
97
+ bundleName: "com.huawei.hmos.clock",
98
+ needUnlock: true,
99
+ actionResponse: true,
100
+ appType: "OHOS_APP",
101
+ timeOut: 5,
102
+ intentParam: {
103
+ items: items,
104
+ },
105
+ permissionId: [],
106
+ achieveType: "INTENT",
118
107
  },
119
- ],
120
- needUploadResult: true,
121
- noHalfPage: false,
122
- pageControlRelated: false,
123
- },
124
- };
125
- // Send command and wait for response (60 second timeout)
126
- return new Promise((resolve, reject) => {
127
- const timeout = setTimeout(() => {
128
- wsManager.off("data-event", handler);
129
- reject(new Error("删除闹钟超时(60秒)"));
130
- }, 60000);
131
- // Listen for data events from WebSocket
132
- const handler = (event) => {
133
- if (event.intentName === "DeleteAlarm") {
134
- clearTimeout(timeout);
108
+ responses: [
109
+ {
110
+ resultCode: "",
111
+ displayText: "",
112
+ ttsText: "",
113
+ },
114
+ ],
115
+ needUploadResult: true,
116
+ noHalfPage: false,
117
+ pageControlRelated: false,
118
+ },
119
+ };
120
+ // Send command and wait for response (60 second timeout)
121
+ return new Promise((resolve, reject) => {
122
+ const timeout = setTimeout(() => {
135
123
  wsManager.off("data-event", handler);
136
- if (event.status === "success" && event.outputs) {
137
- // 成功,直接返回完整的 event.outputs JSON 字符串
138
- resolve({
139
- content: [
140
- {
141
- type: "text",
142
- text: JSON.stringify(event.outputs),
143
- },
144
- ],
145
- });
146
- }
147
- else {
148
- reject(new Error(`删除闹钟失败: ${event.status}`));
124
+ reject(new Error("删除闹钟超时(60秒)"));
125
+ }, 60000);
126
+ // Listen for data events from WebSocket
127
+ const handler = (event) => {
128
+ if (event.intentName === "DeleteAlarm") {
129
+ clearTimeout(timeout);
130
+ wsManager.off("data-event", handler);
131
+ if (event.status === "success" && event.outputs) {
132
+ // 成功,直接返回完整的 event.outputs JSON 字符串
133
+ resolve({
134
+ content: [
135
+ {
136
+ type: "text",
137
+ text: JSON.stringify(event.outputs),
138
+ },
139
+ ],
140
+ });
141
+ }
142
+ else {
143
+ reject(new Error(`删除闹钟失败: ${event.status}`));
144
+ }
149
145
  }
150
- }
151
- };
152
- // Register event handler
153
- wsManager.on("data-event", handler);
154
- // Send the command
155
- sendCommand({
156
- config,
157
- sessionId,
158
- taskId,
159
- messageId,
160
- command,
161
- })
162
- .then(() => {
163
- })
164
- .catch((error) => {
165
- clearTimeout(timeout);
166
- wsManager.off("data-event", handler);
167
- reject(error);
146
+ };
147
+ // Register event handler
148
+ wsManager.on("data-event", handler);
149
+ // Send the command
150
+ sendCommand({
151
+ config,
152
+ sessionId,
153
+ taskId,
154
+ messageId,
155
+ command,
156
+ })
157
+ .then(() => {
158
+ })
159
+ .catch((error) => {
160
+ clearTimeout(timeout);
161
+ wsManager.off("data-event", handler);
162
+ reject(error);
163
+ });
168
164
  });
169
- });
170
- },
171
- };
165
+ },
166
+ };
167
+ }
@@ -1,4 +1,5 @@
1
- export declare const getAlarmToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetAlarmToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,11 +1,17 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { createAlarmTool } from "./create-alarm-tool.js";
3
- import { searchAlarmTool } from "./search-alarm-tool.js";
4
- import { modifyAlarmTool } from "./modify-alarm-tool.js";
5
- import { deleteAlarmTool } from "./delete-alarm-tool.js";
6
- export const getAlarmToolSchemaTool = createSchemaTool({
7
- name: "get_alarm_tool_schema",
8
- label: "Get Alarm Tool Schema",
9
- description: "获取可在用户设备上创建、检索、修改、删除闹钟的相关端工具列表。",
10
- tools: [createAlarmTool, searchAlarmTool, modifyAlarmTool, deleteAlarmTool],
11
- });
2
+ import { makeAlarmTool } from "./create-alarm-tool.js";
3
+ import { createSearchAlarmTool } from "./search-alarm-tool.js";
4
+ import { createModifyAlarmTool } from "./modify-alarm-tool.js";
5
+ import { createDeleteAlarmTool } from "./delete-alarm-tool.js";
6
+ export function createGetAlarmToolSchemaTool(ctx) {
7
+ const createAlarmTool = makeAlarmTool(ctx);
8
+ const modifyAlarmTool = createModifyAlarmTool(ctx);
9
+ const deleteAlarmTool = createDeleteAlarmTool(ctx);
10
+ const searchAlarmTool = createSearchAlarmTool(ctx);
11
+ return createSchemaTool({
12
+ name: "get_alarm_tool_schema",
13
+ label: "Get Alarm Tool Schema",
14
+ description: "获取可在用户设备上创建、检索、修改、删除闹钟的相关端工具列表。",
15
+ tools: [createAlarmTool, searchAlarmTool, modifyAlarmTool, deleteAlarmTool],
16
+ });
17
+ }
@@ -1,4 +1,5 @@
1
- export declare const getCalendarToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetCalendarToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,9 +1,13 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { calendarTool } from "./calendar-tool.js";
3
- import { searchCalendarTool } from "./search-calendar-tool.js";
4
- export const getCalendarToolSchemaTool = createSchemaTool({
5
- name: "get_calendar_tool_schema",
6
- label: "Get Calendar Tool Schema",
7
- description: "获取可在用户设备上创建、检索日程的相关端工具列表。",
8
- tools: [calendarTool, searchCalendarTool],
9
- });
2
+ import { createCalendarTool } from "./calendar-tool.js";
3
+ import { createSearchCalendarTool } from "./search-calendar-tool.js";
4
+ export function createGetCalendarToolSchemaTool(ctx) {
5
+ const calendarTool = createCalendarTool(ctx);
6
+ const searchCalendarTool = createSearchCalendarTool(ctx);
7
+ return createSchemaTool({
8
+ name: "get_calendar_tool_schema",
9
+ label: "Get Calendar Tool Schema",
10
+ description: "获取可在用户设备上创建、检索日程的相关端工具列表。",
11
+ tools: [calendarTool, searchCalendarTool],
12
+ });
13
+ }
@@ -1,4 +1,5 @@
1
- export declare const getCollectionToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetCollectionToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,10 +1,12 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { xiaoyiAddCollectionTool } from "./xiaoyi-add-collection-tool.js";
3
- import { xiaoyiCollectionTool } from "./xiaoyi-collection-tool.js";
4
- import { xiaoyiDeleteCollectionTool } from "./xiaoyi-delete-collection-tool.js";
5
- export const getCollectionToolSchemaTool = createSchemaTool({
6
- name: "get_collection_tool_schema",
7
- label: "Get Collection Tool Schema",
8
- description: "获取可在用户设备上添加、检索、删除小艺收藏中的公共知识数据的相关端工具列表。",
9
- tools: [xiaoyiAddCollectionTool, xiaoyiCollectionTool, xiaoyiDeleteCollectionTool],
10
- });
2
+ import { createXiaoyiAddCollectionTool } from "./xiaoyi-add-collection-tool.js";
3
+ import { createXiaoyiCollectionTool } from "./xiaoyi-collection-tool.js";
4
+ import { createXiaoyiDeleteCollectionTool } from "./xiaoyi-delete-collection-tool.js";
5
+ export function createGetCollectionToolSchemaTool(ctx) {
6
+ return createSchemaTool({
7
+ name: "get_collection_tool_schema",
8
+ label: "Get Collection Tool Schema",
9
+ description: "获取可在用户设备上添加、检索、删除小艺收藏中的公共知识数据的相关端工具列表。",
10
+ tools: [createXiaoyiAddCollectionTool(ctx), createXiaoyiCollectionTool(ctx), createXiaoyiDeleteCollectionTool(ctx)],
11
+ });
12
+ }
@@ -1,4 +1,5 @@
1
- export declare const getContactToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetContactToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,11 +1,17 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { searchContactTool } from "./search-contact-tool.js";
3
- import { callPhoneTool } from "./call-phone-tool.js";
4
- import { searchMessageTool } from "./search-message-tool.js";
5
- import { sendMessageTool } from "./send-message-tool.js";
6
- export const getContactToolSchemaTool = createSchemaTool({
7
- name: "get_contact_tool_schema",
8
- label: "Get Contact Tool Schema",
9
- description: "获取可在用户设备上检索通讯录联系人信息、拨打电话、搜索短信与发送短信的相关端工具列表。",
10
- tools: [searchContactTool, callPhoneTool, searchMessageTool, sendMessageTool],
11
- });
2
+ import { createSearchContactTool } from "./search-contact-tool.js";
3
+ import { createCallPhoneTool } from "./call-phone-tool.js";
4
+ import { createSearchMessageTool } from "./search-message-tool.js";
5
+ import { createSendMessageTool } from "./send-message-tool.js";
6
+ export function createGetContactToolSchemaTool(ctx) {
7
+ const callPhoneTool = createCallPhoneTool(ctx);
8
+ const searchMessageTool = createSearchMessageTool(ctx);
9
+ const sendMessageTool = createSendMessageTool(ctx);
10
+ const searchContactTool = createSearchContactTool(ctx);
11
+ return createSchemaTool({
12
+ name: "get_contact_tool_schema",
13
+ label: "Get Contact Tool Schema",
14
+ description: "获取可在用户设备上检索通讯录联系人信息、拨打电话、搜索短信与发送短信的相关端工具列表。",
15
+ tools: [searchContactTool, callPhoneTool, searchMessageTool, sendMessageTool],
16
+ });
17
+ }
@@ -1,4 +1,5 @@
1
- export declare const getDeviceFileToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetDeviceFileToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,10 +1,14 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { searchFileTool } from "./search-file-tool.js";
3
- import { uploadFileTool } from "./upload-file-tool.js";
4
- import { saveFileToPhoneTool } from "./save-file-to-phone-tool.js";
5
- export const getDeviceFileToolSchemaTool = createSchemaTool({
6
- name: "get_device_file_tool_schema",
7
- label: "Get Device File Tool Schema",
8
- description: "获取可在用户设备上搜索文件系统的文件、将用户设备本地文件上传到公网并获取链接、保存文件到文件管理器的相关端工具列表。",
9
- tools: [searchFileTool, uploadFileTool, saveFileToPhoneTool],
10
- });
2
+ import { createSearchFileTool } from "./search-file-tool.js";
3
+ import { createUploadFileTool } from "./upload-file-tool.js";
4
+ import { createSaveFileToPhoneTool } from "./save-file-to-phone-tool.js";
5
+ export function createGetDeviceFileToolSchemaTool(ctx) {
6
+ const searchFileTool = createSearchFileTool(ctx);
7
+ const saveFileToPhoneTool = createSaveFileToPhoneTool(ctx);
8
+ return createSchemaTool({
9
+ name: "get_device_file_tool_schema",
10
+ label: "Get Device File Tool Schema",
11
+ description: "获取可在用户设备上搜索文件系统的文件、将用户设备本地文件上传到公网并获取链接、保存文件到文件管理器的相关端工具列表。",
12
+ tools: [searchFileTool, createUploadFileTool(ctx), saveFileToPhoneTool],
13
+ });
14
+ }
@@ -1,4 +1,5 @@
1
- export declare const getEmailToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetEmailToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,9 +1,12 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { sendEmailTool } from "./send-email-tool.js";
3
- import { searchEmailTool } from "./search-email-tool.js";
4
- export const getEmailToolSchemaTool = createSchemaTool({
5
- name: "get_email_tool_schema",
6
- label: "Get Email Tool Schema",
7
- description: "获取可在用户设备上发送邮件、检索邮件的相关端工具列表。",
8
- tools: [sendEmailTool, searchEmailTool],
9
- });
2
+ import { createSendEmailTool } from "./send-email-tool.js";
3
+ import { createSearchEmailTool } from "./search-email-tool.js";
4
+ export function createGetEmailToolSchemaTool(ctx) {
5
+ const searchEmailTool = createSearchEmailTool(ctx);
6
+ return createSchemaTool({
7
+ name: "get_email_tool_schema",
8
+ label: "Get Email Tool Schema",
9
+ description: "获取可在用户设备上发送邮件、检索邮件的相关端工具列表。",
10
+ tools: [createSendEmailTool(ctx), searchEmailTool],
11
+ });
12
+ }
@@ -1,4 +1,5 @@
1
- export declare const getNoteToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetNoteToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,10 +1,15 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { noteTool } from "./note-tool.js";
3
- import { searchNoteTool } from "./search-note-tool.js";
4
- import { modifyNoteTool } from "./modify-note-tool.js";
5
- export const getNoteToolSchemaTool = createSchemaTool({
6
- name: "get_note_tool_schema",
7
- label: "Get Note Tool Schema",
8
- description: "获取可在用户设备上创建、搜索、追加备忘录的相关端工具列表。",
9
- tools: [noteTool, searchNoteTool, modifyNoteTool],
10
- });
2
+ import { createNoteTool } from "./note-tool.js";
3
+ import { createSearchNoteTool } from "./search-note-tool.js";
4
+ import { createModifyNoteTool } from "./modify-note-tool.js";
5
+ export function createGetNoteToolSchemaTool(ctx) {
6
+ const noteTool = createNoteTool(ctx);
7
+ const modifyNoteTool = createModifyNoteTool(ctx);
8
+ const searchNoteTool = createSearchNoteTool(ctx);
9
+ return createSchemaTool({
10
+ name: "get_note_tool_schema",
11
+ label: "Get Note Tool Schema",
12
+ description: "获取可在用户设备上创建、搜索、追加备忘录的相关端工具列表。",
13
+ tools: [noteTool, searchNoteTool, modifyNoteTool],
14
+ });
15
+ }
@@ -1,4 +1,5 @@
1
- export declare const getPhotoToolSchemaTool: {
1
+ import type { SessionContext } from "./session-manager.js";
2
+ export declare function createGetPhotoToolSchemaTool(ctx: SessionContext): {
2
3
  name: string;
3
4
  label: string;
4
5
  description: string;
@@ -1,10 +1,13 @@
1
1
  import { createSchemaTool } from "./schema-tool-factory.js";
2
- import { searchPhotoGalleryTool } from "./search-photo-gallery-tool.js";
3
- import { uploadPhotoTool } from "./upload-photo-tool.js";
4
- import { saveMediaToGalleryTool } from "./save-media-to-gallery-tool.js";
5
- export const getPhotoToolSchemaTool = createSchemaTool({
6
- name: "get_photo_tool_schema",
7
- label: "Get Photo Tool Schema",
8
- description: "获取可在用户设备上搜索图库照片、将照片上传到公网并获取链接、保存图片或视频到图库的相关端工具列表。",
9
- tools: [searchPhotoGalleryTool, uploadPhotoTool, saveMediaToGalleryTool],
10
- });
2
+ import { createSearchPhotoGalleryTool } from "./search-photo-gallery-tool.js";
3
+ import { createUploadPhotoTool } from "./upload-photo-tool.js";
4
+ import { createSaveMediaToGalleryTool } from "./save-media-to-gallery-tool.js";
5
+ export function createGetPhotoToolSchemaTool(ctx) {
6
+ const saveMediaToGalleryTool = createSaveMediaToGalleryTool(ctx);
7
+ return createSchemaTool({
8
+ name: "get_photo_tool_schema",
9
+ label: "Get Photo Tool Schema",
10
+ description: "获取可在用户设备上搜索图库照片、将照片上传到公网并获取链接、保存图片或视频到图库的相关端工具列表。",
11
+ tools: [createSearchPhotoGalleryTool(ctx), createUploadPhotoTool(ctx), saveMediaToGalleryTool],
12
+ });
13
+ }
@@ -1,5 +1,6 @@
1
+ import type { SessionContext } from "./session-manager.js";
1
2
  /**
2
3
  * XY Image Reading tool - performs image understanding using local or remote image URLs.
3
4
  * Supports both local file paths and remote URLs.
4
5
  */
5
- export declare const imageReadingTool: any;
6
+ export declare function createImageReadingTool(ctx: SessionContext): any;