@im-more/dsh-milky 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/cordis.patch.yml +11 -0
- package/lib/index.js +2311 -0
- package/lib/index.js.map +1 -0
- package/lib/types/bot.d.ts +127 -0
- package/lib/types/bot.d.ts.map +1 -0
- package/lib/types/bot.js +303 -0
- package/lib/types/bot.js.map +1 -0
- package/lib/types/config.d.ts +24 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +39 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/decode.d.ts +43 -0
- package/lib/types/decode.d.ts.map +1 -0
- package/lib/types/decode.js +277 -0
- package/lib/types/decode.js.map +1 -0
- package/lib/types/errors.d.ts +66 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/errors.js +170 -0
- package/lib/types/errors.js.map +1 -0
- package/lib/types/identity.d.ts +24 -0
- package/lib/types/identity.d.ts.map +1 -0
- package/lib/types/identity.js +33 -0
- package/lib/types/identity.js.map +1 -0
- package/lib/types/ids.d.ts +110 -0
- package/lib/types/ids.d.ts.map +1 -0
- package/lib/types/ids.js +166 -0
- package/lib/types/ids.js.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +9 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/internal.d.ts +2002 -0
- package/lib/types/internal.d.ts.map +1 -0
- package/lib/types/internal.js +408 -0
- package/lib/types/internal.js.map +1 -0
- package/lib/types/modes/text.d.ts +66 -0
- package/lib/types/modes/text.d.ts.map +1 -0
- package/lib/types/modes/text.js +275 -0
- package/lib/types/modes/text.js.map +1 -0
- package/lib/types/reads.d.ts +57 -0
- package/lib/types/reads.d.ts.map +1 -0
- package/lib/types/reads.js +219 -0
- package/lib/types/reads.js.map +1 -0
- package/lib/types/request.d.ts +55 -0
- package/lib/types/request.d.ts.map +1 -0
- package/lib/types/request.js +174 -0
- package/lib/types/request.js.map +1 -0
- package/lib/types/send.d.ts +34 -0
- package/lib/types/send.d.ts.map +1 -0
- package/lib/types/send.js +99 -0
- package/lib/types/send.js.map +1 -0
- package/lib/types/types/schema.d.ts +11726 -0
- package/lib/types/types/schema.d.ts.map +1 -0
- package/lib/types/types/schema.js +1422 -0
- package/lib/types/types/schema.js.map +1 -0
- package/lib/types/ws.d.ts +60 -0
- package/lib/types/ws.d.ts.map +1 -0
- package/lib/types/ws.js +335 -0
- package/lib/types/ws.js.map +1 -0
- package/package.json +62 -3
- package/src/bot.ts +431 -0
- package/src/config.ts +61 -0
- package/src/decode.ts +367 -0
- package/src/errors.ts +195 -0
- package/src/identity.ts +43 -0
- package/src/ids.ts +226 -0
- package/src/index.ts +44 -0
- package/src/internal.ts +657 -0
- package/src/modes/text.ts +368 -0
- package/src/reads.ts +315 -0
- package/src/request.ts +230 -0
- package/src/send.ts +175 -0
- package/src/types/schema.ts +1827 -0
- package/src/ws.ts +383 -0
- package/README.md +0 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifiers shared by decode, send and the reads.
|
|
3
|
+
*
|
|
4
|
+
* Milky names a conversation by `(message_scene, peer_id)` and a message by `message_seq`, which is only unique inside
|
|
5
|
+
* that conversation. DSH needs ids that are globally unique per bot, readable in logs, and decomposable before a
|
|
6
|
+
* platform call, so both are compound text:
|
|
7
|
+
*
|
|
8
|
+
* - chat: `group:<group_id>` / `private:<user_id>` / `temporary:<user_id>`;
|
|
9
|
+
* - message: `g|f|t:<peer_id>:<message_seq>`;
|
|
10
|
+
* - file part (an upload to the file area, not a message): `g|f|t:<peer_id>:file:<file_id>`.
|
|
11
|
+
*/
|
|
12
|
+
import type { ChatRef } from '@deepseek-ai/cordis-plugin-im-core';
|
|
13
|
+
/** The three Milky message scenes. */
|
|
14
|
+
export type MilkyScene = 'friend' | 'group' | 'temp';
|
|
15
|
+
/** A decomposed chat id. */
|
|
16
|
+
export interface MilkyChatId {
|
|
17
|
+
scene: MilkyScene;
|
|
18
|
+
peerId: number;
|
|
19
|
+
}
|
|
20
|
+
/** A decomposed message id. */
|
|
21
|
+
export interface MilkyMessageId extends MilkyChatId {
|
|
22
|
+
messageSeq: number;
|
|
23
|
+
}
|
|
24
|
+
/** A decomposed file part id. */
|
|
25
|
+
export interface MilkyFilePartId extends MilkyChatId {
|
|
26
|
+
fileId: string;
|
|
27
|
+
}
|
|
28
|
+
/** Chat type DSH sees for a scene. */
|
|
29
|
+
export declare function chatTypeOf(scene: MilkyScene): ChatRef['type'];
|
|
30
|
+
/**
|
|
31
|
+
* Chat id of one scene and peer.
|
|
32
|
+
* @param scene - Milky message scene.
|
|
33
|
+
* @param peerId - group number or user number.
|
|
34
|
+
* @returns the stable chat id.
|
|
35
|
+
*/
|
|
36
|
+
export declare function chatIdOf(scene: MilkyScene, peerId: number | string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Split a chat id back into its scene and peer.
|
|
39
|
+
* @param chatId - chat id as this adapter writes it.
|
|
40
|
+
* @returns the parts, or `undefined` for a chat id of another adapter.
|
|
41
|
+
*/
|
|
42
|
+
export declare function decodeChatId(chatId: string): MilkyChatId | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Chat reference of one scene and peer.
|
|
45
|
+
* @param scene - Milky message scene.
|
|
46
|
+
* @param peerId - group number or user number.
|
|
47
|
+
* @param name - chat name, when the event carries one.
|
|
48
|
+
* @returns the chat reference.
|
|
49
|
+
*/
|
|
50
|
+
export declare function chatRefOf(scene: MilkyScene, peerId: number, name?: string): ChatRef;
|
|
51
|
+
/**
|
|
52
|
+
* Message id of one platform message.
|
|
53
|
+
* @param scene - Milky message scene.
|
|
54
|
+
* @param peerId - group number or user number.
|
|
55
|
+
* @param messageSeq - `message_seq` inside that conversation.
|
|
56
|
+
* @returns the message id.
|
|
57
|
+
*/
|
|
58
|
+
export declare function messageIdOf(scene: MilkyScene, peerId: number, messageSeq: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* Split a message id back into scene, peer and sequence.
|
|
61
|
+
* @param id - message id as this adapter writes it.
|
|
62
|
+
* @returns the parts, or `undefined` when `id` is not a message id (a file part id included).
|
|
63
|
+
*/
|
|
64
|
+
export declare function decodeMessageId(id: string): MilkyMessageId | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* File part id of one upload to the QQ file area.
|
|
67
|
+
* @param scene - Milky message scene of the chat.
|
|
68
|
+
* @param peerId - group number or user number.
|
|
69
|
+
* @param fileId - platform `file_id` the upload returned.
|
|
70
|
+
* @returns the file part id.
|
|
71
|
+
*/
|
|
72
|
+
export declare function filePartIdOf(scene: MilkyScene, peerId: number, fileId: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Split a file part id back into scene, peer and file id.
|
|
75
|
+
* @param id - part id as this adapter writes it.
|
|
76
|
+
* @returns the parts, or `undefined` when `id` is not a file part id.
|
|
77
|
+
*/
|
|
78
|
+
export declare function decodeFilePartId(id: string): MilkyFilePartId | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether a decomposed id names the given chat.
|
|
81
|
+
* @param scene - scene of the id.
|
|
82
|
+
* @param peerId - peer of the id.
|
|
83
|
+
* @param chat - chat id the caller is sending into.
|
|
84
|
+
* @returns true when they describe the same conversation.
|
|
85
|
+
*/
|
|
86
|
+
export declare function idNamesChat(scene: MilkyScene, peerId: number, chat: MilkyChatId | undefined): boolean;
|
|
87
|
+
/** Scene token of the `/files/:scene/:peer/:fileId` internal route. */
|
|
88
|
+
export declare function fileSceneToken(scene: MilkyScene): 'group' | 'private' | 'temp';
|
|
89
|
+
/**
|
|
90
|
+
* Event id of one recall, unique per recalled message.
|
|
91
|
+
* @param scene - scene of the recalled message.
|
|
92
|
+
* @param peerId - peer of the recalled message.
|
|
93
|
+
* @param messageSeq - sequence of the recalled message.
|
|
94
|
+
* @returns the event id.
|
|
95
|
+
*/
|
|
96
|
+
export declare function recallEventId(scene: MilkyScene, peerId: number, messageSeq: number): string;
|
|
97
|
+
/**
|
|
98
|
+
* Event id of one reaction change. `isAdd` is part of the key because the same user may add and remove the same
|
|
99
|
+
* reaction more than once.
|
|
100
|
+
*
|
|
101
|
+
* @param groupId - group the reaction happened in.
|
|
102
|
+
* @param messageSeq - reacted message sequence.
|
|
103
|
+
* @param userId - user who reacted.
|
|
104
|
+
* @param reactionType - `face` or `emoji`.
|
|
105
|
+
* @param faceId - reaction id.
|
|
106
|
+
* @param isAdd - whether the reaction was added (`false` = removed).
|
|
107
|
+
* @returns the event id.
|
|
108
|
+
*/
|
|
109
|
+
export declare function reactionEventId(groupId: number, messageSeq: number, userId: number, reactionType: string, faceId: string, isAdd: boolean): string;
|
|
110
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,sCAAsC;AACtC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AA4BpD,4BAA4B;AAC5B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,+BAA+B;AAC/B,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,iCAAiC;AACjC,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,MAAM,EAAE,MAAM,CAAA;CACf;AAED,sCAAsC;AACtC,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE3E;AAED;;;;GAIG;A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0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifiers shared by decode, send and the reads.
|
|
3
|
+
*
|
|
4
|
+
* Milky names a conversation by `(message_scene, peer_id)` and a message by `message_seq`, which is only unique inside
|
|
5
|
+
* that conversation. DSH needs ids that are globally unique per bot, readable in logs, and decomposable before a
|
|
6
|
+
* platform call, so both are compound text:
|
|
7
|
+
*
|
|
8
|
+
* - chat: `group:<group_id>` / `private:<user_id>` / `temporary:<user_id>`;
|
|
9
|
+
* - message: `g|f|t:<peer_id>:<message_seq>`;
|
|
10
|
+
* - file part (an upload to the file area, not a message): `g|f|t:<peer_id>:file:<file_id>`.
|
|
11
|
+
*/
|
|
12
|
+
/** Scene letter of a message / file part id. */
|
|
13
|
+
const SCENE_PREFIX = {
|
|
14
|
+
group: 'g',
|
|
15
|
+
friend: 'f',
|
|
16
|
+
temp: 't',
|
|
17
|
+
};
|
|
18
|
+
const PREFIX_SCENE = {
|
|
19
|
+
g: 'group',
|
|
20
|
+
f: 'friend',
|
|
21
|
+
t: 'temp',
|
|
22
|
+
};
|
|
23
|
+
/** Chat id prefix of a scene. */
|
|
24
|
+
const CHAT_PREFIX = {
|
|
25
|
+
group: 'group',
|
|
26
|
+
friend: 'private',
|
|
27
|
+
temp: 'temporary',
|
|
28
|
+
};
|
|
29
|
+
const CHAT_SCENE = {
|
|
30
|
+
group: 'group',
|
|
31
|
+
private: 'friend',
|
|
32
|
+
temporary: 'temp',
|
|
33
|
+
};
|
|
34
|
+
/** Chat type DSH sees for a scene. */
|
|
35
|
+
export function chatTypeOf(scene) {
|
|
36
|
+
return scene === 'group' ? 'group' : 'direct';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Chat id of one scene and peer.
|
|
40
|
+
* @param scene - Milky message scene.
|
|
41
|
+
* @param peerId - group number or user number.
|
|
42
|
+
* @returns the stable chat id.
|
|
43
|
+
*/
|
|
44
|
+
export function chatIdOf(scene, peerId) {
|
|
45
|
+
return `${CHAT_PREFIX[scene]}:${peerId}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Split a chat id back into its scene and peer.
|
|
49
|
+
* @param chatId - chat id as this adapter writes it.
|
|
50
|
+
* @returns the parts, or `undefined` for a chat id of another adapter.
|
|
51
|
+
*/
|
|
52
|
+
export function decodeChatId(chatId) {
|
|
53
|
+
const match = /^(group|private|temporary):(\d+)$/.exec(chatId);
|
|
54
|
+
if (!match)
|
|
55
|
+
return;
|
|
56
|
+
const scene = CHAT_SCENE[match[1]];
|
|
57
|
+
const peerId = Number(match[2]);
|
|
58
|
+
if (!Number.isSafeInteger(peerId))
|
|
59
|
+
return;
|
|
60
|
+
return { scene, peerId };
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Chat reference of one scene and peer.
|
|
64
|
+
* @param scene - Milky message scene.
|
|
65
|
+
* @param peerId - group number or user number.
|
|
66
|
+
* @param name - chat name, when the event carries one.
|
|
67
|
+
* @returns the chat reference.
|
|
68
|
+
*/
|
|
69
|
+
export function chatRefOf(scene, peerId, name) {
|
|
70
|
+
return {
|
|
71
|
+
id: chatIdOf(scene, peerId),
|
|
72
|
+
type: chatTypeOf(scene),
|
|
73
|
+
...(name === undefined || name === '' ? {} : { name }),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Message id of one platform message.
|
|
78
|
+
* @param scene - Milky message scene.
|
|
79
|
+
* @param peerId - group number or user number.
|
|
80
|
+
* @param messageSeq - `message_seq` inside that conversation.
|
|
81
|
+
* @returns the message id.
|
|
82
|
+
*/
|
|
83
|
+
export function messageIdOf(scene, peerId, messageSeq) {
|
|
84
|
+
return `${SCENE_PREFIX[scene]}:${peerId}:${messageSeq}`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Split a message id back into scene, peer and sequence.
|
|
88
|
+
* @param id - message id as this adapter writes it.
|
|
89
|
+
* @returns the parts, or `undefined` when `id` is not a message id (a file part id included).
|
|
90
|
+
*/
|
|
91
|
+
export function decodeMessageId(id) {
|
|
92
|
+
const match = /^([gft]):(\d+):(\d+)$/.exec(id);
|
|
93
|
+
if (!match)
|
|
94
|
+
return;
|
|
95
|
+
const scene = PREFIX_SCENE[match[1]];
|
|
96
|
+
const peerId = Number(match[2]);
|
|
97
|
+
const messageSeq = Number(match[3]);
|
|
98
|
+
if (!Number.isSafeInteger(peerId) || !Number.isSafeInteger(messageSeq))
|
|
99
|
+
return;
|
|
100
|
+
return { scene, peerId, messageSeq };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* File part id of one upload to the QQ file area.
|
|
104
|
+
* @param scene - Milky message scene of the chat.
|
|
105
|
+
* @param peerId - group number or user number.
|
|
106
|
+
* @param fileId - platform `file_id` the upload returned.
|
|
107
|
+
* @returns the file part id.
|
|
108
|
+
*/
|
|
109
|
+
export function filePartIdOf(scene, peerId, fileId) {
|
|
110
|
+
return `${SCENE_PREFIX[scene]}:${peerId}:file:${fileId}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Split a file part id back into scene, peer and file id.
|
|
114
|
+
* @param id - part id as this adapter writes it.
|
|
115
|
+
* @returns the parts, or `undefined` when `id` is not a file part id.
|
|
116
|
+
*/
|
|
117
|
+
export function decodeFilePartId(id) {
|
|
118
|
+
const match = /^([gft]):(\d+):file:(.+)$/.exec(id);
|
|
119
|
+
if (!match)
|
|
120
|
+
return;
|
|
121
|
+
return {
|
|
122
|
+
scene: PREFIX_SCENE[match[1]],
|
|
123
|
+
peerId: Number(match[2]),
|
|
124
|
+
fileId: match[3],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether a decomposed id names the given chat.
|
|
129
|
+
* @param scene - scene of the id.
|
|
130
|
+
* @param peerId - peer of the id.
|
|
131
|
+
* @param chat - chat id the caller is sending into.
|
|
132
|
+
* @returns true when they describe the same conversation.
|
|
133
|
+
*/
|
|
134
|
+
export function idNamesChat(scene, peerId, chat) {
|
|
135
|
+
return chat !== undefined && chat.scene === scene && chat.peerId === peerId;
|
|
136
|
+
}
|
|
137
|
+
/** Scene token of the `/files/:scene/:peer/:fileId` internal route. */
|
|
138
|
+
export function fileSceneToken(scene) {
|
|
139
|
+
return scene === 'group' ? 'group' : scene === 'friend' ? 'private' : 'temp';
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Event id of one recall, unique per recalled message.
|
|
143
|
+
* @param scene - scene of the recalled message.
|
|
144
|
+
* @param peerId - peer of the recalled message.
|
|
145
|
+
* @param messageSeq - sequence of the recalled message.
|
|
146
|
+
* @returns the event id.
|
|
147
|
+
*/
|
|
148
|
+
export function recallEventId(scene, peerId, messageSeq) {
|
|
149
|
+
return `recall:${SCENE_PREFIX[scene]}:${peerId}:${messageSeq}`;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Event id of one reaction change. `isAdd` is part of the key because the same user may add and remove the same
|
|
153
|
+
* reaction more than once.
|
|
154
|
+
*
|
|
155
|
+
* @param groupId - group the reaction happened in.
|
|
156
|
+
* @param messageSeq - reacted message sequence.
|
|
157
|
+
* @param userId - user who reacted.
|
|
158
|
+
* @param reactionType - `face` or `emoji`.
|
|
159
|
+
* @param faceId - reaction id.
|
|
160
|
+
* @param isAdd - whether the reaction was added (`false` = removed).
|
|
161
|
+
* @returns the event id.
|
|
162
|
+
*/
|
|
163
|
+
export function reactionEventId(groupId, messageSeq, userId, reactionType, faceId, isAdd) {
|
|
164
|
+
return `reaction:${groupId}:${messageSeq}:${userId}:${reactionType}:${faceId}:${isAdd ? 1 : 0}`;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,gDAAgD;AAChD,MAAM,YAAY,GAA+B;IAC/C,KAAK,EAAE,GAAG;IACV,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AAA;IAClD,IAAI,CAAC,KAAK;QAAE,OAAM;IAClB,OAAO;QACL,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAE,CAAE;QAC/B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAE;KAClB,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,KAAiB,EACjB,MAAc,EACd,IAA6B;IAE7B,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAA;AAC7E,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,cAAc,CAC5B,KAAiB;IAEjB,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAA;AAC9E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAiB,EACjB,MAAc,EACd,UAAkB;IAElB,OAAO,UAAU,YAAY,CAAC,KAAK,CAAC,IAAI,MAAM,IAAI,UAAU,EAAE,CAAA;AAChE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,UAAkB,EAClB,MAAc,EACd,YAAoB,EACpB,MAAc,EACd,KAAc;IAEd,OAAO,YAAY,OAAO,IAAI,UAAU,IAAI,MAAM,IAAI,YAAY,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACjG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Public surface of the Milky adapter: the plugin class, its configuration, the API client and the error types. */
|
|
2
|
+
export { MilkyBot, MilkyBot as default, type MilkyModes } from './bot.ts';
|
|
3
|
+
export { Config, type Config as MilkyConfig, type MilkyWsConfig, } from './config.ts';
|
|
4
|
+
export type { MilkyReferrer } from './decode.ts';
|
|
5
|
+
export { MilkyApiError, MilkyConfigError, MilkyIdentityError, classifyMilkyError, } from './errors.ts';
|
|
6
|
+
export { chatIdOf, chatRefOf, decodeChatId, decodeFilePartId, decodeMessageId, filePartIdOf, messageIdOf, type MilkyChatId, type MilkyFilePartId, type MilkyMessageId, type MilkyScene, } from './ids.ts';
|
|
7
|
+
export { Internal } from './internal.ts';
|
|
8
|
+
export { createMilkyTextMode, type MilkyDraft, type MilkyMediaKind, type MilkyMessageDraft, type MilkyModeTypes, type MilkyNode, type MilkyPayload, } from './modes/text.ts';
|
|
9
|
+
export { eventUrl, milkyOrigin, normalizeEndpoint, type MilkyRequest, } from './request.ts';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAEpH,OAAO,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AACzE,OAAO,EACL,MAAM,EACN,KAAK,MAAM,IAAI,WAAW,EAC1B,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Public surface of the Milky adapter: the plugin class, its configuration, the API client and the error types. */
|
|
2
|
+
export { MilkyBot, MilkyBot as default } from "./bot.js";
|
|
3
|
+
export { Config, } from "./config.js";
|
|
4
|
+
export { MilkyApiError, MilkyConfigError, MilkyIdentityError, classifyMilkyError, } from "./errors.js";
|
|
5
|
+
export { chatIdOf, chatRefOf, decodeChatId, decodeFilePartId, decodeMessageId, filePartIdOf, messageIdOf, } from "./ids.js";
|
|
6
|
+
export { Internal } from "./internal.js";
|
|
7
|
+
export { createMilkyTextMode, } from "./modes/text.js";
|
|
8
|
+
export { eventUrl, milkyOrigin, normalizeEndpoint, } from "./request.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAEpH,OAAO,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAmB,MAAM,UAAU,CAAA;AACzE,OAAO,EACL,MAAM,GAGP,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,GAKZ,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,mBAAmB,GAOpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,iBAAiB,GAElB,MAAM,cAAc,CAAA"}
|