@ynhcj/xiaoyi-channel 0.0.72-beta → 0.0.74-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.
@@ -15,6 +15,9 @@ const DEVICE_TOOL_POLICY = {
15
15
  "search_message",
16
16
  "send_command_to_car",
17
17
  "search_contact",
18
+ "QueryCollection",
19
+ "AddCollection",
20
+ "DeleteCollection",
18
21
  ],
19
22
  },
20
23
  };
@@ -1,6 +1,7 @@
1
1
  import { getXYWebSocketManager } from "../client.js";
2
2
  import { sendCommand } from "../formatter.js";
3
3
  import { getCurrentSessionContext } from "./session-manager.js";
4
+ import { XYFileUploadService } from "../file-upload.js";
4
5
  /**
5
6
  * Duck-typed ToolInputError: openclaw 按 .name 字段匹配,不用 instanceof。
6
7
  * 抛出此错误会让 openclaw 返回 HTTP 400 而非 500,
@@ -36,7 +37,7 @@ export const xiaoyiAddCollectionTool = {
36
37
  },
37
38
  uri: {
38
39
  type: "string",
39
- description: "必填字段(IMAGE/FILE类型时)。图片或文件的端存储地址链接。",
40
+ description: "必填字段(IMAGE/FILE类型时)。图片或文件的地址链接。",
40
41
  },
41
42
  sourceAppBundleName: {
42
43
  type: "string",
@@ -70,6 +71,15 @@ export const xiaoyiAddCollectionTool = {
70
71
  const { config, sessionId, taskId, messageId } = sessionContext;
71
72
  // Get WebSocket manager
72
73
  const wsManager = getXYWebSocketManager(config);
74
+ // Handle uri: upload local paths to get public URL
75
+ let publicUri = uri;
76
+ if (uri && !uri.startsWith("http://") && !uri.startsWith("https://") && !uri.startsWith("file://")) {
77
+ const uploadService = new XYFileUploadService(config.fileUploadUrl, config.apiKey, config.uid);
78
+ publicUri = await uploadService.uploadFileAndGetUrl(uri);
79
+ if (!publicUri) {
80
+ throw new Error("本地文件上传失败,无法获取公网URL");
81
+ }
82
+ }
73
83
  // Build intentParam
74
84
  const intentParam = {
75
85
  dataType,
@@ -77,8 +87,8 @@ export const xiaoyiAddCollectionTool = {
77
87
  if (content) {
78
88
  intentParam.content = content;
79
89
  }
80
- if (uri) {
81
- intentParam.uri = uri;
90
+ if (publicUri) {
91
+ intentParam.uri = publicUri;
82
92
  }
83
93
  if (sourceAppBundleName) {
84
94
  intentParam.sourceAppBundleName = sourceAppBundleName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.72-beta",
3
+ "version": "0.0.74-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",