@meet-im/meet 3.1.0 → 3.2.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/dist/runtime-setter-api.js +6 -0
- package/dist/src/client.d.ts +6 -0
- package/dist/src/client.js +23 -0
- package/dist/src/config-schema.d.ts +50 -0
- package/dist/src/config-schema.js +11 -0
- package/dist/src/plugin-version.d.ts +2 -0
- package/dist/src/plugin-version.js +7 -0
- package/dist/src/reply-dispatcher.d.ts +6 -1
- package/dist/src/reply-dispatcher.js +35 -1
- package/dist/src/runtime.d.ts +3 -2
- package/dist/src/runtime.js +9 -2
- package/package.json +2 -2
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { initMeetUserAgent } from "./src/client.js";
|
|
2
|
+
import { resolveMeetOpenClawVersion, resolveMeetPluginVersion } from "./src/plugin-version.js";
|
|
1
3
|
// Keep bundled registration fast: runtime wiring only needs the store setter.
|
|
4
|
+
initMeetUserAgent({
|
|
5
|
+
pluginVersion: resolveMeetPluginVersion(),
|
|
6
|
+
openclawVersion: resolveMeetOpenClawVersion(),
|
|
7
|
+
});
|
|
2
8
|
export { setMeetRuntime } from "./src/runtime.js";
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { MeetBot } from "@meet-im/meet-bot-jssdk";
|
|
2
2
|
import type { PollingOptions } from "@meet-im/meet-bot-jssdk";
|
|
3
3
|
import type { ResolvedMeetAccount } from "./types.js";
|
|
4
|
+
export declare function getPluginUserAgent(): string;
|
|
5
|
+
export declare function initMeetUserAgent(options: {
|
|
6
|
+
pluginVersion?: string;
|
|
7
|
+
openclawVersion?: string;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function setOpenClawVersion(version: string): void;
|
|
4
10
|
export declare function createMeetClient(account: ResolvedMeetAccount): MeetBot;
|
|
5
11
|
export declare function getPollingOptions(account: ResolvedMeetAccount): PollingOptions;
|
|
6
12
|
export declare function getMeetClient(accountId: string): MeetBot | undefined;
|
package/dist/src/client.js
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
|
+
import os from "node:os";
|
|
1
2
|
import { MeetBot, POLLING } from "@meet-im/meet-bot-jssdk";
|
|
3
|
+
let _pluginVersion = "unknown";
|
|
4
|
+
let _openclawVersion = "unknown";
|
|
5
|
+
function buildUserAgent() {
|
|
6
|
+
return `MeetPlugin/${_pluginVersion} (Node/${process.versions.node}; ${os.platform()}; OpenClaw/${_openclawVersion})`;
|
|
7
|
+
}
|
|
8
|
+
export function getPluginUserAgent() {
|
|
9
|
+
return buildUserAgent();
|
|
10
|
+
}
|
|
11
|
+
export function initMeetUserAgent(options) {
|
|
12
|
+
if (options.pluginVersion) {
|
|
13
|
+
_pluginVersion = options.pluginVersion;
|
|
14
|
+
}
|
|
15
|
+
if (options.openclawVersion) {
|
|
16
|
+
_openclawVersion = options.openclawVersion;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function setOpenClawVersion(version) {
|
|
20
|
+
if (version) {
|
|
21
|
+
_openclawVersion = version;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
2
24
|
const botInstances = new Map();
|
|
3
25
|
export function createMeetClient(account) {
|
|
4
26
|
const existing = botInstances.get(account.accountId);
|
|
@@ -18,6 +40,7 @@ export function createMeetClient(account) {
|
|
|
18
40
|
longPollingTimeout: pollTimeoutSec,
|
|
19
41
|
logLevel,
|
|
20
42
|
useV2: true,
|
|
43
|
+
userAgent: buildUserAgent(),
|
|
21
44
|
});
|
|
22
45
|
botInstances.set(account.accountId, bot);
|
|
23
46
|
return bot;
|
|
@@ -23,6 +23,31 @@ export declare const MeetAccountConfigSchema: z.ZodObject<{
|
|
|
23
23
|
silent: "silent";
|
|
24
24
|
info: "info";
|
|
25
25
|
}>>;
|
|
26
|
+
dmPolicy: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
open: "open";
|
|
28
|
+
pairing: "pairing";
|
|
29
|
+
allowlist: "allowlist";
|
|
30
|
+
}>>;
|
|
31
|
+
allowFrom: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
32
|
+
groupPolicy: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
open: "open";
|
|
34
|
+
allowlist: "allowlist";
|
|
35
|
+
disabled: "disabled";
|
|
36
|
+
}>>;
|
|
37
|
+
groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
38
|
+
requireMention: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
40
|
+
historyLimit: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
dmHistoryLimit: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
textChunkLimit: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
mediaMaxMb: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
requireMention: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
49
|
+
users: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
50
|
+
}, z.core.$strip>>>;
|
|
26
51
|
}, z.core.$strip>;
|
|
27
52
|
export declare const MeetConfigSchema: z.ZodObject<{
|
|
28
53
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -78,5 +103,30 @@ export declare const MeetConfigSchema: z.ZodObject<{
|
|
|
78
103
|
silent: "silent";
|
|
79
104
|
info: "info";
|
|
80
105
|
}>>;
|
|
106
|
+
dmPolicy: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
open: "open";
|
|
108
|
+
pairing: "pairing";
|
|
109
|
+
allowlist: "allowlist";
|
|
110
|
+
}>>;
|
|
111
|
+
allowFrom: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
112
|
+
groupPolicy: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
open: "open";
|
|
114
|
+
allowlist: "allowlist";
|
|
115
|
+
disabled: "disabled";
|
|
116
|
+
}>>;
|
|
117
|
+
groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
118
|
+
requireMention: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
120
|
+
historyLimit: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
dmHistoryLimit: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
textChunkLimit: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
mediaMaxMb: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
125
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
name: z.ZodOptional<z.ZodString>;
|
|
127
|
+
requireMention: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
129
|
+
users: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
130
|
+
}, z.core.$strip>>>;
|
|
81
131
|
}, z.core.$strip>>>;
|
|
82
132
|
}, z.core.$strip>;
|
|
@@ -20,6 +20,17 @@ export const MeetAccountConfigSchema = z.object({
|
|
|
20
20
|
pollTimeout: z.number().min(1000).max(300000).optional(),
|
|
21
21
|
pollLimit: z.number().min(1).max(1000).optional(),
|
|
22
22
|
logLevel: z.enum(["silent", "info"]).optional(),
|
|
23
|
+
dmPolicy: z.enum(["open", "pairing", "allowlist"]).optional(),
|
|
24
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
25
|
+
groupPolicy: z.enum(["open", "allowlist", "disabled"]).optional(),
|
|
26
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
27
|
+
requireMention: z.boolean().optional(),
|
|
28
|
+
systemPrompt: z.string().optional(),
|
|
29
|
+
historyLimit: z.number().min(0).optional(),
|
|
30
|
+
dmHistoryLimit: z.number().min(0).optional(),
|
|
31
|
+
textChunkLimit: z.number().min(1).optional(),
|
|
32
|
+
mediaMaxMb: z.number().min(0).optional(),
|
|
33
|
+
groups: z.record(z.string(), MeetGroupConfigSchema).optional(),
|
|
23
34
|
});
|
|
24
35
|
export const MeetConfigSchema = z.object({
|
|
25
36
|
enabled: z.boolean().optional(),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
2
|
+
export function resolveMeetPluginVersion() {
|
|
3
|
+
return packageJson.version;
|
|
4
|
+
}
|
|
5
|
+
export function resolveMeetOpenClawVersion() {
|
|
6
|
+
return packageJson.peerDependencies?.openclaw ?? packageJson.devDependencies?.openclaw ?? "unknown";
|
|
7
|
+
}
|
|
@@ -23,7 +23,12 @@ export type CreateMeetReplyDispatcherOpts = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function createMeetReplyDispatcher(opts: CreateMeetReplyDispatcherOpts): Promise<{
|
|
25
25
|
dispatcher: import("node_modules/openclaw/dist/plugin-sdk/src/auto-reply/reply/reply-dispatcher.types.js").ReplyDispatcher;
|
|
26
|
-
replyOptions:
|
|
26
|
+
replyOptions: {
|
|
27
|
+
sourceReplyDeliveryMode?: import("openclaw/plugin-sdk/channel-reply-pipeline").SourceReplyDeliveryMode | undefined;
|
|
28
|
+
onReplyStart?: (() => Promise<void> | void) | undefined;
|
|
29
|
+
onTypingController?: ((typing: import("node_modules/openclaw/dist/plugin-sdk/src/auto-reply/reply/typing.js").TypingController) => void) | undefined;
|
|
30
|
+
onTypingCleanup?: (() => void) | undefined;
|
|
31
|
+
};
|
|
27
32
|
markDispatchIdle: () => void;
|
|
28
33
|
markRunComplete: () => void;
|
|
29
34
|
}>;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { resolveChannelSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-reply-pipeline";
|
|
1
2
|
import { createReplyPrefixContext } from "openclaw/plugin-sdk/channel-runtime";
|
|
2
3
|
import { getMeetRuntime } from "./runtime.js";
|
|
3
4
|
import { sendMessageMeet, sendMediaMeet } from "./send.js";
|
|
5
|
+
function resolveMeetConversationType(chatId) {
|
|
6
|
+
if (chatId.startsWith("channel:")) {
|
|
7
|
+
return "group";
|
|
8
|
+
}
|
|
9
|
+
if (chatId.startsWith("user:")) {
|
|
10
|
+
return "direct";
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
function resolveMeetChatType(chatId) {
|
|
15
|
+
if (chatId.startsWith("channel:")) {
|
|
16
|
+
return "channel";
|
|
17
|
+
}
|
|
18
|
+
if (chatId.startsWith("user:")) {
|
|
19
|
+
return "direct";
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
4
23
|
/**
|
|
5
24
|
* 匹配末尾不完整的 mention 开始: <@ 或 <@xxx (没有闭合的 >)
|
|
6
25
|
*/
|
|
@@ -61,9 +80,21 @@ export async function createMeetReplyDispatcher(opts) {
|
|
|
61
80
|
});
|
|
62
81
|
const chunkMode = core.channel.text.resolveChunkMode(cfg, "meet", accountId);
|
|
63
82
|
const prefixContext = createReplyPrefixContext({ cfg, agentId });
|
|
83
|
+
const chatType = resolveMeetChatType(chatId);
|
|
84
|
+
const sourceReplyDeliveryMode = chatType
|
|
85
|
+
? resolveChannelSourceReplyDeliveryMode({
|
|
86
|
+
cfg,
|
|
87
|
+
ctx: { ChatType: chatType },
|
|
88
|
+
})
|
|
89
|
+
: undefined;
|
|
64
90
|
const { dispatcher, replyOptions, markDispatchIdle, markRunComplete } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
65
91
|
responsePrefix: prefixContext.responsePrefix,
|
|
66
92
|
responsePrefixContextProvider: prefixContext.responsePrefixContextProvider,
|
|
93
|
+
silentReplyContext: {
|
|
94
|
+
cfg,
|
|
95
|
+
surface: "meet",
|
|
96
|
+
conversationType: resolveMeetConversationType(chatId),
|
|
97
|
+
},
|
|
67
98
|
humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, agentId),
|
|
68
99
|
onReplyStart: async () => {
|
|
69
100
|
},
|
|
@@ -166,7 +197,10 @@ export async function createMeetReplyDispatcher(opts) {
|
|
|
166
197
|
});
|
|
167
198
|
return {
|
|
168
199
|
dispatcher,
|
|
169
|
-
replyOptions
|
|
200
|
+
replyOptions: {
|
|
201
|
+
...replyOptions,
|
|
202
|
+
...(sourceReplyDeliveryMode ? { sourceReplyDeliveryMode } : {}),
|
|
203
|
+
},
|
|
170
204
|
markDispatchIdle,
|
|
171
205
|
markRunComplete,
|
|
172
206
|
};
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export type MeetRuntime = PluginRuntime & {
|
|
|
7
7
|
meet?: MeetChannelRuntime;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
declare const
|
|
11
|
-
export
|
|
10
|
+
declare const getOptionalMeetRuntime: () => MeetRuntime | null, getMeetRuntime: () => MeetRuntime;
|
|
11
|
+
export declare function setMeetRuntime(runtime: MeetRuntime): void;
|
|
12
|
+
export { getMeetRuntime, getOptionalMeetRuntime };
|
package/dist/src/runtime.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
import { setOpenClawVersion } from "./client.js";
|
|
3
|
+
const { setRuntime: setMeetRuntimeStore, tryGetRuntime: getOptionalMeetRuntime, getRuntime: getMeetRuntime, } = createPluginRuntimeStore({
|
|
3
4
|
pluginId: "meet",
|
|
4
5
|
errorMessage: "Meet runtime not initialized",
|
|
5
6
|
});
|
|
6
|
-
export
|
|
7
|
+
export function setMeetRuntime(runtime) {
|
|
8
|
+
if (runtime.version) {
|
|
9
|
+
setOpenClawVersion(runtime.version);
|
|
10
|
+
}
|
|
11
|
+
setMeetRuntimeStore(runtime);
|
|
12
|
+
}
|
|
13
|
+
export { getMeetRuntime, getOptionalMeetRuntime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meet-im/meet",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenClaw Meet channel plugin",
|
|
6
6
|
"scripts": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@meet-im/meet-bot-jssdk": "^1.1
|
|
58
|
+
"@meet-im/meet-bot-jssdk": "^1.2.1",
|
|
59
59
|
"zod": "^4.4.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|