@ynhcj/xiaoyi-channel 0.0.70-beta → 0.0.72-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.
@@ -61,6 +61,14 @@ export const saveMediaToGalleryTool = {
61
61
  if (mediaType && !["pic", "video"].includes(mediaType)) {
62
62
  throw new ToolInputError(`mediaType只支持 pic 或 video,当前值: ${mediaType}`);
63
63
  }
64
+ // Strip file extension from fileName if present
65
+ let sanitizedFileName = fileName;
66
+ if (sanitizedFileName && typeof sanitizedFileName === "string") {
67
+ const lastDot = sanitizedFileName.lastIndexOf(".");
68
+ if (lastDot > 0) {
69
+ sanitizedFileName = sanitizedFileName.substring(0, lastDot);
70
+ }
71
+ }
64
72
  // Get session context
65
73
  const sessionContext = getCurrentSessionContext();
66
74
  if (!sessionContext) {
@@ -86,8 +94,8 @@ export const saveMediaToGalleryTool = {
86
94
  if (mediaType) {
87
95
  intentParam.mediaType = mediaType;
88
96
  }
89
- if (fileName) {
90
- intentParam.fileName = fileName;
97
+ if (sanitizedFileName) {
98
+ intentParam.fileName = sanitizedFileName;
91
99
  }
92
100
  // Build SaveMediaToGallery command
93
101
  const command = {
@@ -44,7 +44,7 @@ export const xiaoyiAddCollectionTool = {
44
44
  },
45
45
  dataType: {
46
46
  type: "string",
47
- description: "必填字段。标识数据类型:HYPER_LINK表示网页(注意:如果收藏的图片或者文件是超链接(http或者https开头),无论是图片还是文件,都使用HYPER_LINK),TEXT表示文本,IMAGE表示图片,FILE表示文件。IMAGE和FILE类型都只支持手机本地地址(file://开头,当前手机本地文件路径仅能通过search_photo_gallery或者QueryCollection或者search_file结果中获取,不要拼凑生成)",
47
+ description: "必填字段。标识数据类型:HYPER_LINK表示网页,TEXT表示文本,IMAGE表示图片,FILE表示文件。",
48
48
  },
49
49
  },
50
50
  required: ["dataType"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.70-beta",
3
+ "version": "0.0.72-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",