@clawling/clawchat-plugin-openclaw 2026.8.4-1 → 2026.8.4-2
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/src/api-client.js +10 -0
- package/dist/src/skill-update.js +5 -3
- package/dist/src/tools-schema.js +10 -0
- package/dist/src/tools.js +29 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +1 -1
- package/src/api-client.ts +21 -0
- package/src/skill-update.ts +5 -3
- package/src/tools-schema.ts +12 -0
- package/src/tools.ts +34 -0
package/dist/src/api-client.js
CHANGED
|
@@ -398,6 +398,16 @@ export function createOpenclawClawlingApiClient(opts) {
|
|
|
398
398
|
assertNonBlankId(conversationId, "leaveConversation: conversationId");
|
|
399
399
|
return await call("POST", `/v1/conversations/${encodeURIComponent(conversationId)}/leave`);
|
|
400
400
|
},
|
|
401
|
+
async addConversationMember(conversationId, userId) {
|
|
402
|
+
assertNonBlankId(conversationId, "addConversationMember: conversationId");
|
|
403
|
+
assertNonBlankId(userId, "addConversationMember: userId");
|
|
404
|
+
const cid = conversationId.trim();
|
|
405
|
+
const uid = userId.trim();
|
|
406
|
+
return await call("POST", `/v1/conversations/${encodeURIComponent(cid)}/members`, {
|
|
407
|
+
body: JSON.stringify({ user_id: uid }),
|
|
408
|
+
headers: { "content-type": "application/json" },
|
|
409
|
+
});
|
|
410
|
+
},
|
|
401
411
|
async patchConversation(conversationId, patch) {
|
|
402
412
|
assertNonBlankId(conversationId, "patchConversation: conversationId");
|
|
403
413
|
const body = pickPatch(patch, ["title", "description"], "patchConversation");
|
package/dist/src/skill-update.js
CHANGED
|
@@ -38,9 +38,11 @@ import { fileURLToPath } from "node:url";
|
|
|
38
38
|
* - All network IO goes through an injected `FetchLike`; tests never touch the
|
|
39
39
|
* real network.
|
|
40
40
|
*
|
|
41
|
-
* Cross-language contract / spec: see
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Cross-language contract / spec: see `docs/clawchat-plugin-openclaw.md`
|
|
42
|
+
* §"Conversational skill hot-update" for this adapter's end of the flow,
|
|
43
|
+
* `docs/client-integration.md` for the `clawchat.skill.update.check` signal
|
|
44
|
+
* shape, and the install-cli repo's `skills/README.md` for the canonical skill
|
|
45
|
+
* source and `manifest.json` contract.
|
|
44
46
|
*/
|
|
45
47
|
// ---------------------------------------------------------------------------
|
|
46
48
|
// Constants — fixed contract (must match the install-cli `config.ts`).
|
package/dist/src/tools-schema.js
CHANGED
|
@@ -128,6 +128,16 @@ export const ClawchatLeaveGroupSchema = Type.Object({
|
|
|
128
128
|
description: "Concrete ClawChat group conversation id to leave",
|
|
129
129
|
}),
|
|
130
130
|
});
|
|
131
|
+
export const ClawchatAddGroupMemberSchema = Type.Object({
|
|
132
|
+
conversationId: Type.String({
|
|
133
|
+
minLength: 1,
|
|
134
|
+
description: "Concrete ClawChat group conversation id to add the user to",
|
|
135
|
+
}),
|
|
136
|
+
userId: Type.String({
|
|
137
|
+
minLength: 1,
|
|
138
|
+
description: "Concrete ClawChat user id (usr_...) to add to the group",
|
|
139
|
+
}),
|
|
140
|
+
});
|
|
131
141
|
export const ClawchatMentionMessageSchema = Type.Object({
|
|
132
142
|
chatId: Type.String({
|
|
133
143
|
minLength: 1,
|
package/dist/src/tools.js
CHANGED
|
@@ -12,7 +12,7 @@ import { getOpenclawClawlingClient, } from "./runtime.js";
|
|
|
12
12
|
import { markTerminalClawChatSend, getCurrentTerminalSendScope } from "./terminal-send.js";
|
|
13
13
|
import { editClawChatMemoryBody, readClawChatMemoryFile, resolveClawChatMemoryPath, searchClawChatMemory, writeClawChatMemoryBody, } from "./clawchat-memory.js";
|
|
14
14
|
import { pullGroupMetadata, pullOwnerMetadata, pullUserMetadata, pushMetadata, updateMetadata, } from "./clawchat-metadata.js";
|
|
15
|
-
import { ClawchatGetAccountProfileSchema, ClawchatGetConversationSchema, ClawchatGetMomentSchema, ClawchatGetUserProfileSchema, ClawchatLeaveGroupSchema, ClawchatAcceptFriendRequestSchema, ClawchatMemoryEditSchema, ClawchatMemoryReadSchema, ClawchatMemorySearchSchema, ClawchatMemoryWriteSchema, ClawchatMetadataSyncSchema, ClawchatMetadataUpdateSchema, ClawchatCreateMomentCommentSchema, ClawchatCreateMomentSchema, ClawchatDeleteMomentCommentSchema, ClawchatDeleteMomentSchema, ClawchatListAccountFriendsSchema, ClawchatListFriendRequestsSchema, ClawchatListMomentsSchema, ClawchatMentionMessageSchema, ClawchatReactMessageSchema, ClawchatReplyMomentCommentSchema, ClawchatRejectFriendRequestSchema, ClawchatRemoveFriendSchema, ClawchatSearchUsersSchema, ClawchatSendFriendRequestSchema, ClawchatToggleMomentReactionSchema, ClawchatUpdateAccountProfileSchema, ClawchatUploadAvatarImageSchema, ClawchatRegisterAppSchema, ClawchatListAppsSchema, ClawchatUnregisterAppSchema, ClawchatLivewareLoginSchema, } from "./tools-schema.js";
|
|
15
|
+
import { ClawchatGetAccountProfileSchema, ClawchatGetConversationSchema, ClawchatGetMomentSchema, ClawchatGetUserProfileSchema, ClawchatLeaveGroupSchema, ClawchatAddGroupMemberSchema, ClawchatAcceptFriendRequestSchema, ClawchatMemoryEditSchema, ClawchatMemoryReadSchema, ClawchatMemorySearchSchema, ClawchatMemoryWriteSchema, ClawchatMetadataSyncSchema, ClawchatMetadataUpdateSchema, ClawchatCreateMomentCommentSchema, ClawchatCreateMomentSchema, ClawchatDeleteMomentCommentSchema, ClawchatDeleteMomentSchema, ClawchatListAccountFriendsSchema, ClawchatListFriendRequestsSchema, ClawchatListMomentsSchema, ClawchatMentionMessageSchema, ClawchatReactMessageSchema, ClawchatReplyMomentCommentSchema, ClawchatRejectFriendRequestSchema, ClawchatRemoveFriendSchema, ClawchatSearchUsersSchema, ClawchatSendFriendRequestSchema, ClawchatToggleMomentReactionSchema, ClawchatUpdateAccountProfileSchema, ClawchatUploadAvatarImageSchema, ClawchatRegisterAppSchema, ClawchatListAppsSchema, ClawchatUnregisterAppSchema, ClawchatLivewareLoginSchema, } from "./tools-schema.js";
|
|
16
16
|
const MAX_UPLOAD_BYTES = 20 * 1024 * 1024;
|
|
17
17
|
// Owner-approval gate business codes (must match the ClawChat backend's owner-approval codes).
|
|
18
18
|
const CODE_PENDING_APPROVAL = 21001;
|
|
@@ -808,6 +808,34 @@ export function registerOpenclawClawlingTools(api, options = {}) {
|
|
|
808
808
|
});
|
|
809
809
|
},
|
|
810
810
|
}, { name: "clawchat_leave_group" });
|
|
811
|
+
api.registerTool({
|
|
812
|
+
name: "clawchat_add_group_member",
|
|
813
|
+
label: "Add ClawChat Group Member",
|
|
814
|
+
description: toolDescription("Add a specified ClawChat user to a group conversation the agent is a member of. " +
|
|
815
|
+
"TRIGGER - invoke only when the user explicitly asks the agent to add, invite, or pull a specific person into a specific ClawChat group, and both a concrete conversationId and a concrete userId are available. " +
|
|
816
|
+
"Never guess a userId from a name or nickname — use ids from ClawChat Group Message Metadata, clawchat_list_account_friends, or clawchat_search_users. " +
|
|
817
|
+
"Groups only: direct conversations are rejected by the server. " +
|
|
818
|
+
"The target must already be the agent's ClawChat friend, and the agent needs the group-management permission granted by its owner; if the call fails for either reason, explain that to the user and do not retry."),
|
|
819
|
+
parameters: ClawchatAddGroupMemberSchema,
|
|
820
|
+
async execute(_callId, params) {
|
|
821
|
+
return await recordClawchatToolCall("clawchat_add_group_member", params, async () => {
|
|
822
|
+
const p = params;
|
|
823
|
+
const built = buildClient();
|
|
824
|
+
if (!built.ok)
|
|
825
|
+
return built.error;
|
|
826
|
+
try {
|
|
827
|
+
const data = await built.client.addConversationMember(p.conversationId, p.userId);
|
|
828
|
+
return jsonResponse(data);
|
|
829
|
+
}
|
|
830
|
+
catch (err) {
|
|
831
|
+
if (err instanceof ClawlingApiError) {
|
|
832
|
+
return apiError(err);
|
|
833
|
+
}
|
|
834
|
+
return genericError(err);
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
},
|
|
838
|
+
}, { name: "clawchat_add_group_member" });
|
|
811
839
|
api.registerTool({
|
|
812
840
|
name: "clawchat_mention_message",
|
|
813
841
|
label: "Send ClawChat Mention Message",
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/api-client.ts
CHANGED
|
@@ -135,6 +135,10 @@ export interface OpenclawClawlingApiClient {
|
|
|
135
135
|
deleteMomentComment(params: { momentId: number; commentId: number }): Promise<{ ok: boolean }>;
|
|
136
136
|
getConversation(conversationId: string): Promise<{ conversation: ConversationDetails }>;
|
|
137
137
|
leaveConversation(conversationId: string): Promise<{ ok: boolean }>;
|
|
138
|
+
addConversationMember(
|
|
139
|
+
conversationId: string,
|
|
140
|
+
userId: string,
|
|
141
|
+
): Promise<{ conversation: ConversationDetails }>;
|
|
138
142
|
patchConversation(
|
|
139
143
|
conversationId: string,
|
|
140
144
|
patch: ConversationMetadataPatch,
|
|
@@ -643,6 +647,23 @@ export function createOpenclawClawlingApiClient(opts: ApiClientOptions): Opencla
|
|
|
643
647
|
`/v1/conversations/${encodeURIComponent(conversationId)}/leave`,
|
|
644
648
|
);
|
|
645
649
|
},
|
|
650
|
+
async addConversationMember(
|
|
651
|
+
conversationId,
|
|
652
|
+
userId,
|
|
653
|
+
): Promise<{ conversation: ConversationDetails }> {
|
|
654
|
+
assertNonBlankId(conversationId, "addConversationMember: conversationId");
|
|
655
|
+
assertNonBlankId(userId, "addConversationMember: userId");
|
|
656
|
+
const cid = conversationId.trim();
|
|
657
|
+
const uid = userId.trim();
|
|
658
|
+
return await call<{ conversation: ConversationDetails }>(
|
|
659
|
+
"POST",
|
|
660
|
+
`/v1/conversations/${encodeURIComponent(cid)}/members`,
|
|
661
|
+
{
|
|
662
|
+
body: JSON.stringify({ user_id: uid }),
|
|
663
|
+
headers: { "content-type": "application/json" },
|
|
664
|
+
},
|
|
665
|
+
);
|
|
666
|
+
},
|
|
646
667
|
async patchConversation(
|
|
647
668
|
conversationId: string,
|
|
648
669
|
patch: ConversationMetadataPatch,
|
package/src/skill-update.ts
CHANGED
|
@@ -39,9 +39,11 @@ import { fileURLToPath } from "node:url";
|
|
|
39
39
|
* - All network IO goes through an injected `FetchLike`; tests never touch the
|
|
40
40
|
* real network.
|
|
41
41
|
*
|
|
42
|
-
* Cross-language contract / spec: see
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* Cross-language contract / spec: see `docs/clawchat-plugin-openclaw.md`
|
|
43
|
+
* §"Conversational skill hot-update" for this adapter's end of the flow,
|
|
44
|
+
* `docs/client-integration.md` for the `clawchat.skill.update.check` signal
|
|
45
|
+
* shape, and the install-cli repo's `skills/README.md` for the canonical skill
|
|
46
|
+
* source and `manifest.json` contract.
|
|
45
47
|
*/
|
|
46
48
|
|
|
47
49
|
// ---------------------------------------------------------------------------
|
package/src/tools-schema.ts
CHANGED
|
@@ -208,6 +208,18 @@ export const ClawchatLeaveGroupSchema = Type.Object({
|
|
|
208
208
|
});
|
|
209
209
|
export type ClawchatLeaveGroupParams = Static<typeof ClawchatLeaveGroupSchema>;
|
|
210
210
|
|
|
211
|
+
export const ClawchatAddGroupMemberSchema = Type.Object({
|
|
212
|
+
conversationId: Type.String({
|
|
213
|
+
minLength: 1,
|
|
214
|
+
description: "Concrete ClawChat group conversation id to add the user to",
|
|
215
|
+
}),
|
|
216
|
+
userId: Type.String({
|
|
217
|
+
minLength: 1,
|
|
218
|
+
description: "Concrete ClawChat user id (usr_...) to add to the group",
|
|
219
|
+
}),
|
|
220
|
+
});
|
|
221
|
+
export type ClawchatAddGroupMemberParams = Static<typeof ClawchatAddGroupMemberSchema>;
|
|
222
|
+
|
|
211
223
|
export const ClawchatMentionMessageSchema = Type.Object({
|
|
212
224
|
chatId: Type.String({
|
|
213
225
|
minLength: 1,
|
package/src/tools.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
ClawchatGetMomentSchema,
|
|
44
44
|
ClawchatGetUserProfileSchema,
|
|
45
45
|
ClawchatLeaveGroupSchema,
|
|
46
|
+
ClawchatAddGroupMemberSchema,
|
|
46
47
|
ClawchatAcceptFriendRequestSchema,
|
|
47
48
|
ClawchatMemoryEditSchema,
|
|
48
49
|
ClawchatMemoryReadSchema,
|
|
@@ -86,6 +87,7 @@ import {
|
|
|
86
87
|
type ClawchatGetMomentParams,
|
|
87
88
|
type ClawchatGetUserProfileParams,
|
|
88
89
|
type ClawchatLeaveGroupParams,
|
|
90
|
+
type ClawchatAddGroupMemberParams,
|
|
89
91
|
type ClawchatListFriendRequestsParams,
|
|
90
92
|
type ClawchatListMomentsParams,
|
|
91
93
|
type ClawchatMentionMessageParams,
|
|
@@ -1048,6 +1050,38 @@ export function registerOpenclawClawlingTools(
|
|
|
1048
1050
|
{ name: "clawchat_leave_group" },
|
|
1049
1051
|
);
|
|
1050
1052
|
|
|
1053
|
+
api.registerTool(
|
|
1054
|
+
{
|
|
1055
|
+
name: "clawchat_add_group_member",
|
|
1056
|
+
label: "Add ClawChat Group Member",
|
|
1057
|
+
description: toolDescription(
|
|
1058
|
+
"Add a specified ClawChat user to a group conversation the agent is a member of. " +
|
|
1059
|
+
"TRIGGER - invoke only when the user explicitly asks the agent to add, invite, or pull a specific person into a specific ClawChat group, and both a concrete conversationId and a concrete userId are available. " +
|
|
1060
|
+
"Never guess a userId from a name or nickname — use ids from ClawChat Group Message Metadata, clawchat_list_account_friends, or clawchat_search_users. " +
|
|
1061
|
+
"Groups only: direct conversations are rejected by the server. " +
|
|
1062
|
+
"The target must already be the agent's ClawChat friend, and the agent needs the group-management permission granted by its owner; if the call fails for either reason, explain that to the user and do not retry.",
|
|
1063
|
+
),
|
|
1064
|
+
parameters: ClawchatAddGroupMemberSchema,
|
|
1065
|
+
async execute(_callId, params) {
|
|
1066
|
+
return await recordClawchatToolCall("clawchat_add_group_member", params, async () => {
|
|
1067
|
+
const p = params as ClawchatAddGroupMemberParams;
|
|
1068
|
+
const built = buildClient();
|
|
1069
|
+
if (!built.ok) return built.error;
|
|
1070
|
+
try {
|
|
1071
|
+
const data = await built.client.addConversationMember(p.conversationId, p.userId);
|
|
1072
|
+
return jsonResponse(data);
|
|
1073
|
+
} catch (err) {
|
|
1074
|
+
if (err instanceof ClawlingApiError) {
|
|
1075
|
+
return apiError(err);
|
|
1076
|
+
}
|
|
1077
|
+
return genericError(err);
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
},
|
|
1081
|
+
},
|
|
1082
|
+
{ name: "clawchat_add_group_member" },
|
|
1083
|
+
);
|
|
1084
|
+
|
|
1051
1085
|
api.registerTool(
|
|
1052
1086
|
{
|
|
1053
1087
|
name: "clawchat_mention_message",
|