@napuketto/kernel 0.19.3 → 0.19.4

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.
Files changed (3) hide show
  1. package/dist/index.d.mts +569 -552
  2. package/dist/index.mjs +4006 -3933
  3. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,5 +1,9 @@
1
1
  /**
2
- * @napuketto/kernel 入口(P0 地基 + P1 前哨)
2
+ * @napuketto/kernel 入口(Flat 5-Tier Runtime)
3
+ *
4
+ * 五段式扁平分层:L0 `types/` + `infra/`(零内部依赖)→ L1 `native/`(原生防腐层)
5
+ * → L2 `apis/`(无状态语义 API)→ L3 `runtime/`(登录 / 缓存 / 内核装配)。
6
+ * 本文件是唯一根出口,逐层汇总公共面;导出符号与目录重构前逐项一致。
3
7
  *
4
8
  * 当前导出:类型化错误(ADR-017)、路径装配(ADR-016)、pino 日志(ADR-007)、
5
9
  * JSON 配置基类(ADR-012)、类型化事件通道(ADR-003)、QQ 版本探测(ADR-018)、
@@ -35,11 +39,24 @@ interface Peer {
35
39
  peerUid: string;
36
40
  guildId?: string;
37
41
  }
38
- /** 文本元素(at 用 atType + atUid 表达)。 */
42
+ /** 文本元素(at 用 atType + atNtUid/atUid 表达)。 */
39
43
  interface TextElement {
40
44
  content: string;
41
45
  atType?: number | null;
46
+ /**
47
+ * 单人 at 目标的 **数字 UIN**(QQ 号字符串)。
48
+ *
49
+ * ⚠️ 不是 NT UID:把 `u_...` 写进本字段会被 wrapper 归零成 `"0"`(issue #192)。
50
+ * 客户端原生元素里它是 atNtUid 的冗余镜像;`@全体` 缺省。
51
+ */
42
52
  atUid?: string | null;
53
+ /**
54
+ * 单人 at 目标的 **NT UID**(`u_...`),QQNT 解析真实提及所依赖的字段;
55
+ * 接收方向优先读它。`@全体` 实测为 `"all"`(atType=1)。
56
+ */
57
+ atNtUid?: string | null;
58
+ /** at 目标 tinyId(原生元素可能携带;发送不需要)。 */
59
+ atTinyId?: string | null;
43
60
  }
44
61
  /** 图片元素(发送时 picPath 必须;接收含 url)。 */
