@napuketto/adapter 0.4.2 → 0.6.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.
@@ -0,0 +1,43 @@
1
+ //#region src/core/uid-uin.ts
2
+ /**
3
+ * uid → uin 解析(OB11 / Milky 请求与通知翻译共用,P1 2026-10-30 收敛)
4
+ *
5
+ * uidToUin 批量映射由调用方取得后传入;映射缺省退化为 uid 数值(wrapper 部分回调
6
+ * 直接给 uin),非数字返回 0(调用方按 0 兜底展示)。
7
+ *
8
+ * request 事件翻译上下文与毫秒换算常量随本模块共享(OB11 / Milky request 同构)。
9
+ */
10
+ /** 毫秒 → 秒(Unix 时间戳换算)。 */
11
+ const MS_TO_SEC = 1e3;
12
+ /** uid → uin(映射命中取 uin,未命中退化 uid 数值,非数字返回 0)。 */
13
+ function resolveUin(uid, uidToUin) {
14
+ if (uid === void 0 || uid === "") return 0;
15
+ const uin = uidToUin.get(uid);
16
+ if (uin !== void 0) return Number(uin);
17
+ const n = Number(uid);
18
+ return Number.isFinite(n) ? n : 0;
19
+ }
20
+ //#endregion
21
+ //#region src/core/buddy-req.ts
22
+ /** BuddyReq 防御性收窄:仅接受字段形状可用的对象。 */
23
+ function isBuddyReqLike(value) {
24
+ if (typeof value !== "object" || value === null) return false;
25
+ const v = value;
26
+ return typeof v["reqTime"] === "string" && typeof v["friendUid"] === "string";
27
+ }
28
+ /**
29
+ * onBuddyReqChange 回调参数 → BuddyReq 列表(防御性收窄)。
30
+ * 已知候选形状:BuddyReq[] / { buddyReqs: BuddyReq[] };其余返回 null。
31
+ */
32
+ function narrowBuddyReqs(arg) {
33
+ if (Array.isArray(arg)) return arg.every(isBuddyReqLike) ? arg : null;
34
+ if (typeof arg === "object" && arg !== null) {
35
+ const reqs = arg["buddyReqs"];
36
+ if (Array.isArray(reqs) && reqs.every(isBuddyReqLike)) return reqs;
37
+ }
38
+ return null;
39
+ }
40
+ //#endregion
41
+ export { MS_TO_SEC as n, resolveUin as r, narrowBuddyReqs as t };
42
+
43
+ //# sourceMappingURL=buddy-req-Q7Q4bVuz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buddy-req-Q7Q4bVuz.mjs","names":[],"sources":["../src/core/uid-uin.ts","../src/core/buddy-req.ts"],"sourcesContent":["/**\n * uid → uin 解析(OB11 / Milky 请求与通知翻译共用,P1 2026-10-30 收敛)\n *\n * uidToUin 批量映射由调用方取得后传入;映射缺省退化为 uid 数值(wrapper 部分回调\n * 直接给 uin),非数字返回 0(调用方按 0 兜底展示)。\n *\n * request 事件翻译上下文与毫秒换算常量随本模块共享(OB11 / Milky request 同构)。\n */\n\n/** 毫秒 → 秒(Unix 时间戳换算)。 */\nexport const MS_TO_SEC = 1000;\n\n/** request 事件翻译上下文(uid→uin 映射,调用方批量转换)。 */\nexport interface RequestTranslateContext {\n selfUin: string;\n uidToUin: Map<string, string>;\n}\n\n/** uid → uin(映射命中取 uin,未命中退化 uid 数值,非数字返回 0)。 */\nexport function resolveUin(uid: string | undefined, uidToUin: Map<string, string>): number {\n if (uid === undefined || uid === \"\") {\n return 0;\n }\n const uin = uidToUin.get(uid);\n if (uin !== undefined) {\n return Number(uin);\n }\n const n = Number(uid);\n return Number.isFinite(n) ? n : 0;\n}\n","/**\n * BuddyReq 防御收窄(OB11 / Milky 共用,P1 2026-10-30 从 onebot11 收敛)\n *\n * onBuddyReqChange 回调参数形状未经真实事件校准(wrapper 字符串证据仅有方法名),\n * 仅接受字段形状可用的对象;未知形状返回 null 由调用方打 raw 日志积累校准数据。\n */\nimport type { BuddyReq } from \"@napuketto/kernel\";\n\n/** BuddyReq 防御性收窄:仅接受字段形状可用的对象。 */\nexport function isBuddyReqLike(value: unknown): value is BuddyReq {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n const v = value as Record<string, unknown>;\n return typeof v[\"reqTime\"] === \"string\" && typeof v[\"friendUid\"] === \"string\";\n}\n\n/**\n * onBuddyReqChange 回调参数 → BuddyReq 列表(防御性收窄)。\n * 已知候选形状:BuddyReq[] / { buddyReqs: BuddyReq[] };其余返回 null。\n */\nexport function narrowBuddyReqs(arg: unknown): BuddyReq[] | null {\n if (Array.isArray(arg)) {\n return arg.every(isBuddyReqLike) ? (arg as BuddyReq[]) : null;\n }\n if (typeof arg === \"object\" && arg !== null) {\n const reqs = (arg as Record<string, unknown>)[\"buddyReqs\"];\n if (Array.isArray(reqs) && reqs.every(isBuddyReqLike)) {\n return reqs as BuddyReq[];\n }\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,YAAY;;AASzB,SAAgB,WAAW,KAAyB,UAAuC;CACvF,IAAI,QAAQ,KAAA,KAAa,QAAQ,IAC7B,OAAO;CAEX,MAAM,MAAM,SAAS,IAAI,GAAG;CAC5B,IAAI,QAAQ,KAAA,GACR,OAAO,OAAO,GAAG;CAErB,MAAM,IAAI,OAAO,GAAG;CACpB,OAAO,OAAO,SAAS,CAAC,IAAI,IAAI;AACpC;;;;ACpBA,SAAgB,eAAe,OAAmC;CAC9D,IAAI,OAAO,UAAU,YAAY,UAAU,MACvC,OAAO;CAEX,MAAM,IAAI;CACV,OAAO,OAAO,EAAE,eAAe,YAAY,OAAO,EAAE,iBAAiB;AACzE;;;;;AAMA,SAAgB,gBAAgB,KAAiC;CAC7D,IAAI,MAAM,QAAQ,GAAG,GACjB,OAAO,IAAI,MAAM,cAAc,IAAK,MAAqB;CAE7D,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM;EACzC,MAAM,OAAQ,IAAgC;EAC9C,IAAI,MAAM,QAAQ,IAAI,KAAK,KAAK,MAAM,cAAc,GAChD,OAAO;CAEf;CACA,OAAO;AACX"}
@@ -0,0 +1,33 @@
1
+ //#region src/core/gray-tip.ts
2
+ /** 非空 uid 才加入集合。 */
3
+ function collectUids(uids, ...candidates) {
4
+ for (const uid of candidates) if (uid !== void 0 && uid !== "") uids.add(uid);
5
+ }
6
+ /** 收集 grayTip 涉及的 uid(批量 uidToUin 用)。 */
7
+ function collectGrayTipUids(msg) {
8
+ const uids = /* @__PURE__ */ new Set();
9
+ for (const el of msg.elements) {
10
+ const g = el.grayTipElement;
11
+ if (g === void 0) continue;
12
+ collectUids(uids, g.revokeElement?.operatorUid, g.aioOpGrayTipElement?.peerUid);
13
+ const grp = g.groupElement;
14
+ if (grp === void 0) continue;
15
+ collectUids(uids, grp.memberUid, grp.adminUid, grp.shutUp?.admin?.uid, grp.shutUp?.member?.uid);
16
+ }
17
+ return [...uids];
18
+ }
19
+ /**
20
+ * 第一条「已挂载但不可翻译」的 grayTip 元素(校准日志入口)。
21
+ * 与 OB11 / Milky notice 翻译共用:翻译函数返回 null 时用本函数定位元素打 raw
22
+ * 日志,两协议的日志口径一致(跳过 REVOKE——撤回翻译独立成事件)。
23
+ */
24
+ function firstUntranslatedGrayTip(msg) {
25
+ for (const el of msg.elements) {
26
+ const g = el.grayTipElement;
27
+ if (g !== void 0 && g.revokeElement === void 0) return g;
28
+ }
29
+ }
30
+ //#endregion
31
+ export { firstUntranslatedGrayTip as n, collectGrayTipUids as t };
32
+
33
+ //# sourceMappingURL=gray-tip-LwBee5mo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gray-tip-LwBee5mo.mjs","names":[],"sources":["../src/core/gray-tip.ts"],"sourcesContent":["/**\n * grayTip 元素工具(OB11 / Satori 共用,2026-08-08 克隆合并)\n *\n * grayTip(系统提示消息)涉及的操作者/成员 uid 需要批量 uid→uin 转换,\n * 两协议翻译层共用同一套收集逻辑。\n */\nimport type { GrayTipElement, RawMessage } from \"@napuketto/kernel\";\n\n/** 非空 uid 才加入集合。 */\nfunction collectUids(uids: Set<string>, ...candidates: Array<string | undefined>): void {\n for (const uid of candidates) {\n if (uid !== undefined && uid !== \"\") {\n uids.add(uid);\n }\n }\n}\n\n/** 收集 grayTip 涉及的 uid(批量 uidToUin 用)。 */\nexport function collectGrayTipUids(msg: RawMessage): string[] {\n const uids = new Set<string>();\n for (const el of msg.elements) {\n const g = el.grayTipElement;\n if (g === undefined) {\n continue;\n }\n collectUids(uids, g.revokeElement?.operatorUid, g.aioOpGrayTipElement?.peerUid);\n const grp = g.groupElement;\n if (grp === undefined) {\n continue;\n }\n collectUids(\n uids,\n grp.memberUid,\n grp.adminUid,\n grp.shutUp?.admin?.uid,\n grp.shutUp?.member?.uid,\n );\n }\n return [...uids];\n}\n\n/**\n * 第一条「已挂载但不可翻译」的 grayTip 元素(校准日志入口)。\n * 与 OB11 / Milky notice 翻译共用:翻译函数返回 null 时用本函数定位元素打 raw\n * 日志,两协议的日志口径一致(跳过 REVOKE——撤回翻译独立成事件)。\n */\nexport function firstUntranslatedGrayTip(msg: RawMessage): GrayTipElement | undefined {\n for (const el of msg.elements) {\n const g = el.grayTipElement;\n if (g !== undefined && g.revokeElement === undefined) {\n return g;\n }\n }\n return undefined;\n}\n"],"mappings":";;AASA,SAAS,YAAY,MAAmB,GAAG,YAA6C;CACpF,KAAK,MAAM,OAAO,YACd,IAAI,QAAQ,KAAA,KAAa,QAAQ,IAC7B,KAAK,IAAI,GAAG;AAGxB;;AAGA,SAAgB,mBAAmB,KAA2B;CAC1D,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,MAAM,IAAI,UAAU;EAC3B,MAAM,IAAI,GAAG;EACb,IAAI,MAAM,KAAA,GACN;EAEJ,YAAY,MAAM,EAAE,eAAe,aAAa,EAAE,qBAAqB,OAAO;EAC9E,MAAM,MAAM,EAAE;EACd,IAAI,QAAQ,KAAA,GACR;EAEJ,YACI,MACA,IAAI,WACJ,IAAI,UACJ,IAAI,QAAQ,OAAO,KACnB,IAAI,QAAQ,QAAQ,GACxB;CACJ;CACA,OAAO,CAAC,GAAG,IAAI;AACnB;;;;;;AAOA,SAAgB,yBAAyB,KAA6C;CAClF,KAAK,MAAM,MAAM,IAAI,UAAU;EAC3B,MAAM,IAAI,GAAG;EACb,IAAI,MAAM,KAAA,KAAa,EAAE,kBAAkB,KAAA,GACvC,OAAO;CAEf;AAEJ"}
@@ -1,5 +1,5 @@
1
1
  import { r as BaseProtocolAdapter } from "../core-DyXyDUcU.mjs";
