gewe-openclaw 2026.3.13 → 2026.3.23
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/README.md +455 -3
- package/index.ts +39 -1
- package/package.json +12 -1
- package/skills/gewe-agent-tools/SKILL.md +113 -0
- package/skills/gewe-channel-rules/SKILL.md +7 -0
- package/src/accounts.ts +51 -5
- package/src/api-tools.ts +1264 -0
- package/src/api.ts +37 -2
- package/src/binary-command.ts +65 -0
- package/src/channel-actions.ts +536 -0
- package/src/channel-allowlist.ts +150 -0
- package/src/channel-directory.ts +419 -0
- package/src/channel-status.ts +186 -0
- package/src/channel.ts +155 -58
- package/src/config-edit.ts +94 -0
- package/src/config-schema.ts +78 -3
- package/src/contacts-api.ts +113 -0
- package/src/delivery.ts +502 -62
- package/src/directory-cache.ts +164 -0
- package/src/gewe-account-api.ts +27 -0
- package/src/group-allowlist-tool.ts +242 -0
- package/src/group-binding-tool.ts +154 -0
- package/src/group-binding.ts +405 -0
- package/src/groups-api.ts +146 -0
- package/src/inbound-batch.ts +5 -2
- package/src/inbound.ts +248 -41
- package/src/media-server.ts +73 -93
- package/src/moments-api.ts +138 -0
- package/src/monitor.ts +81 -24
- package/src/onboarding.ts +9 -4
- package/src/openclaw-compat.ts +1070 -0
- package/src/pairing-store.ts +478 -0
- package/src/personal-api.ts +45 -0
- package/src/policy.ts +130 -22
- package/src/quote-context-cache.ts +97 -0
- package/src/reply-options.ts +101 -2
- package/src/s3.ts +1 -1
- package/src/send.ts +235 -16
- package/src/setup-wizard-types.ts +162 -0
- package/src/setup-wizard.ts +464 -0
- package/src/silk.ts +2 -1
- package/src/state-paths.ts +55 -14
- package/src/types.ts +66 -7
- package/src/xml.ts +158 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
import { resolveGeweAccount } from "./accounts.js";
|
|
4
|
+
import {
|
|
5
|
+
getChatroomInfoGewe,
|
|
6
|
+
modifyChatroomNickNameForSelfGewe,
|
|
7
|
+
modifyChatroomRemarkGewe,
|
|
8
|
+
type GeweChatroomInfo,
|
|
9
|
+
} from "./groups-api.js";
|
|
10
|
+
import { normalizeGeweMessagingTarget } from "./normalize.js";
|
|
11
|
+
import { normalizeAccountId, type OpenClawConfig } from "./openclaw-compat.js";
|
|
12
|
+
import { getProfileGewe, type GeweProfile } from "./personal-api.js";
|
|
13
|
+
import type {
|
|
14
|
+
CoreConfig,
|
|
15
|
+
GeweAccountConfig,
|
|
16
|
+
GeweBindingIdentityRemarkConfig,
|
|
17
|
+
GeweBindingIdentitySelfConfig,
|
|
18
|
+
GeweGroupBindingIdentityConfig,
|
|
19
|
+
GeweGroupConfig,
|
|
20
|
+
ResolvedGeweAccount,
|
|
21
|
+
} from "./types.js";
|
|
22
|
+
|
|
23
|
+
const GEWE_CHANNEL_ALIASES = new Set(["gewe-openclaw", "gewe", "wechat", "wx"]);
|
|
24
|
+
|
|
25
|
+
type BindingLike = {
|
|
26
|
+
type?: string;
|
|
27
|
+
agentId?: string;
|
|
28
|
+
match: {
|
|
29
|
+
channel: string;
|
|
30
|
+
accountId?: string;
|
|
31
|
+
peer?: {
|
|
32
|
+
kind?: string;
|
|
33
|
+
id?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type GeweExactGroupBinding = {
|
|
39
|
+
kind: "route" | "acp";
|
|
40
|
+
groupId: string;
|
|
41
|
+
accountId: string;
|
|
42
|
+
agentId: string;
|
|
43
|
+
binding: BindingLike;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ResolvedGeweGroupBindingIdentity = {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
selfNickname: Required<Pick<GeweBindingIdentitySelfConfig, "source">> & {
|
|
49
|
+
value?: string;
|
|
50
|
+
};
|
|
51
|
+
remark: Required<Pick<GeweBindingIdentityRemarkConfig, "source">> & {
|
|
52
|
+
value?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function normalizeAgentId(value: string | undefined | null): string {
|
|
57
|
+
const trimmed = (value ?? "").trim();
|
|
58
|
+
if (!trimmed) {
|
|
59
|
+
return "main";
|
|
60
|
+
}
|
|
61
|
+
return (
|
|
62
|
+
trimmed
|
|
63
|
+
.toLowerCase()
|
|
64
|
+
.replace(/[^a-z0-9_-]+/g, "-")
|
|
65
|
+
.replace(/^-+/, "")
|
|
66
|
+
.replace(/-+$/, "")
|
|
67
|
+
.slice(0, 64) || "main"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function normalizeBindingChannel(raw: string | undefined): string {
|
|
72
|
+
const trimmed = raw?.trim().toLowerCase() ?? "";
|
|
73
|
+
return GEWE_CHANNEL_ALIASES.has(trimmed) ? "gewe-openclaw" : trimmed;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function normalizeBindingAccountPattern(raw: string | undefined): string {
|
|
77
|
+
const trimmed = raw?.trim();
|
|
78
|
+
if (!trimmed) {
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
if (trimmed === "*") {
|
|
82
|
+
return "*";
|
|
83
|
+
}
|
|
84
|
+
return normalizeAccountId(trimmed);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function resolveBindingAccountMatchScore(pattern: string, accountId: string): 0 | 1 | 2 {
|
|
88
|
+
if (pattern === "*") {
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
if (!pattern) {
|
|
92
|
+
return accountId === "default" ? 2 : 0;
|
|
93
|
+
}
|
|
94
|
+
return pattern === accountId ? 2 : 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function normalizeBindingConversationId(raw: string | undefined): string | null {
|
|
98
|
+
const normalized = raw ? normalizeGeweMessagingTarget(raw) : null;
|
|
99
|
+
return normalized?.trim() ? normalized : null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function isGroupPeer(binding: BindingLike, groupId: string): boolean {
|
|
103
|
+
return (
|
|
104
|
+
binding.match.peer?.kind?.trim().toLowerCase() === "group" &&
|
|
105
|
+
normalizeBindingConversationId(binding.match.peer.id) === groupId
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function buildConfiguredAcpSessionKey(params: {
|
|
110
|
+
channel: string;
|
|
111
|
+
accountId: string;
|
|
112
|
+
conversationId: string;
|
|
113
|
+
agentId: string;
|
|
114
|
+
}): string {
|
|
115
|
+
const hash = createHash("sha256")
|
|
116
|
+
.update(`${params.channel}:${params.accountId}:${params.conversationId}`)
|
|
117
|
+
.digest("hex")
|
|
118
|
+
.slice(0, 16);
|
|
119
|
+
return `agent:${normalizeAgentId(params.agentId)}:acp:binding:${params.channel}:${params.accountId}:${hash}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function parseRouteGroupIdFromSessionKey(sessionKey: string | undefined): string | undefined {
|
|
123
|
+
const trimmed = sessionKey?.trim().toLowerCase() ?? "";
|
|
124
|
+
const marker = ":gewe-openclaw:group:";
|
|
125
|
+
const index = trimmed.indexOf(marker);
|
|
126
|
+
if (index === -1) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const groupId = trimmed.slice(index + marker.length).trim();
|
|
130
|
+
return groupId || undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function normalizeComparableValue(value: string | null | undefined): string | null {
|
|
134
|
+
const trimmed = value?.trim();
|
|
135
|
+
return trimmed ? trimmed : null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function listConfigBindings(cfg: OpenClawConfig): BindingLike[] {
|
|
139
|
+
return Array.isArray(cfg.bindings) ? (cfg.bindings as BindingLike[]) : [];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function pickBetterBinding(
|
|
143
|
+
current: { score: 0 | 1 | 2; binding: BindingLike } | null,
|
|
144
|
+
candidate: { score: 0 | 1 | 2; binding: BindingLike },
|
|
145
|
+
) {
|
|
146
|
+
if (!current) {
|
|
147
|
+
return candidate;
|
|
148
|
+
}
|
|
149
|
+
return candidate.score > current.score ? candidate : current;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function normalizeGeweBindingConversationId(raw: string | undefined): string | undefined {
|
|
153
|
+
const normalized = normalizeBindingConversationId(raw);
|
|
154
|
+
return normalized ?? undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function resolveGeweGroupBindingIdentity(params: {
|
|
158
|
+
groupConfig?: GeweGroupConfig;
|
|
159
|
+
wildcardConfig?: GeweGroupConfig;
|
|
160
|
+
}): ResolvedGeweGroupBindingIdentity {
|
|
161
|
+
const exact = params.groupConfig?.bindingIdentity;
|
|
162
|
+
const wildcard = params.wildcardConfig?.bindingIdentity;
|
|
163
|
+
return {
|
|
164
|
+
enabled: exact?.enabled ?? wildcard?.enabled ?? true,
|
|
165
|
+
selfNickname: {
|
|
166
|
+
source: exact?.selfNickname?.source ?? wildcard?.selfNickname?.source ?? "agent_name",
|
|
167
|
+
value: exact?.selfNickname?.value ?? wildcard?.selfNickname?.value,
|
|
168
|
+
},
|
|
169
|
+
remark: {
|
|
170
|
+
source: exact?.remark?.source ?? wildcard?.remark?.source ?? "agent_id",
|
|
171
|
+
value: exact?.remark?.value ?? wildcard?.remark?.value,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function resolveExplicitGeweGroupBinding(params: {
|
|
177
|
+
cfg: OpenClawConfig;
|
|
178
|
+
accountId: string;
|
|
179
|
+
groupId: string;
|
|
180
|
+
}): GeweExactGroupBinding | null {
|
|
181
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
182
|
+
const groupId = normalizeBindingConversationId(params.groupId);
|
|
183
|
+
if (!groupId) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
let bestRoute: { score: 0 | 1 | 2; binding: BindingLike } | null = null;
|
|
188
|
+
let bestAcp: { score: 0 | 1 | 2; binding: BindingLike } | null = null;
|
|
189
|
+
|
|
190
|
+
for (const binding of listConfigBindings(params.cfg)) {
|
|
191
|
+
if (normalizeBindingChannel(binding.match.channel) !== "gewe-openclaw") {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (!isGroupPeer(binding, groupId)) {
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const score = resolveBindingAccountMatchScore(
|
|
198
|
+
normalizeBindingAccountPattern(binding.match.accountId),
|
|
199
|
+
accountId,
|
|
200
|
+
);
|
|
201
|
+
if (score === 0) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (binding.type === "acp") {
|
|
205
|
+
bestAcp = pickBetterBinding(bestAcp, { score, binding });
|
|
206
|
+
} else {
|
|
207
|
+
bestRoute = pickBetterBinding(bestRoute, { score, binding });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (bestAcp) {
|
|
212
|
+
return {
|
|
213
|
+
kind: "acp",
|
|
214
|
+
groupId,
|
|
215
|
+
accountId,
|
|
216
|
+
agentId: bestAcp.binding.agentId?.trim() || "main",
|
|
217
|
+
binding: bestAcp.binding,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (bestRoute) {
|
|
221
|
+
return {
|
|
222
|
+
kind: "route",
|
|
223
|
+
groupId,
|
|
224
|
+
accountId,
|
|
225
|
+
agentId: bestRoute.binding.agentId?.trim() || "main",
|
|
226
|
+
binding: bestRoute.binding,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function inferCurrentGeweGroupId(params: {
|
|
233
|
+
cfg: OpenClawConfig;
|
|
234
|
+
accountId: string;
|
|
235
|
+
sessionKey?: string;
|
|
236
|
+
}): string | undefined {
|
|
237
|
+
const routeGroupId = parseRouteGroupIdFromSessionKey(params.sessionKey);
|
|
238
|
+
if (routeGroupId) {
|
|
239
|
+
return routeGroupId;
|
|
240
|
+
}
|
|
241
|
+
const normalizedSessionKey = params.sessionKey?.trim().toLowerCase();
|
|
242
|
+
if (!normalizedSessionKey) {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
246
|
+
for (const binding of listConfigBindings(params.cfg)) {
|
|
247
|
+
if (binding.type !== "acp" || normalizeBindingChannel(binding.match.channel) !== "gewe-openclaw") {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const groupId = normalizeBindingConversationId(binding.match.peer?.id);
|
|
251
|
+
if (!groupId || binding.match.peer?.kind?.trim().toLowerCase() !== "group") {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const score = resolveBindingAccountMatchScore(
|
|
255
|
+
normalizeBindingAccountPattern(binding.match.accountId),
|
|
256
|
+
accountId,
|
|
257
|
+
);
|
|
258
|
+
if (score === 0) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
const expectedSessionKey = buildConfiguredAcpSessionKey({
|
|
262
|
+
channel: "gewe-openclaw",
|
|
263
|
+
accountId,
|
|
264
|
+
conversationId: groupId,
|
|
265
|
+
agentId: binding.agentId?.trim() || "main",
|
|
266
|
+
});
|
|
267
|
+
if (expectedSessionKey === normalizedSessionKey) {
|
|
268
|
+
return groupId;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export function resolveGeweAgentDisplayName(cfg: OpenClawConfig, agentId: string): string {
|
|
275
|
+
const agents = (cfg.agents as { list?: Array<{ id?: string; name?: string }> } | undefined)?.list ?? [];
|
|
276
|
+
const match = agents.find((agent) => agent.id?.trim() === agentId);
|
|
277
|
+
return match?.name?.trim() || agentId;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function buildGeweDesiredBindingIdentity(params: {
|
|
281
|
+
identity: ResolvedGeweGroupBindingIdentity;
|
|
282
|
+
agentId: string;
|
|
283
|
+
agentName: string;
|
|
284
|
+
}): {
|
|
285
|
+
selfNickname: string | null;
|
|
286
|
+
remark: string | null;
|
|
287
|
+
} {
|
|
288
|
+
const selfNickname = (() => {
|
|
289
|
+
switch (params.identity.selfNickname.source) {
|
|
290
|
+
case "agent_id":
|
|
291
|
+
return normalizeComparableValue(params.agentId);
|
|
292
|
+
case "literal":
|
|
293
|
+
return normalizeComparableValue(params.identity.selfNickname.value);
|
|
294
|
+
case "agent_name":
|
|
295
|
+
default:
|
|
296
|
+
return normalizeComparableValue(params.agentName);
|
|
297
|
+
}
|
|
298
|
+
})();
|
|
299
|
+
const remark = (() => {
|
|
300
|
+
switch (params.identity.remark.source) {
|
|
301
|
+
case "agent_name":
|
|
302
|
+
return normalizeComparableValue(params.agentName);
|
|
303
|
+
case "name_and_id":
|
|
304
|
+
return normalizeComparableValue(`${params.agentName} (${params.agentId})`);
|
|
305
|
+
case "literal":
|
|
306
|
+
return normalizeComparableValue(params.identity.remark.value);
|
|
307
|
+
case "agent_id":
|
|
308
|
+
default:
|
|
309
|
+
return normalizeComparableValue(params.agentId);
|
|
310
|
+
}
|
|
311
|
+
})();
|
|
312
|
+
return {
|
|
313
|
+
selfNickname,
|
|
314
|
+
remark,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function resolveGeweCurrentSelfNickname(
|
|
319
|
+
groupInfo: GeweChatroomInfo,
|
|
320
|
+
selfWxid: string,
|
|
321
|
+
): string | null {
|
|
322
|
+
const member = groupInfo.memberList?.find((entry) => entry.wxid?.trim() === selfWxid);
|
|
323
|
+
return normalizeComparableValue(member?.displayName ?? undefined);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function requireConfiguredAccount(account: ResolvedGeweAccount) {
|
|
327
|
+
if (!account.token?.trim() || !account.appId?.trim()) {
|
|
328
|
+
throw new Error(`GeWe account "${account.accountId}" is not fully configured.`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export async function getGeweProfile(params: {
|
|
333
|
+
account: ResolvedGeweAccount;
|
|
334
|
+
}): Promise<GeweProfile> {
|
|
335
|
+
requireConfiguredAccount(params.account);
|
|
336
|
+
const data = await getProfileGewe({ account: params.account });
|
|
337
|
+
return {
|
|
338
|
+
wxid: data?.wxid?.trim() ?? "",
|
|
339
|
+
nickName: data?.nickName?.trim() || undefined,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export async function getGeweChatroomInfo(params: {
|
|
344
|
+
account: ResolvedGeweAccount;
|
|
345
|
+
groupId: string;
|
|
346
|
+
}): Promise<GeweChatroomInfo> {
|
|
347
|
+
requireConfiguredAccount(params.account);
|
|
348
|
+
const data = await getChatroomInfoGewe({
|
|
349
|
+
account: params.account,
|
|
350
|
+
chatroomId: params.groupId,
|
|
351
|
+
});
|
|
352
|
+
return {
|
|
353
|
+
chatroomId: data?.chatroomId?.trim() ?? params.groupId,
|
|
354
|
+
nickName: data?.nickName?.trim() || undefined,
|
|
355
|
+
remark: normalizeComparableValue(data?.remark ?? undefined),
|
|
356
|
+
memberList: Array.isArray(data?.memberList) ? data.memberList : [],
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export async function modifyGeweChatroomRemark(params: {
|
|
361
|
+
account: ResolvedGeweAccount;
|
|
362
|
+
groupId: string;
|
|
363
|
+
remark: string;
|
|
364
|
+
}) {
|
|
365
|
+
requireConfiguredAccount(params.account);
|
|
366
|
+
await modifyChatroomRemarkGewe({
|
|
367
|
+
account: params.account,
|
|
368
|
+
chatroomId: params.groupId,
|
|
369
|
+
chatroomRemark: params.remark,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export async function modifyGeweChatroomSelfNickname(params: {
|
|
374
|
+
account: ResolvedGeweAccount;
|
|
375
|
+
groupId: string;
|
|
376
|
+
nickName: string;
|
|
377
|
+
}) {
|
|
378
|
+
requireConfiguredAccount(params.account);
|
|
379
|
+
await modifyChatroomNickNameForSelfGewe({
|
|
380
|
+
account: params.account,
|
|
381
|
+
chatroomId: params.groupId,
|
|
382
|
+
nickName: params.nickName,
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export function resolveGeweBindingIdentityConfigForGroup(params: {
|
|
387
|
+
accountConfig: GeweAccountConfig;
|
|
388
|
+
groupId: string;
|
|
389
|
+
}): ResolvedGeweGroupBindingIdentity {
|
|
390
|
+
const groups = params.accountConfig.groups;
|
|
391
|
+
return resolveGeweGroupBindingIdentity({
|
|
392
|
+
groupConfig: groups?.[params.groupId],
|
|
393
|
+
wildcardConfig: groups?.["*"],
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export function resolveGeweAccountForBindingTool(params: {
|
|
398
|
+
cfg: OpenClawConfig;
|
|
399
|
+
accountId: string;
|
|
400
|
+
}): ResolvedGeweAccount {
|
|
401
|
+
return resolveGeweAccount({
|
|
402
|
+
cfg: params.cfg as CoreConfig,
|
|
403
|
+
accountId: params.accountId,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createGeweAccountMethod,
|
|
3
|
+
type GeweApiList,
|
|
4
|
+
type GeweApiObject,
|
|
5
|
+
} from "./gewe-account-api.js";
|
|
6
|
+
|
|
7
|
+
export type GeweChatroomInfo = {
|
|
8
|
+
chatroomId: string;
|
|
9
|
+
nickName?: string;
|
|
10
|
+
remark?: string | null;
|
|
11
|
+
memberList?: Array<{
|
|
12
|
+
wxid?: string;
|
|
13
|
+
nickName?: string | null;
|
|
14
|
+
displayName?: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
} & GeweApiObject;
|
|
17
|
+
|
|
18
|
+
export const modifyChatroomNickNameForSelfGewe = createGeweAccountMethod<{
|
|
19
|
+
chatroomId: string;
|
|
20
|
+
nickName: string;
|
|
21
|
+
}>("/gewe/v2/api/group/modifyChatroomNickNameForSelf");
|
|
22
|
+
|
|
23
|
+
export const modifyChatroomNameGewe = createGeweAccountMethod<{
|
|
24
|
+
chatroomId: string;
|
|
25
|
+
chatroomName: string;
|
|
26
|
+
}>("/gewe/v2/api/group/modifyChatroomName");
|
|
27
|
+
|
|
28
|
+
export const modifyChatroomRemarkGewe = createGeweAccountMethod<{
|
|
29
|
+
chatroomId: string;
|
|
30
|
+
chatroomRemark: string;
|
|
31
|
+
}>("/gewe/v2/api/group/modifyChatroomRemark");
|
|
32
|
+
|
|
33
|
+
export const createChatroomGewe = createGeweAccountMethod<{
|
|
34
|
+
wxids: string[];
|
|
35
|
+
}>("/gewe/v2/api/group/createChatroom");
|
|
36
|
+
|
|
37
|
+
export const removeMemberGewe = createGeweAccountMethod<{
|
|
38
|
+
chatroomId: string;
|
|
39
|
+
wxids: string[];
|
|
40
|
+
}>("/gewe/v2/api/group/removeMember");
|
|
41
|
+
|
|
42
|
+
export const agreeJoinRoomGewe = createGeweAccountMethod<{
|
|
43
|
+
url: string;
|
|
44
|
+
}>("/gewe/v2/api/group/agreeJoinRoom");
|
|
45
|
+
|
|
46
|
+
export const joinRoomUsingQRCodeGewe = createGeweAccountMethod<{
|
|
47
|
+
qrUrl: string;
|
|
48
|
+
}>("/gewe/v2/api/group/joinRoomUsingQRCode");
|
|
49
|
+
|
|
50
|
+
export const addGroupMemberAsFriendGewe = createGeweAccountMethod<{
|
|
51
|
+
chatroomId: string;
|
|
52
|
+
memberWxid: string;
|
|
53
|
+
content: string;
|
|
54
|
+
}>("/gewe/v2/api/group/addGroupMemberAsFriend");
|
|
55
|
+
|
|
56
|
+
export const roomAccessApplyCheckApproveGewe = createGeweAccountMethod<{
|
|
57
|
+
chatroomId: string;
|
|
58
|
+
newMsgId: string | number;
|
|
59
|
+
msgContent: string;
|
|
60
|
+
}>("/gewe/v2/api/group/roomAccessApplyCheckApprove");
|
|
61
|
+
|
|
62
|
+
export const adminOperateGewe = createGeweAccountMethod<{
|
|
63
|
+
chatroomId: string;
|
|
64
|
+
operType: number;
|
|
65
|
+
wxids: string[];
|
|
66
|
+
}>("/gewe/v2/api/group/adminOperate");
|
|
67
|
+
|
|
68
|
+
export const saveContractListGewe = createGeweAccountMethod<{
|
|
69
|
+
chatroomId: string;
|
|
70
|
+
operType: number;
|
|
71
|
+
}>("/gewe/v2/api/group/saveContractList");
|
|
72
|
+
|
|
73
|
+
export const pinChatGewe = createGeweAccountMethod<{
|
|
74
|
+
chatroomId: string;
|
|
75
|
+
top: boolean | number;
|
|
76
|
+
}>("/gewe/v2/api/group/pinChat");
|
|
77
|
+
|
|
78
|
+
export const getChatroomQrCodeGewe = createGeweAccountMethod<{
|
|
79
|
+
chatroomId: string;
|
|
80
|
+
}>("/gewe/v2/api/group/getChatroomQrCode");
|
|
81
|
+
|
|
82
|
+
export const getChatroomInfoGewe = createGeweAccountMethod<{
|
|
83
|
+
chatroomId: string;
|
|
84
|
+
}, GeweChatroomInfo>("/gewe/v2/api/group/getChatroomInfo");
|
|
85
|
+
|
|
86
|
+
export const getChatroomAnnouncementGewe = createGeweAccountMethod<{
|
|
87
|
+
chatroomId: string;
|
|
88
|
+
}>("/gewe/v2/api/group/getChatroomAnnouncement");
|
|
89
|
+
|
|
90
|
+
export const getChatroomMemberListGewe = createGeweAccountMethod<{
|
|
91
|
+
chatroomId: string;
|
|
92
|
+
}, GeweApiList>("/gewe/v2/api/group/getChatroomMemberList");
|
|
93
|
+
|
|
94
|
+
export const getChatroomMemberDetailGewe = createGeweAccountMethod<{
|
|
95
|
+
chatroomId: string;
|
|
96
|
+
memberWxids: string[];
|
|
97
|
+
}, GeweApiList>("/gewe/v2/api/group/getChatroomMemberDetail");
|
|
98
|
+
|
|
99
|
+
export const disbandChatroomGewe = createGeweAccountMethod<{
|
|
100
|
+
chatroomId: string;
|
|
101
|
+
}>("/gewe/v2/api/group/disbandChatroom");
|
|
102
|
+
|
|
103
|
+
export const setMsgSilenceGewe = createGeweAccountMethod<{
|
|
104
|
+
chatroomId: string;
|
|
105
|
+
silence: boolean | number;
|
|
106
|
+
}>("/gewe/v2/api/group/setMsgSilence");
|
|
107
|
+
|
|
108
|
+
export const setChatroomAnnouncementGewe = createGeweAccountMethod<{
|
|
109
|
+
chatroomId: string;
|
|
110
|
+
content: string;
|
|
111
|
+
}>("/gewe/v2/api/group/setChatroomAnnouncement");
|
|
112
|
+
|
|
113
|
+
export const quitChatroomGewe = createGeweAccountMethod<{
|
|
114
|
+
chatroomId: string;
|
|
115
|
+
}>("/gewe/v2/api/group/quitChatroom");
|
|
116
|
+
|
|
117
|
+
export const inviteMemberGewe = createGeweAccountMethod<{
|
|
118
|
+
chatroomId: string;
|
|
119
|
+
wxids: string[];
|
|
120
|
+
reason: string;
|
|
121
|
+
}>("/gewe/v2/api/group/inviteMember");
|
|
122
|
+
|
|
123
|
+
export const geweGroupsApi = {
|
|
124
|
+
modifyChatroomNickNameForSelf: modifyChatroomNickNameForSelfGewe,
|
|
125
|
+
modifyChatroomName: modifyChatroomNameGewe,
|
|
126
|
+
modifyChatroomRemark: modifyChatroomRemarkGewe,
|
|
127
|
+
createChatroom: createChatroomGewe,
|
|
128
|
+
removeMember: removeMemberGewe,
|
|
129
|
+
agreeJoinRoom: agreeJoinRoomGewe,
|
|
130
|
+
joinRoomUsingQRCode: joinRoomUsingQRCodeGewe,
|
|
131
|
+
addGroupMemberAsFriend: addGroupMemberAsFriendGewe,
|
|
132
|
+
roomAccessApplyCheckApprove: roomAccessApplyCheckApproveGewe,
|
|
133
|
+
adminOperate: adminOperateGewe,
|
|
134
|
+
saveContractList: saveContractListGewe,
|
|
135
|
+
pinChat: pinChatGewe,
|
|
136
|
+
getChatroomQrCode: getChatroomQrCodeGewe,
|
|
137
|
+
getChatroomInfo: getChatroomInfoGewe,
|
|
138
|
+
getChatroomAnnouncement: getChatroomAnnouncementGewe,
|
|
139
|
+
getChatroomMemberList: getChatroomMemberListGewe,
|
|
140
|
+
getChatroomMemberDetail: getChatroomMemberDetailGewe,
|
|
141
|
+
disbandChatroom: disbandChatroomGewe,
|
|
142
|
+
setMsgSilence: setMsgSilenceGewe,
|
|
143
|
+
setChatroomAnnouncement: setChatroomAnnouncementGewe,
|
|
144
|
+
quitChatroom: quitChatroomGewe,
|
|
145
|
+
inviteMember: inviteMemberGewe,
|
|
146
|
+
};
|
package/src/inbound-batch.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
buildAgentMediaPayload,
|
|
3
|
+
type AgentMediaPayload,
|
|
4
|
+
type OpenClawConfig,
|
|
5
|
+
} from "./openclaw-compat.js";
|
|
3
6
|
|
|
4
7
|
import type { GeweInboundMessage } from "./types.js";
|
|
5
8
|
|