@meet-im/meet 2.0.2 → 2.0.4

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.2",
3
+ "version": "2.0.4",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Meet channel plugin",
6
6
  "scripts": {
package/src/bot.ts CHANGED
@@ -16,10 +16,10 @@ import { sendMessageMeet } from "./send.js"
16
16
  import { resolveMediaAttachments, setMediaDebugLogger } from "./media.js"
17
17
 
18
18
  const DEFAULT_GROUP_SYSTEM_PROMPT =
19
- "你正在 Meet 群组中对话。请保持回复简洁明了,适合群聊场景。如需回复特定用户,请使用 <@USER_ID> 格式提及对方,例如 <@553>。注意:Meet 不支持用反引号包住 Markdown 语法标记,描述语法时直接写符号,不要加反引号。"
19
+ "你正在 Meet 群组中对话。请保持回复简洁明了,适合群聊场景。如需回复特定用户,请使用 <@USER_ID> 格式提及对方,例如 <@553>。注意:Meet 不支持用反引号包住 Markdown 语法标记,描述语法时直接写符号,不要加反引号。发送图片或文件时,使用 message 工具的 media 参数,不要用 Markdown 图片语法 ![](path)。"
20
20
 
21
21
  const DEFAULT_DM_SYSTEM_PROMPT =
22
- "你正在 Meet 私聊中对话。注意:Meet 不支持用反引号包住 Markdown 语法标记,描述语法时直接写符号,不要加反引号。"
22
+ "你正在 Meet 私聊中对话。注意:Meet 不支持用反引号包住 Markdown 语法标记,描述语法时直接写符号,不要加反引号。发送图片或文件时,使用 message 工具的 media 参数,不要用 Markdown 图片语法 ![](path)。"
23
23
 
24
24
  function formatHistoryEntry(entry: HistoryEntry): string {
25
25
  return `${entry.sender}: ${entry.body}`
package/src/channel.ts CHANGED
@@ -65,6 +65,7 @@ export const meetPlugin: ChannelPlugin<ResolvedMeetAccount> = {
65
65
  messageToolHints: () => [
66
66
  "- Meet targeting: omit `target` to reply to the current conversation (auto-inferred). Explicit targets: `user:<id>` or `channel:<id>`.",
67
67
  "- Meet mentions: use `<@USER_ID>` to mention users, `<@-1>` to mention everyone. Examples: `<@553> hello` or `<@-1> important announcement`.",
68
+ "- Meet media: use `media` parameter to send images/files as attachments. DO NOT use Markdown image syntax like `![](path)` - Meet does not render it.",
68
69
  ],
69
70
  },
70
71
  groups: {
package/src/send.ts CHANGED
@@ -2,7 +2,7 @@ import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk";
2
2
  import type { MeetMediaInfo } from "./types.js";
3
3
  import type { UploadProgress as SdkUploadProgress } from "@meet-im/meet-bot-jssdk";
4
4
  import { resolveMeetAccount } from "./accounts.js";
5
- import { getMeetClient } from "./client.js";
5
+ import { getMeetClient, createMeetClient } from "./client.js";
6
6
  import { parseTargetToSessionInfo } from "./sdk-bridge.js";
7
7
  import { getMeetRuntime } from "./runtime.js";
8
8
 
@@ -180,13 +180,22 @@ export async function sendMessageMeet(
180
180
  if (!token) {
181
181
  throw new Error("Meet API token not configured");
182
182
  }
183
+ // 检查 token 是否未解析(仍是 secret ref 格式)
184
+ if (token.startsWith("${secret:")) {
185
+ throw new Error(
186
+ `Meet API token not resolved (still a secret reference). ` +
187
+ `Ensure Gateway is running or token is configured directly. ` +
188
+ `AccountId: ${account.accountId}`
189
+ );
190
+ }
183
191
  const botUserId = token.split(":")[0];
184
192
  if (!botUserId) {
185
193
  throw new Error("Invalid Meet API token format");
186
194
  }
187
- const bot = getMeetClient(account.accountId);
195
+ // 如果 client 不存在则自动创建(支持 message tool 直接发送消息)
196
+ let bot = getMeetClient(account.accountId);
188
197
  if (!bot) {
189
- throw new Error(`Meet client not found for account: ${account.accountId}`);
198
+ bot = createMeetClient(account);
190
199
  }
191
200
  const { text: cleanText, atIds: extractedAtIds } = extractAtIds(text);
192
201
  const finalAtIds = explicitAtIds
@@ -232,13 +241,22 @@ export async function sendMediaMeet(
232
241
  if (!token) {
233
242
  throw new Error("Meet API token not configured");
234
243
  }
244
+ // 检查 token 是否未解析(仍是 secret ref 格式)
245
+ if (token.startsWith("${secret:")) {
246
+ throw new Error(
247
+ `Meet API token not resolved (still a secret reference). ` +
248
+ `Ensure Gateway is running or token is configured directly. ` +
249
+ `AccountId: ${account.accountId}`
250
+ );
251
+ }
235
252
  const botUserId = token.split(":")[0];
236
253
  if (!botUserId) {
237
254
  throw new Error("Invalid Meet API token format");
238
255
  }
239
- const bot = getMeetClient(account.accountId);
256
+ // 如果 client 不存在则自动创建(支持 message tool 直接发送消息)
257
+ let bot = getMeetClient(account.accountId);
240
258
  if (!bot) {
241
- throw new Error(`Meet client not found for account: ${account.accountId}`);
259
+ bot = createMeetClient(account);
242
260
  }
243
261
 
244
262
  const runtime = getMeetRuntime();