@dsh-plugin/dsh-synapse 0.0.0-stage → 0.1.0-dev.41044818627
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 +661 -0
- package/NOTICE.md +18 -0
- package/README.md +136 -2
- package/cordis.patch.yml +3 -0
- package/lib/bot.cjs +8314 -0
- package/lib/bot.cjs.map +7 -0
- package/lib/build.json +1 -0
- package/lib/client.js +46 -0
- package/lib/host/agent.d.ts +21 -0
- package/lib/host/agent.js +151 -0
- package/lib/host/agent.js.map +1 -0
- package/lib/host/bot.d.ts +17 -0
- package/lib/host/bot.js +158 -0
- package/lib/host/bot.js.map +1 -0
- package/lib/host/client.d.ts +2 -0
- package/lib/host/client.js +19 -0
- package/lib/host/client.js.map +1 -0
- package/lib/host/config.d.ts +24 -0
- package/lib/host/config.js +192 -0
- package/lib/host/config.js.map +1 -0
- package/lib/host/files.d.ts +29 -0
- package/lib/host/files.js +188 -0
- package/lib/host/files.js.map +1 -0
- package/lib/host/gateway.d.ts +33 -0
- package/lib/host/gateway.js +237 -0
- package/lib/host/gateway.js.map +1 -0
- package/lib/host/github.d.ts +47 -0
- package/lib/host/github.js +219 -0
- package/lib/host/github.js.map +1 -0
- package/lib/host/http.d.ts +4 -0
- package/lib/host/http.js +41 -0
- package/lib/host/http.js.map +1 -0
- package/lib/host/index.d.ts +32 -0
- package/lib/host/index.js +192 -0
- package/lib/host/index.js.map +1 -0
- package/lib/host/inference-worker.d.ts +1 -0
- package/lib/host/inference-worker.js +72 -0
- package/lib/host/inference-worker.js.map +1 -0
- package/lib/host/mcp.d.ts +138 -0
- package/lib/host/mcp.js +104 -0
- package/lib/host/mcp.js.map +1 -0
- package/lib/host/memory.d.ts +26 -0
- package/lib/host/memory.js +155 -0
- package/lib/host/memory.js.map +1 -0
- package/lib/host/panel.d.ts +1 -0
- package/lib/host/panel.html +174 -0
- package/lib/host/panel.js +388 -0
- package/lib/host/panel.js.map +1 -0
- package/lib/host/runtime.d.ts +21 -0
- package/lib/host/runtime.js +145 -0
- package/lib/host/runtime.js.map +1 -0
- package/lib/host/types.d.ts +112 -0
- package/lib/host/types.js +2 -0
- package/lib/host/types.js.map +1 -0
- package/package.json +94 -4
- package/scripts/build.mjs +90 -0
- package/scripts/check.mjs +13 -0
- package/scripts/dump-npm-latest.mjs +49 -0
- package/scripts/model-smoke.mjs +25 -0
- package/src/agent.ts +203 -0
- package/src/bot.ts +173 -0
- package/src/client.ts +20 -0
- package/src/config.ts +217 -0
- package/src/files.ts +206 -0
- package/src/gateway.ts +276 -0
- package/src/github.ts +263 -0
- package/src/http.ts +41 -0
- package/src/index.ts +227 -0
- package/src/inference-worker.ts +89 -0
- package/src/mcp.ts +112 -0
- package/src/memory.ts +178 -0
- package/src/panel.html +174 -0
- package/src/panel.ts +440 -0
- package/src/runtime.ts +164 -0
- package/src/types.ts +106 -0
- package/test/core.test.mjs +279 -0
- package/test/fixtures/mcp-server.mjs +14 -0
- package/test/integration.test.mjs +253 -0
- package/test/panel.test.mjs +73 -0
- package/tsconfig.json +18 -0
- package/vendor/gugle-chat-bot/LICENSE +661 -0
- package/vendor/gugle-chat-bot/package.json +57 -0
- package/vendor/gugle-chat-bot/src/allow-rule.yml +9345 -0
- package/vendor/gugle-chat-bot/src/api.json +4285 -0
- package/vendor/gugle-chat-bot/src/command/index.ts +141 -0
- package/vendor/gugle-chat-bot/src/config/features.ts +548 -0
- package/vendor/gugle-chat-bot/src/config/index.ts +184 -0
- package/vendor/gugle-chat-bot/src/config/manager.ts +357 -0
- package/vendor/gugle-chat-bot/src/constants/index.ts +13 -0
- package/vendor/gugle-chat-bot/src/custom.ts +548 -0
- package/vendor/gugle-chat-bot/src/event/index.ts +118 -0
- package/vendor/gugle-chat-bot/src/features/admin/index.ts +414 -0
- package/vendor/gugle-chat-bot/src/features/bili/image/impl/video.ts +39 -0
- package/vendor/gugle-chat-bot/src/features/bili/image/index.ts +37 -0
- package/vendor/gugle-chat-bot/src/features/bili/index.ts +65 -0
- package/vendor/gugle-chat-bot/src/features/bili/template/style/video.css +97 -0
- package/vendor/gugle-chat-bot/src/features/bili/template/video.html +57 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/index.ts +1128 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/markdown.ts +105 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/slash.ts +355 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/source.ts +96 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/template/message.html +14 -0
- package/vendor/gugle-chat-bot/src/features/discord-bridge/template/style/message.css +144 -0
- package/vendor/gugle-chat-bot/src/features/github/api.ts +93 -0
- package/vendor/gugle-chat-bot/src/features/github/binding.ts +161 -0
- package/vendor/gugle-chat-bot/src/features/github/image/impl/issue.ts +132 -0
- package/vendor/gugle-chat-bot/src/features/github/image/impl/pr.ts +144 -0
- package/vendor/gugle-chat-bot/src/features/github/image/impl/release.ts +160 -0
- package/vendor/gugle-chat-bot/src/features/github/image/index.ts +310 -0
- package/vendor/gugle-chat-bot/src/features/github/index.ts +302 -0
- package/vendor/gugle-chat-bot/src/features/github/template/issue.html +118 -0
- package/vendor/gugle-chat-bot/src/features/github/template/pull_request.html +125 -0
- package/vendor/gugle-chat-bot/src/features/github/template/release.html +53 -0
- package/vendor/gugle-chat-bot/src/features/github/template/style/issue.css +468 -0
- package/vendor/gugle-chat-bot/src/features/github/template/style/pull_request.css +469 -0
- package/vendor/gugle-chat-bot/src/features/github/template/style/release.css +412 -0
- package/vendor/gugle-chat-bot/src/features/hermes/client.ts +184 -0
- package/vendor/gugle-chat-bot/src/features/hermes/config.ts +210 -0
- package/vendor/gugle-chat-bot/src/features/hermes/context.ts +67 -0
- package/vendor/gugle-chat-bot/src/features/hermes/history.ts +86 -0
- package/vendor/gugle-chat-bot/src/features/hermes/index.ts +1533 -0
- package/vendor/gugle-chat-bot/src/features/hermes/message.ts +319 -0
- package/vendor/gugle-chat-bot/src/features/hermes/reaction.ts +181 -0
- package/vendor/gugle-chat-bot/src/features/hermes/render.ts +118 -0
- package/vendor/gugle-chat-bot/src/features/hermes/reply-units.ts +331 -0
- package/vendor/gugle-chat-bot/src/features/hermes/skills.ts +406 -0
- package/vendor/gugle-chat-bot/src/features/hermes/template/approval.html +30 -0
- package/vendor/gugle-chat-bot/src/features/hermes/template/progress.html +21 -0
- package/vendor/gugle-chat-bot/src/features/hermes/template/style/approval.css +81 -0
- package/vendor/gugle-chat-bot/src/features/hermes/template/style/progress.css +120 -0
- package/vendor/gugle-chat-bot/src/features/hermes/trigger.ts +86 -0
- package/vendor/gugle-chat-bot/src/features/hermes/types.ts +327 -0
- package/vendor/gugle-chat-bot/src/features/management/index.ts +156 -0
- package/vendor/gugle-chat-bot/src/features/minecraft/index.ts +127 -0
- package/vendor/gugle-chat-bot/src/features/modrinth/index.ts +71 -0
- package/vendor/gugle-chat-bot/src/features/parentheses/index.ts +117 -0
- package/vendor/gugle-chat-bot/src/features/peak-valley-timer/index.ts +452 -0
- package/vendor/gugle-chat-bot/src/features/poke/index.ts +24 -0
- package/vendor/gugle-chat-bot/src/features/version-tracker/index.ts +78 -0
- package/vendor/gugle-chat-bot/src/features/welcome/index.ts +58 -0
- package/vendor/gugle-chat-bot/src/github-ip.json +5814 -0
- package/vendor/gugle-chat-bot/src/image/index.ts +278 -0
- package/vendor/gugle-chat-bot/src/index.ts +695 -0
- package/vendor/gugle-chat-bot/src/logger/index.ts +54 -0
- package/vendor/gugle-chat-bot/src/result.json +359 -0
- package/vendor/gugle-chat-bot/src/type/bili.d.ts +825 -0
- package/vendor/gugle-chat-bot/src/type/event.d.ts +146 -0
- package/vendor/gugle-chat-bot/src/type/github.d.ts +446 -0
- package/vendor/gugle-chat-bot/src/type/index.d.ts +254 -0
- package/vendor/gugle-chat-bot/tsconfig.json +46 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
export interface Sender {
|
|
2
|
+
user_id: number;
|
|
3
|
+
nickname: string;
|
|
4
|
+
card: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type GroupSender = Sender & {
|
|
8
|
+
role: 'member' | 'owner' | 'admin';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface TextMessage {
|
|
12
|
+
type: 'text';
|
|
13
|
+
data: {
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AtMessage {
|
|
19
|
+
type: 'at';
|
|
20
|
+
data: {
|
|
21
|
+
qq: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ImageMessage {
|
|
26
|
+
type: 'image';
|
|
27
|
+
data: {
|
|
28
|
+
file: string;
|
|
29
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
30
|
+
url?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FaceMessage {
|
|
35
|
+
type: 'face';
|
|
36
|
+
data: {
|
|
37
|
+
id: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface JsonMessage {
|
|
42
|
+
type: 'json';
|
|
43
|
+
data: {
|
|
44
|
+
data: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface RecordMessage {
|
|
49
|
+
type: 'record';
|
|
50
|
+
data: {
|
|
51
|
+
file: string;
|
|
52
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
53
|
+
url?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface VideoMessage {
|
|
58
|
+
type: 'video';
|
|
59
|
+
data: {
|
|
60
|
+
file: string;
|
|
61
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
62
|
+
url?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ReplyMessage {
|
|
67
|
+
type: 'reply';
|
|
68
|
+
data: {
|
|
69
|
+
id: number;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface EnumMusicMessageData {
|
|
74
|
+
type: '163' | 'qq';
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CustomMusicMessageData {
|
|
79
|
+
type: 'custom';
|
|
80
|
+
url: string;
|
|
81
|
+
audio: string;
|
|
82
|
+
title: string;
|
|
83
|
+
image: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type MusicMessageData = EnumMusicMessageData | CustomMusicMessageData;
|
|
87
|
+
|
|
88
|
+
export interface MusicMessage {
|
|
89
|
+
type: 'music';
|
|
90
|
+
data: MusicMessageData;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface DiceMessage {
|
|
94
|
+
type: 'dice';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface RpsMessage {
|
|
98
|
+
type: 'rps';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface FileMessage {
|
|
102
|
+
type: 'file';
|
|
103
|
+
data: {
|
|
104
|
+
file: string;
|
|
105
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
106
|
+
url?: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type Message =
|
|
111
|
+
| TextMessage
|
|
112
|
+
| AtMessage
|
|
113
|
+
| FaceMessage
|
|
114
|
+
| JsonMessage
|
|
115
|
+
| RecordMessage
|
|
116
|
+
| VideoMessage
|
|
117
|
+
| ImageMessage
|
|
118
|
+
| ReplyMessage
|
|
119
|
+
| MusicMessage
|
|
120
|
+
| DiceMessage
|
|
121
|
+
| RpsMessage
|
|
122
|
+
| FileMessage;
|
|
123
|
+
|
|
124
|
+
export interface NodeMessage {
|
|
125
|
+
type: 'node';
|
|
126
|
+
data: {
|
|
127
|
+
user_id: number;
|
|
128
|
+
nickname: string;
|
|
129
|
+
content: Message[];
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface ForwardMessage {
|
|
134
|
+
type: 'forward';
|
|
135
|
+
data: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type SentMessage = Message[] | NodeMessage[];
|
|
141
|
+
|
|
142
|
+
export type ReceiveMessage = Message[] | ForwardMessage[];
|
|
143
|
+
|
|
144
|
+
export interface MetaEventWSMSG {
|
|
145
|
+
post_type: 'meta_event';
|
|
146
|
+
time: number;
|
|
147
|
+
self_id: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type HeartbeatMetaEventWSMSG = MetaEventWSMSG & {
|
|
151
|
+
meta_event_type: 'heartbeat';
|
|
152
|
+
status: { online: boolean; good: boolean };
|
|
153
|
+
interval: number;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export type LifecycleMetaEventWSMSG = MetaEventWSMSG & {
|
|
157
|
+
meta_event_type: 'lifecycle';
|
|
158
|
+
sub_type: 'connect';
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type AllMetaEventWSMSG = LifecycleMetaEventWSMSG | HeartbeatMetaEventWSMSG;
|
|
162
|
+
|
|
163
|
+
export interface MessageWSMSG {
|
|
164
|
+
post_type: 'message';
|
|
165
|
+
self_id: number;
|
|
166
|
+
user_id: number;
|
|
167
|
+
time: number;
|
|
168
|
+
message_id: number;
|
|
169
|
+
message_seq: number;
|
|
170
|
+
real_id: number;
|
|
171
|
+
real_seq: string;
|
|
172
|
+
raw_message: string;
|
|
173
|
+
font: number;
|
|
174
|
+
sub_type: 'friend' | 'normal';
|
|
175
|
+
message: ReceiveMessage;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type GroupMessageWSMSG = MessageWSMSG & {
|
|
179
|
+
message_type: 'group';
|
|
180
|
+
sender: GroupSender;
|
|
181
|
+
group_id: number;
|
|
182
|
+
group_name: string;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export type PrivateMessageWSMSG = MessageWSMSG & {
|
|
186
|
+
message_type: 'private';
|
|
187
|
+
sender: Sender;
|
|
188
|
+
target_id: number;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type AllMessageWSMSG = GroupMessageWSMSG | PrivateMessageWSMSG;
|
|
192
|
+
|
|
193
|
+
export type NoticeWSMSG = {
|
|
194
|
+
post_type: 'notice';
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type NotifyNoticeWSMSG = NoticeWSMSG & {
|
|
198
|
+
notice_type: 'notify';
|
|
199
|
+
sub_type: 'poke' | string;
|
|
200
|
+
group_id?: number;
|
|
201
|
+
target_id: number;
|
|
202
|
+
self_id: number;
|
|
203
|
+
user_id: number;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export type GroupDecreaseNoticeWSMSG = NoticeWSMSG & {
|
|
207
|
+
notice_type: 'group_decrease';
|
|
208
|
+
self_id: number;
|
|
209
|
+
group_id: number;
|
|
210
|
+
user_id: number;
|
|
211
|
+
sub_type: 'kick' | 'leave';
|
|
212
|
+
operator_id: number;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export type GroupIncreaseNoticeWSMSG = NoticeWSMSG & {
|
|
216
|
+
notice_type: 'group_increase';
|
|
217
|
+
self_id: number;
|
|
218
|
+
group_id: number;
|
|
219
|
+
user_id: number;
|
|
220
|
+
sub_type: 'invite' | 'approve';
|
|
221
|
+
operator_id: number;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export type AllNoticeWSMSG = NotifyNoticeWSMSG | GroupDecreaseNoticeWSMSG | GroupIncreaseNoticeWSMSG;
|
|
225
|
+
|
|
226
|
+
export type RequestWSMSG = {
|
|
227
|
+
post_type: 'request';
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export type GroupRequestWSMSG = RequestWSMSG & {
|
|
231
|
+
request_type: 'group';
|
|
232
|
+
self_id: number;
|
|
233
|
+
group_id: number;
|
|
234
|
+
user_id: number;
|
|
235
|
+
comment: string;
|
|
236
|
+
flag: string;
|
|
237
|
+
sub_type: 'add';
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export type AllRequestWSMSG = GroupRequestWSMSG;
|
|
241
|
+
|
|
242
|
+
export type WSMSG = AllMetaEventWSMSG | AllMessageWSMSG | AllNoticeWSMSG | AllRequestWSMSG;
|
|
243
|
+
|
|
244
|
+
export interface LoginInfoData {
|
|
245
|
+
user_id: number;
|
|
246
|
+
nickname: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface LoginInfo {
|
|
250
|
+
retcode: number;
|
|
251
|
+
data: LoginInfoData;
|
|
252
|
+
message: string;
|
|
253
|
+
wording: string;
|
|
254
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"paths": {
|
|
9
|
+
"@/*": ["src/*"]
|
|
10
|
+
},
|
|
11
|
+
// Environment Settings
|
|
12
|
+
// See also https://aka.ms/tsconfig/module
|
|
13
|
+
"module": "commonjs",
|
|
14
|
+
"target": "es2017",
|
|
15
|
+
// For nodejs:
|
|
16
|
+
// "lib": ["esnext"],
|
|
17
|
+
"types": ["node"],
|
|
18
|
+
// and npm install -D @types/node
|
|
19
|
+
|
|
20
|
+
// Other Outputs
|
|
21
|
+
"sourceMap": true,
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"declarationMap": true,
|
|
24
|
+
// Stricter Typechecking Options
|
|
25
|
+
"noUncheckedIndexedAccess": true,
|
|
26
|
+
"exactOptionalPropertyTypes": true,
|
|
27
|
+
// Style Options
|
|
28
|
+
// "noImplicitReturns": true,
|
|
29
|
+
// "noImplicitOverride": true,
|
|
30
|
+
// "noUnusedLocals": true,
|
|
31
|
+
// "noUnusedParameters": true,
|
|
32
|
+
// "noFallthroughCasesInSwitch": true,
|
|
33
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
+
|
|
35
|
+
// Recommended Options
|
|
36
|
+
"strict": true,
|
|
37
|
+
"jsx": "react-jsx",
|
|
38
|
+
// "verbatimModuleSyntax": true,
|
|
39
|
+
"esModuleInterop": true,
|
|
40
|
+
"isolatedModules": true,
|
|
41
|
+
"noUncheckedSideEffectImports": true,
|
|
42
|
+
"moduleDetection": "force",
|
|
43
|
+
"skipLibCheck": true
|
|
44
|
+
},
|
|
45
|
+
"exclude": ["node_modules", "dist", "scripts"]
|
|
46
|
+
}
|