@meet-im/meet 2.0.2 → 2.0.3
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 +1 -1
- package/src/channel.ts +1 -0
- package/src/send.ts +23 -5
package/package.json
CHANGED
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 `` - 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
|
-
|
|
195
|
+
// 如果 client 不存在则自动创建(支持 message tool 直接发送消息)
|
|
196
|
+
let bot = getMeetClient(account.accountId);
|
|
188
197
|
if (!bot) {
|
|
189
|
-
|
|
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
|
-
|
|
256
|
+
// 如果 client 不存在则自动创建(支持 message tool 直接发送消息)
|
|
257
|
+
let bot = getMeetClient(account.accountId);
|
|
240
258
|
if (!bot) {
|
|
241
|
-
|
|
259
|
+
bot = createMeetClient(account);
|
|
242
260
|
}
|
|
243
261
|
|
|
244
262
|
const runtime = getMeetRuntime();
|