2
- import { t as forEachRawMessage } from "../raw-message-6KdlG8kR.mjs";
2
+ import { t as forEachRawMessage } from "../raw-message-D_ecJy4C.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { ChatType, toCanonicalElements } from "@napuketto/kernel";
5
5
  import { z } from "zod";
@@ -0,0 +1,236 @@
1
+ import { i as ProtocolConfig, n as BaseProtocolAdapter, s as ActionRegistry } from "../index-CDKj-jus.mjs";
2
+ import { BuddyEventChannel, ChatType, FriendApi, GroupApi, GroupCache, GroupEventChannel, GroupNotifyApi, KernelErrorCode, MsgApi, MsgEventChannel, Peer, ProfileApi, ProfileLikeApi, RawMessage, RichMediaApi, TicketApi, WebApi } from "@napuketto/kernel";
3
+ import { ZodType, z } from "zod";
4
+ import { EventBroadcaster, TransportAdapter } from "@napuketto/network";
5
+ //#region src/milky/helper/seq-index.d.ts
6
+ /** 合并转发 resId → 定位信息(get_forwarded_messages 取 peer 用)。 */
7
+ interface ForwardEntry {
8
+ chatType: ChatType;
9
+ peerUid: string;
10
+ msgId: string;
11
+ }
12
+ declare class MessageSeqIndex {
13
+ /** `${chatType}:${peerUid}:${seq}` → msgId。 */
14
+ private readonly seqToMsg;
15
+ /** msgId → seq 元信息。 */
16
+ private readonly msgToMeta;
17
+ /** 合并转发 resId → 定位信息(P1:get_forwarded_messages)。 */
18
+ private readonly forwards;
19
+ /** 接收链路登记(一条消息双向写入;重复 msgId 覆盖)。 */
20
+ record(msg: RawMessage): void;
21
+ /** seq → msgId(反查;未登记返回 undefined)。 */
22
+ resolveMsgId(chatType: ChatType, peerUid: string, seq: number): string | undefined;
23
+ /**
24
+ * 批量回填 reply 引用元信息(msgId → Milky reply 段 data 所需三元组)。
25
+ * 未命中的 id 不进表(翻译层按 0 兜底)。
26
+ */
27
+ collectReplyMeta(msgIds: string[]): Map<string, {
28
+ messageSeq: number;
29
+ senderId: number;
30
+ time: number;
31
+ }>;
32
+ /** key 规则(chatType 数值 + peerUid + seq;peerUid 群聊=群号,C2C=uid)。 */
33
+ private key;
34
+ /**
35
+ * 登记合并转发(接收链路:消息含 multiForwardMsgElement 时调用)。
36
+ * resId 是 Milky forward_id 的来源;同一 resId 重复覆盖。
37
+ */
38
+ recordForward(resId: string, entry: ForwardEntry): void;
39
+ /** resId → 转发定位(get_forwarded_messages;未登记返回 undefined)。 */
40
+ resolveForward(resId: string): ForwardEntry | undefined;
41
+ /** FIFO 淘汰到容量上限内。 */
42
+ private evict;
43
+ }
44
+ //#endregion
45
+ //#region src/milky/api.d.ts
46
+ /** MilkyApi 构造参数。 */
47
+ interface MilkyApiOptions {
48
+ msgApi: MsgApi;
49
+ groupApi: GroupApi;
50
+ friendApi: FriendApi;
51
+ profileApi: ProfileApi;
52
+ /** P1 扩面依赖(表态度 / 票据 / 精华列表 / 群通知 / 群文件)。 */
53
+ profileLikeApi: ProfileLikeApi;
54
+ ticketApi: TicketApi;
55
+ webApi: WebApi;
56
+ groupNotifyApi: GroupNotifyApi;
57
+ richMediaApi: RichMediaApi;
58
+ /** 登录身份(get_login_info / self_id / target_user_uid 用)。 */
59
+ self: {
60
+ uin: string;
61
+ nickname: string;
62
+ uid?: string;
63
+ };
64
+ /** 群/成员缓存(群实体回填 / get_group_list;未装配时动作直查 api)。 */
65
+ groupCache?: GroupCache;
66
+ /** QQ 客户端版本(get_impl_info.qq_protocol_version)。 */
67
+ qqVersion: string;
68
+ /** 协议端版本(get_impl_info.impl_version)。 */
69
+ implVersion: string;
70
+ /** 发送媒体 http(s)/base64 URI 下载缓存目录(缺省 = 远程媒体发送不可用)。 */
71
+ mediaDir?: string;
72
+ }
73
+ declare class MilkyApi {
74
+ readonly msgApi: MsgApi;
75
+ readonly groupApi: GroupApi;
76
+ readonly friendApi: FriendApi;
77
+ readonly profileApi: ProfileApi;
78
+ readonly profileLikeApi: ProfileLikeApi;
79
+ readonly ticketApi: TicketApi;
80
+ readonly webApi: WebApi;
81
+ readonly groupNotifyApi: GroupNotifyApi;
82
+ readonly richMediaApi: RichMediaApi;
83
+ readonly self: {
84
+ uin: string;
85
+ nickname: string;
86
+ uid?: string;
87
+ };
88
+ readonly groupCache: GroupCache | undefined;
89
+ readonly qqVersion: string;
90
+ readonly implVersion: string;
91
+ readonly mediaDir: string | undefined;
92
+ /** message_seq ↔ msgId 双向映射(接收链路 record,动作侧反查)。 */
93
+ readonly seqIndex: MessageSeqIndex;
94
+ constructor(opts: MilkyApiOptions, seqIndex: MessageSeqIndex);
95
+ /** uin → uid(私聊目标 / at 段发送转换 / 群管动作的 uid 入参)。 */
96
+ uinToUid(uins: string[]): Promise<Map<string, string>>;
97
+ /** uid → uin(事件路径 mention 转换)。 */
98
+ uidToUin(uids: string[]): Promise<Map<string, string>>;
99
+ /**
100
+ * uin(数字)→ uid(群管动作入参转换);转换失败抛 INVALID_PARAM
101
+ * (Milky 入参 user_id 都是 uin,kernel 群管 API 要 uid)。
102
+ */
103
+ resolveUidFromUin(uin: number | string): Promise<string>;
104
+ /**
105
+ * message_scene + 数字 ID → NT Peer。
106
+ * group = 群号直作 peerUid;friend/temp = uin → uid(失败退 uin 原样,交 QQ 端判断)。
107
+ */
108
+ resolvePeer(scene: "friend" | "group" | "temp", id: number): Promise<Peer>;
109
+ /**
110
+ * seq → msgId(索引优先,未登记扫描近段历史兜底)。
111
+ * 两层都未命中返回 undefined(调用方抛 NOT_FOUND)。
112
+ */
113
+ resolveMsgIdBySeq(peer: Peer, seq: number, chatType: Peer["chatType"]): Promise<string | undefined>;
114
+ /** 发送结果回查:msgId → {message_seq, time}(sendMessage 只回 msgId)。 */
115
+ resolveSentOutput(peer: Peer, msgId: string): Promise<{
116
+ message_seq: number;
117
+ time: number;
118
+ }>;
119
+ }
120
+ //#endregion
121
+ //#region src/milky/action/error-map.d.ts
122
+ /** KernelErrorCode → Milky retcode 映射表(-400/-403 规范语义,其余自定负数)。 */
123
+ type MilkyErrorCodeMap = Record<KernelErrorCode, number>;
124
+ //#endregion
125
+ //#region src/milky/action/base-action.d.ts
126
+ /** Milky 动作结果(retcode 为规范负数族;transport 原样组装信封)。 */
127
+ interface MilkyActionResult<T> {
128
+ status: "ok" | "failed";
129
+ retcode: number;
130
+ data: T | null;
131
+ message: string;
132
+ }
133
+ declare abstract class MilkyAction<TPayload, TReturn> {
134
+ abstract readonly name: string;
135
+ abstract readonly schema: ZodType<TPayload>;
136
+ protected abstract readonly errorCodeMap: MilkyErrorCodeMap;
137
+ protected abstract _handle(payload: TPayload): Promise<TReturn>;
138
+ /** 校验并执行(HTTP /api 入口;WS /event 不承载动作)。 */
139
+ handle(payload: unknown): Promise<MilkyActionResult<TReturn>>;
140
+ }
141
+ //#endregion
142
+ //#region src/milky/action/index.d.ts
143
+ /** Milky 动作注册表(P0+P1 49 动作)。 */
144
+ declare function createMilkyActionRegistry(opts: {
145
+ api: MilkyApi;
146
+ }): ActionRegistry<MilkyAction<unknown, unknown>>;
147
+ //#endregion
148
+ //#region src/milky/config.d.ts
149
+ /** Milky 配置 schema。 */
150
+ declare const milkyConfigSchema: z.ZodObject<{
151
+ enabled: z.ZodDefault<z.ZodBoolean>;
152
+ host: z.ZodDefault<z.ZodString>;
153
+ port: z.ZodDefault<z.ZodNumber>;
154
+ token: z.ZodDefault<z.ZodString>;
155
+ eventModes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
156
+ sse: "sse";
157
+ ws: "ws";
158
+ }>>>;
159
+ webhooks: z.ZodDefault<z.ZodArray<z.ZodString>>;
160
+ cacheDir: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ /** Milky 配置类型(由 schema 推导)。 */
163
+ type MilkyConfig = z.infer<typeof milkyConfigSchema>;
164
+ //#endregion
165
+ //#region src/milky/transport.d.ts
166
+ /** 校准 logger 最小面(webhook 失败 / 配置异常提示;缺省静默)。 */
167
+ interface MilkyLoggerLike {
168
+ warn(obj: unknown, msg?: string): void;
169
+ info(obj: unknown, msg?: string): void;
170
+ }
171
+ //#endregion
172
+ //#region src/milky/adapter.d.ts
173
+ /** 适配器构造参数(api 相关字段继承 MilkyApiOptions)。 */
174
+ interface MilkyAdapterOptions extends MilkyApiOptions {
175
+ config: ProtocolConfig<MilkyConfig>;
176
+ broadcaster: EventBroadcaster;
177
+ /** kernel 消息事件通道(收链路入口)。 */
178
+ msgChannel: MsgEventChannel;
179
+ /** kernel 群事件通道(P1:群请求/邀请推送;缺省不订阅)。 */
180
+ groupChannel?: GroupEventChannel;
181
+ /** kernel 好友事件通道(P1:好友申请推送;缺省不订阅)。 */
182
+ buddyChannel?: BuddyEventChannel;
183
+ /** 校准日志(webhook 失败 / 启停提示 / 未知事件形状;IPC 模式传 loader pino 实例)。 */
184
+ logger?: MilkyLoggerLike;
185
+ }
186
+ declare class NapukettoMilkyAdapter extends BaseProtocolAdapter<MilkyConfig> {
187
+ readonly protocol = "milky";
188
+ private readonly msgChannel;
189
+ private readonly groupChannel;
190
+ private readonly buddyChannel;
191
+ private readonly calibLogger;
192
+ private readonly api;
193
+ private readonly seqIndex;
194
+ /** 动作注册表(公共只读:装配方/测试枚举)。 */
195
+ readonly registry: ReturnType<typeof createMilkyActionRegistry>;
196
+ private unsubscribes;
197
+ private stopTransports;
198
+ constructor(opts: MilkyAdapterOptions);
199
+ /** 启动传输 + 订阅(enabled=false 空转:不订阅不起传输)。 */
200
+ private startTransports;
201
+ /** 热更新:停止重建(enabled 切换生效)。 */
202
+ private reloadTransports;
203
+ /** 停止:退订 + 关传输。 */
204
+ private stopAll;
205
+ /** 订阅 kernel 事件(消息 + 群通知 + 好友请求,幂等)。 */
206
+ private subscribe;
207
+ /** 退订(幂等)。 */
208
+ private unsubscribeAll;
209
+ /** 单条消息:seq 登记 → grayTip→notice / 群文件上传 / message_receive(自消息不上报)。 */
210
+ private handleIncoming;
211
+ /** grayTip → notice 事件广播(REVOKE 走 message_recall,其余走 notice 翻译)。 */
212
+ private broadcastNotice;
213
+ /** notice 翻译上下文(uidToUin 缺省空 Map;logger 透传校准日志)。 */
214
+ private noticeCtx;
215
+ /** 群通知通道:入群请求 / 成员邀请 / 邀请自身(uid→uin 批量后翻译)。 */
216
+ private handleGroupNotifies;
217
+ /** 好友请求通道:Buddy/onBuddyReqChange(防御收窄,未知形状 raw 日志)。 */
218
+ private handleBuddyReqs;
219
+ /** request 翻译上下文(uid→uin 批量转换)。 */
220
+ private requestCtx;
221
+ /** message_receive 组装:at uid→uin + reply 回填 + 群实体回填 + 转发段(全部 fail-soft)。 */
222
+ private buildMessageReceiveEvent;
223
+ /** at uid → uin 批量转换(mention.user_id 用;失败 mention 段跳过)。 */
224
+ private fillMentionUids;
225
+ /** reply 引用元信息回填(seqIndex 命中即用;未命中不强查)。 */
226
+ private fillReplyMeta;
227
+ /** 群场景实体回填(GroupCache 缓存优先,失败最小实体兜底)。 */
228
+ private fillGroupEntities;
229
+ /** 转发 resId → 定位登记(get_forwarded_messages 反查用)。 */
230
+ private recordForward;
231
+ /** uid 批量 → uin(空集/失败返回 undefined 语义:调用方用空 Map)。 */
232
+ private resolveUidToUin;
233
+ }
234
+ //#endregion
235
+ export { type MilkyAdapterOptions, type MilkyConfig, NapukettoMilkyAdapter, milkyConfigSchema };
236
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/milky/helper/seq-index.ts","../../src/milky/api.ts","../../src/milky/action/error-map.ts","../../src/milky/action/base-action.ts","../../src/milky/action/index.ts","../../src/milky/config.ts","../../src/milky/transport.ts","../../src/milky/adapter.ts"],"mappings":";;;;;;UAuBiB;EACb,UAAU;EACV;EACA;;cAGS;;mBAEQ;;mBAEA;;mBAEA;;EAGjB,OAAO,KAAK;;EAeZ,aAAa,UAAU,UAAU,iBAAiB;;;;;EAQlD,iBACI,mBACD;IAAc;IAAoB;IAAkB;;;UAgB/C;;;;;EAQR,cAAc,eAAe,OAAO;;EAepC,eAAe,gBAAgB;;UAKvB;;;;;UCjFK;EACb,QAAQ;EACR,UAAU;EACV,WAAW;EACX,YAAY;;EAEZ,gBAAgB;EAChB,WAAW;EACX,QAAQ;EACR,gBAAgB;EAChB,cAAc;;EAEd;IAAQ;IAAa;IAAkB;;;EAEvC,aAAa;;EAEb;;EAEA;;EAEA;;cAGS;WACA,QAAQ;WACR,UAAU;WACV,WAAW;WACX,YAAY;WACZ,gBAAgB;WAChB,WAAW;WACX,QAAQ;WACR,gBAAgB;WAChB,cAAc;WACd;IAAQ;IAAa;IAAkB;;WACvC,YAAY;WACZ;WACA;WACA;;WAEA,UAAU;EAEnB,YAAY,MAAM,iBAAiB,UAAU;;EAmB7C,SAAS,iBAAiB,QAAQ;;EAKlC,SAAS,iBAAiB,QAAQ;;;;;EAQ5B,kBAAkB,uBAAuB;;;;;EAiBzC,YAAY,oCAAoC,aAAa,QAAQ;;;;;EAqBrE,kBACF,MAAM,MACN,aACA,UAAU,mBACX;;EAeG,kBACF,MAAM,MACN,gBACD;IAAU;IAAqB;;;;;;KCtJ1B,oBAAoB,OAAO;;;;UCItB,kBAAkB;EAC/B;EACA;EACA,MAAM;EACN;;uBAYkB,YAAY,UAAU;oBACtB;oBACA,QAAQ,QAAQ;8BACN,cAAc;qBAEvB,QAAQ,SAAS,WAAW,QAAQ;;EAGjD,OAAO,mBAAmB,QAAQ,kBAAkB;;;;;iBCiC9C,0BAA0B;EACtC,KAAK;IACL,eAAe;;;;cC/DN,mBAAiB,EAAA;;;;;;;;;;;GAe5B,EAAA,KAAA;;KAGU,cAAc,EAAE,aAAa;;;;UCQxB;EACb,KAAK,cAAc;EACnB,KAAK,cAAc;;;;;UCUN,4BAA4B;EACzC,QAAQ,eAAe;EACvB,aAAa;;EAEb,YAAY;;EAEZ,eAAe;;EAEf,eAAe;;EAEf,SAAS;;cAGA,8BAA8B,oBAAoB;WAClD;mBAEQ;mBACA;mBACA;mBACA;mBACA;mBACA;;WAER,UAAU,kBAAkB;UAC7B;UACA;EAER,YAAY,MAAM;;UAoBJ;;UAuBA;;UAMA;;UASN;;UA4BA;;UAQM;;UAuBA;;UAeN;;UASM;;UAWN;;UAkBM;;UASA;;UAgBA;;UAkBN;;UAWM;;UAaN;;UAcA"}