@napuketto/adapter 0.10.0 → 0.11.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/core/index.d.mts +1 -1
- package/dist/core/index.mjs +1 -2
- package/dist/{core-DW5i42XH.mjs → core-BNOfqnV-.mjs} +8 -15
- package/dist/{core-DW5i42XH.mjs.map → core-BNOfqnV-.mjs.map} +1 -1
- package/dist/{essence-DSSyWl36.mjs → essence-BRbsj_Vv.mjs} +5 -8
- package/dist/essence-BRbsj_Vv.mjs.map +1 -0
- package/dist/{gray-tip-LwBee5mo.mjs → gray-tip-ByF-MKeV.mjs} +2 -3
- package/dist/gray-tip-ByF-MKeV.mjs.map +1 -0
- package/dist/{index-h-tsUu0j.d.mts → index-DNvM3A-1.d.mts} +1 -15
- package/dist/index-DNvM3A-1.d.mts.map +1 -0
- package/dist/index.d.mts +1 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/kurobot/index.d.mts +35 -45
- package/dist/kurobot/index.d.mts.map +1 -1
- package/dist/kurobot/index.mjs +7 -12
- package/dist/kurobot/index.mjs.map +1 -1
- package/dist/milky/index.d.mts +4 -20
- package/dist/milky/index.d.mts.map +1 -1
- package/dist/milky/index.mjs +192 -216
- package/dist/milky/index.mjs.map +1 -1
- package/dist/onebot11/index.d.mts +21 -57
- package/dist/onebot11/index.d.mts.map +1 -1
- package/dist/onebot11/index.mjs +99 -178
- package/dist/onebot11/index.mjs.map +1 -1
- package/dist/{raw-message-D_ecJy4C.mjs → raw-message-C1E7jbjl.mjs} +2 -3
- package/dist/raw-message-C1E7jbjl.mjs.map +1 -0
- package/dist/satori/index.d.mts +16 -50
- package/dist/satori/index.d.mts.map +1 -1
- package/dist/satori/index.mjs +28 -52
- package/dist/satori/index.mjs.map +1 -1
- package/dist/{transport-schema-CpPxyRK0.mjs → transport-schema-BEzr06W3.mjs} +2 -3
- package/dist/transport-schema-BEzr06W3.mjs.map +1 -0
- package/package.json +21 -16
- package/dist/essence-DSSyWl36.mjs.map +0 -1
- package/dist/gray-tip-LwBee5mo.mjs.map +0 -1
- package/dist/index-h-tsUu0j.d.mts.map +0 -1
- package/dist/raw-message-D_ecJy4C.mjs.map +0 -1
- package/dist/transport-schema-CpPxyRK0.mjs.map +0 -1
package/dist/kurobot/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { x as ProtocolConfig, y as BaseProtocolAdapter } from "../index-
|
|
1
|
+
import { x as ProtocolConfig, y as BaseProtocolAdapter } from "../index-DNvM3A-1.mjs";
|
|
2
2
|
import { CanonicalElement, MsgEventChannel, Peer, RawMessage } from "@napuketto/kernel";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
//#region src/kurobot/config.d.ts
|
|
5
4
|
/** kurobot 配置 schema。 */
|
|
6
|
-
declare const kurobotConfigSchema: z.ZodObject<{
|
|
5
|
+
export declare const kurobotConfigSchema: z.ZodObject<{
|
|
7
6
|
url: z.ZodURL;
|
|
8
7
|
token: z.ZodDefault<z.ZodString>;
|
|
9
8
|
client: z.ZodOptional<z.ZodString>;
|
|
@@ -22,21 +21,19 @@ type KurobotConfig = z.infer<typeof kurobotConfigSchema>;
|
|
|
22
21
|
* 仅在「无 seed 且配置文件缺失」的直连场景被落盘——端口 0 地址连接会失败退避,
|
|
23
22
|
* 不会静默假在线。
|
|
24
23
|
*/
|
|
25
|
-
declare function kurobotConfigDefaults(): KurobotConfig;
|
|
26
|
-
|
|
27
|
-
//#region src/kurobot/schema.d.ts
|
|
28
|
-
declare const PROTOCOL_NAME: "kurobridge-ws";
|
|
24
|
+
export declare function kurobotConfigDefaults(): KurobotConfig;
|
|
25
|
+
export declare const PROTOCOL_NAME: "kurobridge-ws";
|
|
29
26
|
/** 语义化版本(主版本相同即兼容,ADR-026:0.2.x/0.3.0 服务端均接受 0.3.1 hello)。 */
|
|
30
|
-
declare const PROTOCOL_VERSION: "0.4.0";
|
|
27
|
+
export declare const PROTOCOL_VERSION: "0.4.0";
|
|
31
28
|
/** WS 子协议(握手期校验,服务端 handleProtocols 不带即拒连)。 */
|
|
32
|
-
declare const WS_SUBPROTOCOL: "kurobridge-ws.v1";
|
|
29
|
+
export declare const WS_SUBPROTOCOL: "kurobridge-ws.v1";
|
|
33
30
|
/** 协议版本兼容判定(镜像 meta.ts 同名函数):主版本号相同即兼容。 */
|
|
34
|
-
declare function isProtocolVersionCompatible(peerVersion: string, serverVersion: string): boolean;
|
|
31
|
+
export declare function isProtocolVersionCompatible(peerVersion: string, serverVersion: string): boolean;
|
|
35
32
|
/**
|
|
36
33
|
* 通用线格式帧(两段式解析的第一段):只约束帧骨架(type 受 snake_case、
|
|
37
34
|
* id 存在时须 UUID、body 任意),供收帧侧「先取 type、再分发到具体 schema」。
|
|
38
35
|
*/
|
|
39
|
-
declare const wireFrameSchema: z.ZodObject<{
|
|
36
|
+
export declare const wireFrameSchema: z.ZodObject<{
|
|
40
37
|
header: z.ZodObject<{
|
|
41
38
|
type: z.ZodString;
|
|
42
39
|
id: z.ZodOptional<z.ZodUUID>;
|
|
@@ -44,7 +41,7 @@ declare const wireFrameSchema: z.ZodObject<{
|
|
|
44
41
|
body: z.ZodUnknown;
|
|
45
42
|
}, z.core.$strip>;
|
|
46
43
|
/** 出帧:扁平消息 → 线格式 JSON 文本(单行,可直接走 WS 文本帧) */
|
|
47
|
-
declare function encodeFrame(message: {
|
|
44
|
+
export declare function encodeFrame(message: {
|
|
48
45
|
type: string;
|
|
49
46
|
body: unknown;
|
|
50
47
|
id?: string;
|
|
@@ -67,7 +64,7 @@ declare const helloBodySchema: z.ZodObject<{
|
|
|
67
64
|
client: z.ZodOptional<z.ZodString>;
|
|
68
65
|
}, z.core.$strip>;
|
|
69
66
|
/** 对端注册(请求,服务端必须回同 id 的 hello_ack)。 */
|
|
70
|
-
declare const helloFrame: z.ZodPipe<z.ZodObject<{
|
|
67
|
+
export declare const helloFrame: z.ZodPipe<z.ZodObject<{
|
|
71
68
|
header: z.ZodObject<{
|
|
72
69
|
type: z.ZodLiteral<"hello">;
|
|
73
70
|
id: z.ZodUUID;
|
|
@@ -107,7 +104,7 @@ declare const helloFrame: z.ZodPipe<z.ZodObject<{
|
|
|
107
104
|
}>>;
|
|
108
105
|
type HelloBody = z.infer<typeof helloBodySchema>;
|
|
109
106
|
/** 心跳请求(应用层帧——服务端空闲检测只认应用层入帧,WS 层 ping 无效)。 */
|
|
110
|
-
declare const pingFrame: z.ZodPipe<z.ZodObject<{
|
|
107
|
+
export declare const pingFrame: z.ZodPipe<z.ZodObject<{
|
|
111
108
|
header: z.ZodObject<{
|
|
112
109
|
type: z.ZodLiteral<"ping">;
|
|
113
110
|
id: z.ZodUUID;
|
|
@@ -136,7 +133,7 @@ declare const platformChatBodySchema: z.ZodObject<{
|
|
|
136
133
|
content: z.ZodString;
|
|
137
134
|
}, z.core.$strip>;
|
|
138
135
|
/** 平台 → 游戏聊天(事件;服务端按绑定表过滤未绑定频道)。 */
|
|
139
|
-
declare const platformChatFrame: z.ZodPipe<z.ZodObject<{
|
|
136
|
+
export declare const platformChatFrame: z.ZodPipe<z.ZodObject<{
|
|
140
137
|
header: z.ZodObject<{
|
|
141
138
|
type: z.ZodLiteral<"chat">;
|
|
142
139
|
}, z.core.$strict>;
|
|
@@ -171,7 +168,7 @@ declare const commandBodySchema: z.ZodObject<{
|
|
|
171
168
|
}, z.core.$strip>;
|
|
172
169
|
}, z.core.$strip>;
|
|
173
170
|
/** 群指令 → 执行游戏命令(请求;响应为同 id command_result)。 */
|
|
174
|
-
declare const commandFrame: z.ZodPipe<z.ZodObject<{
|
|
171
|
+
export declare const commandFrame: z.ZodPipe<z.ZodObject<{
|
|
175
172
|
header: z.ZodObject<{
|
|
176
173
|
type: z.ZodLiteral<"command">;
|
|
177
174
|
id: z.ZodUUID;
|
|
@@ -209,7 +206,7 @@ declare const commandFrame: z.ZodPipe<z.ZodObject<{
|
|
|
209
206
|
type CommandBody = z.infer<typeof commandBodySchema>;
|
|
210
207
|
type CommandFrame = z.infer<typeof commandFrame>;
|
|
211
208
|
/** 状态/绑定查询(请求;响应为同 id query_result)。 */
|
|
212
|
-
declare const queryFrame: z.ZodPipe<z.ZodObject<{
|
|
209
|
+
export declare const queryFrame: z.ZodPipe<z.ZodObject<{
|
|
213
210
|
header: z.ZodObject<{
|
|
214
211
|
type: z.ZodLiteral<"query">;
|
|
215
212
|
id: z.ZodUUID;
|
|
@@ -244,7 +241,7 @@ declare const helloAckErrorBodySchema: z.ZodObject<{
|
|
|
244
241
|
reason: z.ZodString;
|
|
245
242
|
}, z.core.$strip>;
|
|
246
243
|
/** 握手结果(响应,同 id)。 */
|
|
247
|
-
declare const helloAckFrame: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
244
|
+
export declare const helloAckFrame: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
248
245
|
header: z.ZodObject<{
|
|
249
246
|
type: z.ZodLiteral<"hello_ack">;
|
|
250
247
|
id: z.ZodUUID;
|
|
@@ -311,7 +308,7 @@ declare const pongBodySchema: z.ZodObject<{
|
|
|
311
308
|
timestamp: z.ZodNumber;
|
|
312
309
|
}, z.core.$strip>;
|
|
313
310
|
/** 心跳响应(不需要处理:收不到就等服务端 1001 关闭走重连)。 */
|
|
314
|
-
declare const pongFrame: z.ZodPipe<z.ZodObject<{
|
|
311
|
+
export declare const pongFrame: z.ZodPipe<z.ZodObject<{
|
|
315
312
|
header: z.ZodObject<{
|
|
316
313
|
type: z.ZodLiteral<"pong">;
|
|
317
314
|
id: z.ZodUUID;
|
|
@@ -341,7 +338,7 @@ declare const gameChatBodySchema: z.ZodObject<{
|
|
|
341
338
|
content: z.ZodString;
|
|
342
339
|
}, z.core.$strip>;
|
|
343
340
|
/** 游戏 → 平台聊天(事件)。 */
|
|
344
|
-
declare const gameChatFrame: z.ZodPipe<z.ZodObject<{
|
|
341
|
+
export declare const gameChatFrame: z.ZodPipe<z.ZodObject<{
|
|
345
342
|
header: z.ZodObject<{
|
|
346
343
|
type: z.ZodLiteral<"chat">;
|
|
347
344
|
}, z.core.$strict>;
|
|
@@ -373,7 +370,7 @@ declare const joinBodySchema: z.ZodObject<{
|
|
|
373
370
|
playerName: z.ZodString;
|
|
374
371
|
}, z.core.$strip>;
|
|
375
372
|
/** 玩家进服(事件,按绑定频道 fan-out)。 */
|
|
376
|
-
declare const joinFrame: z.ZodPipe<z.ZodObject<{
|
|
373
|
+
export declare const joinFrame: z.ZodPipe<z.ZodObject<{
|
|
377
374
|
header: z.ZodObject<{
|
|
378
375
|
type: z.ZodLiteral<"join">;
|
|
379
376
|
}, z.core.$strict>;
|
|
@@ -402,7 +399,7 @@ declare const leaveBodySchema: z.ZodObject<{
|
|
|
402
399
|
playerName: z.ZodString;
|
|
403
400
|
}, z.core.$strip>;
|
|
404
401
|
/** 玩家退服(事件,按绑定频道 fan-out)。 */
|
|
405
|
-
declare const leaveFrame: z.ZodPipe<z.ZodObject<{
|
|
402
|
+
export declare const leaveFrame: z.ZodPipe<z.ZodObject<{
|
|
406
403
|
header: z.ZodObject<{
|
|
407
404
|
type: z.ZodLiteral<"leave">;
|
|
408
405
|
}, z.core.$strict>;
|
|
@@ -432,7 +429,7 @@ declare const statusBodySchema: z.ZodObject<{
|
|
|
432
429
|
uptimeSeconds: z.ZodNumber;
|
|
433
430
|
}, z.core.$strip>;
|
|
434
431
|
/** 服务器状态(事件;无 channel——全服状态而非频道消息)。 */
|
|
435
|
-
declare const statusFrame: z.ZodPipe<z.ZodObject<{
|
|
432
|
+
export declare const statusFrame: z.ZodPipe<z.ZodObject<{
|
|
436
433
|
header: z.ZodObject<{
|
|
437
434
|
type: z.ZodLiteral<"status">;
|
|
438
435
|
}, z.core.$strict>;
|
|
@@ -463,7 +460,7 @@ declare const bindingsUpdatedBodySchema: z.ZodObject<{
|
|
|
463
460
|
channelBindings: z.ZodArray<z.ZodString>;
|
|
464
461
|
}, z.core.$strip>;
|
|
465
462
|
/** 绑定表变更推送(事件)。 */
|
|
466
|
-
declare const bindingsUpdatedFrame: z.ZodPipe<z.ZodObject<{
|
|
463
|
+
export declare const bindingsUpdatedFrame: z.ZodPipe<z.ZodObject<{
|
|
467
464
|
header: z.ZodObject<{
|
|
468
465
|
type: z.ZodLiteral<"bindings_updated">;
|
|
469
466
|
}, z.core.$strict>;
|
|
@@ -485,7 +482,7 @@ declare const bindingsUpdatedFrame: z.ZodPipe<z.ZodObject<{
|
|
|
485
482
|
}>>;
|
|
486
483
|
type BindingsUpdatedBody = z.infer<typeof bindingsUpdatedBodySchema>;
|
|
487
484
|
/** 群指令的执行结果(响应,同 id)。 */
|
|
488
|
-
declare const commandResultFrame: z.ZodPipe<z.ZodObject<{
|
|
485
|
+
export declare const commandResultFrame: z.ZodPipe<z.ZodObject<{
|
|
489
486
|
header: z.ZodObject<{
|
|
490
487
|
type: z.ZodLiteral<"command_result">;
|
|
491
488
|
id: z.ZodUUID;
|
|
@@ -528,7 +525,7 @@ declare const queryResultBodySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
528
525
|
error: z.ZodString;
|
|
529
526
|
}, z.core.$strip>]>;
|
|
530
527
|
/** 查询结果(响应,同 id)。 */
|
|
531
|
-
declare const queryResultFrame: z.ZodPipe<z.ZodObject<{
|
|
528
|
+
export declare const queryResultFrame: z.ZodPipe<z.ZodObject<{
|
|
532
529
|
header: z.ZodObject<{
|
|
533
530
|
type: z.ZodLiteral<"query_result">;
|
|
534
531
|
id: z.ZodUUID;
|
|
@@ -570,7 +567,7 @@ declare const deathBodySchema: z.ZodObject<{
|
|
|
570
567
|
message: z.ZodString;
|
|
571
568
|
}, z.core.$strip>;
|
|
572
569
|
/** 玩家死亡(事件,按绑定频道 fan-out 对齐 join/leave)。 */
|
|
573
|
-
declare const deathFrame: z.ZodPipe<z.ZodObject<{
|
|
570
|
+
export declare const deathFrame: z.ZodPipe<z.ZodObject<{
|
|
574
571
|
header: z.ZodObject<{
|
|
575
572
|
type: z.ZodLiteral<"death">;
|
|
576
573
|
}, z.core.$strict>;
|
|
@@ -597,8 +594,6 @@ declare const deathFrame: z.ZodPipe<z.ZodObject<{
|
|
|
597
594
|
};
|
|
598
595
|
}>>;
|
|
599
596
|
type DeathBody = z.infer<typeof deathBodySchema>;
|
|
600
|
-
//#endregion
|
|
601
|
-
//#region src/kurobot/connection.d.ts
|
|
602
597
|
/** 连接层日志最小面(装配方传 pino 实例;缺省静默)。 */
|
|
603
598
|
interface KurobotLogger {
|
|
604
599
|
debug(obj: unknown, msg: string): void;
|
|
@@ -679,7 +674,7 @@ interface KurobotConnectionOptions {
|
|
|
679
674
|
logger?: KurobotLogger;
|
|
680
675
|
}
|
|
681
676
|
/** kurobridge-ws 客户端连接(子协议 + hello + 应用层 ping + 感知 close code 的指数退避)。 */
|
|
682
|
-
declare class KurobotConnection {
|
|
677
|
+
export declare class KurobotConnection {
|
|
683
678
|
private readonly opts;
|
|
684
679
|
private readonly log;
|
|
685
680
|
private state;
|
|
@@ -730,8 +725,6 @@ declare class KurobotConnection {
|
|
|
730
725
|
/** 指数退避重连:base * 2^attempt 封顶 retryMaxDelayMs;established 成功清零。 */
|
|
731
726
|
private scheduleRetry;
|
|
732
727
|
}
|
|
733
|
-
//#endregion
|
|
734
|
-
//#region src/kurobot/adapter.d.ts
|
|
735
728
|
/** 发群消息最小面(kernel MsgApi.sendMessage 的结构子集,便于测试桩替换)。 */
|
|
736
729
|
interface KurobotMsgApi {
|
|
737
730
|
sendMessage(target: Peer, elements: CanonicalElement[]): Promise<{
|
|
@@ -768,7 +761,7 @@ interface ReceiveLogFilterHolder {
|
|
|
768
761
|
/** 适配器日志面(复用连接层最小面)。 */
|
|
769
762
|
type KurobotLoggerAlias = KurobotConnectionOptions["logger"];
|
|
770
763
|
/** kurobot 协议适配器。 */
|
|
771
|
-
declare class NapukettoKurobotAdapter extends BaseProtocolAdapter<KurobotConfig> {
|
|
764
|
+
export declare class NapukettoKurobotAdapter extends BaseProtocolAdapter<KurobotConfig> {
|
|
772
765
|
readonly protocol = "kurobot";
|
|
773
766
|
private readonly msgChannel;
|
|
774
767
|
private readonly msgApi;
|
|
@@ -825,18 +818,16 @@ declare class NapukettoKurobotAdapter extends BaseProtocolAdapter<KurobotConfig>
|
|
|
825
818
|
/** 退订(幂等)。 */
|
|
826
819
|
private unsubscribeAll;
|
|
827
820
|
}
|
|
828
|
-
//#endregion
|
|
829
|
-
//#region src/kurobot/translate.d.ts
|
|
830
821
|
/** 发往 QQ 文本的总长上限(超出截断追加 …(截断);任务书对 command_result 规定,统一套用)。 */
|
|
831
|
-
declare const MAX_GROUP_TEXT_LENGTH = 1500;
|
|
822
|
+
export declare const MAX_GROUP_TEXT_LENGTH = 1500;
|
|
832
823
|
/** 超长截断(按 UTF-16 码元计,超限部分丢弃)。 */
|
|
833
|
-
declare function truncateForGroup(text: string): string;
|
|
824
|
+
export declare function truncateForGroup(text: string): string;
|
|
834
825
|
/** QQ 群消息发送者显示名:sendMemberName ?? sendNickName(双空兜底 senderUin,schema min(1))。 */
|
|
835
|
-
declare function resolveSenderName(msg: RawMessage): string;
|
|
826
|
+
export declare function resolveSenderName(msg: RawMessage): string;
|
|
836
827
|
/** canonical 元素序列 → 降级文本(text 原文、@、图片/表情/回复占位;空白返回 null = 不发)。 */
|
|
837
|
-
declare function degradeElements(elements: CanonicalElement[]): string | null;
|
|
828
|
+
export declare function degradeElements(elements: CanonicalElement[]): string | null;
|
|
838
829
|
/** RawMessage → 降级文本(便捷封装;null = 空消息不发)。 */
|
|
839
|
-
declare function degradeMessage(msg: RawMessage): string | null;
|
|
830
|
+
export declare function degradeMessage(msg: RawMessage): string | null;
|
|
840
831
|
/** 渲染模板变量(player 必有;content = 聊天内容;message = 死亡消息)。 */
|
|
841
832
|
interface TemplateVars {
|
|
842
833
|
player: string;
|
|
@@ -844,11 +835,10 @@ interface TemplateVars {
|
|
|
844
835
|
message?: string;
|
|
845
836
|
}
|
|
846
837
|
/** 渲染模板:替换 {player}/{content}/{message} 占位符(未知占位符原样保留)。 */
|
|
847
|
-
declare function renderTemplate(template: string, vars: TemplateVars): string;
|
|
838
|
+
export declare function renderTemplate(template: string, vars: TemplateVars): string;
|
|
848
839
|
/** death 事件 → 群文本(message 空串时以「死亡了」代入:Bukkit deathMessage null 兜底)。 */
|
|
849
|
-
declare function renderDeathText(template: string, player: string, message: string): string;
|
|
840
|
+
export declare function renderDeathText(template: string, player: string, message: string): string;
|
|
850
841
|
/** command_result body → 群文本(ok 合并 output;error → 命令失败:{error})。 */
|
|
851
|
-
declare function renderCommandResult(body: CommandResultBody): string;
|
|
852
|
-
|
|
853
|
-
export { type BindingsUpdatedBody, type CommandBody, type CommandFrame, type CommandResultBody, type ConnectionEndedReason, type DeathBody, type GameChatBody, type HelloAckBody, type HelloBody, type JoinBody, type KurobotAdapterOptions, type KurobotConfig, KurobotConnection, type KurobotConnectionOptions, type KurobotHello, type KurobotLogger, type KurobotMsgApi, type LeaveBody, MAX_GROUP_TEXT_LENGTH, NapukettoKurobotAdapter, PROTOCOL_NAME, PROTOCOL_VERSION, type PlatformChatBody, type QueryResultBody, type ServerEventMessage, type StatusBody, WS_SUBPROTOCOL, bindingsUpdatedFrame, commandFrame, commandResultFrame, deathFrame, degradeElements, degradeMessage, encodeFrame, gameChatFrame, helloAckFrame, helloFrame, isProtocolVersionCompatible, joinFrame, kurobotConfigDefaults, kurobotConfigSchema, leaveFrame, pingFrame, platformChatFrame, pongFrame, queryFrame, queryResultFrame, renderCommandResult, renderDeathText, renderTemplate, resolveSenderName, statusFrame, truncateForGroup, wireFrameSchema };
|
|
842
|
+
export declare function renderCommandResult(body: CommandResultBody): string;
|
|
843
|
+
export type { BindingsUpdatedBody, CommandBody, CommandFrame, CommandResultBody, ConnectionEndedReason, DeathBody, GameChatBody, HelloAckBody, HelloBody, JoinBody, KurobotAdapterOptions, KurobotConfig, KurobotConnectionOptions, KurobotHello, KurobotLogger, KurobotMsgApi, LeaveBody, PlatformChatBody, QueryResultBody, ServerEventMessage, StatusBody };
|
|
854
844
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/kurobot/config.ts","../../src/kurobot/schema.ts","../../src/kurobot/connection.ts","../../src/kurobot/adapter.ts","../../src/kurobot/translate.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/kurobot/config.ts","../../src/kurobot/schema.ts","../../src/kurobot/connection.ts","../../src/kurobot/adapter.ts","../../src/kurobot/translate.ts"],"mappings":";;;;qBAYa,qBAAmB,EAAA;;;;;;;;;;GAqB9B,EAAA,KAAA;;KAGU,gBAAgB,EAAE,aAAa;;;;;;;wBAQ3B,yBAAyB;qBC1B5B;;qBAGA;;qBAGA;;wBAcG,4BAA4B,qBAAqB;;;;;qBAqBpD,iBAAe,EAAA;;;;;;GAG1B,EAAA,KAAA;;wBAoDc,YAAY;EAAW;EAAc;EAAe;;;cAiBvD,yBAAuB,EAAA,mBAAA,EAAA;;;;;;GAGlC,EAAA,KAAA;KAEU,oBAAoB,EAAE,aAAa;cAIzC,iBAAe,EAAA;;;;;;;GASnB,EAAA,KAAA;;qBAGW,YAAU,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACX,YAAY,EAAE,aAAa;;qBAQ1B,WAAS,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;cAIhB,wBAAsB,EAAA;;;;GAK1B,EAAA,KAAA;;qBAGW,mBAAiB,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KAClB,mBAAmB,EAAE,aAAa;cAUxC,mBAAiB,EAAA;;;;;;GAIrB,EAAA,KAAA;;qBAGW,cAAY,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACb,cAAc,EAAE,aAAa;KAE7B,eAAe,EAAE,aAAa;;qBAQ7B,YAAU,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;cAMjB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EAiBlB,iBAAiB;;EAKjB;;EAKA,MAAM;;UAWQ;;UAoCA;;UAMN;;UAQM;;UAYN;;UAQA;;UAUA;;UAsEA;;UAuBA;;UAsCA;;UAKA;;UAcA;;UAeA;;UASA;;UAYA;;;qBChYC;;wBAMG,iBAAiB;;wBAQjB,kBAAkB,KAAK;;wBAqBvB,gBAAgB,UAAU;;wBA6B1B,eAAe,KAAK;;UAKnB;EACb;EACA;EACA;;;wBAIY,eAAe,kBAAkB,MAAM;;wBAQvC,gBAAgB,kBAAkB,gBAAgB;;wBAKlD,oBAAoB,MAAM"}
|
package/dist/kurobot/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as BaseProtocolAdapter } from "../core-
|
|
2
|
-
import { t as forEachRawMessage } from "../raw-message-
|
|
1
|
+
import { _ as BaseProtocolAdapter } from "../core-BNOfqnV-.mjs";
|
|
2
|
+
import { t as forEachRawMessage } from "../raw-message-C1E7jbjl.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { ChatType, toCanonicalElements } from "@napuketto/kernel";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { WebSocket } from "ws";
|
|
8
|
-
|
|
8
|
+
// src/kurobot/schema.ts
|
|
9
9
|
/**
|
|
10
10
|
* kurobridge-ws 协议 schema(镜像实现,任务书 KUROBOT-PROMPT §1.2 决策一)
|
|
11
11
|
*
|
|
@@ -201,8 +201,7 @@ const deathFrame = eventFrameSchema("death", z.object({
|
|
|
201
201
|
/** 死亡消息文本(Bukkit deathMessage 可为 null → 服务端以空串兜底,故允许空串) */
|
|
202
202
|
message: z.string()
|
|
203
203
|
}));
|
|
204
|
-
|
|
205
|
-
//#region src/kurobot/connection.ts
|
|
204
|
+
// src/kurobot/connection.ts
|
|
206
205
|
/**
|
|
207
206
|
* KurobotConnection:kurobridge-ws 客户端连接层(任务书 KUROBOT-PROMPT §1.2 决策二)
|
|
208
207
|
*
|
|
@@ -579,8 +578,7 @@ const SILENT_LOGGER = {
|
|
|
579
578
|
warn: () => void 0,
|
|
580
579
|
error: () => void 0
|
|
581
580
|
};
|
|
582
|
-
|
|
583
|
-
//#region src/kurobot/translate.ts
|
|
581
|
+
// src/kurobot/translate.ts
|
|
584
582
|
/**
|
|
585
583
|
* 消息映射纯函数(任务书 KUROBOT-PROMPT §1.2 QQ↔MC 映射;翻译层无副作用,ADR-008)
|
|
586
584
|
*
|
|
@@ -654,8 +652,7 @@ function renderCommandResult(body) {
|
|
|
654
652
|
if (output.length === 0) return "(命令执行成功,无输出)";
|
|
655
653
|
return output.join("\n");
|
|
656
654
|
}
|
|
657
|
-
|
|
658
|
-
//#region src/kurobot/adapter.ts
|
|
655
|
+
// src/kurobot/adapter.ts
|
|
659
656
|
/**
|
|
660
657
|
* NapukettoKurobotAdapter:kurobridge-ws 协议适配器(KuroBot MVP-3,2026-09-13)
|
|
661
658
|
*
|
|
@@ -966,8 +963,7 @@ function resolveDefaultClient() {
|
|
|
966
963
|
const version = resolvePackageVersion();
|
|
967
964
|
return version === null ? "napukettoqq" : `napukettoqq/${version}`;
|
|
968
965
|
}
|
|
969
|
-
|
|
970
|
-
//#region src/kurobot/config.ts
|
|
966
|
+
// src/kurobot/config.ts
|
|
971
967
|
/**
|
|
972
968
|
* kurobot 协议配置(zod schema,归属本包,ADR-012;任务书 KUROBOT-PROMPT §1.2)
|
|
973
969
|
*
|
|
@@ -1004,7 +1000,6 @@ const kurobotConfigSchema = z.object({
|
|
|
1004
1000
|
function kurobotConfigDefaults() {
|
|
1005
1001
|
return kurobotConfigSchema.parse({ url: "ws://127.0.0.1:0" });
|
|
1006
1002
|
}
|
|
1007
|
-
//#endregion
|
|
1008
1003
|
export { KurobotConnection, MAX_GROUP_TEXT_LENGTH, NapukettoKurobotAdapter, PROTOCOL_NAME, PROTOCOL_VERSION, WS_SUBPROTOCOL, bindingsUpdatedFrame, commandFrame, commandResultFrame, deathFrame, degradeElements, degradeMessage, encodeFrame, gameChatFrame, helloAckFrame, helloFrame, isProtocolVersionCompatible, joinFrame, kurobotConfigDefaults, kurobotConfigSchema, leaveFrame, pingFrame, platformChatFrame, pongFrame, queryFrame, queryResultFrame, renderCommandResult, renderDeathText, renderTemplate, resolveSenderName, statusFrame, truncateForGroup, wireFrameSchema };
|
|
1009
1004
|
|
|
1010
1005
|
//# sourceMappingURL=index.mjs.map
|