45
62
  interface PicElement {
@@ -1263,7 +1280,7 @@ type RecentContactListener = {
1263
1280
  *
1264
1281
  * 本文件只做**类型声明**(无 `node:fs` / `infra` 运行时依赖);运行时转换函数
1265
1282
  * (`picLocalCandidates` / `toCanonicalElements` / `toSendElements`)在
1266
- * `codec/message-element.ts`,经 `codec/index.ts` 对外。
1283
+ * `native/message-codec.ts`,经 `native/index.ts` 对外。
1267
1284
  */
1268
1285
  /** 协议无关的规范消息元素。 */
1269
1286
  type CanonicalElement = {
@@ -1603,6 +1620,40 @@ interface WrapperNodeApi {
1603
1620
  /** 构造器:`new wrapper.NodeIKernelLoginService()`。 */
1604
1621
  NodeIKernelLoginService: NodeIKernelLoginServiceCtor;
1605
1622
  }
1623
+ /** 闪传上传结果。 */
1624
+ interface FlashTransferUploadResult {
1625
+ /** 文件集 id(发卡片用)。 */
1626
+ fileSetId: string;
1627
+ /** 分享链接(`https://qfile.qq.com/q/…`,可能为空串——以 fileSetId 为准)。 */
1628
+ shareLink: string;
1629
+ /** 本次文件集的文件数。 */
1630
+ fileCount: number;
1631
+ }
1632
+ /** 上传选项。 */
1633
+ interface FlashTransferUploadOptions {
1634
+ /** 文件集名称(对端卡片标题);缺省取首个文件名。 */
1635
+ name?: string | undefined;
1636
+ /** 分享权限码(permission.code,实测 0 = 链接可直接打开)。 */
1637
+ permissionCode?: number | undefined;
1638
+ /** 超时毫秒(缺省 10 分钟)。 */
1639
+ timeoutMs?: number | undefined;
1640
+ }
1641
+ /** 闪传 API:从 session 拿 flash transfer service,包装成语义化方法。 */
1642
+ export declare class FlashTransferApi {
1643
+ private readonly service;
1644
+ constructor(session: NodeIQQNTWrapperSession);
1645
+ /**
1646
+ * 上传文件集(`createFlashTransferUploadTask`)。所有文件 `onFileDidFinishUpload`
1647
+ * 后返回;超时 / 原生拒绝抛内核错误。空路径列表是参数错误(原生怕空集)。
1648
+ */
1649
+ uploadFileSet(paths: string[], options?: FlashTransferUploadOptions): Promise<FlashTransferUploadResult>;
1650
+ /** 发送闪传卡片(`sendFlashTransferMsg`;destType 取 Peer.chatType,destUid 取 peerUid)。 */
1651
+ sendCard(target: Peer, fileSetId: string): Promise<void>;
1652
+ /** 上传 + 发卡片(常见一步用法)。 */
1653
+ sendFile(target: Peer, paths: string[], options?: FlashTransferUploadOptions): Promise<FlashTransferUploadResult>;
1654
+ /** 注销监听器:失败不影响主流程(原生可能已卸载服务)。 */
1655
+ private detachQuietly;
1656
+ }
1606
1657
  /** 群 API:从 session 拿 group service,包装成语义化方法。 */
1607
1658
  export declare class GroupApi {
1608
1659
  private readonly service;
@@ -1728,153 +1779,6 @@ export declare class GroupNotifyApi {
1728
1779
  handleGroupRequest(doubt: boolean, notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason: string): Promise<void>;
1729
1780
  private operateRequest;
1730
1781
  }
1731
- /** 闪传上传结果。 */
1732
- interface FlashTransferUploadResult {
1733
- /** 文件集 id(发卡片用)。 */
1734
- fileSetId: string;
1735
- /** 分享链接(`https://qfile.qq.com/q/…`,可能为空串——以 fileSetId 为准)。 */
1736
- shareLink: string;
1737
- /** 本次文件集的文件数。 */
1738
- fileCount: number;
1739
- }
1740
- /** 上传选项。 */
1741
- interface FlashTransferUploadOptions {
1742
- /** 文件集名称(对端卡片标题);缺省取首个文件名。 */
1743
- name?: string | undefined;
1744
- /** 分享权限码(permission.code,实测 0 = 链接可直接打开)。 */
1745
- permissionCode?: number | undefined;
1746
- /** 超时毫秒(缺省 10 分钟)。 */
1747
- timeoutMs?: number | undefined;
1748
- }
1749
- /** 闪传 API:从 session 拿 flash transfer service,包装成语义化方法。 */
1750
- export declare class FlashTransferApi {
1751
- private readonly service;
1752
- constructor(session: NodeIQQNTWrapperSession);
1753
- /**
1754
- * 上传文件集(`createFlashTransferUploadTask`)。所有文件 `onFileDidFinishUpload`
1755
- * 后返回;超时 / 原生拒绝抛内核错误。空路径列表是参数错误(原生怕空集)。
1756
- */
1757
- uploadFileSet(paths: string[], options?: FlashTransferUploadOptions): Promise<FlashTransferUploadResult>;
1758
- /** 发送闪传卡片(`sendFlashTransferMsg`;destType 取 Peer.chatType,destUid 取 peerUid)。 */
1759
- sendCard(target: Peer, fileSetId: string): Promise<void>;
1760
- /** 上传 + 发卡片(常见一步用法)。 */
1761
- sendFile(target: Peer, paths: string[], options?: FlashTransferUploadOptions): Promise<FlashTransferUploadResult>;
1762
- /** 注销监听器:失败不影响主流程(原生可能已卸载服务)。 */
1763
- private detachQuietly;
1764
- }
1765
- /** 群文件列表条目(fileInfo/folderInfo 取其一)。 */
1766
- interface GroupFileListItem {
1767
- fileInfo?: GroupFileItemInfo;
1768
- folderInfo?: GroupFolderInfo;
1769
- }
1770
- /** 群文件系统信息。 */
1771
- interface GroupFileSystemInfo {
1772
- fileCount: number;
1773
- limitCount: number;
1774
- usedSpace: number;
1775
- totalSpace: number;
1776
- }
1777
- /** 富媒体 API:从 session 拿 rich media service,包装成语义化方法。 */
1778
- export declare class RichMediaApi {
1779
- private readonly service;
1780
- constructor(session: NodeIQQNTWrapperSession);
1781
- /** 英文单词翻译(translate_en2zh)。 */
1782
- translateWords(words: string[]): Promise<string[]>;
1783
- /** 群文件列表(get_group_root_files;parent 缺省根目录)。 */
1784
- getGroupFileList(groupCode: string, parentFolderId?: string, fileCount?: number): Promise<GroupFileListItem[]>;
1785
- /** 群文件系统信息(get_group_file_system_info;getGroupFileList 的 groupSpaceResult)。 */
1786
- getGroupFileSystemInfo(groupCode: string): Promise<GroupFileSystemInfo>;
1787
- /** 创建群文件夹(create_group_file_folder)。 */
1788
- createGroupFolder(groupCode: string, folderName: string): Promise<string>;
1789
- /** 删除群文件(delete_group_file)。 */
1790
- deleteGroupFile(groupCode: string, fileIds: string[]): Promise<void>;
1791
- /** 删除群文件夹(delete_group_folder)。 */
1792
- deleteGroupFolder(groupCode: string, folderId: string): Promise<void>;
1793
- /** 重命名群文件(rename_group_file;参数语义待探测校准)。 */
1794
- renameGroupFile(groupCode: string, fileId: string, newName: string): Promise<void>;
1795
- /** 移动群文件(move_group_file;targetFolder 空为根目录)。 */
1796
- moveGroupFile(groupCode: string, fileIds: string[], targetFolderId: string): Promise<void>;
1797
- /** 重命名群文件夹(rename_group_folder;形态镜像 renameGroupFile,待校准)。 */
1798
- renameGroupFolder(groupCode: string, folderId: string, newName: string): Promise<void>;
1799
- /**
1800
- * 群文件下载链接(get_group_file_download_url):getGroupFileList 根列表按
1801
- * fileId 查找取 url 字段(字段待实机确认)。已知差异:仅根目录可达——
1802
- * 子目录文件需 parentFolderId 逐层定位,暂不支持。
1803
- */
1804
- getGroupFileDownloadUrl(groupCode: string, fileId: string): Promise<string>;
1805
- /** 转存群文件(trans_group_file)。 */
1806
- transGroupFile(groupCode: string, fileId: string): Promise<void>;
1807
- }
1808
- /** 票据 API:从 session 拿 ticket service,包装成语义化方法。 */
1809
- export declare class TicketApi {
1810
- private readonly service;
1811
- constructor(session: NodeIQQNTWrapperSession);
1812
- /** 获取 clientKey(get_clientkey)。 */
1813
- getClientKey(): Promise<ForceFetchClientKeyRetType>;
1814
- /** 获取指定域名的 cookies(get_cookies;uin 为机器人 QQ 号)。 */
1815
- getCookies(domain: string, uin: string): Promise<Record<string, string>>;
1816
- /** 计算 bkn(get_csrf_token 与 web 接口共用;skey → bkn 哈希)。 */
1817
- static getBkn(skey: string): string;
1818
- }
1819
- /** 精华消息项(digest_list 返回 data.msg_list 成员,说明书参考)。
1820
- * 原生返回并不保证带全部展示字段,缺失按 optional 防御;`msg_content` 是标识字段。 */
1821
- interface EssenceMsgItem {
1822
- msg_seq?: number;
1823
- msg_random?: number;
1824
- sender_uin?: string;
1825
- sender_nick?: string;
1826
- add_digest_uin?: string;
1827
- add_digest_nick?: string;
1828
- add_digest_time?: number;
1829
- msg_content: Array<{
1830
- msg_type?: number;
1831
- text?: string;
1832
- image_url?: string;
1833
- }>;
1834
- }
1835
- /** 群荣誉项(honorlist 返回列表项,说明书参考)。 */
1836
- interface HonorListItem {
1837
- uin: string;
1838
- name: string;
1839
- avatar: string;
1840
- desc: string;
1841
- }
1842
- /** 群荣誉信息(getGroupHonorInfo 返回)。 */
1843
- interface GroupHonorWebInfo {
1844
- group_id: number;
1845
- current_talkative: HonorListItem | null;
1846
- talkative_list: HonorListItem[];
1847
- performer_list: HonorListItem[];
1848
- legend_list: HonorListItem[];
1849
- emotion_list: HonorListItem[];
1850
- strong_newbie_list: HonorListItem[];
1851
- }
1852
- /** 群荣誉类型(1=龙王 2=群聊之火 3=群聊炽热 6=快乐源泉)。 */
1853
- export declare const WebHonorType: {
1854
- readonly ALL: 0;
1855
- readonly TALKATIVE: 1;
1856
- readonly PERFORMER: 2;
1857
- readonly LEGEND: 3;
1858
- readonly EMOTION: 6;
1859
- };
1860
- export type WebHonorType = (typeof WebHonorType)[keyof typeof WebHonorType];
1861
- /** 群空间 web API(Cookie 经 TicketApi 注入)。 */
1862
- export declare class WebApi {
1863
- private readonly getCookies;
1864
- constructor(opts: {
1865
- getCookies: (domain: string) => Promise<Record<string, string>>;
1866
- });
1867
- /** 拉取单页精华消息(失败/retcode 非 0 返回 null)。 */
1868
- private fetchEssencePage;
1869
- /** 获取群精华消息列表(get_essence_msg_list;分页拉取至 is_end)。 */
1870
- getEssenceMsgList(groupCode: string): Promise<EssenceMsgItem[]>;
1871
- /** 获取群荣誉信息(get_group_honor_info;type 0=全部)。 */
1872
- getGroupHonorInfo(groupCode: string, type: WebHonorType): Promise<GroupHonorWebInfo>;
1873
- /** 按 type 填充荣誉列表(ALL 拉全部,单类型只拉对应类)。 */
1874
- private fillHonorLists;
1875
- /** 拉取单类荣誉列表(honorlist 接口,正则提取 __INITIAL_STATE__)。 */
1876
- private fetchHonorList;
1877
- }
1878
1782
  /** Listener 接口形状(宽约束;精确签名由实例化时的具体接口保证)。 */
1879
1783
  type ListenerShape = Record<string, unknown>;
1880
1784
  /** 事件名:`${Service}/${method}`。 */
@@ -2139,6 +2043,49 @@ export declare class MsgApi {
2139
2043
  };
2140
2044
  }): Promise<void>;
2141
2045
  }
2046
+ /** 群文件列表条目(fileInfo/folderInfo 取其一)。 */
2047
+ interface GroupFileListItem {
2048
+ fileInfo?: GroupFileItemInfo;
2049
+ folderInfo?: GroupFolderInfo;
2050
+ }
2051
+ /** 群文件系统信息。 */
2052
+ interface GroupFileSystemInfo {
2053
+ fileCount: number;
2054
+ limitCount: number;
2055
+ usedSpace: number;
2056
+ totalSpace: number;
2057
+ }
2058
+ /** 富媒体 API:从 session 拿 rich media service,包装成语义化方法。 */
2059
+ export declare class RichMediaApi {
2060
+ private readonly service;
2061
+ constructor(session: NodeIQQNTWrapperSession);
2062
+ /** 英文单词翻译(translate_en2zh)。 */
2063
+ translateWords(words: string[]): Promise<string[]>;
2064
+ /** 群文件列表(get_group_root_files;parent 缺省根目录)。 */
2065
+ getGroupFileList(groupCode: string, parentFolderId?: string, fileCount?: number): Promise<GroupFileListItem[]>;
2066
+ /** 群文件系统信息(get_group_file_system_info;getGroupFileList 的 groupSpaceResult)。 */
2067
+ getGroupFileSystemInfo(groupCode: string): Promise<GroupFileSystemInfo>;
2068
+ /** 创建群文件夹(create_group_file_folder)。 */
2069
+ createGroupFolder(groupCode: string, folderName: string): Promise<string>;
2070
+ /** 删除群文件(delete_group_file)。 */
2071
+ deleteGroupFile(groupCode: string, fileIds: string[]): Promise<void>;
2072
+ /** 删除群文件夹(delete_group_folder)。 */
2073
+ deleteGroupFolder(groupCode: string, folderId: string): Promise<void>;
2074
+ /** 重命名群文件(rename_group_file;参数语义待探测校准)。 */
2075
+ renameGroupFile(groupCode: string, fileId: string, newName: string): Promise<void>;
2076
+ /** 移动群文件(move_group_file;targetFolder 空为根目录)。 */
2077
+ moveGroupFile(groupCode: string, fileIds: string[], targetFolderId: string): Promise<void>;
2078
+ /** 重命名群文件夹(rename_group_folder;形态镜像 renameGroupFile,待校准)。 */
2079
+ renameGroupFolder(groupCode: string, folderId: string, newName: string): Promise<void>;
2080
+ /**
2081
+ * 群文件下载链接(get_group_file_download_url):getGroupFileList 根列表按
2082
+ * fileId 查找取 url 字段(字段待实机确认)。已知差异:仅根目录可达——
2083
+ * 子目录文件需 parentFolderId 逐层定位,暂不支持。
2084
+ */
2085
+ getGroupFileDownloadUrl(groupCode: string, fileId: string): Promise<string>;
2086
+ /** 转存群文件(trans_group_file)。 */
2087
+ transGroupFile(groupCode: string, fileId: string): Promise<void>;
2088
+ }
2142
2089
  /** 好友条目(uid + 昵称/备注,昵称由 buddy service 缓存补全)。 */
2143
2090
  interface Friend {
2144
2091
  uid: string;
@@ -2268,209 +2215,76 @@ export declare class RecentContactApi {
2268
2215
  /** 置顶会话列表(get_peer_pins;getRecentContactList 返回形状待探测校准)。 */
2269
2216
  getPinnedContacts(): Promise<PinnedContact[]>;
2270
2217
  }
2271
- /** BuddyCache diff 事件 listener(归一化「新增/删除」事件)。 */
2272
- type BuddyCacheListener = {
2273
- onBuddyAdded: (entry: BuddyListEntry) => void;
2274
- onBuddyRemoved: (entry: BuddyListEntry) => void;
2275
- };
2276
- /** BuddyCache diff 事件通道(事件名 BuddyCache/onBuddyAdded 等)。 */
2277
- type BuddyCacheEventChannel = NTEventChannel<BuddyCacheListener, "BuddyCache">;
2278
- /** BuddyCache 构造参数。 */
2279
- interface BuddyCacheOptions {
2280
- /** Buddy 事件通道(FriendBridge 注册原生监听后 emit 到这里)。 */
2281
- channel: BuddyEventChannel;
2282
- /** 校准日志(可选:快照形状异常 raw 记录;缺省静默)。 */
2283
- logger?: {
2284
- warn(obj: unknown, msg?: string): void;
2285
- };
2218
+ /** 票据 API:从 session 拿 ticket service,包装成语义化方法。 */
2219
+ export declare class TicketApi {
2220
+ private readonly service;
2221
+ constructor(session: NodeIQQNTWrapperSession);
2222
+ /** 获取 clientKey(get_clientkey)。 */
2223
+ getClientKey(): Promise<ForceFetchClientKeyRetType>;
2224
+ /** 获取指定域名的 cookies(get_cookies;uin 为机器人 QQ 号)。 */
2225
+ getCookies(domain: string, uin: string): Promise<Record<string, string>>;
2226
+ /** 计算 bkn(get_csrf_token 与 web 接口共用;skey → bkn 哈希)。 */
2227
+ static getBkn(skey: string): string;
2286
2228
  }
2287
- /**
2288
- * 防御性收窄 onBuddyListChange 载荷 → BuddyCategory[](T10 实证形状;
2289
- * 非数组 / 非对象分类项返回 null,调用方打 raw 日志积累校准数据)。
2290
- * 分类字段逐项做运行时类型校验并安全构造,缺失项取保守默认值。
2291
- */
2292
- export declare function narrowBuddyCategories(arg: unknown): BuddyCategory[] | null;
2293
- /** 好友缓存:快照维护 + diff 归一化事件。 */
2294
- export declare class BuddyCache {
2295
- private readonly channel;
2296
- private readonly logger;
2297
- /** diff 归一化事件通道(协议层订阅 friend_add / IPC 转发消费)。 */
2298
- readonly events: BuddyCacheEventChannel;
2299
- /** 好友快照(uid → entry,onBuddyListChange 全量维护)。 */
2300
- private readonly buddies;
2301
- /** 首帧已建 baseline(此后快照才参与 diff)。 */
2302
- private bootstrapped;
2303
- private unsubscribes;
2304
- constructor(opts: BuddyCacheOptions);
2305
- /** 订阅 Buddy 事件通道(幂等)。 */
2306
- register(): void;
2307
- /** 退订事件通道(幂等)。 */
2308
- unregister(): void;
2309
- /** 释放(等价 unregister,幂等)。 */
2310
- dispose(): void;
2311
- /** `using cache = ...` 自动释放。 */
2312
- [Symbol.dispose](): void;
2313
- /** 应用全量快照:首帧建 baseline,之后 diff 发布归一化事件。 */
2314
- private applySnapshot;
2315
- /** 好友快照(只读拷贝)。 */
2316
- listBuddies(): BuddyListEntry[];
2317
- /** 单个好友(快照;undefined = 不在缓存)。 */
2318
- getBuddy(uid: string): BuddyListEntry | undefined;
2319
- /** 快照是否已建(测试/诊断用)。 */
2320
- get baselineReady(): boolean;
2321
- }
2322
- /** onGroupEssenceListChange 参数 → 群号(录制实证首项字符串;防御收窄)。 */
2323
- export declare function narrowEssenceGroupArg(arg: unknown): string | null;
2324
- /** 列表缓存条目:seq → 操作者/发送者 uin(null = 不可得)。 */
2325
- interface EssenceCacheEntry {
2326
- /** 加精操作者(add_digest_uin;取消场景无值)。 */
2327
- operatorUin: string | null;
2328
- /** 被加精消息发送者(sender_uin;OB11 delete 事件 sender_id 只能从缓存回填)。 */
2329
- senderUin: string | null;
2330
- /** 加精时间(add_digest_time 秒级 unix;非正数 → null = 不可得)。 */
2331
- addDigestTime: number | null;
2332
- }
2333
- /** 列表 diff 结果:cache = 新列表缓存。 */
2334
- interface EssenceDiffResult {
2335
- cache: Map<number, EssenceCacheEntry>;
2336
- /** 新增(is_set=true);operator = add_digest_uin,sender = sender_uin。 */
2337
- added: EssenceAddedItem[];
2338
- /** 移除(is_set=false;移除者不可从列表得知,operator 省略)。 */
2339
- removed: number[];
2340
- }
2341
- /** diff 新增条目。 */
2342
- interface EssenceAddedItem {
2343
- messageSeq: number;
2344
- operatorUin: string | null;
2345
- senderUin: string | null;
2346
- addDigestTime: number | null;
2347
- }
2348
- /**
2349
- * 精华列表 diff:prev 缺省(基线未建立)时只建缓存不产出事件——
2350
- * 首个变更事件只做基线,避免全量首推被误报为「逐条加精」。
2351
- */
2352
- export declare function diffEssenceList(prev: ReadonlyMap<number, EssenceCacheEntry> | undefined, items: readonly EssenceMsgItem[]): EssenceDiffResult;
2353
- /** 精华列表同步依赖(拉取 + 广播回调;事件翻译归协议层)。 */
2354
- interface EssenceListSyncDeps {
2355
- /** 全量精华列表拉取(WebApi.getEssenceMsgList)。 */
2356
- fetchList: (groupCode: string) => Promise<EssenceMsgItem[]>;
2357
- /** diff 新增项广播(协议层做事件翻译 + message_id 反查 / 快路径去重)。 */
2358
- onAdded: (groupCode: string, added: readonly EssenceAddedItem[]) => void | Promise<void>;
2359
- /** diff 移除项广播(prev 供 sender 回填)。 */
2360
- onRemoved: (groupCode: string, removed: readonly number[], prev: ReadonlyMap<number, EssenceCacheEntry>) => void | Promise<void>;
2361
- /** 列表拉取失败(串行链不中断,下个触发器继续;缺省静默)。 */
2362
- onFetchError?: (groupCode: string, err: unknown) => void;
2229
+ /** 精华消息项(digest_list 返回 data.msg_list 成员,说明书参考)。
2230
+ * 原生返回并不保证带全部展示字段,缺失按 optional 防御;`msg_content` 是标识字段。 */
2231
+ interface EssenceMsgItem {
2232
+ msg_seq?: number;
2233
+ msg_random?: number;
2234
+ sender_uin?: string;
2235
+ sender_nick?: string;
2236
+ add_digest_uin?: string;
2237
+ add_digest_nick?: string;
2238
+ add_digest_time?: number;
2239
+ msg_content: Array<{
2240
+ msg_type?: number;
2241
+ text?: string;
2242
+ image_url?: string;
2243
+ }>;
2363
2244
  }
2364
- /**
2365
- * 精华列表串行同步器(OB11 / Milky adapter 共用):
2366
- * - 列表缓存(群号 → seq → 条目)+ 串行链——并发回写乱序会把新列表覆盖成旧列表,
2367
- * 732:1 触发器与列表回调共用一条链,谁先到谁触发,diff 幂等 + 串行天然去重;
2368
- * - 基线未建立只建基线不产出事件(避免全量首推被误报为逐条加精)。
2369
- */
2370
- export declare class EssenceListSync {
2371
- private readonly deps;
2372
- private readonly caches;
2373
- private chain;
2374
- constructor(deps: EssenceListSyncDeps);
2375
- /** 入队单群串行同步(拉取 → diff → 广播 → 更新缓存)。 */
2376
- enqueue(groupCode: string): void;
2377
- /** 单群同步:拉取失败走 onFetchError;基线未建立只建缓存。 */
2378
- private sync;
2245
+ /** 群荣誉项(honorlist 返回列表项,说明书参考)。 */
2246
+ interface HonorListItem {
2247
+ uin: string;
2248
+ name: string;
2249
+ avatar: string;
2250
+ desc: string;
2379
2251
  }
2380
- /** GroupCache 构造参数。 */
2381
- interface GroupCacheOptions {
2382
- /** 群事件通道(GroupBridge 注册原生监听后 emit 到这里)。 */
2383
- channel: GroupEventChannel;
2384
- /** 群 API(惰性回填用)。 */
2385
- groupApi: GroupApi;
2252
+ /** 群荣誉信息(getGroupHonorInfo 返回)。 */
2253
+ interface GroupHonorWebInfo {
2254
+ group_id: number;
2255
+ current_talkative: HonorListItem | null;
2256
+ talkative_list: HonorListItem[];
2257
+ performer_list: HonorListItem[];
2258
+ legend_list: HonorListItem[];
2259
+ emotion_list: HonorListItem[];
2260
+ strong_newbie_list: HonorListItem[];
2386
2261
  }
2387
- /**
2388
- * 群/成员缓存:事件主动维护 + 查询惰性回填。
2389
- * 只读接口 getGroupDetail / getMembers / getMember / getGroup(列表项)。
2390
- */
2391
- export declare class GroupCache {
2392
- private readonly channel;
2393
- private readonly groupApi;
2394
- /** 群列表项(onGroupListUpdate / getGroupList 回填)。 */
2395
- private readonly groupList;
2396
- /** 群详情(onGroupDetailInfoChange / getGroupInfo 回填)。 */
2397
- private readonly groupDetails;
2398
- /** 群成员:groupCode → (uid → GroupMember)。 */
2399
- private readonly members;
2400
- /**
2401
- * 惰性回填 in-flight 去重。
2402
- *
2403
- * 按返回类型拆成三个精确容器:同 key 并发只拉一次,且取回的值类型由容器
2404
- * 声明(Promise<Group[]> / Promise<GroupDetailInfo> / Promise<GroupMember[]>)
2405
- * 自然推导——不再用 `Promise<unknown>` + `as Promise<T>` 假装泛型。
2406
- */
2407
- private inFlightGroupList;
2408
- private readonly inFlightDetail;
2409
- private readonly inFlightMembers;
2410
- private unsubscribes;
2411
- constructor(opts: GroupCacheOptions);
2412
- /** 订阅群事件通道(幂等)。 */
2413
- register(): void;
2414
- /** 退订事件通道(幂等)。 */
2415
- unregister(): void;
2416
- /** 释放(等价 unregister,幂等)。 */
2417
- dispose(): void;
2418
- /** `using cache = ...` 自动释放。 */
2419
- [Symbol.dispose](): void;
2420
- /** 合并成员到该群缓存(uid → GroupMember)。 */
2421
- private upsertMembers;
2422
- /** 群列表是否已有缓存(同步判断)。 */
2423
- hasGroup(groupCode: string): boolean;
2424
- /**
2425
- * 群列表快照(只读,缓存由 onGroupListUpdate 事件主动维护)。
2426
- * 群列表数据不走原生 getGroupList 返回值(实测仅 { result, errMsg },
2427
- * 列表经事件推送)——协议/IPC 层消费列表一律经此方法。
2428
- */
2429
- listGroups(): Group[];
2430
- /**
2431
- * 群列表快照(缓存为空时主动触发原生刷新,等待事件回填后返回)。
2432
- *
2433
- * 实测(2026-08-08 端到端联调):onGroupListUpdate 仅在登录后首轮同步
2434
- * 推送(MMKV 已有缓存后不再重复推送)——进程内缓存为空时列表读不到。
2435
- * 触发 getGroupList(true) 会重新拉取并推送事件回填缓存。
2436
- * 返回空数组 = 刷新后仍无数据(超时 5s)。
2437
- */
2438
- listGroupsRefreshed(): Promise<Group[]>;
2439
- /**
2440
- * 群列表项(只读;缺失惰性回填 getGroupList)。
2441
- * 返回 undefined 表示群不存在。
2442
- */
2443
- getGroup(groupCode: string): Promise<Group | undefined>;
2444
- /**
2445
- * 群详情(只读;缺失惰性回填 getGroupInfo)。
2446
- * getGroupInfo 恒返回对象(失败抛 KernelError),直接缓存。
2447
- */
2448
- getGroupDetail(groupCode: string): Promise<GroupDetailInfo>;
2449
- /**
2450
- * 群成员列表(只读;缺失惰性回填 getAllMemberList(forceFetch=true))。
2451
- * 返回空数组表示该群无成员(或拉取失败已由 GroupApi 抛 KernelError)。
2452
- */
2453
- getMembers(groupCode: string): Promise<GroupMember[]>;
2454
- /**
2455
- * 群成员(只读;缺失回填:先整群拉取,再按 uid 取;仍无则 getMemberInfo 单查)。
2456
- * 返回 undefined 表示成员不在群。
2457
- */
2458
- getMember(groupCode: string, uid: string): Promise<GroupMember | undefined>;
2459
- /** 读缓存成员(缺失先整群回填一次)。 */
2460
- private getCachedMember;
2461
- /** 惰性回填全量群列表(getGroup 缺失时;并发调用共享同一次拉取)。 */
2462
- private loadGroupList;
2463
- /**
2464
- * 惰性回填并发去重(按返回类型分容器):同 map + key 并发只拉一次。
2465
- * loader 的返回值类型即容器元素类型——取回时由 Promise<T> 自然给出 T,
2466
- * 不需要 `as Promise<T>` 断言。
2467
- */
2468
- private dedupeMap;
2262
+ /** 群荣誉类型(1=龙王 2=群聊之火 3=群聊炽热 6=快乐源泉)。 */
2263
+ export declare const WebHonorType: {
2264
+ readonly ALL: 0;
2265
+ readonly TALKATIVE: 1;
2266
+ readonly PERFORMER: 2;
2267
+ readonly LEGEND: 3;
2268
+ readonly EMOTION: 6;
2269
+ };
2270
+ export type WebHonorType = (typeof WebHonorType)[keyof typeof WebHonorType];
2271
+ /** 群空间 web API(Cookie 经 TicketApi 注入)。 */
2272
+ export declare class WebApi {
2273
+ private readonly getCookies;
2274
+ constructor(opts: {
2275
+ getCookies: (domain: string) => Promise<Record<string, string>>;
2276
+ });
2277
+ /** 拉取单页精华消息(失败/retcode 非 0 返回 null)。 */
2278
+ private fetchEssencePage;
2279
+ /** 获取群精华消息列表(get_essence_msg_list;分页拉取至 is_end)。 */
2280
+ getEssenceMsgList(groupCode: string): Promise<EssenceMsgItem[]>;
2281
+ /** 获取群荣誉信息(get_group_honor_info;type 0=全部)。 */
2282
+ getGroupHonorInfo(groupCode: string, type: WebHonorType): Promise<GroupHonorWebInfo>;
2283
+ /** 按 type 填充荣誉列表(ALL 拉全部,单类型只拉对应类)。 */
2284
+ private fillHonorLists;
2285
+ /** 拉取单类荣誉列表(honorlist 接口,正则提取 __INITIAL_STATE__)。 */
2286
+ private fetchHonorList;
2469
2287
  }
2470
- /** NT RawMessage → canonical 元素(与 toSendElements 对称,接收方向)。 */
2471
- export declare function toCanonicalElements(msg: RawMessage): CanonicalElement[];
2472
- /** canonical 元素 → NT 发送元素(text/at/face/image/voice/reply 核心 + json ARK 透传)。 */
2473
- export declare function toSendElements(elements: CanonicalElement[]): SendMessageElement[];
2474
2288
  /** 配置文本格式。 */
2475
2289
  type ConfigFormat = "json" | "toml";
2476
2290
  /**
@@ -2823,6 +2637,10 @@ export declare function requireKernelService<T extends object>(service: T | null
2823
2637
  export declare function waitFor(predicate: () => boolean, timeoutMs: number, intervalMs?: number): Promise<boolean>;
2824
2638
  /** 短延迟。 */
2825
2639
  export declare function sleep(ms: number): Promise<void>;
2640
+ /** NT RawMessage → canonical 元素(与 toSendElements 对称,接收方向)。 */
2641
+ export declare function toCanonicalElements(msg: RawMessage): CanonicalElement[];
2642
+ /** canonical 元素 → NT 发送元素(text/at/face/image/voice/reply 核心 + json ARK 透传)。 */
2643
+ export declare function toSendElements(elements: CanonicalElement[]): SendMessageElement[];
2826
2644
  /** startNapuketto 的引导环境(由 loader launcher 注入环境变量,boot.cjs 透传)。 */
2827
2645
  interface BootEnv {
2828
2646
  /** QQ 版本(如 "9.9.31-49919")。 */
@@ -2976,19 +2794,410 @@ export declare function startNapuketto(options: StartNapukettoOptions): WrapperC
2976
2794
  */
2977
2795
  export declare function activateO3MiscService(wrapperExports: WrapperNodeApi | Record<string, unknown> | undefined): boolean;
2978
2796
  /**
2979
- * 等待网络连接就绪(loginService.getMsfStatus() === 3)。
2980
- * 参考 NapCat waitForNetworkConnection 思路(自研实现):快速登录在 QQ 刚拉起、
2981
- * 网络栈未初始化时报 1006511 网络异常——等待 MSF 连接后再重试。
2982
- * @returns 是否在超时前就绪。
2797
+ * 探测 wrapper 运行时:dump session 方法与各 service 方法名到 JSON。
2798
+ * 返回探测结果对象;同时写文件(NAPUKETTO_CFG_DIR/<file>,默认 napuketto-probe.json)。
2799
+ * 服务枚举逐项增量落盘(persist)——活 session 上原生崩溃时文件保留断点。
2983
2800
  */
2984
- export declare function waitForNetworkConnection(ctx: WrapperContext, opts?: {
2985
- timeoutMs?: number;
2986
- }): Promise<boolean>;
2987
- /** 登录结果(QR 或快速登录)。 */
2988
- interface LoginResult {
2989
- uin: string;
2990
- uid: string;
2991
- nick: string;
2801
+ export declare function probeRuntime(ctx: WrapperContext, file?: string): Record<string, unknown>;
2802
+ /** 录制事件(JSONL 一行)。 */
2803
+ interface ListenerRecordEvent {
2804
+ /** ISO 时间戳。 */
2805
+ ts: string;
2806
+ /** 服务简称(Msg / Group / …;LoginService 例外,来自 exports 单例)。 */
2807
+ service: string;
2808
+ /** 回调名;陷阱观测用合成事件 `<get>` / `<has>` / `<ownKeys>` / `<registered>`。 */
2809
+ event: string;
2810
+ /** 回调入参(截断序列化)或注册附加信息。 */
2811
+ args: unknown[];
2812
+ }
2813
+ /** 录制结果摘要(bootstrap 日志用)。 */
2814
+ interface ListenerRecordingResult {
2815
+ /** jsonl 产物绝对路径。 */
2816
+ file: string;
2817
+ /** 逐服务注册结果(ok=listenerId / error / null=服务 getter 返回空)。 */
2818
+ registered: Record<string, {
2819
+ ok: boolean;
2820
+ listenerId?: number;
2821
+ error?: string | null;
2822
+ }>;
2823
+ }
2824
+ /**
2825
+ * 构造万能监听器:Proxy get 陷阱对任意字符串属性返回记录函数(同时记录原生
2826
+ * 查过的名字,即使从未调用);has / ownKeys 也记录(判定原生按名 Get 还是
2827
+ * 枚举发现回调);非字符串键(Symbol,如 util.inspect 触发)放行默认行为。
2828
+ */
2829
+ export declare function createRecordingListener(service: string, onEvent: (record: ListenerRecordEvent) => void): object;
2830
+ /**
2831
+ * 启动 listener 录制:session 十服务 + LoginService(exports 单例)逐服务注册
2832
+ * 万能监听器,JSONL 逐行追加。返回摘要;文件路径写入结果(bootstrap 日志用)。
2833
+ *
2834
+ * ⚠️ 调用时序约束:必须在任何探测(probeRuntime / getMainSession)之前调用——
2835
+ * resolveMainFromStartup 会把空壳主 session 写回 ctx.session(session-resolver.ts),
2836
+ * 空壳的 service getter 函数仍在但调用返回 null(late probe 61/63 null 的根因)。
2837
+ */
2838
+ export declare function startListenerRecording(ctx: WrapperContext, file?: string): ListenerRecordingResult;
2839
+ /**
2840
+ * QQ 数据根路径解析(P2-1,2026-08-06)
2841
+ *
2842
+ * 从 `getNTUserDataInfoConfig()` 的返回值中提取 QQ 真实数据根路径:
2843
+ * worker(utilityProcess)模式下 loginService 是 new 的,commonPath 必须指向
2844
+ * QQ 真实数据路径才能读到历史账号(cli 的 `.napuketto\default` 读不到,
2845
+ * getLoginList 空,P2-1 实测)。
2846
+ *
2847
+ * 返回值形态可能是 JSON 字符串(对象/数组)或纯路径字符串,此处做宽容解析。
2848
+ */
2849
+ /**
2850
+ * QQ 全局数据目录(commonPath / desktopGlobalPath = 数据根/nt_qq/global,
2851
+ * HANDOVER-V6 自建宿主三要素之三,p0-kernel-flow 实证)。
2852
+ *
2853
+ * 防御:已含 nt_qq/global 后缀(worker 环境下 getNTUserDataInfoConfig 可能
2854
+ * 返回完整路径)则不重复拼接,避免 `nt_qq/global/nt_qq/global` 错位。
2855
+ */
2856
+ export declare function resolveQqGlobalPath(root: string): string;
2857
+ /**
2858
+ * 复用 QQ 已有 session(P1-4:QQ 已登录,直接拿单例避免重复 init)。
2859
+ * 优先 `NodeIQQNTWrapperSession.get()`;返回 null 时回退 createSession。
2860
+ *
2861
+ * @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(会写回 ctx.session)。
2862
+ */
2863
+ export declare function getExistingSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
2864
+ /**
2865
+ * 复用 QQ 主 session(P1-4 实测链路):
2866
+ * `NodeIQQNTStartupSessionWrapper.create()` → `start()` → `getSessionIdList()`(Map
2867
+ * {nt:"nt_3", gpro:"gpro_3"})→ `NodeIQQNTWrapperSession.getNTWrapperSession("nt_3")`。
2868
+ * 注:实测这些 session 是空壳(核心 service null),真正可用的是 new + init(lifecycle.ts)。
2869
+ *
2870
+ * @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(纯查询语义,不改写 ctx.session)。
2871
+ */
2872
+ export declare function getMainSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
2873
+ /** NAPI 回调占位(方法存在即可被反射调用,无副作用)。 */
2874
+ declare const noop: () => void;
2875
+ /** NodeIGlobalAdapter 实现(engine.initWithDeskTopConfig 第二参)。 */
2876
+ export declare class GlobalAdapter implements NodeIGlobalAdapter {
2877
+ onLog: typeof noop;
2878
+ onGetSrvCalTime: typeof noop;
2879
+ onShowErrUITips: typeof noop;
2880
+ fixPicImgType: typeof noop;
2881
+ getAppSetting: typeof noop;
2882
+ onInstallFinished: typeof noop;
2883
+ onUpdateGeneralFlag: typeof noop;
2884
+ onGetOfflineMsg: typeof noop;
2885
+ }
2886
+ /** NodeIDependsAdapter 实现(session.init 第二参)。 */
2887
+ export declare class DependsAdapter implements NodeIDependsAdapter {
2888
+ onMSFStatusChange: typeof noop;
2889
+ onMSFSsoError: typeof noop;
2890
+ getGroupCode: typeof noop;
2891
+ }
2892
+ /** NodeIDispatcherAdapter 实现(session.init 第三参)。 */
2893
+ export declare class DispatcherAdapter implements NodeIDispatcherAdapter {
2894
+ dispatchRequest: typeof noop;
2895
+ dispatchCall: typeof noop;
2896
+ dispatchCallWithJson: typeof noop;
2897
+ }
2898
+ /** 会话监听器选项。 */
2899
+ interface SessionListenerOptions {
2900
+ /** 事件日志回调(默认静默——boot 阶段事件对用户是噪音;调试时可传回调观察)。 */
2901
+ onEvent?: ((name: string, ...args: unknown[]) => void) | undefined;
2902
+ }
2903
+ /**
2904
+ * 创建会话监听器(默认静默,boot 阶段默认;login 模块接入后可覆盖)。
2905
+ * 回调方法必须存在(NAPI 按方法名反射),但输出与否由调用方决定——
2906
+ * onNTSessionCreate / onOpentelemetryInit 等对用户无信息量,默认不打 stdout。
2907
+ */
2908
+ export declare function createSessionListener(opts?: SessionListenerOptions): NodeIKernelSessionListener;
2909
+ /** 创建登录监听器(占位,登录器接入时填充)。 */
2910
+ export declare function createLoginListener(): KernelLoginListener;
2911
+ /**
2912
+ * 从 major.node 提取 appid(NapCat parseAppidFromMajorV2 的自研等价实现)。
2913
+ * major.node 含 `QQAppId/` 标记后跟数字(腾讯工具链产物,实测确认)。
2914
+ * 返回 null 表示解析失败(调用方应显式报错,不再回退硬编码 appid)。
2915
+ */
2916
+ export declare function parseAppidFromMajor(majorPath: string): string | null;
2917
+ /**
2918
+ * 解析 appid / qua(自研,参考 NapCat QQBasicInfoWrapper 思路但独立实现):
2919
+ * appid 唯一来源 = major.node 提取(实测 9.9.33-51802 = 537376818)。
2920
+ * majorPath 缺省或解析失败时抛 KernelError——不再静默回退过期 appid。
2921
+ * majorPath 传 wrapper.node 同目录 major.node。
2922
+ */
2923
+ export declare function resolveAppidQua(fullVersion: string, majorPath?: string, platform?: PlatformType): {
2924
+ appid: string;
2925
+ qua: string;
2926
+ };
2927
+ /** 生成 engine 桌面配置(wrapper 契约字段)。majorPath 可选(缺失/解析失败会抛错)。 */
2928
+ export declare function buildEngineConfig(fullVersion: string, dataPathGlobal: string, majorPath?: string, platform?: PlatformType): EnginInitDesktopConfig;
2929
+ /** 生成登录初始化配置(externalVersion: false 与 NapCat 同款,扫码兼容关键)。 */
2930
+ export declare function buildLoginConfig(appid: string, fullVersion: string, commonPath: string): Record<string, unknown>;
2931
+ /** buildSessionConfig 参数。 */
2932
+ interface SessionConfigOptions {
2933
+ appid: string;
2934
+ fullVersion: string;
2935
+ selfUin: string;
2936
+ selfUid: string;
2937
+ accountPath: string;
2938
+ downloadPath: string;
2939
+ /** 设备指纹 guid(来自 loginService.getMachineGuid();缺省空串)。 */
2940
+ machineGuid?: string | undefined;
2941
+ /** 平台(缺省按 process.platform 探测;测试/联调可显式覆盖)。 */
2942
+ platform?: PlatformType | undefined;
2943
+ }
2944
+ /** 生成 session 初始化配置(登录成功后调用)。 */
2945
+ export declare function buildSessionConfig(options: SessionConfigOptions): WrapperSessionInitConfig;
2946
+ /**
2947
+ * 读取设备指纹 guid(wrapper.node 字符串分析实证,2026-08-12):
2948
+ * NodeIKernelLoginService::getMachineGuid(0 参,返回机器 GUID 字符串)。
2949
+ * 无 getMachineId 方法——TODO 里的方法名不存在,等价方法是 getMachineGuid。
2950
+ * 失败(无该方法 / 调用抛错 / 返回值非字符串)兜底空串。
2951
+ */
2952
+ export declare function readMachineGuid(loginService: unknown): string;
2953
+ /**
2954
+ * QQ 安装目录探测(ADR-018)
2955
+ *
2956
+ * wrapper.node 路径随 QQ 版本变化:`<安装目录>/versions/<版本>/resources/app/wrapper.node`。
2957
+ * 加载前必须知道版本(登录握手参数 appid/qua 与版本强相关)。
2958
+ *
2959
+ * 已实测确认(2026-08-05,QQ 9.9.31-49919):
2960
+ * - 目录结构:versions/<9.9.31-49919>/resources/app/wrapper.node
2961
+ * - 版本信息在 versions/<版本>/resources/app/package.json(name=qq-chat / version / buildVersion)
2962
+ * - wrapper.node 是 C++ ABI 模块(非 N-API),导出 INTSessionShell 等符号
2963
+ */
2964
+ /** 解析 wrapper.node 绝对路径(按 ADR-018 目录约定)。 */
2965
+ export declare function resolveWrapperPath(installDir: string, version: string): string;
2966
+ /**
2967
+ * 探测指定版本信息(校验 wrapper.node 存在)。
2968
+ * 版本号不匹配目录时抛 NOT_FOUND(明确失败而非静默)。
2969
+ */
2970
+ export declare function resolveQQVersion(installDir: string, version: string): QQVersionInfo;
2971
+ /** 扫描 versions 目录,取可加载的版本列表(按目录名倒序,最新在前)。 */
2972
+ export declare function listQQVersions(installDir: string): string[];
2973
+ /** QQ 版本信息。 */
2974
+ interface QqVersionInfo {
2975
+ /** 完整版本号,如 "9.9.31-49919"。 */
2976
+ fullVersion: string;
2977
+ /** 构建号,如 "49919"。 */
2978
+ buildVersion: string;
2979
+ /** wrapper.node 绝对路径。 */
2980
+ wrapperPath: string;
2981
+ /** 登录握手参数(P1 探测脚本产出,暂为空串)。 */
2982
+ appid: string;
2983
+ /** 登录握手参数(P1 探测脚本产出,暂为空串)。 */
2984
+ qua: string;
2985
+ }
2986
+ /** @deprecated 使用 `QqVersionInfo`(缩写大小写统一为 `Qq`)。 */
2987
+ type QQVersionInfo = QqVersionInfo;
2988
+ /** BuddyCache diff 事件 listener(归一化「新增/删除」事件)。 */
2989
+ type BuddyCacheListener = {
2990
+ onBuddyAdded: (entry: BuddyListEntry) => void;
2991
+ onBuddyRemoved: (entry: BuddyListEntry) => void;
2992
+ };
2993
+ /** BuddyCache diff 事件通道(事件名 BuddyCache/onBuddyAdded 等)。 */
2994
+ type BuddyCacheEventChannel = NTEventChannel<BuddyCacheListener, "BuddyCache">;
2995
+ /** BuddyCache 构造参数。 */
2996
+ interface BuddyCacheOptions {
2997
+ /** Buddy 事件通道(FriendBridge 注册原生监听后 emit 到这里)。 */
2998
+ channel: BuddyEventChannel;
2999
+ /** 校准日志(可选:快照形状异常 raw 记录;缺省静默)。 */
3000
+ logger?: {
3001
+ warn(obj: unknown, msg?: string): void;
3002
+ };
3003
+ }
3004
+ /**
3005
+ * 防御性收窄 onBuddyListChange 载荷 → BuddyCategory[](T10 实证形状;
3006
+ * 非数组 / 非对象分类项返回 null,调用方打 raw 日志积累校准数据)。
3007
+ * 分类字段逐项做运行时类型校验并安全构造,缺失项取保守默认值。
3008
+ */
3009
+ export declare function narrowBuddyCategories(arg: unknown): BuddyCategory[] | null;
3010
+ /** 好友缓存:快照维护 + diff 归一化事件。 */
3011
+ export declare class BuddyCache {
3012
+ private readonly channel;
3013
+ private readonly logger;
3014
+ /** diff 归一化事件通道(协议层订阅 friend_add / IPC 转发消费)。 */
3015
+ readonly events: BuddyCacheEventChannel;
3016
+ /** 好友快照(uid → entry,onBuddyListChange 全量维护)。 */
3017
+ private readonly buddies;
3018
+ /** 首帧已建 baseline(此后快照才参与 diff)。 */
3019
+ private bootstrapped;
3020
+ private unsubscribes;
3021
+ constructor(opts: BuddyCacheOptions);
3022
+ /** 订阅 Buddy 事件通道(幂等)。 */
3023
+ register(): void;
3024
+ /** 退订事件通道(幂等)。 */
3025
+ unregister(): void;
3026
+ /** 释放(等价 unregister,幂等)。 */
3027
+ dispose(): void;
3028
+ /** `using cache = ...` 自动释放。 */
3029
+ [Symbol.dispose](): void;
3030
+ /** 应用全量快照:首帧建 baseline,之后 diff 发布归一化事件。 */
3031
+ private applySnapshot;
3032
+ /** 好友快照(只读拷贝)。 */
3033
+ listBuddies(): BuddyListEntry[];
3034
+ /** 单个好友(快照;undefined = 不在缓存)。 */
3035
+ getBuddy(uid: string): BuddyListEntry | undefined;
3036
+ /** 快照是否已建(测试/诊断用)。 */
3037
+ get baselineReady(): boolean;
3038
+ }
3039
+ /** onGroupEssenceListChange 参数 → 群号(录制实证首项字符串;防御收窄)。 */
3040
+ export declare function narrowEssenceGroupArg(arg: unknown): string | null;
3041
+ /** 列表缓存条目:seq → 操作者/发送者 uin(null = 不可得)。 */
3042
+ interface EssenceCacheEntry {
3043
+ /** 加精操作者(add_digest_uin;取消场景无值)。 */
3044
+ operatorUin: string | null;
3045
+ /** 被加精消息发送者(sender_uin;OB11 delete 事件 sender_id 只能从缓存回填)。 */
3046
+ senderUin: string | null;
3047
+ /** 加精时间(add_digest_time 秒级 unix;非正数 → null = 不可得)。 */
3048
+ addDigestTime: number | null;
3049
+ }
3050
+ /** 列表 diff 结果:cache = 新列表缓存。 */
3051
+ interface EssenceDiffResult {
3052
+ cache: Map<number, EssenceCacheEntry>;
3053
+ /** 新增(is_set=true);operator = add_digest_uin,sender = sender_uin。 */
3054
+ added: EssenceAddedItem[];
3055
+ /** 移除(is_set=false;移除者不可从列表得知,operator 省略)。 */
3056
+ removed: number[];
3057
+ }
3058
+ /** diff 新增条目。 */
3059
+ interface EssenceAddedItem {
3060
+ messageSeq: number;
3061
+ operatorUin: string | null;
3062
+ senderUin: string | null;
3063
+ addDigestTime: number | null;
3064
+ }
3065
+ /**
3066
+ * 精华列表 diff:prev 缺省(基线未建立)时只建缓存不产出事件——
3067
+ * 首个变更事件只做基线,避免全量首推被误报为「逐条加精」。
3068
+ */
3069
+ export declare function diffEssenceList(prev: ReadonlyMap<number, EssenceCacheEntry> | undefined, items: readonly EssenceMsgItem[]): EssenceDiffResult;
3070
+ /** 精华列表同步依赖(拉取 + 广播回调;事件翻译归协议层)。 */
3071
+ interface EssenceListSyncDeps {
3072
+ /** 全量精华列表拉取(WebApi.getEssenceMsgList)。 */
3073
+ fetchList: (groupCode: string) => Promise<EssenceMsgItem[]>;
3074
+ /** diff 新增项广播(协议层做事件翻译 + message_id 反查 / 快路径去重)。 */
3075
+ onAdded: (groupCode: string, added: readonly EssenceAddedItem[]) => void | Promise<void>;
3076
+ /** diff 移除项广播(prev 供 sender 回填)。 */
3077
+ onRemoved: (groupCode: string, removed: readonly number[], prev: ReadonlyMap<number, EssenceCacheEntry>) => void | Promise<void>;
3078
+ /** 列表拉取失败(串行链不中断,下个触发器继续;缺省静默)。 */
3079
+ onFetchError?: (groupCode: string, err: unknown) => void;
3080
+ }
3081
+ /**
3082
+ * 精华列表串行同步器(OB11 / Milky adapter 共用):
3083
+ * - 列表缓存(群号 → seq → 条目)+ 串行链——并发回写乱序会把新列表覆盖成旧列表,
3084
+ * 732:1 触发器与列表回调共用一条链,谁先到谁触发,diff 幂等 + 串行天然去重;
3085
+ * - 基线未建立只建基线不产出事件(避免全量首推被误报为逐条加精)。
3086
+ */
3087
+ export declare class EssenceListSync {
3088
+ private readonly deps;
3089
+ private readonly caches;
3090
+ private chain;
3091
+ constructor(deps: EssenceListSyncDeps);
3092
+ /** 入队单群串行同步(拉取 → diff → 广播 → 更新缓存)。 */
3093
+ enqueue(groupCode: string): void;
3094
+ /** 单群同步:拉取失败走 onFetchError;基线未建立只建缓存。 */
3095
+ private sync;
3096
+ }
3097
+ /** GroupCache 构造参数。 */
3098
+ interface GroupCacheOptions {
3099
+ /** 群事件通道(GroupBridge 注册原生监听后 emit 到这里)。 */
3100
+ channel: GroupEventChannel;
3101
+ /** 群 API(惰性回填用)。 */
3102
+ groupApi: GroupApi;
3103
+ }
3104
+ /**
3105
+ * 群/成员缓存:事件主动维护 + 查询惰性回填。
3106
+ * 只读接口 getGroupDetail / getMembers / getMember / getGroup(列表项)。
3107
+ */
3108
+ export declare class GroupCache {
3109
+ private readonly channel;
3110
+ private readonly groupApi;
3111
+ /** 群列表项(onGroupListUpdate / getGroupList 回填)。 */
3112
+ private readonly groupList;
3113
+ /** 群详情(onGroupDetailInfoChange / getGroupInfo 回填)。 */
3114
+ private readonly groupDetails;
3115
+ /** 群成员:groupCode → (uid → GroupMember)。 */
3116
+ private readonly members;
3117
+ /**
3118
+ * 惰性回填 in-flight 去重。
3119
+ *
3120
+ * 按返回类型拆成三个精确容器:同 key 并发只拉一次,且取回的值类型由容器
3121
+ * 声明(Promise<Group[]> / Promise<GroupDetailInfo> / Promise<GroupMember[]>)
3122
+ * 自然推导——不再用 `Promise<unknown>` + `as Promise<T>` 假装泛型。
3123
+ */
3124
+ private inFlightGroupList;
3125
+ private readonly inFlightDetail;
3126
+ private readonly inFlightMembers;
3127
+ private unsubscribes;
3128
+ constructor(opts: GroupCacheOptions);
3129
+ /** 订阅群事件通道(幂等)。 */
3130
+ register(): void;
3131
+ /** 退订事件通道(幂等)。 */
3132
+ unregister(): void;
3133
+ /** 释放(等价 unregister,幂等)。 */
3134
+ dispose(): void;
3135
+ /** `using cache = ...` 自动释放。 */
3136
+ [Symbol.dispose](): void;
3137
+ /** 合并成员到该群缓存(uid → GroupMember)。 */
3138
+ private upsertMembers;
3139
+ /** 群列表是否已有缓存(同步判断)。 */
3140
+ hasGroup(groupCode: string): boolean;
3141
+ /**
3142
+ * 群列表快照(只读,缓存由 onGroupListUpdate 事件主动维护)。
3143
+ * 群列表数据不走原生 getGroupList 返回值(实测仅 { result, errMsg },
3144
+ * 列表经事件推送)——协议/IPC 层消费列表一律经此方法。
3145
+ */
3146
+ listGroups(): Group[];
3147
+ /**
3148
+ * 群列表快照(缓存为空时主动触发原生刷新,等待事件回填后返回)。
3149
+ *
3150
+ * 实测(2026-08-08 端到端联调):onGroupListUpdate 仅在登录后首轮同步
3151
+ * 推送(MMKV 已有缓存后不再重复推送)——进程内缓存为空时列表读不到。
3152
+ * 触发 getGroupList(true) 会重新拉取并推送事件回填缓存。
3153
+ * 返回空数组 = 刷新后仍无数据(超时 5s)。
3154
+ */
3155
+ listGroupsRefreshed(): Promise<Group[]>;
3156
+ /**
3157
+ * 群列表项(只读;缺失惰性回填 getGroupList)。
3158
+ * 返回 undefined 表示群不存在。
3159
+ */
3160
+ getGroup(groupCode: string): Promise<Group | undefined>;
3161
+ /**
3162
+ * 群详情(只读;缺失惰性回填 getGroupInfo)。
3163
+ * getGroupInfo 恒返回对象(失败抛 KernelError),直接缓存。
3164
+ */
3165
+ getGroupDetail(groupCode: string): Promise<GroupDetailInfo>;
3166
+ /**
3167
+ * 群成员列表(只读;缺失惰性回填 getAllMemberList(forceFetch=true))。
3168
+ * 返回空数组表示该群无成员(或拉取失败已由 GroupApi 抛 KernelError)。
3169
+ */
3170
+ getMembers(groupCode: string): Promise<GroupMember[]>;
3171
+ /**
3172
+ * 群成员(只读;缺失回填:先整群拉取,再按 uid 取;仍无则 getMemberInfo 单查)。
3173
+ * 返回 undefined 表示成员不在群。
3174
+ */
3175
+ getMember(groupCode: string, uid: string): Promise<GroupMember | undefined>;
3176
+ /** 读缓存成员(缺失先整群回填一次)。 */
3177
+ private getCachedMember;
3178
+ /** 惰性回填全量群列表(getGroup 缺失时;并发调用共享同一次拉取)。 */
3179
+ private loadGroupList;
3180
+ /**
3181
+ * 惰性回填并发去重(按返回类型分容器):同 map + key 并发只拉一次。
3182
+ * loader 的返回值类型即容器元素类型——取回时由 Promise<T> 自然给出 T,
3183
+ * 不需要 `as Promise<T>` 断言。
3184
+ */
3185
+ private dedupeMap;
3186
+ }
3187
+ /**
3188
+ * 等待网络连接就绪(loginService.getMsfStatus() === 3)。
3189
+ * 参考 NapCat waitForNetworkConnection 思路(自研实现):快速登录在 QQ 刚拉起、
3190
+ * 网络栈未初始化时报 1006511 网络异常——等待 MSF 连接后再重试。
3191
+ * @returns 是否在超时前就绪。
3192
+ */
3193
+ export declare function waitForNetworkConnection(ctx: WrapperContext, opts?: {
3194
+ timeoutMs?: number;
3195
+ }): Promise<boolean>;
3196
+ /** 登录结果(QR 或快速登录)。 */
3197
+ interface LoginResult {
3198
+ uin: string;
3199
+ uid: string;
3200
+ nick: string;
2992
3201
  }
2993
3202
  /** 登录列表项(getLoginList 返回,说明书参考)。 */
2994
3203
  interface LoginAccountInfo {
@@ -3355,196 +3564,4 @@ export declare class NapukettoCore {
3355
3564
  /** `using core = ...` 自动释放。 */
3356
3565
  [Symbol.dispose](): void;
3357
3566
  }
3358
- /**
3359
- * 探测 wrapper 运行时:dump session 方法与各 service 方法名到 JSON。
3360
- * 返回探测结果对象;同时写文件(NAPUKETTO_CFG_DIR/<file>,默认 napuketto-probe.json)。
3361
- * 服务枚举逐项增量落盘(persist)——活 session 上原生崩溃时文件保留断点。
3362
- */
3363
- export declare function probeRuntime(ctx: WrapperContext, file?: string): Record<string, unknown>;
3364
- /** 录制事件(JSONL 一行)。 */
3365
- interface ListenerRecordEvent {
3366
- /** ISO 时间戳。 */
3367
- ts: string;
3368
- /** 服务简称(Msg / Group / …;LoginService 例外,来自 exports 单例)。 */
3369
- service: string;
3370
- /** 回调名;陷阱观测用合成事件 `<get>` / `<has>` / `<ownKeys>` / `<registered>`。 */
3371
- event: string;
3372
- /** 回调入参(截断序列化)或注册附加信息。 */
3373
- args: unknown[];
3374
- }
3375
- /** 录制结果摘要(bootstrap 日志用)。 */
3376
- interface ListenerRecordingResult {
3377
- /** jsonl 产物绝对路径。 */
3378
- file: string;
3379
- /** 逐服务注册结果(ok=listenerId / error / null=服务 getter 返回空)。 */
3380
- registered: Record<string, {
3381
- ok: boolean;
3382
- listenerId?: number;
3383
- error?: string | null;
3384
- }>;
3385
- }
3386
- /**
3387
- * 构造万能监听器:Proxy get 陷阱对任意字符串属性返回记录函数(同时记录原生
3388
- * 查过的名字,即使从未调用);has / ownKeys 也记录(判定原生按名 Get 还是
3389
- * 枚举发现回调);非字符串键(Symbol,如 util.inspect 触发)放行默认行为。
3390
- */
3391
- export declare function createRecordingListener(service: string, onEvent: (record: ListenerRecordEvent) => void): object;
3392
- /**
3393
- * 启动 listener 录制:session 十服务 + LoginService(exports 单例)逐服务注册
3394
- * 万能监听器,JSONL 逐行追加。返回摘要;文件路径写入结果(bootstrap 日志用)。
3395
- *
3396
- * ⚠️ 调用时序约束:必须在任何探测(probeRuntime / getMainSession)之前调用——
3397
- * resolveMainFromStartup 会把空壳主 session 写回 ctx.session(session-resolver.ts),
3398
- * 空壳的 service getter 函数仍在但调用返回 null(late probe 61/63 null 的根因)。
3399
- */
3400
- export declare function startListenerRecording(ctx: WrapperContext, file?: string): ListenerRecordingResult;
3401
- /**
3402
- * QQ 数据根路径解析(P2-1,2026-08-06)
3403
- *
3404
- * 从 `getNTUserDataInfoConfig()` 的返回值中提取 QQ 真实数据根路径:
3405
- * worker(utilityProcess)模式下 loginService 是 new 的,commonPath 必须指向
3406
- * QQ 真实数据路径才能读到历史账号(cli 的 `.napuketto\default` 读不到,
3407
- * getLoginList 空,P2-1 实测)。
3408
- *
3409
- * 返回值形态可能是 JSON 字符串(对象/数组)或纯路径字符串,此处做宽容解析。
3410
- */
3411
- /**
3412
- * QQ 全局数据目录(commonPath / desktopGlobalPath = 数据根/nt_qq/global,
3413
- * HANDOVER-V6 自建宿主三要素之三,p0-kernel-flow 实证)。
3414
- *
3415
- * 防御:已含 nt_qq/global 后缀(worker 环境下 getNTUserDataInfoConfig 可能
3416
- * 返回完整路径)则不重复拼接,避免 `nt_qq/global/nt_qq/global` 错位。
3417
- */
3418
- export declare function resolveQqGlobalPath(root: string): string;
3419
- /**
3420
- * 复用 QQ 已有 session(P1-4:QQ 已登录,直接拿单例避免重复 init)。
3421
- * 优先 `NodeIQQNTWrapperSession.get()`;返回 null 时回退 createSession。
3422
- *
3423
- * @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(会写回 ctx.session)。
3424
- */
3425
- export declare function getExistingSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
3426
- /**
3427
- * 复用 QQ 主 session(P1-4 实测链路):
3428
- * `NodeIQQNTStartupSessionWrapper.create()` → `start()` → `getSessionIdList()`(Map
3429
- * {nt:"nt_3", gpro:"gpro_3"})→ `NodeIQQNTWrapperSession.getNTWrapperSession("nt_3")`。
3430
- * 注:实测这些 session 是空壳(核心 service null),真正可用的是 new + init(lifecycle.ts)。
3431
- *
3432
- * @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(纯查询语义,不改写 ctx.session)。
3433
- */
3434
- export declare function getMainSession(ctx: WrapperContext): NodeIQQNTWrapperSession | null;
3435
- /** NAPI 回调占位(方法存在即可被反射调用,无副作用)。 */
3436
- declare const noop: () => void;
3437
- /** NodeIGlobalAdapter 实现(engine.initWithDeskTopConfig 第二参)。 */
3438
- export declare class GlobalAdapter implements NodeIGlobalAdapter {
3439
- onLog: typeof noop;
3440
- onGetSrvCalTime: typeof noop;
3441
- onShowErrUITips: typeof noop;
3442
- fixPicImgType: typeof noop;
3443
- getAppSetting: typeof noop;
3444
- onInstallFinished: typeof noop;
3445
- onUpdateGeneralFlag: typeof noop;
3446
- onGetOfflineMsg: typeof noop;
3447
- }
3448
- /** NodeIDependsAdapter 实现(session.init 第二参)。 */
3449
- export declare class DependsAdapter implements NodeIDependsAdapter {
3450
- onMSFStatusChange: typeof noop;
3451
- onMSFSsoError: typeof noop;
3452
- getGroupCode: typeof noop;
3453
- }
3454
- /** NodeIDispatcherAdapter 实现(session.init 第三参)。 */
3455
- export declare class DispatcherAdapter implements NodeIDispatcherAdapter {
3456
- dispatchRequest: typeof noop;
3457
- dispatchCall: typeof noop;
3458
- dispatchCallWithJson: typeof noop;
3459
- }
3460
- /** 会话监听器选项。 */
3461
- interface SessionListenerOptions {
3462
- /** 事件日志回调(默认静默——boot 阶段事件对用户是噪音;调试时可传回调观察)。 */
3463
- onEvent?: ((name: string, ...args: unknown[]) => void) | undefined;
3464
- }
3465
- /**
3466
- * 创建会话监听器(默认静默,boot 阶段默认;login 模块接入后可覆盖)。
3467
- * 回调方法必须存在(NAPI 按方法名反射),但输出与否由调用方决定——
3468
- * onNTSessionCreate / onOpentelemetryInit 等对用户无信息量,默认不打 stdout。
3469
- */
3470
- export declare function createSessionListener(opts?: SessionListenerOptions): NodeIKernelSessionListener;
3471
- /** 创建登录监听器(占位,登录器接入时填充)。 */
3472
- export declare function createLoginListener(): KernelLoginListener;
3473
- /**
3474
- * 从 major.node 提取 appid(NapCat parseAppidFromMajorV2 的自研等价实现)。
3475
- * major.node 含 `QQAppId/` 标记后跟数字(腾讯工具链产物,实测确认)。
3476
- * 返回 null 表示解析失败(调用方应显式报错,不再回退硬编码 appid)。
3477
- */
3478
- export declare function parseAppidFromMajor(majorPath: string): string | null;
3479
- /**
3480
- * 解析 appid / qua(自研,参考 NapCat QQBasicInfoWrapper 思路但独立实现):
3481
- * appid 唯一来源 = major.node 提取(实测 9.9.33-51802 = 537376818)。
3482
- * majorPath 缺省或解析失败时抛 KernelError——不再静默回退过期 appid。
3483
- * majorPath 传 wrapper.node 同目录 major.node。
3484
- */
3485
- export declare function resolveAppidQua(fullVersion: string, majorPath?: string, platform?: PlatformType): {
3486
- appid: string;
3487
- qua: string;
3488
- };
3489
- /** 生成 engine 桌面配置(wrapper 契约字段)。majorPath 可选(缺失/解析失败会抛错)。 */
3490
- export declare function buildEngineConfig(fullVersion: string, dataPathGlobal: string, majorPath?: string, platform?: PlatformType): EnginInitDesktopConfig;
3491
- /** 生成登录初始化配置(externalVersion: false 与 NapCat 同款,扫码兼容关键)。 */
3492
- export declare function buildLoginConfig(appid: string, fullVersion: string, commonPath: string): Record<string, unknown>;
3493
- /** buildSessionConfig 参数。 */
3494
- interface SessionConfigOptions {
3495
- appid: string;
3496
- fullVersion: string;
3497
- selfUin: string;
3498
- selfUid: string;
3499
- accountPath: string;
3500
- downloadPath: string;
3501
- /** 设备指纹 guid(来自 loginService.getMachineGuid();缺省空串)。 */
3502
- machineGuid?: string | undefined;
3503
- /** 平台(缺省按 process.platform 探测;测试/联调可显式覆盖)。 */
3504
- platform?: PlatformType | undefined;
3505
- }
3506
- /** 生成 session 初始化配置(登录成功后调用)。 */
3507
- export declare function buildSessionConfig(options: SessionConfigOptions): WrapperSessionInitConfig;
3508
- /**
3509
- * 读取设备指纹 guid(wrapper.node 字符串分析实证,2026-08-12):
3510
- * NodeIKernelLoginService::getMachineGuid(0 参,返回机器 GUID 字符串)。
3511
- * 无 getMachineId 方法——TODO 里的方法名不存在,等价方法是 getMachineGuid。
3512
- * 失败(无该方法 / 调用抛错 / 返回值非字符串)兜底空串。
3513
- */
3514
- export declare function readMachineGuid(loginService: unknown): string;
3515
- /**
3516
- * QQ 安装目录探测(ADR-018)
3517
- *
3518
- * wrapper.node 路径随 QQ 版本变化:`<安装目录>/versions/<版本>/resources/app/wrapper.node`。
3519
- * 加载前必须知道版本(登录握手参数 appid/qua 与版本强相关)。
3520
- *
3521
- * 已实测确认(2026-08-05,QQ 9.9.31-49919):
3522
- * - 目录结构:versions/<9.9.31-49919>/resources/app/wrapper.node
3523
- * - 版本信息在 versions/<版本>/resources/app/package.json(name=qq-chat / version / buildVersion)
3524
- * - wrapper.node 是 C++ ABI 模块(非 N-API),导出 INTSessionShell 等符号
3525
- */
3526
- /** 解析 wrapper.node 绝对路径(按 ADR-018 目录约定)。 */
3527
- export declare function resolveWrapperPath(installDir: string, version: string): string;
3528
- /**
3529
- * 探测指定版本信息(校验 wrapper.node 存在)。
3530
- * 版本号不匹配目录时抛 NOT_FOUND(明确失败而非静默)。
3531
- */
3532
- export declare function resolveQQVersion(installDir: string, version: string): QQVersionInfo;
3533
- /** 扫描 versions 目录,取可加载的版本列表(按目录名倒序,最新在前)。 */
3534
- export declare function listQQVersions(installDir: string): string[];
3535
- /** QQ 版本信息。 */
3536
- interface QqVersionInfo {
3537
- /** 完整版本号,如 "9.9.31-49919"。 */
3538
- fullVersion: string;
3539
- /** 构建号,如 "49919"。 */
3540
- buildVersion: string;
3541
- /** wrapper.node 绝对路径。 */
3542
- wrapperPath: string;
3543
- /** 登录握手参数(P1 探测脚本产出,暂为空串)。 */
3544
- appid: string;
3545
- /** 登录握手参数(P1 探测脚本产出,暂为空串)。 */
3546
- qua: string;
3547
- }
3548
- /** @deprecated 使用 `QqVersionInfo`(缩写大小写统一为 `Qq`)。 */
3549
- type QQVersionInfo = QqVersionInfo;
3550
3567
  export { type BootEnv, type BuddyCacheEventChannel, type BuddyCacheListener, type BuddyCacheOptions, type BuddyCategory, type BuddyCoreInfo, type BuddyEventChannel, type BuddyListEntry, type BuddyListener, type BuddyProfileLikeResult, type BuddyReq, type CanonicalElement, type ConfigFormat, type ConfigOptions, type ConfigPathOptions, type ConfigSchema, type ConsoleFormatStreamOptions, type CoreContext, type CoreContextOptions, type CoreLoginOptions, type DesktopPathConfig, type DeviceInfo, type DoubtBuddyReq, type DoubtFriendRequestInfo, type EnginInitDesktopConfig, type EssenceAddedItem, type EssenceCacheEntry, type EssenceDiffResult, type EssenceListSyncDeps, type EssenceMsgItem, type FaceElement, type FileElement, type FlashTransferFileSet, type FlashTransferFileStatus, type FlashTransferPermission, type FlashTransferTarget, type FlashTransferTaskInfo, type FlashTransferUploadListener, type FlashTransferUploadOptions, type FlashTransferUploadResult, type ForceFetchClientKeyRetType, type Friend, type FriendApiOptions, type FriendCategory, type GeneralCallResult, type GetFileListParam, type GrayTipElement, type GrayTipRevokeElement, type Group, type GroupBulletin, type GroupCacheOptions, type GroupDetailInfo, type GroupEventChannel, type GroupFileItemInfo, type GroupFileListItem, type GroupFileSystemInfo, type GroupFolderInfo, type GroupHonorWebInfo, type GroupListener, type GroupMember, type GroupMemberListChange, type GroupNotify, type GroupRemainAtTimes, type GroupRequestKind, type GroupRequestRef, type GroupSpaceInfo, type HonorListItem, type IKernelLoginListener, type KernelErrorCode, type KernelLoginListener, type KernelRuntime, type KernelRuntimeOptions, type KickMemberInfo, type KickMemberV2Req, 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 LoginListener, type LoginProgress, type LoginResult, type LoginState, type MsgEventChannel, type MsgListener, type MsgReadReportItem, type MsgReceipt, 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 PendingGroupRequest, type PicElement, type PinnedContact, type PlatformType, type PttElement, type QQVersionContext, type QQVersionInfo, type QqDataRootOptions, type QqVersionContext, type QqVersionInfo, type QrCodeData, type QuickLoginOptions, type RDeliveryConfig, type RawElement, type RawMessage, type RecentContact, type RecentContactEventChannel, type RecentContactFetchParam, type RecentContactListChanged, type RecentContactListener, type ReplyElement, type SelfInfo, type SendMessageElement, type SessionConfigOptions, type SessionListenerOptions, type ShutUpGroupMember, type StartNapukettoOptions, type StrangerInfo, type TextElement, type TimestampMode, type TipAioOpGrayTipElement, type TipGroupElement, type UserDetailInfoByUin, type VendorType, type VideoElement, type WrapperContext, type WrapperNodeApi, type WrapperSessionInitConfig, createSessionListener as createLifecycleSessionListener };