@napuketto/kernel 0.12.3 → 0.13.0
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 +353 -67
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +423 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1197,6 +1197,8 @@ const ChatType = {
|
|
|
1197
1197
|
GUILD: 4,
|
|
1198
1198
|
C2C_TEMP: 100
|
|
1199
1199
|
};
|
|
1200
|
+
/** 视频缩略图在 thumbPath Map 中的 key(收向实测 Map<0, path>)。 */
|
|
1201
|
+
const VIDEO_THUMB_KEY = 0;
|
|
1200
1202
|
/** 灰色提示子类型(系统事件类型,QQ wrapper 契约)。 */
|
|
1201
1203
|
const GrayTipSubType = {
|
|
1202
1204
|
REVOKE: 1,
|
|
@@ -1607,6 +1609,13 @@ const GroupListUpdateType = {
|
|
|
1607
1609
|
/** 增量更新(合并到现有缓存)。 */
|
|
1608
1610
|
PARTIAL: 1
|
|
1609
1611
|
};
|
|
1612
|
+
/** 成员数据来源(onMemberInfoChange 第二参,说明书参考)。 */
|
|
1613
|
+
const GroupMemberDataSource = {
|
|
1614
|
+
/** 本地缓存。 */
|
|
1615
|
+
CACHE: 0,
|
|
1616
|
+
/** 网络拉取。 */
|
|
1617
|
+
NETWORK: 1
|
|
1618
|
+
};
|
|
1610
1619
|
// src/types/wrapper.ts
|
|
1611
1620
|
/**
|
|
1612
1621
|
* wrapper.node 的 NAPI 接口面(自研描述,非移植)
|
|
@@ -1660,10 +1669,12 @@ var GroupApi = class {
|
|
|
1660
1669
|
/**
|
|
1661
1670
|
* 群列表(force=true 触发原生刷新)。
|
|
1662
1671
|
*
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1665
|
-
*
|
|
1666
|
-
*
|
|
1672
|
+
* @remarks
|
|
1673
|
+
* ⚠️ 本方法**只触发底层事件推送,返回值恒为 `[]`**——原生 getGroupList
|
|
1674
|
+
* 返回仅 `{ result, errMsg }`,列表数据经 onGroupListUpdate 事件推送。
|
|
1675
|
+
* 需要群列表数组请改用 `GroupCache.listGroups()`(缓存快照)或
|
|
1676
|
+
* `GroupCache.listGroupsRefreshed()`(触发刷新并等待事件落地)。
|
|
1677
|
+
* @see GroupCache.listGroupsRefreshed
|
|
1667
1678
|
*/
|
|
1668
1679
|
async getGroupList(force = false) {
|
|
1669
1680
|
const raw = await this.service.getGroupList(force);
|
|
@@ -1741,7 +1752,12 @@ var GroupApi = class {
|
|
|
1741
1752
|
const raw = await this.service.kickMemberV2(req);
|
|
1742
1753
|
unwrap("kickMemberV2", raw.result, raw.errMsg);
|
|
1743
1754
|
}
|
|
1744
|
-
/**
|
|
1755
|
+
/**
|
|
1756
|
+
* 成员禁言。
|
|
1757
|
+
*
|
|
1758
|
+
* @param members 每项 `duration` 单位为**秒(s)**,`0` 表示解除禁言。
|
|
1759
|
+
* @throws {KernelError} 成员列表为空(INVALID_PARAM)或原生调用失败。
|
|
1760
|
+
*/
|
|
1745
1761
|
async setMemberShutUp(groupCode, members) {
|
|
1746
1762
|
if (members.length === 0) throw kernelError("setMemberShutUp 需要至少一个成员", "INVALID_PARAM");
|
|
1747
1763
|
const raw = await this.service.setMemberShutUp(groupCode, members.map((m) => ({
|
|
@@ -2374,21 +2390,30 @@ var MsgApi = class {
|
|
|
2374
2390
|
*/
|
|
2375
2391
|
confirmSend(channel, msgId, target) {
|
|
2376
2392
|
return new Promise((resolve, reject) => {
|
|
2393
|
+
let timer = null;
|
|
2394
|
+
const cleanup = () => {
|
|
2395
|
+
if (timer !== null) {
|
|
2396
|
+
clearTimeout(timer);
|
|
2397
|
+
timer = null;
|
|
2398
|
+
}
|
|
2399
|
+
off();
|
|
2400
|
+
};
|
|
2377
2401
|
const off = channel.on("Msg/onMsgInfoListUpdate", (list) => {
|
|
2378
2402
|
const mine = list.find((m) => m.guildId === msgId);
|
|
2379
2403
|
if (mine === void 0) return;
|
|
2380
2404
|
if (mine.sendStatus === SEND_STATUS.SUCCESS || mine.sendStatus === SEND_STATUS.SUCCESS_NO_SEQ) {
|
|
2381
|
-
|
|
2405
|
+
cleanup();
|
|
2382
2406
|
resolve(mine);
|
|
2383
2407
|
} else if (mine.sendStatus === SEND_STATUS.FAILED) {
|
|
2384
|
-
|
|
2408
|
+
cleanup();
|
|
2385
2409
|
reject(kernelError(`sendMsg 失败: sendStatus=${mine.sendStatus}`, "SEND_FAILED"));
|
|
2386
2410
|
}
|
|
2387
2411
|
});
|
|
2388
|
-
setTimeout(() => {
|
|
2389
|
-
|
|
2412
|
+
timer = setTimeout(() => {
|
|
2413
|
+
cleanup();
|
|
2390
2414
|
reject(kernelError(`sendMsg 等待确认超时(msgId=${msgId}, target=${JSON.stringify(target)})`, "SEND_FAILED"));
|
|
2391
2415
|
}, SEND_CONFIRM_TIMEOUT_MS);
|
|
2416
|
+
timer.unref?.();
|
|
2392
2417
|
});
|
|
2393
2418
|
}
|
|
2394
2419
|
/** 撤回消息(群聊管理员 / 私聊 2 分钟内)。 */
|
|
@@ -3173,6 +3198,14 @@ var FriendBridge = class {
|
|
|
3173
3198
|
this.service.removeKernelBuddyListener(this.listenerId);
|
|
3174
3199
|
this.listenerId = null;
|
|
3175
3200
|
}
|
|
3201
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3202
|
+
dispose() {
|
|
3203
|
+
this.unregister();
|
|
3204
|
+
}
|
|
3205
|
+
/** `using bridge = ...` 自动释放。 */
|
|
3206
|
+
[Symbol.dispose]() {
|
|
3207
|
+
this.unregister();
|
|
3208
|
+
}
|
|
3176
3209
|
};
|
|
3177
3210
|
// src/bridge/group-bridge.ts
|
|
3178
3211
|
/**
|
|
@@ -3211,6 +3244,14 @@ var GroupBridge = class {
|
|
|
3211
3244
|
this.service.removeKernelGroupListener(this.listenerId);
|
|
3212
3245
|
this.listenerId = null;
|
|
3213
3246
|
}
|
|
3247
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3248
|
+
dispose() {
|
|
3249
|
+
this.unregister();
|
|
3250
|
+
}
|
|
3251
|
+
/** `using bridge = ...` 自动释放。 */
|
|
3252
|
+
[Symbol.dispose]() {
|
|
3253
|
+
this.unregister();
|
|
3254
|
+
}
|
|
3214
3255
|
};
|
|
3215
3256
|
// src/bridge/login-bridge.ts
|
|
3216
3257
|
/**
|
|
@@ -3241,6 +3282,14 @@ var LoginBridge = class {
|
|
|
3241
3282
|
this.service.removeKernelLoginListener(this.listenerId);
|
|
3242
3283
|
this.listenerId = null;
|
|
3243
3284
|
}
|
|
3285
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3286
|
+
dispose() {
|
|
3287
|
+
this.unregister();
|
|
3288
|
+
}
|
|
3289
|
+
/** `using bridge = ...` 自动释放。 */
|
|
3290
|
+
[Symbol.dispose]() {
|
|
3291
|
+
this.unregister();
|
|
3292
|
+
}
|
|
3244
3293
|
};
|
|
3245
3294
|
// src/bridge/pic-path-grace.ts
|
|
3246
3295
|
/**
|
|
@@ -3322,7 +3371,7 @@ var MsgBridge = class {
|
|
|
3322
3371
|
this.channel.emit(event, msgs);
|
|
3323
3372
|
return;
|
|
3324
3373
|
}
|
|
3325
|
-
awaitPicLocalPaths(msgs).then(() => this.channel.emit(event, msgs));
|
|
3374
|
+
awaitPicLocalPaths(msgs).catch(() => void 0).then(() => this.channel.emit(event, msgs));
|
|
3326
3375
|
}
|
|
3327
3376
|
/** 注册原生监听(幂等)。 */
|
|
3328
3377
|
register() {
|
|
@@ -3345,6 +3394,14 @@ var MsgBridge = class {
|
|
|
3345
3394
|
this.service.removeKernelMsgListener(this.listenerId);
|
|
3346
3395
|
this.listenerId = null;
|
|
3347
3396
|
}
|
|
3397
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3398
|
+
dispose() {
|
|
3399
|
+
this.unregister();
|
|
3400
|
+
}
|
|
3401
|
+
/** `using bridge = ...` 自动释放。 */
|
|
3402
|
+
[Symbol.dispose]() {
|
|
3403
|
+
this.unregister();
|
|
3404
|
+
}
|
|
3348
3405
|
};
|
|
3349
3406
|
// src/bridge/recent-contact-bridge.ts
|
|
3350
3407
|
/**
|
|
@@ -3376,6 +3433,14 @@ var RecentContactBridge = class {
|
|
|
3376
3433
|
this.service.removeKernelRecentContactListener(this.listenerId);
|
|
3377
3434
|
this.listenerId = null;
|
|
3378
3435
|
}
|
|
3436
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3437
|
+
dispose() {
|
|
3438
|
+
this.unregister();
|
|
3439
|
+
}
|
|
3440
|
+
/** `using bridge = ...` 自动释放。 */
|
|
3441
|
+
[Symbol.dispose]() {
|
|
3442
|
+
this.unregister();
|
|
3443
|
+
}
|
|
3379
3444
|
};
|
|
3380
3445
|
// src/event-channel.ts
|
|
3381
3446
|
/**
|
|
@@ -3436,6 +3501,7 @@ var NTEventChannel = class {
|
|
|
3436
3501
|
cleanup();
|
|
3437
3502
|
reject(kernelError(`等待事件超时: ${event}`, "TIMEOUT"));
|
|
3438
3503
|
}, timeoutMs);
|
|
3504
|
+
timer.unref?.();
|
|
3439
3505
|
const cleanup = () => {
|
|
3440
3506
|
clearTimeout(timer);
|
|
3441
3507
|
this.emitter.removeListener(event, handler);
|
|
@@ -3461,20 +3527,33 @@ var NTEventChannel = class {
|
|
|
3461
3527
|
}
|
|
3462
3528
|
emit(event, ...args) {
|
|
3463
3529
|
for (const anyHandler of this.anyHandlers) try {
|
|
3464
|
-
anyHandler(event, ...args);
|
|
3530
|
+
const ret = anyHandler(event, ...args);
|
|
3531
|
+
this.catchAsyncListenerError(ret);
|
|
3465
3532
|
} catch (err) {
|
|
3466
3533
|
this.notifyError(err);
|
|
3467
3534
|
}
|
|
3468
3535
|
const listeners = this.emitter.listeners(event);
|
|
3469
3536
|
for (const listener of listeners) try {
|
|
3470
|
-
listener(...args);
|
|
3537
|
+
const ret = listener(...args);
|
|
3538
|
+
this.catchAsyncListenerError(ret);
|
|
3471
3539
|
} catch (err) {
|
|
3472
3540
|
this.notifyError(err);
|
|
3473
3541
|
}
|
|
3474
3542
|
}
|
|
3475
|
-
/**
|
|
3543
|
+
/**
|
|
3544
|
+
* 下游 async 监听器的 Promise 拒绝不会被 try/catch 捕获(会变成进程级
|
|
3545
|
+
* UnhandledRejection)——这里统一挂 catch 转发到 onError 兜底。
|
|
3546
|
+
*/
|
|
3547
|
+
catchAsyncListenerError(ret) {
|
|
3548
|
+
if (ret !== null && typeof ret === "object" && typeof ret.catch === "function") ret.catch((err) => {
|
|
3549
|
+
this.notifyError(err);
|
|
3550
|
+
});
|
|
3551
|
+
}
|
|
3552
|
+
/** 通知所有错误处理器(单个处理器异常不打断其他处理器)。 */
|
|
3476
3553
|
notifyError(err) {
|
|
3477
|
-
for (const handler of this.errorHandlers)
|
|
3554
|
+
for (const handler of this.errorHandlers) try {
|
|
3555
|
+
handler(err);
|
|
3556
|
+
} catch {}
|
|
3478
3557
|
}
|
|
3479
3558
|
/** 订阅错误通知(监听器抛出的异常 / 其他内部错误)。 */
|
|
3480
3559
|
onError(handler) {
|
|
@@ -3483,6 +3562,16 @@ var NTEventChannel = class {
|
|
|
3483
3562
|
this.errorHandlers.delete(handler);
|
|
3484
3563
|
};
|
|
3485
3564
|
}
|
|
3565
|
+
/** 清空全部监听器与错误处理器(幂等;Runtime 销毁时调用)。 */
|
|
3566
|
+
dispose() {
|
|
3567
|
+
this.emitter.removeAllListeners();
|
|
3568
|
+
this.errorHandlers.clear();
|
|
3569
|
+
this.anyHandlers.clear();
|
|
3570
|
+
}
|
|
3571
|
+
/** `using channel = ...` 自动清理。 */
|
|
3572
|
+
[Symbol.dispose]() {
|
|
3573
|
+
this.dispose();
|
|
3574
|
+
}
|
|
3486
3575
|
};
|
|
3487
3576
|
// src/cache/buddy-cache.ts
|
|
3488
3577
|
/**
|
|
@@ -3535,6 +3624,14 @@ var BuddyCache = class {
|
|
|
3535
3624
|
this.buddies.clear();
|
|
3536
3625
|
this.bootstrapped = false;
|
|
3537
3626
|
}
|
|
3627
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3628
|
+
dispose() {
|
|
3629
|
+
this.unregister();
|
|
3630
|
+
}
|
|
3631
|
+
/** `using cache = ...` 自动释放。 */
|
|
3632
|
+
[Symbol.dispose]() {
|
|
3633
|
+
this.unregister();
|
|
3634
|
+
}
|
|
3538
3635
|
/** 应用全量快照:首帧建 baseline,之后 diff 发布归一化事件。 */
|
|
3539
3636
|
applySnapshot(entries) {
|
|
3540
3637
|
if (!this.bootstrapped) {
|
|
@@ -3616,6 +3713,14 @@ var GroupCache = class {
|
|
|
3616
3713
|
this.members.clear();
|
|
3617
3714
|
this.inFlight.clear();
|
|
3618
3715
|
}
|
|
3716
|
+
/** 释放(等价 unregister,幂等)。 */
|
|
3717
|
+
dispose() {
|
|
3718
|
+
this.unregister();
|
|
3719
|
+
}
|
|
3720
|
+
/** `using cache = ...` 自动释放。 */
|
|
3721
|
+
[Symbol.dispose]() {
|
|
3722
|
+
this.unregister();
|
|
3723
|
+
}
|
|
3619
3724
|
/** 合并成员到该群缓存(uid → GroupMember)。 */
|
|
3620
3725
|
upsertMembers(groupCode, infos) {
|
|
3621
3726
|
let map = this.members.get(groupCode);
|
|
@@ -3853,14 +3958,22 @@ async function ensureLoginConnected(ctx, opts) {
|
|
|
3853
3958
|
function waitLoginConnected(raw, timeoutMs) {
|
|
3854
3959
|
return new Promise((resolve) => {
|
|
3855
3960
|
let settled = false;
|
|
3961
|
+
let listenerId = null;
|
|
3962
|
+
let timer = null;
|
|
3856
3963
|
const finish = () => {
|
|
3857
|
-
if (
|
|
3858
|
-
|
|
3859
|
-
|
|
3964
|
+
if (settled) return;
|
|
3965
|
+
settled = true;
|
|
3966
|
+
if (timer !== null) {
|
|
3967
|
+
clearTimeout(timer);
|
|
3968
|
+
timer = null;
|
|
3860
3969
|
}
|
|
3970
|
+
removeConnectListener(raw, listenerId);
|
|
3971
|
+
listenerId = null;
|
|
3972
|
+
resolve();
|
|
3861
3973
|
};
|
|
3862
|
-
tryRegisterConnectListener(raw, finish);
|
|
3863
|
-
setTimeout(finish, timeoutMs ?? NETWORK_READY_TIMEOUT_MS);
|
|
3974
|
+
listenerId = tryRegisterConnectListener(raw, finish);
|
|
3975
|
+
timer = setTimeout(finish, timeoutMs ?? NETWORK_READY_TIMEOUT_MS);
|
|
3976
|
+
timer.unref?.();
|
|
3864
3977
|
try {
|
|
3865
3978
|
raw.connect?.();
|
|
3866
3979
|
} catch {
|
|
@@ -3868,14 +3981,27 @@ function waitLoginConnected(raw, timeoutMs) {
|
|
|
3868
3981
|
}
|
|
3869
3982
|
});
|
|
3870
3983
|
}
|
|
3871
|
-
/**
|
|
3984
|
+
/**
|
|
3985
|
+
* 注册临时登录连接监听(失败不阻塞连接)。返回 listenerId(不可注册时为 null)。
|
|
3986
|
+
* 连接确认或超时后由 finish 统一 remove——软重登/多实例下不会堆积原生监听器。
|
|
3987
|
+
*/
|
|
3872
3988
|
function tryRegisterConnectListener(raw, finish) {
|
|
3873
3989
|
try {
|
|
3874
3990
|
const listener = createLoginListener();
|
|
3875
3991
|
listener.onLoginConnected = () => {
|
|
3876
3992
|
finish();
|
|
3877
3993
|
};
|
|
3878
|
-
if (typeof raw.addKernelLoginListener === "function") raw.addKernelLoginListener(listener);
|
|
3994
|
+
if (typeof raw.addKernelLoginListener === "function") return raw.addKernelLoginListener(listener);
|
|
3995
|
+
return null;
|
|
3996
|
+
} catch {
|
|
3997
|
+
return null;
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
/** 移除临时登录连接监听(无 remove 方法 / 抛错时静默——监听器随后续登录覆盖)。 */
|
|
4001
|
+
function removeConnectListener(raw, listenerId) {
|
|
4002
|
+
if (listenerId === null || typeof raw.removeKernelLoginListener !== "function") return;
|
|
4003
|
+
try {
|
|
4004
|
+
raw.removeKernelLoginListener(listenerId);
|
|
3879
4005
|
} catch {}
|
|
3880
4006
|
}
|
|
3881
4007
|
/**
|
|
@@ -4009,7 +4135,7 @@ const SESSION_READY_POLL_MS = 1e3;
|
|
|
4009
4135
|
* 也不自己 create(登录前 create() 干扰 QQ,实测 QQ 退出 code=0)。
|
|
4010
4136
|
* 正确做法:等 QQ 的 session 就绪(getMsgService 非 null = 核心 service 已挂载)。
|
|
4011
4137
|
*/
|
|
4012
|
-
async function waitSessionReady(ctx, opts) {
|
|
4138
|
+
async function waitSessionReady(ctx, opts = {}) {
|
|
4013
4139
|
const { session } = ctx;
|
|
4014
4140
|
if (session === null || session === void 0) throw kernelError("session 未创建", "INVALID_STATE");
|
|
4015
4141
|
if (!await waitFor(() => {
|
|
@@ -4023,7 +4149,7 @@ async function waitSessionReady(ctx, opts) {
|
|
|
4023
4149
|
}
|
|
4024
4150
|
/** 登录连接 + 快速登录(quickLogin 等)已拆到 login-connect.ts(见文件头 re-export)。 */
|
|
4025
4151
|
/** session 初始化(4 参全为普通 JS 对象,等 init 完成信号)。 */
|
|
4026
|
-
async function initAndStartSession(ctx, config, listener, opts) {
|
|
4152
|
+
async function initAndStartSession(ctx, config, listener = createSessionListener(), opts = {}) {
|
|
4027
4153
|
const { session } = ctx;
|
|
4028
4154
|
if (session === null || session === void 0) throw kernelError("session 未创建", "INVALID_STATE");
|
|
4029
4155
|
const depends = new DependsAdapter();
|
|
@@ -4242,6 +4368,153 @@ var QrLoginSession = class {
|
|
|
4242
4368
|
for (const cb of this.qrCodeHandlers) cb(qr);
|
|
4243
4369
|
}
|
|
4244
4370
|
};
|
|
4371
|
+
// src/runtime.ts
|
|
4372
|
+
/**
|
|
4373
|
+
* KernelRuntime:内核服务聚合(开箱即用装配 + 生命周期管理)
|
|
4374
|
+
*
|
|
4375
|
+
* 把「事件通道 → 原生桥 → 业务 API → 缓存」这套固定装配从 loader 下沉到
|
|
4376
|
+
* kernel,外部嵌入方只需一个 `createKernelRuntime({ session })` 即可拿到
|
|
4377
|
+
* 全部内核服务,无需理解桥/通道的注册顺序与依赖注入细节。
|
|
4378
|
+
*
|
|
4379
|
+
* 约定:
|
|
4380
|
+
* - `autoRegister` 默认 true(自动 register 全部桥与缓存);
|
|
4381
|
+
* - `dispose()` 幂等:一键 unregister 桥/缓存并 dispose 通道;
|
|
4382
|
+
* - `reportOnlineStatus` 默认 false(自建宿主建议 true:status=10 开启服务端
|
|
4383
|
+
* 实时消息推送,与 loader 引导链同款调用)。
|
|
4384
|
+
*/
|
|
4385
|
+
/** 在线状态契约值(与 loader 引导链一致:status=10 = 在线)。 */
|
|
4386
|
+
const ONLINE_STATUS = 10;
|
|
4387
|
+
/**
|
|
4388
|
+
* 装配内核运行时(同步;API 构造失败即抛 KernelError)。
|
|
4389
|
+
*
|
|
4390
|
+
* @param opts 装配参数(session 必填)
|
|
4391
|
+
* @returns 聚合了全部通道/桥/API/缓存的服务对象
|
|
4392
|
+
*/
|
|
4393
|
+
function createKernelRuntime(opts) {
|
|
4394
|
+
const { session } = opts;
|
|
4395
|
+
const msgChannel = new NTEventChannel("Msg");
|
|
4396
|
+
const groupChannel = new NTEventChannel("Group");
|
|
4397
|
+
const friendChannel = new NTEventChannel("Buddy");
|
|
4398
|
+
const recentContactChannel = new NTEventChannel("RecentContact");
|
|
4399
|
+
const loginChannel = new NTEventChannel("Login");
|
|
4400
|
+
const msgBridge = new MsgBridge(session, msgChannel);
|
|
4401
|
+
const groupBridge = new GroupBridge(session, groupChannel);
|
|
4402
|
+
const friendBridge = new FriendBridge(session, friendChannel);
|
|
4403
|
+
const recentContactBridge = createRecentContactBridge(session, recentContactChannel);
|
|
4404
|
+
const loginBridge = createLoginBridge(opts, loginChannel);
|
|
4405
|
+
const groupApi = new GroupApi(session);
|
|
4406
|
+
const msgApi = new MsgApi(session, msgChannel, wrapperUtilOf(opts.wrapperExports));
|
|
4407
|
+
const friendApi = new FriendApi(session, { uidToUin: (uids) => groupApi.uidToUin(uids) });
|
|
4408
|
+
const groupNotifyApi = new GroupNotifyApi(session);
|
|
4409
|
+
const ticketApi = new TicketApi(session);
|
|
4410
|
+
const richMediaApi = new RichMediaApi(session);
|
|
4411
|
+
const flashTransferApi = new FlashTransferApi(session);
|
|
4412
|
+
const recentContactApi = new RecentContactApi(session);
|
|
4413
|
+
const profileApi = new ProfileApi(session);
|
|
4414
|
+
const profileLikeApi = new ProfileLikeApi(session);
|
|
4415
|
+
const webApi = new WebApi({ getCookies: (domain) => ticketApi.getCookies(domain, opts.login?.uin ?? "") });
|
|
4416
|
+
const groupCache = new GroupCache({
|
|
4417
|
+
channel: groupChannel,
|
|
4418
|
+
groupApi
|
|
4419
|
+
});
|
|
4420
|
+
const buddyCache = new BuddyCache({
|
|
4421
|
+
channel: friendChannel,
|
|
4422
|
+
...opts.logger !== void 0 ? { logger: opts.logger } : {}
|
|
4423
|
+
});
|
|
4424
|
+
if (opts.autoRegister !== false) {
|
|
4425
|
+
msgBridge.register();
|
|
4426
|
+
groupBridge.register();
|
|
4427
|
+
friendBridge.register();
|
|
4428
|
+
recentContactBridge?.register();
|
|
4429
|
+
loginBridge?.register();
|
|
4430
|
+
groupCache.register();
|
|
4431
|
+
buddyCache.register();
|
|
4432
|
+
}
|
|
4433
|
+
if (opts.reportOnlineStatus === true) reportOnlineStatus(msgApi, opts.logger);
|
|
4434
|
+
let disposed = false;
|
|
4435
|
+
const dispose = () => {
|
|
4436
|
+
if (disposed) return;
|
|
4437
|
+
disposed = true;
|
|
4438
|
+
msgBridge.unregister();
|
|
4439
|
+
groupBridge.unregister();
|
|
4440
|
+
friendBridge.unregister();
|
|
4441
|
+
recentContactBridge?.unregister();
|
|
4442
|
+
loginBridge?.unregister();
|
|
4443
|
+
groupCache.unregister();
|
|
4444
|
+
buddyCache.unregister();
|
|
4445
|
+
msgChannel.dispose();
|
|
4446
|
+
groupChannel.dispose();
|
|
4447
|
+
friendChannel.dispose();
|
|
4448
|
+
recentContactChannel.dispose();
|
|
4449
|
+
loginChannel.dispose();
|
|
4450
|
+
};
|
|
4451
|
+
return {
|
|
4452
|
+
msgChannel,
|
|
4453
|
+
groupChannel,
|
|
4454
|
+
friendChannel,
|
|
4455
|
+
recentContactChannel,
|
|
4456
|
+
loginChannel,
|
|
4457
|
+
msgBridge,
|
|
4458
|
+
groupBridge,
|
|
4459
|
+
friendBridge,
|
|
4460
|
+
recentContactBridge,
|
|
4461
|
+
loginBridge,
|
|
4462
|
+
msgApi,
|
|
4463
|
+
groupApi,
|
|
4464
|
+
friendApi,
|
|
4465
|
+
groupNotifyApi,
|
|
4466
|
+
ticketApi,
|
|
4467
|
+
richMediaApi,
|
|
4468
|
+
flashTransferApi,
|
|
4469
|
+
recentContactApi,
|
|
4470
|
+
profileApi,
|
|
4471
|
+
profileLikeApi,
|
|
4472
|
+
webApi,
|
|
4473
|
+
groupCache,
|
|
4474
|
+
buddyCache,
|
|
4475
|
+
dispose,
|
|
4476
|
+
[Symbol.dispose]: dispose
|
|
4477
|
+
};
|
|
4478
|
+
}
|
|
4479
|
+
/** wrapper exports → util(支持直接传 exports 或 NodeQQNTWrapperUtil 本身)。 */
|
|
4480
|
+
function wrapperUtilOf(wrapperExports) {
|
|
4481
|
+
if (wrapperExports === void 0) return;
|
|
4482
|
+
return wrapperExports["NodeQQNTWrapperUtil"] ?? wrapperExports;
|
|
4483
|
+
}
|
|
4484
|
+
/** RecentContact 桥:老版本 wrapper 无 getRecentContactService 时跳过。 */
|
|
4485
|
+
function createRecentContactBridge(session, channel) {
|
|
4486
|
+
if (typeof session.getRecentContactService !== "function") return null;
|
|
4487
|
+
try {
|
|
4488
|
+
return new RecentContactBridge(session, channel);
|
|
4489
|
+
} catch {
|
|
4490
|
+
return null;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
/** Login 桥:仅当传入合法 loginService 时装配。 */
|
|
4494
|
+
function createLoginBridge(opts, channel) {
|
|
4495
|
+
const loginService = opts.loginService;
|
|
4496
|
+
if (loginService === void 0 || loginService === null) return null;
|
|
4497
|
+
try {
|
|
4498
|
+
return new LoginBridge(loginService, channel);
|
|
4499
|
+
} catch {
|
|
4500
|
+
return null;
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4503
|
+
/** 上报在线状态(失败仅告警:不影响收发链路其余部分)。 */
|
|
4504
|
+
function reportOnlineStatus(msgApi, logger) {
|
|
4505
|
+
msgApi.setOnlineStatus({
|
|
4506
|
+
status: ONLINE_STATUS,
|
|
4507
|
+
extStatus: 0,
|
|
4508
|
+
batteryStatus: 0,
|
|
4509
|
+
customStatus: {
|
|
4510
|
+
faceId: "",
|
|
4511
|
+
wording: "",
|
|
4512
|
+
faceType: "1"
|
|
4513
|
+
}
|
|
4514
|
+
}).catch((err) => {
|
|
4515
|
+
logger?.warn({ error: errorMessage(err) }, "KernelRuntime: 在线状态上报失败(实时消息推送可能不可用)");
|
|
4516
|
+
});
|
|
4517
|
+
}
|
|
4245
4518
|
// src/wrapper/qq-data-path.ts
|
|
4246
4519
|
/**
|
|
4247
4520
|
* QQ 数据根路径解析(P2-1,2026-08-06)
|
|
@@ -4579,7 +4852,7 @@ function readMachineGuid(loginService) {
|
|
|
4579
4852
|
function defaultEngineConfig(env, qqDataPath) {
|
|
4580
4853
|
const platform = detectPlatformType();
|
|
4581
4854
|
const fullVersion = env.qqVersion ?? "";
|
|
4582
|
-
const wrapperPath = process.env["NAPUKETTO_WRAPPER_PATH"] ?? process.env["NAPUTO_WRAPPER_PATH"] ?? "";
|
|
4855
|
+
const wrapperPath = env.wrapperPath ?? process.env["NAPUKETTO_WRAPPER_PATH"] ?? process.env["NAPUTO_WRAPPER_PATH"] ?? "";
|
|
4583
4856
|
const majorPath = wrapperPath !== "" ? join(dirname(wrapperPath), "major.node") : "";
|
|
4584
4857
|
const qua = (majorPath !== "" ? parseQuaFromMajor(majorPath) : null) ?? (fullVersion !== "" ? buildQua(fullVersion, platform) : "");
|
|
4585
4858
|
return {
|
|
@@ -4745,6 +5018,8 @@ function startNapuketto(options) {
|
|
|
4745
5018
|
prepareSession(ctx, hasCapturedSession, isSelfHost);
|
|
4746
5019
|
initEngine(ctx, resolveEngineConfig(ctx, env, engineConfig));
|
|
4747
5020
|
resolveLoginService(ctx, qqLoginService);
|
|
5021
|
+
ctx.wrapperPath = env?.wrapperPath ?? process.env["NAPUKETTO_WRAPPER_PATH"] ?? process.env["NAPUTO_WRAPPER_PATH"];
|
|
5022
|
+
if (isSelfHost) activateO3MiscService(wrapperExports);
|
|
4748
5023
|
finishSession(ctx, hasCapturedSession, isSelfHost, sessionConfig);
|
|
4749
5024
|
return ctx;
|
|
4750
5025
|
}
|
|
@@ -4824,18 +5099,25 @@ function dlopenWrapper(wrapperPath) {
|
|
|
4824
5099
|
if (!Object.keys(m.exports ?? {}).includes("NodeIKernelLoginService")) throw kernelError("exports 无 NodeIKernelLoginService(stub 环境异常?)", "INVALID_STATE");
|
|
4825
5100
|
return m.exports;
|
|
4826
5101
|
}
|
|
5102
|
+
/** 已激活 O3MiscService 的 exports(幂等标记,避免重复挂监听)。 */
|
|
5103
|
+
const ACTIVATED_O3_EXPORTS = /* @__PURE__ */ new WeakSet();
|
|
4827
5104
|
/**
|
|
4828
5105
|
* 激活自建宿主 O3MiscService 事件分发(三要素之二,V6 实测决定性):
|
|
4829
5106
|
* 不激活则 getLoginList 永不 resolve(挂起)。listener 用普通对象
|
|
4830
5107
|
* (getOnAmgomDataPiece 空实现,wrapper 契约回调)。
|
|
4831
5108
|
*
|
|
5109
|
+
* 幂等:同一 exports 重复调用只激活一次(已激活返回 true)。
|
|
5110
|
+
*
|
|
4832
5111
|
* @param wrapperExports dlopen 产出的 exports(缺失/版本变化时返回 false)
|
|
4833
5112
|
* @returns 是否成功激活
|
|
4834
5113
|
*/
|
|
4835
5114
|
function activateO3MiscService(wrapperExports) {
|
|
4836
|
-
|
|
5115
|
+
if (wrapperExports === void 0 || wrapperExports === null) return false;
|
|
5116
|
+
if (ACTIVATED_O3_EXPORTS.has(wrapperExports)) return true;
|
|
5117
|
+
const O3 = wrapperExports["NodeIO3MiscService"];
|
|
4837
5118
|
if (O3 && typeof O3.get === "function") {
|
|
4838
5119
|
O3.get().addO3MiscListener({ getOnAmgomDataPiece() {} });
|
|
5120
|
+
ACTIVATED_O3_EXPORTS.add(wrapperExports);
|
|
4839
5121
|
return true;
|
|
4840
5122
|
}
|
|
4841
5123
|
return false;
|
|
@@ -4865,6 +5147,10 @@ var NapukettoCore = class NapukettoCore {
|
|
|
4865
5147
|
ctx;
|
|
4866
5148
|
/** QR 登录会话句柄(登录期间非空;登录终态后清空)。refreshQr() 据此可达。 */
|
|
4867
5149
|
qrSession = null;
|
|
5150
|
+
/** 由 createRuntime() 装配的运行时服务集合(stop/dispose 时统一清理)。 */
|
|
5151
|
+
runtime = null;
|
|
5152
|
+
/** stop 幂等标记。 */
|
|
5153
|
+
stopped = false;
|
|
4868
5154
|
/** 由 create() 装配,不直接 new。 */
|
|
4869
5155
|
constructor(ctx) {
|
|
4870
5156
|
this.ctx = ctx;
|
|
@@ -4915,27 +5201,72 @@ var NapukettoCore = class NapukettoCore {
|
|
|
4915
5201
|
return wrapper;
|
|
4916
5202
|
}
|
|
4917
5203
|
/**
|
|
4918
|
-
*
|
|
4919
|
-
* loginService.initConfig → 登录(快速/QR)→
|
|
4920
|
-
* → 等 onOpentelemetryInit(is_init) 完成信号。成功后填 ctx.login。
|
|
5204
|
+
* 登录握手(wrapper 契约,2026-08-05 实测确认):
|
|
5205
|
+
* loginService.initConfig → 登录(快速/QR)→ 填 ctx.login 后返回。
|
|
4921
5206
|
*
|
|
4922
|
-
*
|
|
4923
|
-
*
|
|
4924
|
-
*
|
|
5207
|
+
* 默认**仅完成登录握手**,不做 session 初始化——QQ 登录后重建 session
|
|
5208
|
+
* (boot.cjs Proxy 捕获新实例并 setSession 替换),替换发生在 login 返回之后。
|
|
5209
|
+
* 需要一步完成会话初始化时:传 `activateSession: true`(登录成功后自动跑
|
|
5210
|
+
* accountPath → machineGuid → buildSessionConfig → initAndStartSession →
|
|
5211
|
+
* waitSessionReady),或随后手动调用 `core.activateSession()`。
|
|
4925
5212
|
*/
|
|
4926
5213
|
async login(opts) {
|
|
4927
5214
|
const { wrapper } = this.ctx;
|
|
4928
5215
|
if (wrapper === null) throw kernelError("wrapper 未装配,无法登录", "INVALID_STATE");
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
this.ctx.login = loginResult;
|
|
4933
|
-
return loginResult;
|
|
4934
|
-
}
|
|
4935
|
-
const loginResult = await this.loginQuickFirst(wrapper, opts);
|
|
5216
|
+
const appid = resolveCoreAppid(wrapper, opts.appid);
|
|
5217
|
+
this.initLoginConfig(wrapper, appid);
|
|
5218
|
+
const loginResult = opts.qrOnly === true ? await this.loginByQr(opts) : await this.loginQuickFirst(wrapper, opts);
|
|
4936
5219
|
this.ctx.login = loginResult;
|
|
5220
|
+
if (opts.activateSession === true) await this.activateSession({
|
|
5221
|
+
appid,
|
|
5222
|
+
...opts.initTimeoutMs !== void 0 ? { timeoutMs: opts.initTimeoutMs } : {}
|
|
5223
|
+
});
|
|
4937
5224
|
return loginResult;
|
|
4938
5225
|
}
|
|
5226
|
+
/**
|
|
5227
|
+
* 激活当前登录账号的 Session(先 init 后 startupSession.start,再等就绪)。
|
|
5228
|
+
*
|
|
5229
|
+
* 前置:必须已 `attachWrapper` 且 `login` 成功(否则 fail-fast INVALID_STATE)。
|
|
5230
|
+
* appid 未传时按 wrapperPath / 环境变量同目录 major.node 自动解析。
|
|
5231
|
+
* 幂等性由底层 init 语义决定:重复调用会再次 init(调用方自行保证只激活一次)。
|
|
5232
|
+
*/
|
|
5233
|
+
async activateSession(opts = {}) {
|
|
5234
|
+
const { wrapper } = this.ctx;
|
|
5235
|
+
const loginResult = this.ctx.login;
|
|
5236
|
+
if (wrapper === null || loginResult === null) throw kernelError("请先调用 core.attachWrapper() 与 core.login() 后再激活 session", "INVALID_STATE");
|
|
5237
|
+
const appid = resolveCoreAppid(wrapper, opts.appid);
|
|
5238
|
+
const accountPath = resolveSessionAccountPath(this.ctx, wrapper);
|
|
5239
|
+
await initAndStartSession(wrapper, buildSessionConfig({
|
|
5240
|
+
appid,
|
|
5241
|
+
fullVersion: wrapper.versionInfo.fullVersion,
|
|
5242
|
+
selfUin: loginResult.uin,
|
|
5243
|
+
selfUid: loginResult.uid,
|
|
5244
|
+
accountPath,
|
|
5245
|
+
downloadPath: this.ctx.paths.cacheDir,
|
|
5246
|
+
machineGuid: readMachineGuid(wrapper.loginService)
|
|
5247
|
+
}), createSessionListener(), { ...opts.timeoutMs !== void 0 ? { timeoutMs: opts.timeoutMs } : {} });
|
|
5248
|
+
await waitSessionReady(wrapper, { ...opts.readyTimeoutMs !== void 0 ? { timeoutMs: opts.readyTimeoutMs } : {} });
|
|
5249
|
+
this.ctx.logger.info({ account: loginResult.uin }, "Session 激活完成");
|
|
5250
|
+
}
|
|
5251
|
+
/**
|
|
5252
|
+
* 装配开箱即用的内核运行时服务(事件通道 + 桥 + 业务 API + 缓存聚合)。
|
|
5253
|
+
* 前置:wrapper 已 attach 且 session 非空(否则 fail-fast INVALID_STATE)。
|
|
5254
|
+
* dispose 由 `stop()` / `dispose()` 统一回收。
|
|
5255
|
+
*/
|
|
5256
|
+
createRuntime(opts = {}) {
|
|
5257
|
+
const wrapper = this.ctx.wrapper;
|
|
5258
|
+
const session = wrapper?.session;
|
|
5259
|
+
if (wrapper === null || session === null || session === void 0) throw kernelError("请先调用 core.attachWrapper() 且 session 非空后再创建运行时", "INVALID_STATE");
|
|
5260
|
+
const runtime = createKernelRuntime({
|
|
5261
|
+
...opts,
|
|
5262
|
+
loginService: opts.loginService ?? wrapper.loginService,
|
|
5263
|
+
session,
|
|
5264
|
+
login: this.ctx.login,
|
|
5265
|
+
wrapperExports: wrapper.exports
|
|
5266
|
+
});
|
|
5267
|
+
this.runtime = runtime;
|
|
5268
|
+
return runtime;
|
|
5269
|
+
}
|
|
4939
5270
|
/** 快速登录优先,失败按 qrFallback 决定是否回退 QR(QR 应直接出码,见 loginByQr 注)。 */
|
|
4940
5271
|
async loginQuickFirst(wrapper, opts) {
|
|
4941
5272
|
try {
|
|
@@ -5027,11 +5358,58 @@ var NapukettoCore = class NapukettoCore {
|
|
|
5027
5358
|
this.ctx.logger.info({ state }, "QR 登录状态");
|
|
5028
5359
|
opts.onLoginProgress?.(qrProgressEvent(state, session.failureReason ?? void 0));
|
|
5029
5360
|
}
|
|
5030
|
-
/**
|
|
5361
|
+
/**
|
|
5362
|
+
* 停止:幂等清理 QR 会话 + 已装配的运行时服务(桥/缓存/通道)后日志收尾。
|
|
5363
|
+
* 重复调用直接返回(宿主关停钩子可能同时触发多次)。
|
|
5364
|
+
*/
|
|
5031
5365
|
stop() {
|
|
5366
|
+
if (this.stopped) return;
|
|
5367
|
+
this.stopped = true;
|
|
5368
|
+
this.qrSession?.stop();
|
|
5369
|
+
this.qrSession = null;
|
|
5370
|
+
this.runtime?.dispose();
|
|
5371
|
+
this.runtime = null;
|
|
5032
5372
|
this.ctx.logger.info("NapukettoCore 停止");
|
|
5033
5373
|
}
|
|
5374
|
+
/** 显式释放(`using` / 手动调用的统一入口;等价 stop)。 */
|
|
5375
|
+
dispose() {
|
|
5376
|
+
this.stop();
|
|
5377
|
+
}
|
|
5378
|
+
/** `using core = ...` 自动释放。 */
|
|
5379
|
+
[Symbol.dispose]() {
|
|
5380
|
+
this.stop();
|
|
5381
|
+
}
|
|
5034
5382
|
};
|
|
5383
|
+
/** wrapperPath 候选环境变量(优先级从高到低)。 */
|
|
5384
|
+
const WRAPPER_PATH_ENV_KEYS = ["NAPUKETTO_WRAPPER_PATH", "NAPUTO_WRAPPER_PATH"];
|
|
5385
|
+
/** 解析 wrapperPath:wrapper 上下文优先,其次环境变量。 */
|
|
5386
|
+
function resolveWrapperPath$1(wrapper) {
|
|
5387
|
+
if (wrapper.wrapperPath !== void 0 && wrapper.wrapperPath !== "") return wrapper.wrapperPath;
|
|
5388
|
+
for (const key of WRAPPER_PATH_ENV_KEYS) {
|
|
5389
|
+
const value = process.env[key];
|
|
5390
|
+
if (value !== void 0 && value !== "") return value;
|
|
5391
|
+
}
|
|
5392
|
+
}
|
|
5393
|
+
/**
|
|
5394
|
+
* appid 解析:显式传入优先;否则从 wrapperPath 同目录 major.node 解析。
|
|
5395
|
+
* 仍无法解析时抛清晰的 INVALID_PARAM(不静默回退过期 appid)。
|
|
5396
|
+
*/
|
|
5397
|
+
function resolveCoreAppid(wrapper, explicit) {
|
|
5398
|
+
if (explicit !== void 0 && explicit !== "") return explicit;
|
|
5399
|
+
const wrapperPath = resolveWrapperPath$1(wrapper);
|
|
5400
|
+
if (wrapperPath !== void 0) try {
|
|
5401
|
+
return resolveAppidQua(wrapper.versionInfo.fullVersion, join(dirname(wrapperPath), "major.node")).appid;
|
|
5402
|
+
} catch {}
|
|
5403
|
+
throw kernelError("未提供 appid 且无法自动定位 major.node,请在 CoreLoginOptions.appid 或 BootEnv.wrapperPath 中指定", "INVALID_PARAM");
|
|
5404
|
+
}
|
|
5405
|
+
/**
|
|
5406
|
+
* session 数据目录:worker/自建宿主优先 QQ 真实数据目录(数据根/nt_qq/global),
|
|
5407
|
+
* 否则回退账号目录(与 loader bootstrap-core 的激活路径同口径)。
|
|
5408
|
+
*/
|
|
5409
|
+
function resolveSessionAccountPath(ctx, wrapper) {
|
|
5410
|
+
const root = resolveQqUserDataRoot(wrapper.exports, { dataRoot: ctx.paths.root });
|
|
5411
|
+
return root !== null ? resolveQqGlobalPath(root) : ctx.paths.accountDir;
|
|
5412
|
+
}
|
|
5035
5413
|
/** 写二维码 png 到磁盘(base64 解码,供 cli/用户扫码)。 */
|
|
5036
5414
|
function writeQrCodePng(filePath, pngBase64) {
|
|
5037
5415
|
try {
|
|
@@ -5113,6 +5491,8 @@ function resolveMainSession(created, getNTWrapperSession) {
|
|
|
5113
5491
|
/**
|
|
5114
5492
|
* 复用 QQ 已有 session(P1-4:QQ 已登录,直接拿单例避免重复 init)。
|
|
5115
5493
|
* 优先 `NodeIQQNTWrapperSession.get()`;返回 null 时回退 createSession。
|
|
5494
|
+
*
|
|
5495
|
+
* @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(会写回 ctx.session)。
|
|
5116
5496
|
*/
|
|
5117
5497
|
function getExistingSession(ctx) {
|
|
5118
5498
|
const got = trySessionGet(ctx);
|
|
@@ -5138,6 +5518,8 @@ function trySessionGet(ctx) {
|
|
|
5138
5518
|
* `NodeIQQNTStartupSessionWrapper.create()` → `start()` → `getSessionIdList()`(Map
|
|
5139
5519
|
* {nt:"nt_3", gpro:"gpro_3"})→ `NodeIQQNTWrapperSession.getNTWrapperSession("nt_3")`。
|
|
5140
5520
|
* 注:实测这些 session 是空壳(核心 service null),真正可用的是 new + init(lifecycle.ts)。
|
|
5521
|
+
*
|
|
5522
|
+
* @internal 仅供 probe 诊断参考,请勿在业务装配中直接调用(纯查询语义,不改写 ctx.session)。
|
|
5141
5523
|
*/
|
|
5142
5524
|
function getMainSession(ctx) {
|
|
5143
5525
|
try {
|
|
@@ -5154,9 +5536,7 @@ function resolveMainFromStartup(ctx) {
|
|
|
5154
5536
|
const created = startupRaw.create();
|
|
5155
5537
|
if (!created) return null;
|
|
5156
5538
|
const getSession = (id) => sessionCtor.getNTWrapperSession(id);
|
|
5157
|
-
|
|
5158
|
-
if (session !== null) ctx.session = session;
|
|
5159
|
-
return session;
|
|
5539
|
+
return resolveMainSession(created, getSession);
|
|
5160
5540
|
}
|
|
5161
5541
|
// src/wrapper/probe/probe-serialize.ts
|
|
5162
5542
|
/**
|
|
@@ -5909,6 +6289,6 @@ function listQQVersions(installDir) {
|
|
|
5909
6289
|
return statSync(full).isDirectory() && existsSync(join(full, "resources", "app", "wrapper.node"));
|
|
5910
6290
|
}).sort().reverse();
|
|
5911
6291
|
}
|
|
5912
|
-
export { BuddyCache, ChatType, ConfigBase, ConfigError, DEFAULT_DATA_ROOT_NAME, EXIT_CONFIG_INVALID, ElementType, FlashTransferApi, FriendApi, FriendBridge, GrayTipSubType, GroupApi, GroupBridge, GroupCache, GroupListUpdateType, GroupNotifyApi, GroupNotifyMsgStatus, GroupNotifyMsgType, KERNEL_ERROR_CODES, KernelError, LoginBridge, MAIN_CONFIG_FILE, MsgApi, MsgBridge, NTEventChannel, NTGroupMemberRole, NTGroupRequestOperateTypes, NapukettoCore, PathWrapper, ProfileApi, ProfileLikeApi, QrLoginSession, RecentContactApi, RecentContactBridge, RichMediaApi, TicketApi, TipGroupElementType, WebApi, WebHonorType, activateO3MiscService, buildEngineConfig, buildLoginConfig, buildSessionConfig, configError, createCoreContext, createSessionListener as createLifecycleSessionListener, createSessionListener, createLogger, createLoginListener, createRecordingListener, createSession, createWrapper, dlopenWrapper, electronProcessType, errorMessage, 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 };
|
|
6292
|
+
export { BuddyCache, ChatType, ConfigBase, ConfigError, DEFAULT_DATA_ROOT_NAME, DependsAdapter, DispatcherAdapter, EXIT_CONFIG_INVALID, ElementType, FlashTransferApi, FriendApi, FriendBridge, GlobalAdapter, GrayTipSubType, GroupApi, GroupBridge, GroupCache, GroupListUpdateType, GroupMemberDataSource, GroupNotifyApi, GroupNotifyMsgStatus, GroupNotifyMsgType, KERNEL_ERROR_CODES, KernelError, LoginBridge, MAIN_CONFIG_FILE, MsgApi, MsgBridge, NTEventChannel, NTGroupMemberRole, NTGroupRequestOperateTypes, NapukettoCore, PathWrapper, ProfileApi, ProfileLikeApi, QrLoginSession, RecentContactApi, RecentContactBridge, RichMediaApi, TicketApi, TipGroupElementType, VIDEO_THUMB_KEY, WebApi, WebHonorType, activateO3MiscService, buildEngineConfig, buildLoginConfig, buildSessionConfig, configError, createConsoleFormatStream, createCoreContext, createKernelRuntime, createSessionListener as createLifecycleSessionListener, createSessionListener, createLogger, createLoginListener, createRecordingListener, createSession, createWrapper, dlopenWrapper, electronProcessType, errorMessage, getExistingSession, getMainSession, initAndStartSession, initEngine, initSession, isKernelError, kernelError, listLoginAccounts, listQQVersions, narrowBuddyCategories, parseAppidFromMajor, parseLogConfig, parseToml, probeRuntime, quickLogin, readMachineGuid, resolveAppidQua, resolveConfigPath, resolveDataRoot, resolveQQVersion, resolveQqGlobalPath, resolveQqUserDataRoot, resolveWrapperPath, sleep, startListenerRecording, startNapuketto, startSession, stringifyToml, toCanonicalElements, toSendElements, waitFor, waitForNetworkConnection, waitSessionReady };
|
|
5913
6293
|
|
|
5914
6294
|
//# sourceMappingURL=index.mjs.map
|