@ynhcj/xiaoyi-channel 0.0.85-beta → 0.0.85-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.
- package/dist/index.d.ts +6 -9
- package/dist/index.js +26 -21
- package/dist/src/bot.js +26 -3
- package/dist/src/channel.js +2 -29
- package/dist/src/client.js +7 -1
- package/dist/src/login-token-handler.d.ts +8 -0
- package/dist/src/login-token-handler.js +60 -0
- package/dist/src/message-queue.d.ts +17 -0
- package/dist/src/message-queue.js +51 -0
- package/dist/src/monitor.js +64 -4
- package/dist/src/provider.d.ts +2 -1
- package/dist/src/provider.js +442 -25
- package/dist/src/reply-dispatcher.js +6 -0
- package/dist/src/runtime.d.ts +3 -11
- package/dist/src/runtime.js +6 -18
- package/dist/src/self-evolution-handler.d.ts +7 -0
- package/dist/src/self-evolution-handler.js +140 -0
- package/dist/src/self-evolution-keyword.d.ts +9 -0
- package/dist/src/self-evolution-keyword.js +147 -0
- package/dist/src/self-evolution-tool-result-nudge.d.ts +3 -0
- package/dist/src/self-evolution-tool-result-nudge.js +96 -0
- package/dist/src/skill-retriever/config.d.ts +4 -0
- package/dist/src/skill-retriever/config.js +23 -0
- package/dist/src/skill-retriever/hooks.d.ts +22 -0
- package/dist/src/skill-retriever/hooks.js +82 -0
- package/dist/src/skill-retriever/tool-search.d.ts +16 -0
- package/dist/src/skill-retriever/tool-search.js +172 -0
- package/dist/src/skill-retriever/types.d.ts +36 -0
- package/dist/src/skill-retriever/types.js +1 -0
- package/dist/src/task-manager.d.ts +4 -0
- package/dist/src/task-manager.js +12 -1
- package/dist/src/tools/calendar-tool.d.ts +2 -1
- package/dist/src/tools/calendar-tool.js +112 -116
- package/dist/src/tools/call-device-tool.d.ts +6 -0
- package/dist/src/tools/call-device-tool.js +153 -0
- package/dist/src/tools/call-phone-tool.d.ts +2 -1
- package/dist/src/tools/call-phone-tool.js +109 -113
- package/dist/src/tools/create-alarm-tool.d.ts +2 -1
- package/dist/src/tools/create-alarm-tool.js +226 -241
- package/dist/src/tools/create-all-tools.d.ts +16 -0
- package/dist/src/tools/create-all-tools.js +50 -0
- package/dist/src/tools/delete-alarm-tool.d.ts +2 -1
- package/dist/src/tools/delete-alarm-tool.js +131 -138
- package/dist/src/tools/device-tool-map.js +5 -3
- package/dist/src/tools/get-alarm-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-alarm-tool-schema.js +17 -0
- package/dist/src/tools/get-calendar-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-calendar-tool-schema.js +13 -0
- package/dist/src/tools/get-collection-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-collection-tool-schema.js +12 -0
- package/dist/src/tools/get-contact-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-contact-tool-schema.js +17 -0
- package/dist/src/tools/get-device-file-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-device-file-tool-schema.js +14 -0
- package/dist/src/tools/get-email-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-email-tool-schema.js +12 -0
- package/dist/src/tools/get-note-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-note-tool-schema.js +15 -0
- package/dist/src/tools/get-photo-tool-schema.d.ts +17 -0
- package/dist/src/tools/get-photo-tool-schema.js +13 -0
- package/dist/src/tools/image-reading-tool.d.ts +2 -1
- package/dist/src/tools/image-reading-tool.js +87 -94
- package/dist/src/tools/location-tool.d.ts +2 -1
- package/dist/src/tools/location-tool.js +87 -91
- package/dist/src/tools/login-token-tool.d.ts +6 -0
- package/dist/src/tools/login-token-tool.js +133 -0
- package/dist/src/tools/modify-alarm-tool.d.ts +2 -1
- package/dist/src/tools/modify-alarm-tool.js +233 -250
- package/dist/src/tools/modify-note-tool.d.ts +2 -1
- package/dist/src/tools/modify-note-tool.js +104 -108
- package/dist/src/tools/note-tool.d.ts +2 -1
- package/dist/src/tools/note-tool.js +103 -107
- package/dist/src/tools/query-app-message-tool.d.ts +5 -0
- package/dist/src/tools/query-app-message-tool.js +135 -0
- package/dist/src/tools/query-memory-data-tool.d.ts +5 -0
- package/dist/src/tools/query-memory-data-tool.js +151 -0
- package/dist/src/tools/query-todo-task-tool.d.ts +5 -0
- package/dist/src/tools/query-todo-task-tool.js +130 -0
- package/dist/src/tools/save-file-to-phone-tool.d.ts +2 -1
- package/dist/src/tools/save-file-to-phone-tool.js +127 -135
- package/dist/src/tools/save-media-to-gallery-tool.d.ts +2 -1
- package/dist/src/tools/save-media-to-gallery-tool.js +134 -142
- package/dist/src/tools/save-self-evolution-skill-tool.d.ts +2 -0
- package/dist/src/tools/save-self-evolution-skill-tool.js +410 -0
- package/dist/src/tools/schema-tool-factory.d.ts +27 -0
- package/dist/src/tools/schema-tool-factory.js +32 -0
- package/dist/src/tools/search-alarm-tool.d.ts +2 -1
- package/dist/src/tools/search-alarm-tool.js +171 -182
- package/dist/src/tools/search-calendar-tool.d.ts +2 -1
- package/dist/src/tools/search-calendar-tool.js +145 -149
- package/dist/src/tools/search-contact-tool.d.ts +2 -1
- package/dist/src/tools/search-contact-tool.js +98 -102
- package/dist/src/tools/search-email-tool.d.ts +6 -0
- package/dist/src/tools/search-email-tool.js +133 -0
- package/dist/src/tools/search-file-tool.d.ts +2 -1
- package/dist/src/tools/search-file-tool.js +102 -106
- package/dist/src/tools/search-message-tool.d.ts +2 -1
- package/dist/src/tools/search-message-tool.js +100 -104
- package/dist/src/tools/search-note-tool.d.ts +2 -1
- package/dist/src/tools/search-note-tool.js +95 -99
- package/dist/src/tools/search-photo-gallery-tool.d.ts +2 -1
- package/dist/src/tools/search-photo-gallery-tool.js +35 -39
- package/dist/src/tools/send-email-tool.d.ts +5 -0
- package/dist/src/tools/send-email-tool.js +131 -0
- package/dist/src/tools/send-file-to-user-tool.d.ts +2 -1
- package/dist/src/tools/send-file-to-user-tool.js +154 -158
- package/dist/src/tools/send-message-tool.d.ts +2 -1
- package/dist/src/tools/send-message-tool.js +119 -123
- package/dist/src/tools/session-manager.d.ts +21 -6
- package/dist/src/tools/session-manager.js +134 -18
- package/dist/src/tools/upload-file-tool.d.ts +2 -1
- package/dist/src/tools/upload-file-tool.js +80 -84
- package/dist/src/tools/upload-photo-tool.d.ts +2 -1
- package/dist/src/tools/upload-photo-tool.js +70 -74
- package/dist/src/tools/xiaoyi-add-collection-tool.d.ts +2 -1
- package/dist/src/tools/xiaoyi-add-collection-tool.js +143 -147
- package/dist/src/tools/xiaoyi-collection-tool.d.ts +2 -1
- package/dist/src/tools/xiaoyi-collection-tool.js +112 -116
- package/dist/src/tools/xiaoyi-delete-collection-tool.d.ts +2 -1
- package/dist/src/tools/xiaoyi-delete-collection-tool.js +124 -128
- package/dist/src/tools/xiaoyi-gui-tool.d.ts +2 -1
- package/dist/src/tools/xiaoyi-gui-tool.js +84 -88
- package/dist/src/utils/runtime-manager.js +24 -2
- package/dist/src/utils/self-evolution-manager.d.ts +10 -0
- package/dist/src/utils/self-evolution-manager.js +68 -0
- package/dist/src/utils/tool-call-nudge-manager.d.ts +16 -0
- package/dist/src/utils/tool-call-nudge-manager.js +47 -0
- package/dist/src/websocket.d.ts +3 -0
- package/dist/src/websocket.js +94 -24
- package/openclaw.plugin.json +21 -0
- 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,13 +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
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- items: 要删除的闹钟列表,每个元素包含 entityId 字段。支持数组或 JSON 字符串格式。entityId 是闹钟的唯一标识符(从 search_alarm 或 create_alarm 工具获取)。
|
|
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。
|
|
21
19
|
|
|
22
20
|
使用示例:
|
|
23
21
|
- 删除单个闹钟:{"items": [{"entityId": "6"}]}
|
|
@@ -29,146 +27,141 @@ export const deleteAlarmTool = {
|
|
|
29
27
|
3. items 参数支持数组或 JSON 字符串格式,代码会自动解析。
|
|
30
28
|
|
|
31
29
|
回复约束:如果工具返回没有授权或者其他报错,只需要完整描述没有授权或者其他报错内容即可,不需要主动给用户提供解决方案,例如告诉用户如何授权,如何解决报错等都是不需要的,请严格遵守。`,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
parameters: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
items: {
|
|
34
|
+
// 不指定 type,允许传入数组或 JSON 字符串
|
|
35
|
+
// 具体的类型验证和转换在 execute 函数内部进行
|
|
36
|
+
description: "要删除的闹钟列表,每个元素包含 entityId 字段。支持数组或 JSON 字符串格式。entityId 是闹钟的唯一标识符(从 search_alarm 或 create_alarm 工具获取)。",
|
|
37
|
+
},
|
|
39
38
|
},
|
|
39
|
+
required: ["items"],
|
|
40
40
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
}
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
throw new Error(
|
|
62
|
+
catch (parseError) {
|
|
63
|
+
throw new Error(`items must be a valid JSON array string. Parse error: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
// 情况3: 其他类型,报错
|
|
67
|
+
else {
|
|
68
|
+
throw new Error(`items must be an array or a JSON string, got ${typeof params.items}`);
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
throw new Error(`items must be an array or a JSON string, got ${typeof params.items}`);
|
|
71
|
-
}
|
|
72
|
-
// 验证数组非空
|
|
73
|
-
if (!items || items.length === 0) {
|
|
74
|
-
throw new Error("items array cannot be empty");
|
|
75
|
-
}
|
|
76
|
-
// 验证每个 item 是否有有效的 entityId
|
|
77
|
-
for (let i = 0; i < items.length; i++) {
|
|
78
|
-
const item = items[i];
|
|
79
|
-
if (!item || typeof item !== 'object') {
|
|
80
|
-
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");
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
|
|
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
|
+
}
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// Get WebSocket manager
|
|
93
|
-
const wsManager = getXYWebSocketManager(config);
|
|
94
|
-
// Build DeleteAlarm command
|
|
95
|
-
const command = {
|
|
96
|
-
header: {
|
|
97
|
-
namespace: "Common",
|
|
98
|
-
name: "Action",
|
|
99
|
-
},
|
|
100
|
-
payload: {
|
|
101
|
-
cardParam: {},
|
|
102
|
-
executeParam: {
|
|
103
|
-
executeMode: "background",
|
|
104
|
-
intentName: "DeleteAlarm",
|
|
105
|
-
bundleName: "com.huawei.hmos.clock",
|
|
106
|
-
needUnlock: true,
|
|
107
|
-
actionResponse: true,
|
|
108
|
-
appType: "OHOS_APP",
|
|
109
|
-
timeOut: 5,
|
|
110
|
-
intentParam: {
|
|
111
|
-
items: items,
|
|
112
|
-
},
|
|
113
|
-
permissionId: [],
|
|
114
|
-
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",
|
|
115
91
|
},
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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",
|
|
121
107
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
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(() => {
|
|
138
123
|
wsManager.off("data-event", handler);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
+
}
|
|
152
145
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
+
});
|
|
171
164
|
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
@@ -14,9 +14,11 @@ const DEVICE_TOOL_POLICY = {
|
|
|
14
14
|
"send_message",
|
|
15
15
|
"search_message",
|
|
16
16
|
"search_contact",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
17
|
+
"get_contact_tool_schema",
|
|
18
|
+
"query_collection",
|
|
19
|
+
"add_collection",
|
|
20
|
+
"delete_collection",
|
|
21
|
+
"get_collection_tool_schema",
|
|
20
22
|
],
|
|
21
23
|
},
|
|
22
24
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetAlarmToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetCalendarToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetCollectionToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetContactToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetDeviceFileToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetEmailToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetNoteToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionContext } from "./session-manager.js";
|
|
2
|
+
export declare function createGetPhotoToolSchemaTool(ctx: SessionContext): {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
required: string[];
|
|
10
|
+
};
|
|
11
|
+
execute(_toolCallId: string, _params: any): Promise<{
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSchemaTool } from "./schema-tool-factory.js";
|
|
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
|
|
6
|
+
export declare function createImageReadingTool(ctx: SessionContext): any;
|