feat(onebot): implement collection list retrieval

Replace the get_collection_list placeholder with authenticated, read-only collection retrieval through the existing bridge API.

Add strict binary envelope validation, bounded pagination, accurate category filtering, preserved 64-bit identifiers, and explicit ticket, transport, service, and malformed-response failures. Cap item counts, page traversal, response bytes, per-request waits, and the total operation time.

Expose the compatible response model through Core, OneBot, the SDK, and the generated MCP catalog. Cover protocol framing, cursor behavior, filtered hasMore semantics, cleanup failures, bridge ticket acquisition, and Action validation with regression tests.

Verified with the live test bot without changing native components or adding any collection write behavior.
This commit is contained in:
DrSmoothl committed 2026-07-19 20:22:16 +08:00
1 parent 4e62fdc80b
commit 810d72fa04
15 files changed
+1912 -20

No files matched your search

+3 -1
View File
@@ -65,6 +65,7 @@ import type {
NcGetUserStatusParams,
GroupTodoParams,
GetAiCharactersParams,
GetCollectionListParams,
AiVoiceParams,
DeleteGroupFolderParams,
SendPacketParams,
@@ -97,6 +98,7 @@ import type {
AiCharacterCategory,
UserOnlineStatus,
SendGroupAiRecordResult,
CollectionListInfo,
} from './results';
export type ActionData = JsonValue;
@@ -207,7 +209,7 @@ export interface SnowLumaActionMap {
get_group_at_all_remain: { params: JsonObject; data: GroupAtAllRemainInfo };
get_unidirectional_friend_list: { params: JsonObject; data: JsonArray };
set_self_longnick: { params: JsonObject; data: EmptyData };
get_collection_list: { params: JsonObject; data: JsonArray };
get_collection_list: { params: GetCollectionListParams; data: CollectionListInfo };
create_collection: { params: JsonObject; data: JsonValue };
set_qq_avatar: { params: JsonObject; data: EmptyData };
set_input_status: { params: JsonObject; data: EmptyData };
+7
View File
@@ -297,6 +297,13 @@ export interface FetchCustomFaceParams extends JsonObject {
count?: number;
}
export interface GetCollectionListParams extends JsonObject {
/** Collection category ID; 0 returns every category. */
category?: number;
/** Maximum number of collection items to return (1-500). */
count?: number;
}
export interface GetEmojiLikesParams extends MessageIdParams {
emoji_id: string;
}
+49
View File
@@ -126,6 +126,55 @@ export interface OnlineClientsInfo {
clients: OnlineClientInfo[];
}
export interface CollectionAuthorInfo extends JsonObject {
type: number;
numId: string;
strId: string;
groupId: string;
groupName: string;
uid: string;
}
export interface CollectionSummaryInfo extends JsonObject {
textSummary: JsonValue;
linkSummary: JsonValue;
gallerySummary: JsonValue;
audioSummary: JsonValue;
videoSummary: JsonValue;
fileSummary: JsonValue;
locationSummary: JsonValue;
richMediaSummary: JsonValue;
}
export interface CollectionItemInfo extends JsonObject {
cid: string;
type: number;
status: number;
author: CollectionAuthorInfo;
bid: number;
category: number;
createTime: string;
collectTime: string;
modifyTime: string;
sequence: string;
shareUrl: string;
customGroupId: number;
securityBeat: boolean;
summary: CollectionSummaryInfo;
}
export interface CollectionSearchListInfo extends JsonObject {
collectionItemList: CollectionItemInfo[];
hasMore: boolean;
bottomTimeStamp: string;
}
export interface CollectionListInfo extends JsonObject {
errCode: number;
errMsg: string;
collectionSearchList: CollectionSearchListInfo;
}
export interface UrlSafetyInfo {
level: number;
}