@meet-im/meet 2.0.0 → 2.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meet-im/meet",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Meet channel plugin",
6
6
  "scripts": {
@@ -115,7 +115,54 @@ export async function createMeetReplyDispatcher(
115
115
  }
116
116
  },
117
117
  onError: async (error, info) => {
118
- opts.runtime.error?.(`meet[${accountId}] ${info.kind} reply failed: ${String(error)}`)
118
+ const errorMessage = String(error)
119
+ opts.runtime.error?.(`meet[${accountId}] ${info.kind} reply failed: ${errorMessage}`)
120
+ // 发送错误提示给用户,让 AI 也能看到错误并修正
121
+ // 根据错误类型生成友好提示
122
+ let userMessage: string
123
+ const lowerError = errorMessage.toLowerCase()
124
+ if (
125
+ lowerError.includes("not found") ||
126
+ lowerError.includes("enoent") ||
127
+ lowerError.includes("does not exist") ||
128
+ lowerError.includes("local media file not found")
129
+ ) {
130
+ userMessage = `发送失败: 文件不存在或无法访问。请提供有效的文件路径(建议使用绝对路径)。\n错误详情: ${errorMessage}`
131
+ } else if (
132
+ lowerError.includes("mediafetcherror") ||
133
+ lowerError.includes("fetch_failed") ||
134
+ lowerError.includes("failed to fetch")
135
+ ) {
136
+ userMessage = `发送失败: 无法获取媒体文件。请检查 URL 是否正确或网络是否可用。\n错误详情: ${errorMessage}`
137
+ } else if (
138
+ lowerError.includes("localmediaaccesserror") ||
139
+ lowerError.includes("path-not-allowed") ||
140
+ lowerError.includes("not safe to read") ||
141
+ lowerError.includes("network-path-not-allowed")
142
+ ) {
143
+ userMessage = `发送失败: 文件路径不在允许访问的目录内。请使用工作区内的文件路径,或联系管理员配置 mediaLocalRoots。\n错误详情: ${errorMessage}`
144
+ } else if (
145
+ lowerError.includes("max_bytes") ||
146
+ lowerError.includes("exceeds maxbytes") ||
147
+ lowerError.includes("exceeds") && lowerError.includes("limit")
148
+ ) {
149
+ userMessage = `发送失败: 文件大小超过限制。请使用较小的文件。\n错误详情: ${errorMessage}`
150
+ } else if (lowerError.includes("not a file")) {
151
+ userMessage = `发送失败: 路径不是文件。请提供文件路径而非目录。\n错误详情: ${errorMessage}`
152
+ } else {
153
+ userMessage = `发送失败: ${errorMessage}`
154
+ }
155
+ // 尝试发送错误消息,忽略发送失败(避免递归)
156
+ try {
157
+ await sendMessageMeet({
158
+ cfg,
159
+ to: chatId,
160
+ text: userMessage,
161
+ accountId,
162
+ })
163
+ } catch {
164
+ // 忽略错误消息发送失败
165
+ }
119
166
  },
120
167
  onIdle: async () => {
121
168
  },