@napuketto/kernel 0.8.0 → 0.9.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/index.d.mts +100 -199
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +216 -175
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -18
- package/dist/index.cjs +0 -5627
- package/dist/index.d.cts +0 -3086
- package/dist/index.d.cts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import pino from "pino";
|
|
2
|
-
//#region src/types/entities.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 实体类型层(运行时探测产物 + 公开资料作说明书,ADR-006)
|
|
5
4
|
*
|
|
@@ -7,14 +6,14 @@ import pino from "pino";
|
|
|
7
6
|
* 探测(probe.ts)校准——接口签名是外部系统事实,自研描述其形状。
|
|
8
7
|
*/
|
|
9
8
|
/** 会话类型(QQ wrapper 外部契约)。 */
|
|
10
|
-
declare const ChatType: {
|
|
9
|
+
export declare const ChatType: {
|
|
11
10
|
readonly C2C: 1;
|
|
12
11
|
readonly GROUP: 2;
|
|
13
12
|
readonly DISC: 3;
|
|
14
13
|
readonly GUILD: 4;
|
|
15
14
|
readonly C2C_TEMP: 100;
|
|
16
15
|
};
|
|
17
|
-
type ChatType = (typeof ChatType)[keyof typeof ChatType];
|
|
16
|
+
export type ChatType = (typeof ChatType)[keyof typeof ChatType];
|
|
18
17
|
/** 会话对象(peer 目标:群号 / 用户 uid)。 */
|
|
19
18
|
interface Peer {
|
|
20
19
|
chatType: ChatType;
|
|
@@ -153,7 +152,7 @@ interface FileElement {
|
|
|
153
152
|
subElementType?: number;
|
|
154
153
|
}
|
|
155
154
|
/** 灰色提示子类型(系统事件类型,QQ wrapper 契约)。 */
|
|
156
|
-
declare const GrayTipSubType: {
|
|
155
|
+
export declare const GrayTipSubType: {
|
|
157
156
|
readonly REVOKE: 1;
|
|
158
157
|
readonly PROCLAMATION: 2;
|
|
159
158
|
readonly GROUP: 4;
|
|
@@ -165,9 +164,9 @@ declare const GrayTipSubType: {
|
|
|
165
164
|
readonly FILE: 10;
|
|
166
165
|
readonly JSON: 17;
|
|
167
166
|
};
|
|
168
|
-
type GrayTipSubType = (typeof GrayTipSubType)[keyof typeof GrayTipSubType];
|
|
167
|
+
export type GrayTipSubType = (typeof GrayTipSubType)[keyof typeof GrayTipSubType];
|
|
169
168
|
/** 群成员变动类型(TipGroupElement.type)。 */
|
|
170
|
-
declare const TipGroupElementType: {
|
|
169
|
+
export declare const TipGroupElementType: {
|
|
171
170
|
readonly MEMBER_ADD: 1;
|
|
172
171
|
readonly DISBANDED: 2;
|
|
173
172
|
readonly QUIT: 3;
|
|
@@ -177,7 +176,7 @@ declare const TipGroupElementType: {
|
|
|
177
176
|
readonly UNBLOCK: 7;
|
|
178
177
|
readonly SHUT_UP: 8;
|
|
179
178
|
};
|
|
180
|
-
type TipGroupElementType = (typeof TipGroupElementType)[keyof typeof TipGroupElementType];
|
|
179
|
+
export type TipGroupElementType = (typeof TipGroupElementType)[keyof typeof TipGroupElementType];
|
|
181
180
|
/** 撤回元素(revokeElement)。 */
|
|
182
181
|
interface GrayTipRevokeElement {
|
|
183
182
|
operatorUid: string;
|
|
@@ -282,8 +281,6 @@ interface RawMessage {
|
|
|
282
281
|
guildId?: string;
|
|
283
282
|
[key: string]: unknown;
|
|
284
283
|
}
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/types/listeners/buddy.d.ts
|
|
287
284
|
/**
|
|
288
285
|
* Buddy 服务(BuddyService)的原生回调监听类型(2026-09-08)。
|
|
289
286
|
*
|
|
@@ -306,15 +303,13 @@ type BuddyListener = {
|
|
|
306
303
|
/** 好友被删除(参数形状待真实事件校准)。 */
|
|
307
304
|
onBuddyDeleted: (arg: unknown) => void;
|
|
308
305
|
};
|
|
309
|
-
//#endregion
|
|
310
|
-
//#region src/types/services/msg-service.d.ts
|
|
311
306
|
/** 原生通用返回:result 非 0 即失败(errMsg 附原因)。 */
|
|
312
307
|
interface GeneralCallResult {
|
|
313
308
|
result: number;
|
|
314
309
|
errMsg: string;
|
|
315
310
|
}
|
|
316
311
|
/** 消息元素类型枚举(QQ wrapper 外部契约,自研描述)。 */
|
|
317
|
-
declare const ElementType: {
|
|
312
|
+
export declare const ElementType: {
|
|
318
313
|
readonly UNKNOWN: 0;
|
|
319
314
|
readonly TEXT: 1;
|
|
320
315
|
readonly PIC: 2;
|
|
@@ -336,7 +331,7 @@ declare const ElementType: {
|
|
|
336
331
|
readonly INTEXT_GIFT: 18;
|
|
337
332
|
readonly CALENDAR: 19;
|
|
338
333
|
};
|
|
339
|
-
type ElementType = (typeof ElementType)[keyof typeof ElementType];
|
|
334
|
+
export type ElementType = (typeof ElementType)[keyof typeof ElementType];
|
|
340
335
|
/** 发送消息元素(session 发送用,elementType + 各子元素互斥)。 */
|
|
341
336
|
interface SendMessageElement {
|
|
342
337
|
elementType: ElementType;
|
|
@@ -447,17 +442,15 @@ interface NodeIKernelMsgService {
|
|
|
447
442
|
emojiInfoList?: unknown;
|
|
448
443
|
}>;
|
|
449
444
|
}
|
|
450
|
-
//#endregion
|
|
451
|
-
//#region src/types/services/group-service.d.ts
|
|
452
445
|
/** 群成员角色(QQ wrapper 契约)。 */
|
|
453
|
-
declare const NTGroupMemberRole: {
|
|
446
|
+
export declare const NTGroupMemberRole: {
|
|
454
447
|
readonly UNSPECIFIED: 0;
|
|
455
448
|
readonly STRANGER: 1;
|
|
456
449
|
readonly MEMBER: 2;
|
|
457
450
|
readonly ADMIN: 3;
|
|
458
451
|
readonly OWNER: 4;
|
|
459
452
|
};
|
|
460
|
-
type NTGroupMemberRole = (typeof NTGroupMemberRole)[keyof typeof NTGroupMemberRole];
|
|
453
|
+
export type NTGroupMemberRole = (typeof NTGroupMemberRole)[keyof typeof NTGroupMemberRole];
|
|
461
454
|
/** 踢人请求项(KickMemberV2Req.kickList 成员,说明书参考,字段值待探测校准)。 */
|
|
462
455
|
interface KickMemberInfo {
|
|
463
456
|
optFlag: number;
|
|
@@ -482,7 +475,7 @@ interface GroupRemainAtTimes {
|
|
|
482
475
|
canNotAtAllMsg: string;
|
|
483
476
|
}
|
|
484
477
|
/** 群通知类型(GroupNotifyMsgType,说明书参考)。 */
|
|
485
|
-
declare const GroupNotifyMsgType: {
|
|
478
|
+
export declare const GroupNotifyMsgType: {
|
|
486
479
|
readonly UN_SPECIFIED: 0;
|
|
487
480
|
readonly INVITED_BY_MEMBER: 1;
|
|
488
481
|
readonly REFUSE_INVITED: 2;
|
|
@@ -500,25 +493,25 @@ declare const GroupNotifyMsgType: {
|
|
|
500
493
|
readonly TRANSFER_GROUP_NOTIFY_OLDOWNER: 14;
|
|
501
494
|
readonly TRANSFER_GROUP_NOTIFY_ADMIN: 15;
|
|
502
495
|
};
|
|
503
|
-
type GroupNotifyMsgType = (typeof GroupNotifyMsgType)[keyof typeof GroupNotifyMsgType];
|
|
496
|
+
export type GroupNotifyMsgType = (typeof GroupNotifyMsgType)[keyof typeof GroupNotifyMsgType];
|
|
504
497
|
/** 群通知处理状态(GroupNotifyMsgStatus,说明书参考)。 */
|
|
505
|
-
declare const GroupNotifyMsgStatus: {
|
|
498
|
+
export declare const GroupNotifyMsgStatus: {
|
|
506
499
|
readonly KINIT: 0;
|
|
507
500
|
readonly KUNHANDLE: 1;
|
|
508
501
|
readonly KAGREED: 2;
|
|
509
502
|
readonly KREFUSED: 3;
|
|
510
503
|
readonly KIGNORED: 4;
|
|
511
504
|
};
|
|
512
|
-
type GroupNotifyMsgStatus = (typeof GroupNotifyMsgStatus)[keyof typeof GroupNotifyMsgStatus];
|
|
505
|
+
export type GroupNotifyMsgStatus = (typeof GroupNotifyMsgStatus)[keyof typeof GroupNotifyMsgStatus];
|
|
513
506
|
/** 群请求操作类型(NTGroupRequestOperateTypes,说明书参考)。 */
|
|
514
|
-
declare const NTGroupRequestOperateTypes: {
|
|
507
|
+
export declare const NTGroupRequestOperateTypes: {
|
|
515
508
|
readonly KUNSPECIFIED: 0;
|
|
516
509
|
readonly KAGREE: 1;
|
|
517
510
|
readonly KREFUSE: 2;
|
|
518
511
|
readonly KIGNORE: 3;
|
|
519
512
|
readonly KDELETE: 4;
|
|
520
513
|
};
|
|
521
|
-
type NTGroupRequestOperateTypes = (typeof NTGroupRequestOperateTypes)[keyof typeof NTGroupRequestOperateTypes];
|
|
514
|
+
export type NTGroupRequestOperateTypes = (typeof NTGroupRequestOperateTypes)[keyof typeof NTGroupRequestOperateTypes];
|
|
522
515
|
/** 群通知(getSingleScreenNotifies 返回项,说明书参考,待探测校准)。 */
|
|
523
516
|
interface GroupNotify {
|
|
524
517
|
seq: string;
|
|
@@ -721,16 +714,14 @@ interface NodeIKernelGroupService {
|
|
|
721
714
|
/** 群头像(set_group_avatar;参数待校准;Profile setHeader 同名方法)。 */
|
|
722
715
|
setHeader(groupCode: string, imagePath: string): Promise<unknown>;
|
|
723
716
|
}
|
|
724
|
-
//#endregion
|
|
725
|
-
//#region src/types/listeners/group.d.ts
|
|
726
717
|
/** 群列表更新类型(说明书参考,值待探测校准)。 */
|
|
727
|
-
declare const GroupListUpdateType: {
|
|
718
|
+
export declare const GroupListUpdateType: {
|
|
728
719
|
/** 全量更新(groupList 为完整列表)。 */
|
|
729
720
|
readonly ALL: 0;
|
|
730
721
|
/** 增量更新(合并到现有缓存)。 */
|
|
731
722
|
readonly PARTIAL: 1;
|
|
732
723
|
};
|
|
733
|
-
type GroupListUpdateType = (typeof GroupListUpdateType)[keyof typeof GroupListUpdateType];
|
|
724
|
+
export type GroupListUpdateType = (typeof GroupListUpdateType)[keyof typeof GroupListUpdateType];
|
|
734
725
|
/** 成员数据来源(onMemberInfoChange 第二参,说明书参考)。 */
|
|
735
726
|
declare const GroupMemberDataSource: {
|
|
736
727
|
/** 本地缓存。 */
|
|
@@ -776,8 +767,6 @@ type GroupListener = {
|
|
|
776
767
|
*/
|
|
777
768
|
onGroupEssenceListChange: (arg: unknown) => void;
|
|
778
769
|
};
|
|
779
|
-
//#endregion
|
|
780
|
-
//#region src/types/listeners/login.d.ts
|
|
781
770
|
/**
|
|
782
771
|
* 登录状态监听转发面(LoginBridge 通道类型,2026-11-01 批次三)
|
|
783
772
|
*
|
|
@@ -793,8 +782,6 @@ type LoginListener = {
|
|
|
793
782
|
/** 登出成功(主动登出路径)。 */
|
|
794
783
|
onLogoutSucceed: (...args: unknown[]) => void;
|
|
795
784
|
};
|
|
796
|
-
//#endregion
|
|
797
|
-
//#region src/types/listeners/msg.d.ts
|
|
798
785
|
/** 消息已读上报(peer + 已读 seq)。 */
|
|
799
786
|
interface MsgReadReportItem {
|
|
800
787
|
peer: unknown;
|
|
@@ -854,8 +841,6 @@ type MsgListener = {
|
|
|
854
841
|
*/
|
|
855
842
|
onRecvSysMsg: (arg: unknown) => void;
|
|
856
843
|
};
|
|
857
|
-
//#endregion
|
|
858
|
-
//#region src/types/services/recent-contact-service.d.ts
|
|
859
844
|
/** 会话联系人(getRecentContactList 项,说明书参考,待探测校准)。 */
|
|
860
845
|
interface RecentContact {
|
|
861
846
|
/** 会话 id(群场景 = 群号,好友场景 = uid)。 */
|
|
@@ -888,8 +873,6 @@ interface NodeIKernelRecentContactService {
|
|
|
888
873
|
/** 注销会话列表监听。 */
|
|
889
874
|
removeKernelRecentContactListener(listenerId: number): void;
|
|
890
875
|
}
|
|
891
|
-
//#endregion
|
|
892
|
-
//#region src/types/listeners/recent-contact.d.ts
|
|
893
876
|
/** 会话列表变更(onRecentContactListChangedVer2 参数项,录制实证形状)。 */
|
|
894
877
|
interface RecentContactListChanged {
|
|
895
878
|
/** 列表类别(实测 1/2 两类;翻译侧不依赖,用条目 chatType 判场景)。 */
|
|
@@ -907,12 +890,10 @@ type RecentContactListener = {
|
|
|
907
890
|
/** 会话通知(单条快照数组,peerUid 空 / chatType=7 影子条目须过滤)。 */
|
|
908
891
|
onRecentContactNotification: (contacts: RecentContact[]) => void;
|
|
909
892
|
};
|
|
910
|
-
//#endregion
|
|
911
|
-
//#region src/types/message-element.d.ts
|
|
912
893
|
/** NT RawMessage → canonical 元素(与 toSendElements 对称,接收方向)。 */
|
|
913
|
-
declare function toCanonicalElements(msg: RawMessage): CanonicalElement[];
|
|
894
|
+
export declare function toCanonicalElements(msg: RawMessage): CanonicalElement[];
|
|
914
895
|
/** canonical 元素 → NT 发送元素(text/at/face/image/voice/reply 核心 + json ARK 透传)。 */
|
|
915
|
-
declare function toSendElements(elements: CanonicalElement[]): SendMessageElement[];
|
|
896
|
+
export declare function toSendElements(elements: CanonicalElement[]): SendMessageElement[];
|
|
916
897
|
/** 协议无关的规范消息元素。 */
|
|
917
898
|
type CanonicalElement = {
|
|
918
899
|
type: "text";
|
|
@@ -966,8 +947,6 @@ type CanonicalElement = {
|
|
|
966
947
|
type: "unknown";
|
|
967
948
|
raw: unknown;
|
|
968
949
|
};
|
|
969
|
-
//#endregion
|
|
970
|
-
//#region src/types/services/buddy-service.d.ts
|
|
971
950
|
/** 好友核心信息(BuddyListEntry.coreInfo,2026-09-08 T10 实测)。 */
|
|
972
951
|
interface BuddyCoreInfo {
|
|
973
952
|
uid: string;
|
|
@@ -1060,8 +1039,6 @@ interface NodeIKernelBuddyService {
|
|
|
1060
1039
|
/** 处理可疑好友申请(set_doubt_friends_add_request;str1/str2 语义未知,传空串)。 */
|
|
1061
1040
|
approvalDoubtBuddyReq(uid: string, str1: string, str2: string): void;
|
|
1062
1041
|
}
|
|
1063
|
-
//#endregion
|
|
1064
|
-
//#region src/types/services/profile-like-service.d.ts
|
|
1065
1042
|
/**
|
|
1066
1043
|
* NodeIKernelProfileLikeService:资料点赞服务接口面(自研描述,非移植)
|
|
1067
1044
|
*
|
|
@@ -1089,8 +1066,6 @@ interface NodeIKernelProfileLikeService {
|
|
|
1089
1066
|
}): Promise<BuddyProfileLikeResult>;
|
|
1090
1067
|
isNull(): boolean;
|
|
1091
1068
|
}
|
|
1092
|
-
//#endregion
|
|
1093
|
-
//#region src/types/services/profile-service.d.ts
|
|
1094
1069
|
/** 用户详情(getUserDetailInfoByUin / getUserDetailInfo 返回,宽松自研描述,待探测校准)。 */
|
|
1095
1070
|
interface UserDetailInfoByUin {
|
|
1096
1071
|
detail?: {
|
|
@@ -1140,8 +1115,6 @@ interface NodeIKernelProfileService {
|
|
|
1140
1115
|
getUserDetailInfo(uid: string): Promise<UserDetailInfoByUin>;
|
|
1141
1116
|
isNull(): boolean;
|
|
1142
1117
|
}
|
|
1143
|
-
//#endregion
|
|
1144
|
-
//#region src/types/services/richmedia-service.d.ts
|
|
1145
1118
|
/** 群文件列表参数(getGroupFileList,说明书参考)。 */
|
|
1146
1119
|
interface GetFileListParam {
|
|
1147
1120
|
sortType: number;
|
|
@@ -1216,8 +1189,6 @@ interface NodeIKernelRichMediaService {
|
|
|
1216
1189
|
}>;
|
|
1217
1190
|
isNull(): boolean;
|
|
1218
1191
|
}
|
|
1219
|
-
//#endregion
|
|
1220
|
-
//#region src/types/services/ticket-service.d.ts
|
|
1221
1192
|
/** forceFetchClientKey 返回(get_clientkey 直接返回,get_cookies 用 clientKey 换跳转票据)。 */
|
|
1222
1193
|
interface ForceFetchClientKeyRetType extends GeneralCallResult {
|
|
1223
1194
|
url: string;
|
|
@@ -1232,8 +1203,6 @@ interface NodeIKernelTicketService {
|
|
|
1232
1203
|
forceFetchClientKey(arg: string): Promise<ForceFetchClientKeyRetType>;
|
|
1233
1204
|
isNull(): boolean;
|
|
1234
1205
|
}
|
|
1235
|
-
//#endregion
|
|
1236
|
-
//#region src/types/wrapper.d.ts
|
|
1237
1206
|
/**
|
|
1238
1207
|
* wrapper.node 的 NAPI 接口面(自研描述,非移植)
|
|
1239
1208
|
*
|
|
@@ -1500,8 +1469,6 @@ interface WrapperNodeApi {
|
|
|
1500
1469
|
/** 构造器:`new wrapper.NodeIKernelLoginService()`。 */
|
|
1501
1470
|
NodeIKernelLoginService: NodeIKernelLoginServiceCtor;
|
|
1502
1471
|
}
|
|
1503
|
-
//#endregion
|
|
1504
|
-
//#region src/apis/friend.d.ts
|
|
1505
1472
|
/** 好友条目(uid + 昵称/备注,昵称由 buddy service 缓存补全)。 */
|
|
1506
1473
|
interface Friend {
|
|
1507
1474
|
uid: string;
|
|
@@ -1536,7 +1503,7 @@ interface FriendApiOptions {
|
|
|
1536
1503
|
uidToUin?: (uids: string[]) => Promise<Map<string, string>>;
|
|
1537
1504
|
}
|
|
1538
1505
|
/** 好友 API:从 session 拿 buddy service,包装成语义化方法。 */
|
|
1539
|
-
declare class FriendApi {
|
|
1506
|
+
export declare class FriendApi {
|
|
1540
1507
|
private readonly service;
|
|
1541
1508
|
private readonly uidToUin;
|
|
1542
1509
|
constructor(session: NodeIQQNTWrapperSession, opts?: FriendApiOptions);
|
|
@@ -1563,10 +1530,8 @@ declare class FriendApi {
|
|
|
1563
1530
|
/** 处理可疑好友申请(set_doubt_friends_add_request;uid=flag)。 */
|
|
1564
1531
|
handleDoubtFriendRequest(uid: string): void;
|
|
1565
1532
|
}
|
|
1566
|
-
//#endregion
|
|
1567
|
-
//#region src/apis/group.d.ts
|
|
1568
1533
|
/** 群 API:从 session 拿 group service,包装成语义化方法。 */
|
|
1569
|
-
declare class GroupApi {
|
|
1534
|
+
export declare class GroupApi {
|
|
1570
1535
|
private readonly service;
|
|
1571
1536
|
/** 精华消息需要 msg service(按 msgId 拉消息取 msgSeq/msgRandom)。 */
|
|
1572
1537
|
private readonly msgService;
|
|
@@ -1647,10 +1612,8 @@ declare class GroupApi {
|
|
|
1647
1612
|
remainAtAllCountForGroup: number;
|
|
1648
1613
|
}>;
|
|
1649
1614
|
}
|
|
1650
|
-
//#endregion
|
|
1651
|
-
//#region src/apis/group-notify.d.ts
|
|
1652
1615
|
/** 群通知 API:从 session 拿 group service,包装成语义化方法。 */
|
|
1653
|
-
declare class GroupNotifyApi {
|
|
1616
|
+
export declare class GroupNotifyApi {
|
|
1654
1617
|
private readonly service;
|
|
1655
1618
|
constructor(session: NodeIQQNTWrapperSession);
|
|
1656
1619
|
/** 单屏通知列表(get_group_system_msg / set_group_add_request 共用)。 */
|
|
@@ -1660,8 +1623,6 @@ declare class GroupNotifyApi {
|
|
|
1660
1623
|
/** 处理群请求(set_group_add_request 应答;approve=true 同意 / false 拒绝)。 */
|
|
1661
1624
|
handleGroupRequest(doubt: boolean, notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason: string): Promise<void>;
|
|
1662
1625
|
}
|
|
1663
|
-
//#endregion
|
|
1664
|
-
//#region src/event-channel.d.ts
|
|
1665
1626
|
/** Listener 接口形状(宽约束;精确签名由实例化时的具体接口保证)。 */
|
|
1666
1627
|
type ListenerShape = Record<string, unknown>;
|
|
1667
1628
|
/** 事件名:`${Service}/${method}`。 */
|
|
@@ -1688,7 +1649,7 @@ type ListenerEvents<L extends ListenerShape, Name extends string> = { [K in keyo
|
|
|
1688
1649
|
* @typeParam L - Listener 接口(探测产物,如 MsgListener)
|
|
1689
1650
|
* @typeParam Name - Service 名(事件名前缀,如 "Msg")
|
|
1690
1651
|
*/
|
|
1691
|
-
declare class NTEventChannel<L extends ListenerShape, Name extends string> {
|
|
1652
|
+
export declare class NTEventChannel<L extends ListenerShape, Name extends string> {
|
|
1692
1653
|
readonly serviceName: Name;
|
|
1693
1654
|
private readonly emitter;
|
|
1694
1655
|
private readonly errorHandlers;
|
|
@@ -1724,15 +1685,13 @@ declare class NTEventChannel<L extends ListenerShape, Name extends string> {
|
|
|
1724
1685
|
/** 订阅错误通知(监听器抛出的异常 / 其他内部错误)。 */
|
|
1725
1686
|
onError(handler: (err: unknown) => void): () => void;
|
|
1726
1687
|
}
|
|
1727
|
-
//#endregion
|
|
1728
|
-
//#region src/bridge/msg-bridge.d.ts
|
|
1729
1688
|
/** 消息事件通道的固定类型(事件名前缀 "Msg")。 */
|
|
1730
1689
|
type MsgEventChannel = NTEventChannel<MsgListener, "Msg">;
|
|
1731
1690
|
/**
|
|
1732
1691
|
* 消息事件桥:注册原生监听 → 回调 emit 到 channel。
|
|
1733
1692
|
* 无全局单例(ADR-015 推论)——每进程每 session 实例化一份。
|
|
1734
1693
|
*/
|
|
1735
|
-
declare class MsgBridge {
|
|
1694
|
+
export declare class MsgBridge {
|
|
1736
1695
|
private readonly service;
|
|
1737
1696
|
private readonly channel;
|
|
1738
1697
|
private listenerId;
|
|
@@ -1742,10 +1701,8 @@ declare class MsgBridge {
|
|
|
1742
1701
|
/** 注销原生监听(幂等)。 */
|
|
1743
1702
|
unregister(): void;
|
|
1744
1703
|
}
|
|
1745
|
-
//#endregion
|
|
1746
|
-
//#region src/apis/msg.d.ts
|
|
1747
1704
|
/** 消息 API:从 session 拿 msg service,包装成语义化方法。 */
|
|
1748
|
-
declare class MsgApi {
|
|
1705
|
+
export declare class MsgApi {
|
|
1749
1706
|
private readonly service;
|
|
1750
1707
|
/** 消息事件通道(sendMsg 后等 onMsgInfoListUpdate 确认发送结果)。 */
|
|
1751
1708
|
private readonly channel;
|
|
@@ -1897,8 +1854,6 @@ declare class MsgApi {
|
|
|
1897
1854
|
};
|
|
1898
1855
|
}): Promise<void>;
|
|
1899
1856
|
}
|
|
1900
|
-
//#endregion
|
|
1901
|
-
//#region src/apis/stranger-info.d.ts
|
|
1902
1857
|
/** 陌生人信息(get_stranger_info 返回)。 */
|
|
1903
1858
|
interface StrangerInfo {
|
|
1904
1859
|
user_id: number;
|
|
@@ -1917,10 +1872,8 @@ interface StrangerInfo {
|
|
|
1917
1872
|
status: number;
|
|
1918
1873
|
login_days: number;
|
|
1919
1874
|
}
|
|
1920
|
-
//#endregion
|
|
1921
|
-
//#region src/apis/profile.d.ts
|
|
1922
1875
|
/** 资料 API:从 session 拿 profile service,包装成语义化方法。 */
|
|
1923
|
-
declare class ProfileApi {
|
|
1876
|
+
export declare class ProfileApi {
|
|
1924
1877
|
private readonly service;
|
|
1925
1878
|
constructor(session: NodeIQQNTWrapperSession);
|
|
1926
1879
|
/** 设置个性签名(set_self_longnick)。 */
|
|
@@ -1932,17 +1885,13 @@ declare class ProfileApi {
|
|
|
1932
1885
|
/** 获取陌生人信息(get_stranger_info;uin 为用户 QQ 号)。 */
|
|
1933
1886
|
getStrangerInfo(uin: string): Promise<StrangerInfo>;
|
|
1934
1887
|
}
|
|
1935
|
-
//#endregion
|
|
1936
|
-
//#region src/apis/profile-like.d.ts
|
|
1937
1888
|
/** 点赞 API:从 session 拿 profile like service,包装成语义化方法。 */
|
|
1938
|
-
declare class ProfileLikeApi {
|
|
1889
|
+
export declare class ProfileLikeApi {
|
|
1939
1890
|
private readonly service;
|
|
1940
1891
|
constructor(session: NodeIQQNTWrapperSession);
|
|
1941
1892
|
/** 点赞(send_like;uid 为目标 uid,count 次数)。 */
|
|
1942
1893
|
sendLike(uid: string, count?: number): Promise<void>;
|
|
1943
1894
|
}
|
|
1944
|
-
//#endregion
|
|
1945
|
-
//#region src/apis/recent-contact.d.ts
|
|
1946
1895
|
/** 置顶会话(get_peer_pins 数据项):peerUid 按 chatType 归 friend/group。 */
|
|
1947
1896
|
interface PinnedContact {
|
|
1948
1897
|
/** 会话 id(好友 = uid,群 = 群号)。 */
|
|
@@ -1953,14 +1902,12 @@ interface PinnedContact {
|
|
|
1953
1902
|
scene: "friend" | "group";
|
|
1954
1903
|
}
|
|
1955
1904
|
/** 会话列表 API:从 session 拿 recent contact service,包装成语义化方法。 */
|
|
1956
|
-
declare class RecentContactApi {
|
|
1905
|
+
export declare class RecentContactApi {
|
|
1957
1906
|
private readonly service;
|
|
1958
1907
|
constructor(session: NodeIQQNTWrapperSession);
|
|
1959
1908
|
/** 置顶会话列表(get_peer_pins;getRecentContactList 返回形状待探测校准)。 */
|
|
1960
1909
|
getPinnedContacts(): Promise<PinnedContact[]>;
|
|
1961
1910
|
}
|
|
1962
|
-
//#endregion
|
|
1963
|
-
//#region src/apis/richmedia.d.ts
|
|
1964
1911
|
/** 群文件列表条目(fileInfo/folderInfo 取其一)。 */
|
|
1965
1912
|
interface GroupFileListItem {
|
|
1966
1913
|
fileInfo?: GroupFileItemInfo;
|
|
@@ -1974,7 +1921,7 @@ interface GroupFileSystemInfo {
|
|
|
1974
1921
|
totalSpace: number;
|
|
1975
1922
|
}
|
|
1976
1923
|
/** 富媒体 API:从 session 拿 rich media service,包装成语义化方法。 */
|
|
1977
|
-
declare class RichMediaApi {
|
|
1924
|
+
export declare class RichMediaApi {
|
|
1978
1925
|
private readonly service;
|
|
1979
1926
|
constructor(session: NodeIQQNTWrapperSession);
|
|
1980
1927
|
/** 英文单词翻译(translate_en2zh)。 */
|
|
@@ -2004,10 +1951,8 @@ declare class RichMediaApi {
|
|
|
2004
1951
|
/** 转存群文件(trans_group_file)。 */
|
|
2005
1952
|
transGroupFile(groupCode: string, fileId: string): Promise<void>;
|
|
2006
1953
|
}
|
|
2007
|
-
//#endregion
|
|
2008
|
-
//#region src/apis/ticket.d.ts
|
|
2009
1954
|
/** 票据 API:从 session 拿 ticket service,包装成语义化方法。 */
|
|
2010
|
-
declare class TicketApi {
|
|
1955
|
+
export declare class TicketApi {
|
|
2011
1956
|
private readonly service;
|
|
2012
1957
|
constructor(session: NodeIQQNTWrapperSession);
|
|
2013
1958
|
/** 获取 clientKey(get_clientkey)。 */
|
|
@@ -2017,8 +1962,6 @@ declare class TicketApi {
|
|
|
2017
1962
|
/** 计算 bkn(get_csrf_token 与 web 接口共用;skey → bkn 哈希)。 */
|
|
2018
1963
|
static getBkn(skey: string): string;
|
|
2019
1964
|
}
|
|
2020
|
-
//#endregion
|
|
2021
|
-
//#region src/apis/webapi.d.ts
|
|
2022
1965
|
/** 精华消息项(digest_list 返回 data.msg_list 成员,说明书参考)。 */
|
|
2023
1966
|
interface EssenceMsgItem {
|
|
2024
1967
|
msg_seq: number;
|
|
@@ -2052,16 +1995,16 @@ interface GroupHonorWebInfo {
|
|
|
2052
1995
|
strong_newbie_list: HonorListItem[];
|
|
2053
1996
|
}
|
|
2054
1997
|
/** 群荣誉类型(1=龙王 2=群聊之火 3=群聊炽热 6=快乐源泉)。 */
|
|
2055
|
-
declare const WebHonorType: {
|
|
1998
|
+
export declare const WebHonorType: {
|
|
2056
1999
|
readonly ALL: 0;
|
|
2057
2000
|
readonly TALKATIVE: 1;
|
|
2058
2001
|
readonly PERFORMER: 2;
|
|
2059
2002
|
readonly LEGEND: 3;
|
|
2060
2003
|
readonly EMOTION: 6;
|
|
2061
2004
|
};
|
|
2062
|
-
type WebHonorType = (typeof WebHonorType)[keyof typeof WebHonorType];
|
|
2005
|
+
export type WebHonorType = (typeof WebHonorType)[keyof typeof WebHonorType];
|
|
2063
2006
|
/** 群空间 web API(Cookie 经 TicketApi 注入)。 */
|
|
2064
|
-
declare class WebApi {
|
|
2007
|
+
export declare class WebApi {
|
|
2065
2008
|
private readonly getCookies;
|
|
2066
2009
|
constructor(opts: {
|
|
2067
2010
|
getCookies: (domain: string) => Promise<Record<string, string>>;
|
|
@@ -2077,15 +2020,13 @@ declare class WebApi {
|
|
|
2077
2020
|
/** 拉取单类荣誉列表(honorlist 接口,正则提取 __INITIAL_STATE__)。 */
|
|
2078
2021
|
private fetchHonorList;
|
|
2079
2022
|
}
|
|
2080
|
-
//#endregion
|
|
2081
|
-
//#region src/bridge/friend-bridge.d.ts
|
|
2082
2023
|
/** 好友事件通道的固定类型(事件名前缀 "Buddy")。 */
|
|
2083
2024
|
type BuddyEventChannel = NTEventChannel<BuddyListener, "Buddy">;
|
|
2084
2025
|
/**
|
|
2085
2026
|
* 好友事件桥:注册原生监听 → 回调 emit 到 channel。
|
|
2086
2027
|
* 无全局单例(ADR-015 推论)——每进程每 session 实例化一份。
|
|
2087
2028
|
*/
|
|
2088
|
-
declare class FriendBridge {
|
|
2029
|
+
export declare class FriendBridge {
|
|
2089
2030
|
private readonly service;
|
|
2090
2031
|
private readonly channel;
|
|
2091
2032
|
private listenerId;
|
|
@@ -2095,15 +2036,13 @@ declare class FriendBridge {
|
|
|
2095
2036
|
/** 注销原生监听(幂等)。 */
|
|
2096
2037
|
unregister(): void;
|
|
2097
2038
|
}
|
|
2098
|
-
//#endregion
|
|
2099
|
-
//#region src/bridge/group-bridge.d.ts
|
|
2100
2039
|
/** 群事件通道的固定类型(事件名前缀 "Group")。 */
|
|
2101
2040
|
type GroupEventChannel = NTEventChannel<GroupListener, "Group">;
|
|
2102
2041
|
/**
|
|
2103
2042
|
* 群事件桥:注册原生监听 → 回调 emit 到 channel。
|
|
2104
2043
|
* 无全局单例(ADR-015 推论)——每进程每 session 实例化一份。
|
|
2105
2044
|
*/
|
|
2106
|
-
declare class GroupBridge {
|
|
2045
|
+
export declare class GroupBridge {
|
|
2107
2046
|
private readonly service;
|
|
2108
2047
|
private readonly channel;
|
|
2109
2048
|
private listenerId;
|
|
@@ -2113,15 +2052,13 @@ declare class GroupBridge {
|
|
|
2113
2052
|
/** 注销原生监听(幂等)。 */
|
|
2114
2053
|
unregister(): void;
|
|
2115
2054
|
}
|
|
2116
|
-
//#endregion
|
|
2117
|
-
//#region src/bridge/login-bridge.d.ts
|
|
2118
2055
|
/** 登录事件通道的固定类型(事件名前缀 "Login")。 */
|
|
2119
2056
|
type LoginEventChannel = NTEventChannel<LoginListener, "Login">;
|
|
2120
2057
|
/**
|
|
2121
2058
|
* 登录事件桥:注册原生监听 → 回调 emit 到 channel。
|
|
2122
2059
|
* 无全局单例(ADR-015 推论)——每进程一份。
|
|
2123
2060
|
*/
|
|
2124
|
-
declare class LoginBridge {
|
|
2061
|
+
export declare class LoginBridge {
|
|
2125
2062
|
private readonly service;
|
|
2126
2063
|
private readonly channel;
|
|
2127
2064
|
private listenerId;
|
|
@@ -2131,15 +2068,13 @@ declare class LoginBridge {
|
|
|
2131
2068
|
/** 注销原生监听(幂等)。 */
|
|
2132
2069
|
unregister(): void;
|
|
2133
2070
|
}
|
|
2134
|
-
//#endregion
|
|
2135
|
-
//#region src/bridge/recent-contact-bridge.d.ts
|
|
2136
2071
|
/** 会话列表事件通道的固定类型(事件名前缀 "RecentContact")。 */
|
|
2137
2072
|
type RecentContactEventChannel = NTEventChannel<RecentContactListener, "RecentContact">;
|
|
2138
2073
|
/**
|
|
2139
2074
|
* 会话列表事件桥:注册原生监听 → 回调 emit 到 channel。
|
|
2140
2075
|
* 无全局单例(ADR-015 推论)——每进程每 session 实例化一份。
|
|
2141
2076
|
*/
|
|
2142
|
-
declare class RecentContactBridge {
|
|
2077
|
+
export declare class RecentContactBridge {
|
|
2143
2078
|
private readonly service;
|
|
2144
2079
|
private readonly channel;
|
|
2145
2080
|
private listenerId;
|
|
@@ -2149,8 +2084,6 @@ declare class RecentContactBridge {
|
|
|
2149
2084
|
/** 注销原生监听(幂等)。 */
|
|
2150
2085
|
unregister(): void;
|
|
2151
2086
|
}
|
|
2152
|
-
//#endregion
|
|
2153
|
-
//#region src/cache/buddy-cache.d.ts
|
|
2154
2087
|
/** BuddyCache diff 事件 listener(归一化「新增/删除」事件)。 */
|
|
2155
2088
|
type BuddyCacheListener = {
|
|
2156
2089
|
onBuddyAdded: (entry: BuddyListEntry) => void;
|
|
@@ -2171,9 +2104,9 @@ interface BuddyCacheOptions {
|
|
|
2171
2104
|
* 防御性收窄 onBuddyListChange 载荷 → BuddyCategory[](T10 实证形状;
|
|
2172
2105
|
* 非数组返回 null,调用方打 raw 日志积累校准数据)。
|
|
2173
2106
|
*/
|
|
2174
|
-
declare function narrowBuddyCategories(arg: unknown): BuddyCategory[] | null;
|
|
2107
|
+
export declare function narrowBuddyCategories(arg: unknown): BuddyCategory[] | null;
|
|
2175
2108
|
/** 好友缓存:快照维护 + diff 归一化事件。 */
|
|
2176
|
-
declare class BuddyCache {
|
|
2109
|
+
export declare class BuddyCache {
|
|
2177
2110
|
private readonly channel;
|
|
2178
2111
|
private readonly logger;
|
|
2179
2112
|
/** diff 归一化事件通道(协议层订阅 friend_add / IPC 转发消费)。 */
|
|
@@ -2197,8 +2130,6 @@ declare class BuddyCache {
|
|
|
2197
2130
|
/** 快照是否已建(测试/诊断用)。 */
|
|
2198
2131
|
get baselineReady(): boolean;
|
|
2199
2132
|
}
|
|
2200
|
-
//#endregion
|
|
2201
|
-
//#region src/cache/group-cache.d.ts
|
|
2202
2133
|
/** GroupCache 构造参数。 */
|
|
2203
2134
|
interface GroupCacheOptions {
|
|
2204
2135
|
/** 群事件通道(GroupBridge 注册原生监听后 emit 到这里)。 */
|
|
@@ -2210,7 +2141,7 @@ interface GroupCacheOptions {
|
|
|
2210
2141
|
* 群/成员缓存:事件主动维护 + 查询惰性回填。
|
|
2211
2142
|
* 只读接口 getGroupDetail / getMembers / getMember / getGroup(列表项)。
|
|
2212
2143
|
*/
|
|
2213
|
-
declare class GroupCache {
|
|
2144
|
+
export declare class GroupCache {
|
|
2214
2145
|
private readonly channel;
|
|
2215
2146
|
private readonly groupApi;
|
|
2216
2147
|
/** 群列表项(onGroupListUpdate / getGroupList 回填)。 */
|
|
@@ -2273,8 +2204,6 @@ declare class GroupCache {
|
|
|
2273
2204
|
/** 惰性回填并发去重:同 key 并发只拉一次。 */
|
|
2274
2205
|
private dedupe;
|
|
2275
2206
|
}
|
|
2276
|
-
//#endregion
|
|
2277
|
-
//#region src/infra/config.d.ts
|
|
2278
2207
|
/** 配置文本格式。 */
|
|
2279
2208
|
type ConfigFormat = "json" | "toml";
|
|
2280
2209
|
/**
|
|
@@ -2302,7 +2231,7 @@ interface ConfigOptions<T> {
|
|
|
2302
2231
|
* - `load()`:seed 存在 → 直接用 seed;否则读文件(缺失落默认值)。
|
|
2303
2232
|
* - `save()`:按格式序列化(TOML/JSON)原子写。
|
|
2304
2233
|
*/
|
|
2305
|
-
declare class ConfigBase<T> {
|
|
2234
|
+
export declare class ConfigBase<T> {
|
|
2306
2235
|
readonly path: string;
|
|
2307
2236
|
readonly defaults: T;
|
|
2308
2237
|
private readonly schema;
|
|
@@ -2335,11 +2264,9 @@ declare class ConfigBase<T> {
|
|
|
2335
2264
|
private parse;
|
|
2336
2265
|
}
|
|
2337
2266
|
/** 解析 TOML 文本 → 对象(boot.cjs / 探测脚本等无 ConfigBase 场景复用)。 */
|
|
2338
|
-
declare function parseToml(text: string): Record<string, unknown>;
|
|
2267
|
+
export declare function parseToml(text: string): Record<string, unknown>;
|
|
2339
2268
|
/** 对象 → TOML 文本(config init 生成全局配置文件等场景)。 */
|
|
2340
|
-
declare function stringifyToml(value: Record<string, unknown>): string;
|
|
2341
|
-
//#endregion
|
|
2342
|
-
//#region src/infra/errors.d.ts
|
|
2269
|
+
export declare function stringifyToml(value: Record<string, unknown>): string;
|
|
2343
2270
|
/**
|
|
2344
2271
|
* kernel 类型化错误(ADR-009 / ADR-017)
|
|
2345
2272
|
*
|
|
@@ -2355,16 +2282,16 @@ type KernelErrorCode = "SEND_FAILED" | "PERMISSION_DENIED" | "NOT_FOUND" | "TIME
|
|
|
2355
2282
|
* 全部错误码集合。协议层映射表可据此推导:
|
|
2356
2283
|
* `Record<(typeof KERNEL_ERROR_CODES)[number], number>`。
|
|
2357
2284
|
*/
|
|
2358
|
-
declare const KERNEL_ERROR_CODES: readonly ["SEND_FAILED", "PERMISSION_DENIED", "NOT_FOUND", "TIMEOUT", "NOT_LOGIN", "INVALID_PARAM", "INVALID_STATE", "UNKNOWN"];
|
|
2285
|
+
export declare const KERNEL_ERROR_CODES: readonly ["SEND_FAILED", "PERMISSION_DENIED", "NOT_FOUND", "TIMEOUT", "NOT_LOGIN", "INVALID_PARAM", "INVALID_STATE", "UNKNOWN"];
|
|
2359
2286
|
/** kernel 类型化错误:apis / 基础设施层抛出的统一错误形态。 */
|
|
2360
|
-
declare class KernelError extends Error {
|
|
2287
|
+
export declare class KernelError extends Error {
|
|
2361
2288
|
readonly code: KernelErrorCode;
|
|
2362
2289
|
constructor(message: string, code?: KernelErrorCode, options?: ErrorOptions);
|
|
2363
2290
|
}
|
|
2364
2291
|
/** 便捷构造:`kernelError('消息不存在', 'NOT_FOUND', { cause })`。 */
|
|
2365
|
-
declare function kernelError(message: string, code?: KernelErrorCode, options?: ErrorOptions): KernelError;
|
|
2292
|
+
export declare function kernelError(message: string, code?: KernelErrorCode, options?: ErrorOptions): KernelError;
|
|
2366
2293
|
/** 类型守卫:协议层 catch 统一映射时区分 KernelError 与意外错误。 */
|
|
2367
|
-
declare function isKernelError(err: unknown): err is KernelError;
|
|
2294
|
+
export declare function isKernelError(err: unknown): err is KernelError;
|
|
2368
2295
|
/**
|
|
2369
2296
|
* 配置校验失败(INVALID_PARAM 子型,2026-10-25 嵌入式宿主契约):仅用于
|
|
2370
2297
|
* 「配置未就绪」一族——主配置校验/反序列化、内联配置、协议段 seed 校验。
|
|
@@ -2372,15 +2299,13 @@ declare function isKernelError(err: unknown): err is KernelError;
|
|
|
2372
2299
|
* (CLI/self-host 进程以 EXIT_CONFIG_INVALID 退出),与错误文案完全解耦——
|
|
2373
2300
|
* 文案是人读的,退出码是宿主消费的机器契约。
|
|
2374
2301
|
*/
|
|
2375
|
-
declare class ConfigError extends KernelError {
|
|
2302
|
+
export declare class ConfigError extends KernelError {
|
|
2376
2303
|
constructor(message: string, options?: ErrorOptions);
|
|
2377
2304
|
}
|
|
2378
2305
|
/** 便捷构造:`configError('主配置缺少 accounts', { cause })`。 */
|
|
2379
|
-
declare function configError(message: string, options?: ErrorOptions): ConfigError;
|
|
2306
|
+
export declare function configError(message: string, options?: ErrorOptions): ConfigError;
|
|
2380
2307
|
/** 配置校验失败的进程退出码(UNIX sysexits EX_CONFIG 惯例)。 */
|
|
2381
|
-
declare const EXIT_CONFIG_INVALID = 78;
|
|
2382
|
-
//#endregion
|
|
2383
|
-
//#region src/infra/logger.d.ts
|
|
2308
|
+
export declare const EXIT_CONFIG_INVALID = 78;
|
|
2384
2309
|
/** 日志级别(pino 标准级别 + silent)。 */
|
|
2385
2310
|
type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "silent";
|
|
2386
2311
|
/**
|
|
@@ -2410,14 +2335,19 @@ interface LoggerOptions {
|
|
|
2410
2335
|
/** 控制台目的地(缺省 process.stdout;测试注入用)。 */
|
|
2411
2336
|
destination?: Optional<NodeJS.WriteStream>;
|
|
2412
2337
|
/** 附加基础字段(如 `{ name: 'kernel' }`),自动保留 pid;name 用 pino 保留字段
|
|
2413
|
-
* (logger name),
|
|
2338
|
+
* (logger name),pretty 渲染为 `(name/pid)` 元数据头。 */
|
|
2414
2339
|
base?: Optional<Record<string, unknown>>;
|
|
2415
2340
|
/** 追加的敏感字段路径(默认内置 token/票据等,见 DEFAULT_REDACT_PATHS)。 */
|
|
2416
2341
|
redact?: string[];
|
|
2417
2342
|
}
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2343
|
+
/**
|
|
2344
|
+
* 创建 pino logger:console(pretty/single-line/json)+ 可选文件,统一 level / redact。
|
|
2345
|
+
*
|
|
2346
|
+
* 文件目的地用同步写入(`sync: true`):日志量级下性能可接受,且进程退出不丢日志,
|
|
2347
|
+
* 无需额外的 flush 步骤(对比异步 SonicBoom 的 flushSync 时序陷阱)。
|
|
2348
|
+
* 文件目的地恒为 JSON 行(数值时间戳),格式/时间戳渲染仅作用于控制台目的地。
|
|
2349
|
+
*/
|
|
2350
|
+
export declare function createLogger(opts?: LoggerOptions): pino.Logger;
|
|
2421
2351
|
/** 控制台输出格式。 */
|
|
2422
2352
|
type LogFormat = "pretty" | "single-line" | "json";
|
|
2423
2353
|
/** 时间戳渲染模式(见 LogConfig.timestamp)。 */
|
|
@@ -2465,13 +2395,11 @@ type LogEnvSource = Record<string, string | undefined>;
|
|
|
2465
2395
|
* @param section TOML 解析后的 [log] 段(缺失/undefined = 全缺省)
|
|
2466
2396
|
* @param env 环境变量快照(默认空对象 = 无 env 覆盖)
|
|
2467
2397
|
*/
|
|
2468
|
-
declare function parseLogConfig(section: unknown, env?: LogEnvSource): LogConfig;
|
|
2469
|
-
//#endregion
|
|
2470
|
-
//#region src/infra/paths.d.ts
|
|
2398
|
+
export declare function parseLogConfig(section: unknown, env?: LogEnvSource): LogConfig;
|
|
2471
2399
|
/** 默认数据根目录名(项目根下,2026-08-08 用户拍板:不放用户目录)。 */
|
|
2472
|
-
declare const DEFAULT_DATA_ROOT_NAME = ".napuketto";
|
|
2400
|
+
export declare const DEFAULT_DATA_ROOT_NAME = ".napuketto";
|
|
2473
2401
|
/** 全局配置文件名。 */
|
|
2474
|
-
declare const MAIN_CONFIG_FILE = "napuketto.toml";
|
|
2402
|
+
export declare const MAIN_CONFIG_FILE = "napuketto.toml";
|
|
2475
2403
|
interface PathOptions {
|
|
2476
2404
|
/** 显式数据根(cli `--data-dir` 传入,优先级最高)。 */
|
|
2477
2405
|
dataRoot?: string;
|
|
@@ -2483,7 +2411,7 @@ interface PathOptions {
|
|
|
2483
2411
|
* 支持 `~` 前缀(展开为用户主目录)与相对路径(相对 cwd 解析)。
|
|
2484
2412
|
* 返回绝对路径。独立导出便于 cli / 探测脚本复用。
|
|
2485
2413
|
*/
|
|
2486
|
-
declare function resolveDataRoot(dataRoot?: string): string;
|
|
2414
|
+
export declare function resolveDataRoot(dataRoot?: string): string;
|
|
2487
2415
|
interface ConfigPathOptions {
|
|
2488
2416
|
/** 兜底数据根(探测全部失败时用 `<dataRoot>/napuketto.toml`,保持旧行为)。 */
|
|
2489
2417
|
dataRoot?: string;
|
|
@@ -2499,12 +2427,12 @@ interface ConfigPathOptions {
|
|
|
2499
2427
|
*
|
|
2500
2428
|
* 返回绝对路径。独立导出便于 cli / loader 装配链复用。
|
|
2501
2429
|
*/
|
|
2502
|
-
declare function resolveConfigPath(opts?: ConfigPathOptions): string;
|
|
2430
|
+
export declare function resolveConfigPath(opts?: ConfigPathOptions): string;
|
|
2503
2431
|
/**
|
|
2504
2432
|
* 路径装配器:持有账号数据目录下的全部子目录。
|
|
2505
2433
|
* 无全局单例(ADR-015 推论)——每账号每进程实例化一份。
|
|
2506
2434
|
*/
|
|
2507
|
-
declare class PathWrapper {
|
|
2435
|
+
export declare class PathWrapper {
|
|
2508
2436
|
/** 数据根(绝对路径)。 */
|
|
2509
2437
|
readonly root: string;
|
|
2510
2438
|
/** 账号数据目录(绝对路径),缺省 account 时等于 root。 */
|
|
@@ -2526,14 +2454,12 @@ declare class PathWrapper {
|
|
|
2526
2454
|
*/
|
|
2527
2455
|
clearCache(): void;
|
|
2528
2456
|
}
|
|
2529
|
-
//#endregion
|
|
2530
|
-
//#region src/wrapper/wrapper-loader.d.ts
|
|
2531
2457
|
/**
|
|
2532
2458
|
* Electron 进程类型(Node 的 process 类型无此字段)。
|
|
2533
2459
|
* - "browser":QQ 主进程(V1 模式)
|
|
2534
2460
|
* - "utility":utilityProcess Worker(路线 B,2026-08-06)
|
|
2535
2461
|
*/
|
|
2536
|
-
declare function electronProcessType(): string | undefined;
|
|
2462
|
+
export declare function electronProcessType(): string | undefined;
|
|
2537
2463
|
/**
|
|
2538
2464
|
* 解析 QQ 用户数据根(登录数据目录,如 `C:\Users\<user>\Documents\Tencent Files`)。
|
|
2539
2465
|
* 优先 NodeQQNTWrapperUtil.getNTUserDataInfoConfig()(QQ 官方 API),回退默认位置。
|
|
@@ -2544,7 +2470,7 @@ declare function electronProcessType(): string | undefined;
|
|
|
2544
2470
|
* (getLoginList 返回空 → 只能 QR 登录)。V1 主进程模式 QQ 自己 initConfig 过
|
|
2545
2471
|
* 正确路径,无需此解析。
|
|
2546
2472
|
*/
|
|
2547
|
-
declare function resolveQqUserDataRoot(exports: WrapperNodeApi): string | null;
|
|
2473
|
+
export declare function resolveQqUserDataRoot(exports: WrapperNodeApi): string | null;
|
|
2548
2474
|
/** QQ 版本信息(登录握手用)。 */
|
|
2549
2475
|
interface QQVersionContext {
|
|
2550
2476
|
fullVersion: string;
|
|
@@ -2569,9 +2495,9 @@ interface WrapperContext {
|
|
|
2569
2495
|
* 从 loader 截获的 NAPI exports 创建 wrapper 上下文。
|
|
2570
2496
|
* 在 QQ 主进程内调用(boot.cjs → kernel 入口)。
|
|
2571
2497
|
*/
|
|
2572
|
-
declare function createWrapper(exports: WrapperNodeApi, versionInfo: QQVersionContext): WrapperContext;
|
|
2498
|
+
export declare function createWrapper(exports: WrapperNodeApi, versionInfo: QQVersionContext): WrapperContext;
|
|
2573
2499
|
/** engine 初始化(wrapper 契约:先 engine 后 session)。config 为普通 JS 对象。 */
|
|
2574
|
-
declare function initEngine(ctx: WrapperContext, config: EnginInitDesktopConfig): void;
|
|
2500
|
+
export declare function initEngine(ctx: WrapperContext, config: EnginInitDesktopConfig): void;
|
|
2575
2501
|
/**
|
|
2576
2502
|
* 创建会话(2026-08-06 P2-0 实测修正——NapCat 方式自研等价):
|
|
2577
2503
|
* 1. StartupSessionWrapper.create()(启动会话包装)
|
|
@@ -2583,9 +2509,9 @@ declare function initEngine(ctx: WrapperContext, config: EnginInitDesktopConfig)
|
|
|
2583
2509
|
* NapCat 用 StartupSessionWrapper.create() + getNTWrapperSession('nt_1') 解决——
|
|
2584
2510
|
* 返回带完整实现的实例。worker(utilityProcess)继承 QQ env 后同样有效。
|
|
2585
2511
|
*/
|
|
2586
|
-
declare function createSession(ctx: WrapperContext): NodeIQQNTWrapperSession;
|
|
2512
|
+
export declare function createSession(ctx: WrapperContext): NodeIQQNTWrapperSession;
|
|
2587
2513
|
/** session 初始化(4 参全为 JS 对象,NAPI 自动转换)。 */
|
|
2588
|
-
declare function initSession(ctx: WrapperContext, config: WrapperSessionInitConfig, listener: NodeIKernelSessionListener): void;
|
|
2514
|
+
export declare function initSession(ctx: WrapperContext, config: WrapperSessionInitConfig, listener: NodeIKernelSessionListener): void;
|
|
2589
2515
|
/**
|
|
2590
2516
|
* 启动会话(有 startupSession 用 start(),否则 startNT(0))。
|
|
2591
2517
|
*
|
|
@@ -2594,7 +2520,7 @@ declare function initSession(ctx: WrapperContext, config: WrapperSessionInitConf
|
|
|
2594
2520
|
* 先 start 后 init 业务 service 不挂载(HANDOVER-V9 实测)。本函数保留给
|
|
2595
2521
|
* 已 init 的 session 补启动用;新路径请用 initAndStartSession。
|
|
2596
2522
|
*/
|
|
2597
|
-
declare function startSession(ctx: WrapperContext): void;
|
|
2523
|
+
export declare function startSession(ctx: WrapperContext): void;
|
|
2598
2524
|
/**
|
|
2599
2525
|
* boot 装配入口:createWrapper → initEngine → session。
|
|
2600
2526
|
*
|
|
@@ -2606,7 +2532,7 @@ declare function startSession(ctx: WrapperContext): void;
|
|
|
2606
2532
|
* 由 kernel NapukettoCore(core.ts)装配调用;loader 自建宿主 bootstrap 也直接调用作回退。
|
|
2607
2533
|
* 返回 WrapperContext;失败抛 KernelError。
|
|
2608
2534
|
*/
|
|
2609
|
-
declare function startNapuketto(options: StartNapukettoOptions): WrapperContext;
|
|
2535
|
+
export declare function startNapuketto(options: StartNapukettoOptions): WrapperContext;
|
|
2610
2536
|
/** startNapuketto 的引导环境(由 loader launcher 注入环境变量,boot.cjs 透传)。 */
|
|
2611
2537
|
interface BootEnv {
|
|
2612
2538
|
/** QQ 版本(如 "9.9.31-49919")。 */
|
|
@@ -2633,8 +2559,6 @@ interface StartNapukettoOptions {
|
|
|
2633
2559
|
/** QQ 的 loginService 实例(boot.cjs 拦截 new 捕获)。 */
|
|
2634
2560
|
qqLoginService?: unknown;
|
|
2635
2561
|
}
|
|
2636
|
-
//#endregion
|
|
2637
|
-
//#region src/login/login-connect.d.ts
|
|
2638
2562
|
/** 登录结果(QR 或快速登录)。 */
|
|
2639
2563
|
interface LoginResult {
|
|
2640
2564
|
uin: string;
|
|
@@ -2654,11 +2578,11 @@ interface LoginAccountInfo {
|
|
|
2654
2578
|
* 网络栈未初始化时报 1006511 网络异常——等待 MSF 连接后再重试。
|
|
2655
2579
|
* @returns 是否在超时前就绪。
|
|
2656
2580
|
*/
|
|
2657
|
-
declare function waitForNetworkConnection(ctx: WrapperContext, opts?: {
|
|
2581
|
+
export declare function waitForNetworkConnection(ctx: WrapperContext, opts?: {
|
|
2658
2582
|
timeoutMs?: number;
|
|
2659
2583
|
}): Promise<boolean>;
|
|
2660
2584
|
/** 列出历史登录账号(boot.cjs 启动横幅用,「可用快速登录 of QQ」)。 */
|
|
2661
|
-
declare function listLoginAccounts(ctx: WrapperContext): Promise<LoginAccountInfo[]>;
|
|
2585
|
+
export declare function listLoginAccounts(ctx: WrapperContext): Promise<LoginAccountInfo[]>;
|
|
2662
2586
|
/** quickLogin 参数(uin 指定账号;timeoutMs 网络就绪等待;quickLoginTimeoutMs 单步超时)。 */
|
|
2663
2587
|
interface QuickLoginOptions {
|
|
2664
2588
|
/** 指定快速登录账号(缺省遍历历史列表,优先 isQuickLogin)。 */
|
|
@@ -2675,9 +2599,7 @@ interface QuickLoginOptions {
|
|
|
2675
2599
|
* 已有会话时底层 promise 永久挂起,超时按登录失败(「快速登录失败: 快速登录超时」)
|
|
2676
2600
|
* 抛出,上层 catch/qrFallback 语义自动生效。
|
|
2677
2601
|
*/
|
|
2678
|
-
declare function quickLogin(ctx: WrapperContext, opts?: QuickLoginOptions): Promise<LoginResult>;
|
|
2679
|
-
//#endregion
|
|
2680
|
-
//#region src/login/lifecycle.d.ts
|
|
2602
|
+
export declare function quickLogin(ctx: WrapperContext, opts?: QuickLoginOptions): Promise<LoginResult>;
|
|
2681
2603
|
/**
|
|
2682
2604
|
* 等待 QQ 自己完成 session 初始化(framework 复用模式,2026-08-05 修正)。
|
|
2683
2605
|
*
|
|
@@ -2686,16 +2608,14 @@ declare function quickLogin(ctx: WrapperContext, opts?: QuickLoginOptions): Prom
|
|
|
2686
2608
|
* 也不自己 create(登录前 create() 干扰 QQ,实测 QQ 退出 code=0)。
|
|
2687
2609
|
* 正确做法:等 QQ 的 session 就绪(getMsgService 非 null = 核心 service 已挂载)。
|
|
2688
2610
|
*/
|
|
2689
|
-
declare function waitSessionReady(ctx: WrapperContext, opts: {
|
|
2611
|
+
export declare function waitSessionReady(ctx: WrapperContext, opts: {
|
|
2690
2612
|
timeoutMs?: number;
|
|
2691
2613
|
}): Promise<void>;
|
|
2692
2614
|
/** 登录连接 + 快速登录(quickLogin 等)已拆到 login-connect.ts(见文件头 re-export)。 */
|
|
2693
2615
|
/** session 初始化(4 参全为普通 JS 对象,等 init 完成信号)。 */
|
|
2694
|
-
declare function initAndStartSession(ctx: WrapperContext, config: WrapperSessionInitConfig, listener: NodeIKernelSessionListener, opts: {
|
|
2616
|
+
export declare function initAndStartSession(ctx: WrapperContext, config: WrapperSessionInitConfig, listener: NodeIKernelSessionListener, opts: {
|
|
2695
2617
|
timeoutMs?: number;
|
|
2696
2618
|
}): Promise<void>;
|
|
2697
|
-
//#endregion
|
|
2698
|
-
//#region src/login/login.d.ts
|
|
2699
2619
|
/** 登录状态。 */
|
|
2700
2620
|
type LoginState = "idle" | "waiting_scan" | "scanned" | "logged_in" | "failed";
|
|
2701
2621
|
/** 二维码数据(png base64 + 解码 url)。 */
|
|
@@ -2717,7 +2637,7 @@ interface LoginListItem {
|
|
|
2717
2637
|
isQuickLogin?: boolean;
|
|
2718
2638
|
}
|
|
2719
2639
|
/** QR 登录会话(状态机 + 回调订阅)。 */
|
|
2720
|
-
declare class QrLoginSession {
|
|
2640
|
+
export declare class QrLoginSession {
|
|
2721
2641
|
private readonly loginService;
|
|
2722
2642
|
private state;
|
|
2723
2643
|
private listenerId;
|
|
@@ -2765,8 +2685,6 @@ declare class QrLoginSession {
|
|
|
2765
2685
|
private setState;
|
|
2766
2686
|
private emitQrCode;
|
|
2767
2687
|
}
|
|
2768
|
-
//#endregion
|
|
2769
|
-
//#region src/context.d.ts
|
|
2770
2688
|
interface CoreContextOptions {
|
|
2771
2689
|
/** pino logger(console + 可选文件,由装配层创建)。 */
|
|
2772
2690
|
logger: pino.Logger;
|
|
@@ -2786,9 +2704,7 @@ interface CoreContext {
|
|
|
2786
2704
|
login: LoginResult | null;
|
|
2787
2705
|
}
|
|
2788
2706
|
/** 创建装配根(初始 wrapper/login 为 null)。 */
|
|
2789
|
-
declare function createCoreContext(opts: CoreContextOptions): CoreContext;
|
|
2790
|
-
//#endregion
|
|
2791
|
-
//#region src/core.d.ts
|
|
2707
|
+
export declare function createCoreContext(opts: CoreContextOptions): CoreContext;
|
|
2792
2708
|
interface NapukettoCoreOptions {
|
|
2793
2709
|
/** 数据根 / 账号(透传给 PathWrapper,见 ADR-016)。 */
|
|
2794
2710
|
paths?: PathOptions;
|
|
@@ -2847,7 +2763,7 @@ interface CoreLoginOptions {
|
|
|
2847
2763
|
* 核心装配器:持有 CoreContext,负责启动/停止编排。
|
|
2848
2764
|
* 无全局单例(ADR-015 推论)——每账号每进程实例化一份。
|
|
2849
2765
|
*/
|
|
2850
|
-
declare class NapukettoCore {
|
|
2766
|
+
export declare class NapukettoCore {
|
|
2851
2767
|
/** 装配根(协议层 / apis / cache 的消费入口)。 */
|
|
2852
2768
|
readonly ctx: CoreContext;
|
|
2853
2769
|
/** QR 登录会话句柄(登录期间非空;登录终态后清空)。refreshQr() 据此可达。 */
|
|
@@ -2908,16 +2824,12 @@ declare class NapukettoCore {
|
|
|
2908
2824
|
/** 停止:日志收尾(资源清理留给 P2 常驻管理)。 */
|
|
2909
2825
|
stop(): void;
|
|
2910
2826
|
}
|
|
2911
|
-
//#endregion
|
|
2912
|
-
//#region src/wrapper/probe/probe.d.ts
|
|
2913
2827
|
/**
|
|
2914
2828
|
* 探测 wrapper 运行时:dump session 方法与各 service 方法名到 JSON。
|
|
2915
2829
|
* 返回探测结果对象;同时写文件(NAPUTO_CFG_DIR/<file>,默认 napuketto-probe.json)。
|
|
2916
2830
|
* 服务枚举逐项增量落盘(persist)——活 session 上原生崩溃时文件保留断点。
|
|
2917
2831
|
*/
|
|
2918
|
-
declare function probeRuntime(ctx: WrapperContext, file?: string): Record<string, unknown>;
|
|
2919
|
-
//#endregion
|
|
2920
|
-
//#region src/wrapper/probe/probe-listener.d.ts
|
|
2832
|
+
export declare function probeRuntime(ctx: WrapperContext, file?: string): Record<string, unknown>;
|
|
2921
2833
|
/** 录制事件(JSONL 一行)。 */
|
|
2922
2834
|
interface ListenerRecordEvent {
|
|
2923
2835
|
/** ISO 时间戳。 */
|
|
@@ -2945,7 +2857,7 @@ interface ListenerRecordingResult {
|
|
|
2945
2857
|
* 查过的名字,即使从未调用);has / ownKeys 也记录(判定原生按名 Get 还是
|
|
2946
2858
|
* 枚举发现回调);非字符串键(Symbol,如 util.inspect 触发)放行默认行为。
|
|
2947
2859
|
*/
|
|
2948
|
-
declare function createRecordingListener(service: string, onEvent: (record: ListenerRecordEvent) => void): object;
|
|
2860
|
+
export declare function createRecordingListener(service: string, onEvent: (record: ListenerRecordEvent) => void): object;
|
|
2949
2861
|
/**
|
|
2950
2862
|
* 启动 listener 录制:session 十服务 + LoginService(exports 单例)逐服务注册
|
|
2951
2863
|
* 万能监听器,JSONL 逐行追加。返回摘要;文件路径写入结果(bootstrap 日志用)。
|
|
@@ -2954,9 +2866,7 @@ declare function createRecordingListener(service: string, onEvent: (record: List
|
|
|
2954
2866
|
* resolveMainFromStartup 会把空壳主 session 写回 ctx.session(session-resolver.ts),
|
|
2955
2867
|
* 空壳的 service getter 函数仍在但调用返回 null(late probe 61/63 null 的根因)。
|
|
2956
2868
|
*/
|
|
2957
|
-
declare function startListenerRecording(ctx: WrapperContext, file?: string): ListenerRecordingResult;
|
|
2958
|
-
//#endregion
|
|
2959
|
-
//#region src/wrapper/qq-data-path.d.ts
|
|
2869
|
+
export declare function startListenerRecording(ctx: WrapperContext, file?: string): ListenerRecordingResult;
|
|
2960
2870
|
/**
|
|
2961
2871
|
* QQ 数据根路径解析(P2-1,2026-08-06)
|
|
2962
2872
|
*
|
|
@@ -2974,23 +2884,19 @@ declare function startListenerRecording(ctx: WrapperContext, file?: string): Lis
|
|
|
2974
2884
|
* 防御:已含 nt_qq/global 后缀(worker 环境下 getNTUserDataInfoConfig 可能
|
|
2975
2885
|
* 返回完整路径)则不重复拼接,避免 `nt_qq/global/nt_qq/global` 错位。
|
|
2976
2886
|
*/
|
|
2977
|
-
declare function resolveQqGlobalPath(root: string): string;
|
|
2978
|
-
//#endregion
|
|
2979
|
-
//#region src/wrapper/session-resolver.d.ts
|
|
2887
|
+
export declare function resolveQqGlobalPath(root: string): string;
|
|
2980
2888
|
/**
|
|
2981
2889
|
* 复用 QQ 已有 session(P1-4:QQ 已登录,直接拿单例避免重复 init)。
|
|
2982
2890
|
* 优先 `NodeIQQNTWrapperSession.get()`;返回 null 时回退 createSession。
|
|
2983
2891
|
*/
|
|
2984
|
-
declare function getExistingSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
|
|
2892
|
+
export declare function getExistingSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
|
|
2985
2893
|
/**
|
|
2986
2894
|
* 复用 QQ 主 session(P1-4 实测链路):
|
|
2987
2895
|
* `NodeIQQNTStartupSessionWrapper.create()` → `start()` → `getSessionIdList()`(Map
|
|
2988
2896
|
* {nt:"nt_3", gpro:"gpro_3"})→ `NodeIQQNTWrapperSession.getNTWrapperSession("nt_3")`。
|
|
2989
2897
|
* 注:实测这些 session 是空壳(核心 service null),真正可用的是 new + init(lifecycle.ts)。
|
|
2990
2898
|
*/
|
|
2991
|
-
declare function getMainSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
|
|
2992
|
-
//#endregion
|
|
2993
|
-
//#region src/wrapper/wrapper-adapters.d.ts
|
|
2899
|
+
export declare function getMainSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
|
|
2994
2900
|
/** 会话监听器选项。 */
|
|
2995
2901
|
interface SessionListenerOptions {
|
|
2996
2902
|
/** 事件日志回调(默认静默——boot 阶段事件对用户是噪音;调试时可传回调观察)。 */
|
|
@@ -3001,31 +2907,29 @@ interface SessionListenerOptions {
|
|
|
3001
2907
|
* 回调方法必须存在(NAPI 按方法名反射),但输出与否由调用方决定——
|
|
3002
2908
|
* onNTSessionCreate / onOpentelemetryInit 等对用户无信息量,默认不打 stdout。
|
|
3003
2909
|
*/
|
|
3004
|
-
declare function createSessionListener(opts?: SessionListenerOptions): NodeIKernelSessionListener;
|
|
2910
|
+
export declare function createSessionListener(opts?: SessionListenerOptions): NodeIKernelSessionListener;
|
|
3005
2911
|
/** 创建登录监听器(占位,登录器接入时填充)。 */
|
|
3006
|
-
declare function createLoginListener(): IKernelLoginListener;
|
|
3007
|
-
//#endregion
|
|
3008
|
-
//#region src/wrapper/wrapper-config.d.ts
|
|
2912
|
+
export declare function createLoginListener(): IKernelLoginListener;
|
|
3009
2913
|
/**
|
|
3010
2914
|
* 从 major.node 提取 appid(NapCat parseAppidFromMajorV2 的自研等价实现)。
|
|
3011
2915
|
* major.node 含 `QQAppId/` 标记后跟数字(腾讯工具链产物,实测确认)。
|
|
3012
2916
|
* 返回 null 表示解析失败(调用方应显式报错,不再回退硬编码 appid)。
|
|
3013
2917
|
*/
|
|
3014
|
-
declare function parseAppidFromMajor(majorPath: string): string | null;
|
|
2918
|
+
export declare function parseAppidFromMajor(majorPath: string): string | null;
|
|
3015
2919
|
/**
|
|
3016
2920
|
* 解析 appid / qua(自研,参考 NapCat QQBasicInfoWrapper 思路但独立实现):
|
|
3017
2921
|
* appid 唯一来源 = major.node 提取(实测 9.9.33-51802 = 537376818)。
|
|
3018
2922
|
* majorPath 缺省或解析失败时抛 KernelError——不再静默回退过期 appid。
|
|
3019
2923
|
* majorPath 传 wrapper.node 同目录 major.node。
|
|
3020
2924
|
*/
|
|
3021
|
-
declare function resolveAppidQua(fullVersion: string, majorPath?: string): {
|
|
2925
|
+
export declare function resolveAppidQua(fullVersion: string, majorPath?: string): {
|
|
3022
2926
|
appid: string;
|
|
3023
2927
|
qua: string;
|
|
3024
2928
|
};
|
|
3025
2929
|
/** 生成 engine 桌面配置(wrapper 契约字段)。majorPath 可选(缺失/解析失败会抛错)。 */
|
|
3026
|
-
declare function buildEngineConfig(fullVersion: string, dataPathGlobal: string, majorPath?: string): EnginInitDesktopConfig;
|
|
2930
|
+
export declare function buildEngineConfig(fullVersion: string, dataPathGlobal: string, majorPath?: string): EnginInitDesktopConfig;
|
|
3027
2931
|
/** 生成登录初始化配置(externalVersion: false 与 NapCat 同款,扫码兼容关键)。 */
|
|
3028
|
-
declare function buildLoginConfig(appid: string, fullVersion: string, commonPath: string): Record<string, unknown>;
|
|
2932
|
+
export declare function buildLoginConfig(appid: string, fullVersion: string, commonPath: string): Record<string, unknown>;
|
|
3029
2933
|
/** buildSessionConfig 参数。 */
|
|
3030
2934
|
interface SessionConfigOptions {
|
|
3031
2935
|
appid: string;
|
|
@@ -3038,16 +2942,14 @@ interface SessionConfigOptions {
|
|
|
3038
2942
|
machineGuid?: string;
|
|
3039
2943
|
}
|
|
3040
2944
|
/** 生成 session 初始化配置(登录成功后调用)。 */
|
|
3041
|
-
declare function buildSessionConfig(options: SessionConfigOptions): WrapperSessionInitConfig;
|
|
2945
|
+
export declare function buildSessionConfig(options: SessionConfigOptions): WrapperSessionInitConfig;
|
|
3042
2946
|
/**
|
|
3043
2947
|
* 读取设备指纹 guid(wrapper.node 字符串分析实证,2026-08-12):
|
|
3044
2948
|
* NodeIKernelLoginService::getMachineGuid(0 参,返回机器 GUID 字符串)。
|
|
3045
2949
|
* 无 getMachineId 方法——TODO 里的方法名不存在,等价方法是 getMachineGuid。
|
|
3046
2950
|
* 失败(无该方法 / 调用抛错 / 返回值非字符串)兜底空串。
|
|
3047
2951
|
*/
|
|
3048
|
-
declare function readMachineGuid(loginService: unknown): string;
|
|
3049
|
-
//#endregion
|
|
3050
|
-
//#region src/wrapper/wrapper-version.d.ts
|
|
2952
|
+
export declare function readMachineGuid(loginService: unknown): string;
|
|
3051
2953
|
/**
|
|
3052
2954
|
* QQ 安装目录探测(ADR-018)
|
|
3053
2955
|
*
|
|
@@ -3060,14 +2962,14 @@ declare function readMachineGuid(loginService: unknown): string;
|
|
|
3060
2962
|
* - wrapper.node 是 C++ ABI 模块(非 N-API),导出 INTSessionShell 等符号
|
|
3061
2963
|
*/
|
|
3062
2964
|
/** 解析 wrapper.node 绝对路径(按 ADR-018 目录约定)。 */
|
|
3063
|
-
declare function resolveWrapperPath(installDir: string, version: string): string;
|
|
2965
|
+
export declare function resolveWrapperPath(installDir: string, version: string): string;
|
|
3064
2966
|
/**
|
|
3065
2967
|
* 探测指定版本信息(校验 wrapper.node 存在)。
|
|
3066
2968
|
* 版本号不匹配目录时抛 NOT_FOUND(明确失败而非静默)。
|
|
3067
2969
|
*/
|
|
3068
|
-
declare function resolveQQVersion(installDir: string, version: string): QQVersionInfo;
|
|
2970
|
+
export declare function resolveQQVersion(installDir: string, version: string): QQVersionInfo;
|
|
3069
2971
|
/** 扫描 versions 目录,取可加载的版本列表(按目录名倒序,最新在前)。 */
|
|
3070
|
-
declare function listQQVersions(installDir: string): string[];
|
|
2972
|
+
export declare function listQQVersions(installDir: string): string[];
|
|
3071
2973
|
/** QQ 版本信息。 */
|
|
3072
2974
|
interface QQVersionInfo {
|
|
3073
2975
|
/** 完整版本号,如 "9.9.31-49919"。 */
|
|
@@ -3081,6 +2983,5 @@ interface QQVersionInfo {
|
|
|
3081
2983
|
/** 登录握手参数(P1 探测脚本产出,暂为空串)。 */
|
|
3082
2984
|
qua: string;
|
|
3083
2985
|
}
|
|
3084
|
-
|
|
3085
|
-
export { type BootEnv, BuddyCache, type BuddyCacheEventChannel, type BuddyCacheListener, type BuddyCacheOptions, type BuddyCategory, type BuddyCoreInfo, type BuddyEventChannel, type BuddyListEntry, type BuddyListener, type BuddyReq, type CanonicalElement, ChatType, ConfigBase, ConfigError, type ConfigFormat, type ConfigOptions, type ConfigSchema, type CoreContext, type CoreContextOptions, type CoreLoginOptions, DEFAULT_DATA_ROOT_NAME, type DesktopPathConfig, type DeviceInfo, type DoubtBuddyReq, type DoubtFriendRequestInfo, EXIT_CONFIG_INVALID, ElementType, type EnginInitDesktopConfig, type EssenceMsgItem, type ForceFetchClientKeyRetType, type Friend, FriendApi, FriendBridge, type FriendCategory, type GeneralCallResult, type GetFileListParam, type GrayTipElement, type GrayTipRevokeElement, GrayTipSubType, type Group, GroupApi, GroupBridge, type GroupBulletin, GroupCache, type GroupCacheOptions, type GroupDetailInfo, type GroupEventChannel, type GroupFileItemInfo, type GroupFolderInfo, type GroupHonorWebInfo, GroupListUpdateType, type GroupListener, type GroupMember, type GroupMemberDataSource, type GroupMemberListChange, type GroupNotify, GroupNotifyApi, GroupNotifyMsgStatus, GroupNotifyMsgType, type GroupSpaceInfo, type HonorListItem, KERNEL_ERROR_CODES, KernelError, type KernelErrorCode, type ListenerEvents, type ListenerRecordEvent, type ListenerRecordingResult, type LogConfig, type LogEnvSource, type LogFileConfig, type LogFormat, type LogLevel, type LogModuleName, type LoggerOptions, type LoginAccountInfo, LoginBridge, type LoginEventChannel, type LoginListItem, type LoginProgress, type LoginResult, type LoginState, MAIN_CONFIG_FILE, MsgApi, MsgBridge, type MsgEventChannel, type MsgListener, NTEventChannel, NTGroupMemberRole, NTGroupRequestOperateTypes, NapukettoCore, type NapukettoCoreOptions, type NodeIDependsAdapter, type NodeIDispatcherAdapter, type NodeIGlobalAdapter, type NodeIKernelBuddyService, type NodeIKernelGroupService, type NodeIKernelLoginService, type NodeIKernelMsgService, type NodeIKernelProfileLikeService, type NodeIKernelProfileService, type NodeIKernelRecentContactService, type NodeIKernelRichMediaService, type NodeIKernelSessionListener, type NodeIKernelTicketService, type NodeIQQNTStartupSessionWrapper, type NodeIQQNTWrapperEngine, type NodeIQQNTWrapperSession, type NodeQQNTWrapperUtil, type NudgeParam, type PathOptions, PathWrapper, type Peer, type PinnedContact, type PlatformType, ProfileApi, ProfileLikeApi, type QQVersionContext, type QQVersionInfo, type QrCodeData, QrLoginSession, type RDeliveryConfig, type RawElement, type RawMessage, type RecentContact, RecentContactApi, RecentContactBridge, type RecentContactEventChannel, type RecentContactFetchParam, type RecentContactListChanged, type RecentContactListener, RichMediaApi, type SelfInfo, type SendMessageElement, type SessionConfigOptions, type ShutUpGroupMember, type StartNapukettoOptions, type StrangerInfo, TicketApi, type TimestampMode, type TipAioOpGrayTipElement, type TipGroupElement, TipGroupElementType, type UserDetailInfoByUin, type VendorType, WebApi, WebHonorType, type WrapperContext, type WrapperNodeApi, type WrapperSessionInitConfig, buildEngineConfig, buildLoginConfig, buildSessionConfig, configError, createCoreContext, createSessionListener as createLifecycleSessionListener, createSessionListener, createLogger, createLoginListener, createRecordingListener, createSession, createWrapper, electronProcessType, getExistingSession, getMainSession, initAndStartSession, initEngine, initSession, isKernelError, kernelError, listLoginAccounts, listQQVersions, narrowBuddyCategories, parseAppidFromMajor, parseLogConfig, parseToml, probeRuntime, quickLogin, readMachineGuid, resolveAppidQua, resolveConfigPath, resolveDataRoot, resolveQQVersion, resolveQqGlobalPath, resolveQqUserDataRoot, resolveWrapperPath, startListenerRecording, startNapuketto, startSession, stringifyToml, toCanonicalElements, toSendElements, waitForNetworkConnection, waitSessionReady };
|
|
2986
|
+
export { type BootEnv, type BuddyCacheEventChannel, type BuddyCacheListener, type BuddyCacheOptions, type BuddyCategory, type BuddyCoreInfo, type BuddyEventChannel, type BuddyListEntry, type BuddyListener, type BuddyReq, type CanonicalElement, type ConfigFormat, type ConfigOptions, type ConfigSchema, type CoreContext, type CoreContextOptions, type CoreLoginOptions, type DesktopPathConfig, type DeviceInfo, type DoubtBuddyReq, type DoubtFriendRequestInfo, type EnginInitDesktopConfig, type EssenceMsgItem, type ForceFetchClientKeyRetType, type Friend, type FriendCategory, type GeneralCallResult, type GetFileListParam, type GrayTipElement, type GrayTipRevokeElement, type Group, type GroupBulletin, type GroupCacheOptions, type GroupDetailInfo, type GroupEventChannel, type GroupFileItemInfo, type GroupFolderInfo, type GroupHonorWebInfo, type GroupListener, type GroupMember, type GroupMemberDataSource, type GroupMemberListChange, type GroupNotify, type GroupSpaceInfo, type HonorListItem, type KernelErrorCode, type ListenerEvents, type ListenerRecordEvent, type ListenerRecordingResult, type LogConfig, type LogEnvSource, type LogFileConfig, type LogFormat, type LogLevel, type LogModuleName, type LoggerOptions, type LoginAccountInfo, type LoginEventChannel, type LoginListItem, type LoginProgress, type LoginResult, type LoginState, type MsgEventChannel, type MsgListener, type NapukettoCoreOptions, type NodeIDependsAdapter, type NodeIDispatcherAdapter, type NodeIGlobalAdapter, type NodeIKernelBuddyService, type NodeIKernelGroupService, type NodeIKernelLoginService, type NodeIKernelMsgService, type NodeIKernelProfileLikeService, type NodeIKernelProfileService, type NodeIKernelRecentContactService, type NodeIKernelRichMediaService, type NodeIKernelSessionListener, type NodeIKernelTicketService, type NodeIQQNTStartupSessionWrapper, type NodeIQQNTWrapperEngine, type NodeIQQNTWrapperSession, type NodeQQNTWrapperUtil, type NudgeParam, type PathOptions, type Peer, type PinnedContact, type PlatformType, type QQVersionContext, type QQVersionInfo, type QrCodeData, type RDeliveryConfig, type RawElement, type RawMessage, type RecentContact, type RecentContactEventChannel, type RecentContactFetchParam, type RecentContactListChanged, type RecentContactListener, type SelfInfo, type SendMessageElement, type SessionConfigOptions, type ShutUpGroupMember, type StartNapukettoOptions, type StrangerInfo, type TimestampMode, type TipAioOpGrayTipElement, type TipGroupElement, type UserDetailInfoByUin, type VendorType, type WrapperContext, type WrapperNodeApi, type WrapperSessionInitConfig, createSessionListener as createLifecycleSessionListener };
|
|
3086
2987
|
//# sourceMappingURL=index.d.mts.map
|