@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.
Files changed (150) hide show
  1. package/LICENSE +661 -0
  2. package/NOTICE.md +18 -0
  3. package/README.md +136 -2
  4. package/cordis.patch.yml +3 -0
  5. package/lib/bot.cjs +8314 -0
  6. package/lib/bot.cjs.map +7 -0
  7. package/lib/build.json +1 -0
  8. package/lib/client.js +46 -0
  9. package/lib/host/agent.d.ts +21 -0
  10. package/lib/host/agent.js +151 -0
  11. package/lib/host/agent.js.map +1 -0
  12. package/lib/host/bot.d.ts +17 -0
  13. package/lib/host/bot.js +158 -0
  14. package/lib/host/bot.js.map +1 -0
  15. package/lib/host/client.d.ts +2 -0
  16. package/lib/host/client.js +19 -0
  17. package/lib/host/client.js.map +1 -0
  18. package/lib/host/config.d.ts +24 -0
  19. package/lib/host/config.js +192 -0
  20. package/lib/host/config.js.map +1 -0
  21. package/lib/host/files.d.ts +29 -0
  22. package/lib/host/files.js +188 -0
  23. package/lib/host/files.js.map +1 -0
  24. package/lib/host/gateway.d.ts +33 -0
  25. package/lib/host/gateway.js +237 -0
  26. package/lib/host/gateway.js.map +1 -0
  27. package/lib/host/github.d.ts +47 -0
  28. package/lib/host/github.js +219 -0
  29. package/lib/host/github.js.map +1 -0
  30. package/lib/host/http.d.ts +4 -0
  31. package/lib/host/http.js +41 -0
  32. package/lib/host/http.js.map +1 -0
  33. package/lib/host/index.d.ts +32 -0
  34. package/lib/host/index.js +192 -0
  35. package/lib/host/index.js.map +1 -0
  36. package/lib/host/inference-worker.d.ts +1 -0
  37. package/lib/host/inference-worker.js +72 -0
  38. package/lib/host/inference-worker.js.map +1 -0
  39. package/lib/host/mcp.d.ts +138 -0
  40. package/lib/host/mcp.js +104 -0
  41. package/lib/host/mcp.js.map +1 -0
  42. package/lib/host/memory.d.ts +26 -0
  43. package/lib/host/memory.js +155 -0
  44. package/lib/host/memory.js.map +1 -0
  45. package/lib/host/panel.d.ts +1 -0
  46. package/lib/host/panel.html +174 -0
  47. package/lib/host/panel.js +388 -0
  48. package/lib/host/panel.js.map +1 -0
  49. package/lib/host/runtime.d.ts +21 -0
  50. package/lib/host/runtime.js +145 -0
  51. package/lib/host/runtime.js.map +1 -0
  52. package/lib/host/types.d.ts +112 -0
  53. package/lib/host/types.js +2 -0
  54. package/lib/host/types.js.map +1 -0
  55. package/package.json +94 -4
  56. package/scripts/build.mjs +90 -0
  57. package/scripts/check.mjs +13 -0
  58. package/scripts/dump-npm-latest.mjs +49 -0
  59. package/scripts/model-smoke.mjs +25 -0
  60. package/src/agent.ts +203 -0
  61. package/src/bot.ts +173 -0
  62. package/src/client.ts +20 -0
  63. package/src/config.ts +217 -0
  64. package/src/files.ts +206 -0
  65. package/src/gateway.ts +276 -0
  66. package/src/github.ts +263 -0
  67. package/src/http.ts +41 -0
  68. package/src/index.ts +227 -0
  69. package/src/inference-worker.ts +89 -0
  70. package/src/mcp.ts +112 -0
  71. package/src/memory.ts +178 -0
  72. package/src/panel.html +174 -0
  73. package/src/panel.ts +440 -0
  74. package/src/runtime.ts +164 -0
  75. package/src/types.ts +106 -0
  76. package/test/core.test.mjs +279 -0
  77. package/test/fixtures/mcp-server.mjs +14 -0
  78. package/test/integration.test.mjs +253 -0
  79. package/test/panel.test.mjs +73 -0
  80. package/tsconfig.json +18 -0
  81. package/vendor/gugle-chat-bot/LICENSE +661 -0
  82. package/vendor/gugle-chat-bot/package.json +57 -0
  83. package/vendor/gugle-chat-bot/src/allow-rule.yml +9345 -0
  84. package/vendor/gugle-chat-bot/src/api.json +4285 -0
  85. package/vendor/gugle-chat-bot/src/command/index.ts +141 -0
  86. package/vendor/gugle-chat-bot/src/config/features.ts +548 -0
  87. package/vendor/gugle-chat-bot/src/config/index.ts +184 -0
  88. package/vendor/gugle-chat-bot/src/config/manager.ts +357 -0
  89. package/vendor/gugle-chat-bot/src/constants/index.ts +13 -0
  90. package/vendor/gugle-chat-bot/src/custom.ts +548 -0
  91. package/vendor/gugle-chat-bot/src/event/index.ts +118 -0
  92. package/vendor/gugle-chat-bot/src/features/admin/index.ts +414 -0
  93. package/vendor/gugle-chat-bot/src/features/bili/image/impl/video.ts +39 -0
  94. package/vendor/gugle-chat-bot/src/features/bili/image/index.ts +37 -0
  95. package/vendor/gugle-chat-bot/src/features/bili/index.ts +65 -0
  96. package/vendor/gugle-chat-bot/src/features/bili/template/style/video.css +97 -0
  97. package/vendor/gugle-chat-bot/src/features/bili/template/video.html +57 -0
  98. package/vendor/gugle-chat-bot/src/features/discord-bridge/index.ts +1128 -0
  99. package/vendor/gugle-chat-bot/src/features/discord-bridge/markdown.ts +105 -0
  100. package/vendor/gugle-chat-bot/src/features/discord-bridge/slash.ts +355 -0
  101. package/vendor/gugle-chat-bot/src/features/discord-bridge/source.ts +96 -0
  102. package/vendor/gugle-chat-bot/src/features/discord-bridge/template/message.html +14 -0
  103. package/vendor/gugle-chat-bot/src/features/discord-bridge/template/style/message.css +144 -0
  104. package/vendor/gugle-chat-bot/src/features/github/api.ts +93 -0
  105. package/vendor/gugle-chat-bot/src/features/github/binding.ts +161 -0
  106. package/vendor/gugle-chat-bot/src/features/github/image/impl/issue.ts +132 -0
  107. package/vendor/gugle-chat-bot/src/features/github/image/impl/pr.ts +144 -0
  108. package/vendor/gugle-chat-bot/src/features/github/image/impl/release.ts +160 -0
  109. package/vendor/gugle-chat-bot/src/features/github/image/index.ts +310 -0
  110. package/vendor/gugle-chat-bot/src/features/github/index.ts +302 -0
  111. package/vendor/gugle-chat-bot/src/features/github/template/issue.html +118 -0
  112. package/vendor/gugle-chat-bot/src/features/github/template/pull_request.html +125 -0
  113. package/vendor/gugle-chat-bot/src/features/github/template/release.html +53 -0
  114. package/vendor/gugle-chat-bot/src/features/github/template/style/issue.css +468 -0
  115. package/vendor/gugle-chat-bot/src/features/github/template/style/pull_request.css +469 -0
  116. package/vendor/gugle-chat-bot/src/features/github/template/style/release.css +412 -0
  117. package/vendor/gugle-chat-bot/src/features/hermes/client.ts +184 -0
  118. package/vendor/gugle-chat-bot/src/features/hermes/config.ts +210 -0
  119. package/vendor/gugle-chat-bot/src/features/hermes/context.ts +67 -0
  120. package/vendor/gugle-chat-bot/src/features/hermes/history.ts +86 -0
  121. package/vendor/gugle-chat-bot/src/features/hermes/index.ts +1533 -0
  122. package/vendor/gugle-chat-bot/src/features/hermes/message.ts +319 -0
  123. package/vendor/gugle-chat-bot/src/features/hermes/reaction.ts +181 -0
  124. package/vendor/gugle-chat-bot/src/features/hermes/render.ts +118 -0
  125. package/vendor/gugle-chat-bot/src/features/hermes/reply-units.ts +331 -0
  126. package/vendor/gugle-chat-bot/src/features/hermes/skills.ts +406 -0
  127. package/vendor/gugle-chat-bot/src/features/hermes/template/approval.html +30 -0
  128. package/vendor/gugle-chat-bot/src/features/hermes/template/progress.html +21 -0
  129. package/vendor/gugle-chat-bot/src/features/hermes/template/style/approval.css +81 -0
  130. package/vendor/gugle-chat-bot/src/features/hermes/template/style/progress.css +120 -0
  131. package/vendor/gugle-chat-bot/src/features/hermes/trigger.ts +86 -0
  132. package/vendor/gugle-chat-bot/src/features/hermes/types.ts +327 -0
  133. package/vendor/gugle-chat-bot/src/features/management/index.ts +156 -0
  134. package/vendor/gugle-chat-bot/src/features/minecraft/index.ts +127 -0
  135. package/vendor/gugle-chat-bot/src/features/modrinth/index.ts +71 -0
  136. package/vendor/gugle-chat-bot/src/features/parentheses/index.ts +117 -0
  137. package/vendor/gugle-chat-bot/src/features/peak-valley-timer/index.ts +452 -0
  138. package/vendor/gugle-chat-bot/src/features/poke/index.ts +24 -0
  139. package/vendor/gugle-chat-bot/src/features/version-tracker/index.ts +78 -0
  140. package/vendor/gugle-chat-bot/src/features/welcome/index.ts +58 -0
  141. package/vendor/gugle-chat-bot/src/github-ip.json +5814 -0
  142. package/vendor/gugle-chat-bot/src/image/index.ts +278 -0
  143. package/vendor/gugle-chat-bot/src/index.ts +695 -0
  144. package/vendor/gugle-chat-bot/src/logger/index.ts +54 -0
  145. package/vendor/gugle-chat-bot/src/result.json +359 -0
  146. package/vendor/gugle-chat-bot/src/type/bili.d.ts +825 -0
  147. package/vendor/gugle-chat-bot/src/type/event.d.ts +146 -0
  148. package/vendor/gugle-chat-bot/src/type/github.d.ts +446 -0
  149. package/vendor/gugle-chat-bot/src/type/index.d.ts +254 -0
  150. package/vendor/gugle-chat-bot/tsconfig.json +46 -0
@@ -0,0 +1,825 @@
1
+ /**
2
+ * 视频/专栏等内容的概要信息
3
+ */
4
+ export interface ViewData {
5
+ /** 封面图片URL */
6
+ pic: string;
7
+ /** 标题 */
8
+ title: string;
9
+ /** 创建时间戳(秒) */
10
+ ctime: number;
11
+ /** 描述文字 */
12
+ desc: string;
13
+ /** 视频时长(秒) */
14
+ duration: number;
15
+ /** 作者信息 */
16
+ owner: {
17
+ mid: number; // 作者UID
18
+ name: string; // 作者昵称
19
+ face: string; // 作者头像URL
20
+ };
21
+ /** 统计数据 */
22
+ stat: {
23
+ view: number; // 播放量
24
+ like: number; // 点赞数
25
+ reply: number; // 评论数
26
+ };
27
+ }
28
+
29
+ // ==================== 空间动态项(SpaceDataItem)相关类型 ====================
30
+
31
+ /**
32
+ * 点赞图标
33
+ */
34
+ export interface LikeIcon {
35
+ id: string;
36
+ start_url: string;
37
+ action_url: string;
38
+ end_url: string;
39
+ }
40
+
41
+ /**
42
+ * 图片资源(用于头像、装饰等)
43
+ */
44
+ export interface ImageResource {
45
+ res_type: number; // 资源类型,通常为3表示图片
46
+ res_image: {
47
+ image_src: {
48
+ src_type: number; // 1=远程,2=本地占位
49
+ placeholder: number; // 占位图类型
50
+ remote?: {
51
+ url: string; // 图片URL
52
+ bfs_style?: string; // BFS样式
53
+ };
54
+ local?: number; // 本地资源标识
55
+ };
56
+ };
57
+ }
58
+
59
+ /**
60
+ * 头像图层
61
+ */
62
+ export interface AvatarLayer {
63
+ layer_id: string;
64
+ visible: boolean;
65
+ general_spec: {
66
+ pos_spec: {
67
+ coordinate_pos: number;
68
+ axis_x: number;
69
+ axis_y: number;
70
+ };
71
+ size_spec: {
72
+ width: number;
73
+ height: number;
74
+ };
75
+ render_spec: {
76
+ opacity: number;
77
+ };
78
+ };
79
+ layer_config: {
80
+ tags: Record<string, any>; // 标签配置,如AVATAR_LAYER、GENERAL_CFG等
81
+ is_critical: boolean;
82
+ allow_over_paint: boolean;
83
+ layer_mask: null | any;
84
+ };
85
+ resource: ImageResource;
86
+ }
87
+
88
+ /**
89
+ * 头像备用图层组
90
+ */
91
+ export interface FallbackLayers {
92
+ group_id: string;
93
+ layers: AvatarLayer[];
94
+ group_mask: null | any;
95
+ is_critical_group: boolean;
96
+ }
97
+
98
+ /**
99
+ * 头像信息(合成头像)
100
+ */
101
+ export interface AvatarInfo {
102
+ container_size: {
103
+ width: number;
104
+ height: number;
105
+ };
106
+ layers: any[]; // 实际数据中为空数组,可能预留
107
+ fallback_layers: FallbackLayers;
108
+ mid: string; // 作者mid
109
+ }
110
+
111
+ /**
112
+ * NFT信息(可能为null,若有则定义)
113
+ */
114
+ export interface NftInfo {
115
+ // 根据实际数据结构补充,目前JSON中为null
116
+ }
117
+
118
+ /**
119
+ * 名称渲染信息(可能为null,若有则定义)
120
+ */
121
+ export interface NameRender {
122
+ // 根据实际数据结构补充,目前JSON中为null
123
+ }
124
+
125
+ /**
126
+ * 头像挂件
127
+ */
128
+ export interface Pendant {
129
+ pid: number;
130
+ name: string;
131
+ image: string;
132
+ expire: string;
133
+ image_enhance: string;
134
+ image_enhance_frame: string;
135
+ n_pid: string;
136
+ }
137
+
138
+ /**
139
+ * 大会员标签
140
+ */
141
+ export interface VipLabel {
142
+ path: string;
143
+ text: string;
144
+ label_theme: string;
145
+ text_color: string;
146
+ bg_style: number;
147
+ bg_color: string;
148
+ border_color: string;
149
+ use_img_label: boolean;
150
+ img_label_uri_hans: string;
151
+ img_label_uri_hant: string;
152
+ img_label_uri_hans_static: string;
153
+ img_label_uri_hant_static: string;
154
+ }
155
+
156
+ /**
157
+ * 头像图标
158
+ */
159
+ export interface AvatarIcon {
160
+ icon_type: number;
161
+ icon_resource: {
162
+ type: number;
163
+ url: string;
164
+ };
165
+ }
166
+
167
+ /**
168
+ * 大会员信息
169
+ */
170
+ export interface VipInfo {
171
+ type: number; // 会员类型,0=无,1=月会员,2=年会员等
172
+ status: number; // 状态,0=无,1=有
173
+ due_date: string; // 到期时间戳
174
+ vip_pay_type: number; // 支付类型
175
+ theme_type: number;
176
+ label: VipLabel;
177
+ avatar_subscript: number;
178
+ nickname_color: string;
179
+ role: string;
180
+ avatar_subscript_url: string;
181
+ tv_vip_status: number;
182
+ tv_vip_pay_type: number;
183
+ tv_due_date: string;
184
+ avatar_icon: AvatarIcon;
185
+ }
186
+
187
+ /**
188
+ * 官方认证信息
189
+ */
190
+ export interface OfficialVerify {
191
+ type: number; // -1=未认证,0=个人认证,1=企业认证
192
+ desc: string;
193
+ }
194
+
195
+ /**
196
+ * 粉丝装扮卡片
197
+ */
198
+ export interface DecorationCard {
199
+ id: string;
200
+ item_id: string;
201
+ name: string;
202
+ card_url: string;
203
+ big_card_url: string;
204
+ card_type: string; // 如"2"
205
+ expire_time: string;
206
+ card_type_name: string; // 如"免费"
207
+ jump_url: string;
208
+ fan: {
209
+ is_fan: string; // "1"或"0"
210
+ number: string; // 粉丝数
211
+ color: string; // 颜色
212
+ name: string; // 粉丝团名称
213
+ num_desc: string; // 数字描述
214
+ num_prefix: string;
215
+ color_format: {
216
+ start_point: string;
217
+ end_point: string;
218
+ colors: string[];
219
+ gradients: string[];
220
+ };
221
+ };
222
+ image_enhance: string;
223
+ image_group: null | any;
224
+ }
225
+
226
+ /**
227
+ * 装饰信息(可能为null,若有则定义)
228
+ */
229
+ export interface Decorate {
230
+ // 根据实际数据结构补充,目前JSON中为null
231
+ }
232
+
233
+ /**
234
+ * 图标徽章(可能为null,若有则定义)
235
+ */
236
+ export interface IconBadge {
237
+ // 根据实际数据结构补充,目前JSON中为null
238
+ }
239
+
240
+ /**
241
+ * 作者模块信息
242
+ */
243
+ export interface SpaceDataItemAuthor {
244
+ /** 作者类型,如"AUTHOR_TYPE_NORMAL" */
245
+ type: string;
246
+ /** 头像详细结构 */
247
+ avatar: AvatarInfo;
248
+ /** 头像URL */
249
+ face: string;
250
+ /** 是否为NFT头像 */
251
+ face_nft: boolean;
252
+ /** NFT相关信息 */
253
+ nft_info: NftInfo | null;
254
+ /** 作者昵称 */
255
+ name: string;
256
+ /** 昵称渲染信息(如特殊样式) */
257
+ name_render: NameRender | null;
258
+ /** 作者标签(如"UP主认证") */
259
+ label: string;
260
+ /** 作者UID */
261
+ mid: number;
262
+ /** 空间跳转链接 */
263
+ jump_url: string;
264
+ /** 当前用户是否关注该作者 */
265
+ following: boolean;
266
+ /** 发布时间戳(字符串形式) */
267
+ pub_ts: string;
268
+ /** 发布相对时间描述,如"3天前" */
269
+ pub_time: string;
270
+ /** 发布动作描述,如"投稿了视频" */
271
+ pub_action: string;
272
+ /** 发布位置文本 */
273
+ pub_location_text: string;
274
+ /** 头像挂件信息 */
275
+ pendant: Pendant;
276
+ /** 大会员信息 */
277
+ vip: VipInfo;
278
+ /** 官方认证信息 */
279
+ official_verify: OfficialVerify;
280
+ /** 装饰信息 */
281
+ decorate: Decorate | null;
282
+ /** 粉丝装扮卡片信息 */
283
+ decoration_card: DecorationCard | null;
284
+ /** 是否置顶 */
285
+ is_top: boolean;
286
+ /** 图标徽章 */
287
+ icon_badge: IconBadge | null;
288
+ }
289
+
290
+ /**
291
+ * 三点菜单项的操作参数(联合类型,根据type不同)
292
+ */
293
+ export type ThreePointParams =
294
+ | { dynamic_id: string; status: boolean } // 置顶/取消置顶
295
+ | { dyn_id_str: string; dyn_type: number; rid_str: string } // 删除
296
+ | Record<string, any>; // 其他未知类型
297
+
298
+ /**
299
+ * 三点菜单项
300
+ */
301
+ export interface SpaceDataItemThreePointItem {
302
+ /** 菜单项文本 */
303
+ label: string;
304
+ /** 类型,如"THREE_POINT_TOP"(置顶)、"THREE_POINT_DELETE"(删除) */
305
+ type: string;
306
+ /** 操作参数 */
307
+ params: ThreePointParams;
308
+ /** 弹窗配置(如果有点击弹窗) */
309
+ modal: {
310
+ title: string; // 弹窗标题
311
+ content: string; // 弹窗内容
312
+ confirm: string; // 确认按钮文本
313
+ cancel: string; // 取消按钮文本
314
+ } | null;
315
+ /** 跳转链接 */
316
+ jump_url: string;
317
+ }
318
+
319
+ /**
320
+ * 更多操作模块
321
+ */
322
+ export interface SpaceDataItemMore {
323
+ /** 推荐文本 */
324
+ rcmd_text: string;
325
+ /** 三点菜单项列表 */
326
+ three_point_items: SpaceDataItemThreePointItem[];
327
+ }
328
+
329
+ /**
330
+ * 话题信息
331
+ */
332
+ export interface SpaceDataItemTopic {
333
+ /** 话题ID */
334
+ id: string;
335
+ /** 话题名称 */
336
+ name: string;
337
+ /** 话题跳转链接 */
338
+ jump_url: string;
339
+ }
340
+
341
+ /**
342
+ * 富文本节点类型
343
+ */
344
+ export type RichTextNodeType =
345
+ | 'RICH_TEXT_NODE_TYPE_TEXT' // 纯文本
346
+ | 'RICH_TEXT_NODE_TYPE_AT' // @用户
347
+ | 'RICH_TEXT_NODE_TYPE_EMOJI' // 表情
348
+ | 'RICH_TEXT_NODE_TYPE_VOTE' // 投票
349
+ | 'RICH_TEXT_NODE_TYPE_LOTTERY' // 抽奖
350
+ | 'RICH_TEXT_NODE_TYPE_TOPIC'; // 话题
351
+
352
+ /**
353
+ * 表情信息
354
+ */
355
+ export interface EmojiInfo {
356
+ type: string; // 表情类型,如"1"(普通)、"11"(充电)
357
+ size: number; // 尺寸
358
+ text: string; // 表情文本
359
+ icon_url: string; // 图标URL
360
+ gif_url: string; // GIF URL
361
+ webp_url: string; // WebP URL
362
+ jump_url: string; // 点击跳转链接
363
+ jump_title: string; // 跳转标题
364
+ }
365
+
366
+ /**
367
+ * 商品信息(可能为null,若有则定义)
368
+ */
369
+ export interface GoodsInfo {
370
+ // 根据实际数据结构补充,目前JSON中为null
371
+ }
372
+
373
+ /**
374
+ * 样式信息
375
+ */
376
+ export interface TextStyle {
377
+ color?: string;
378
+ bg_color?: string;
379
+ font_size?: number;
380
+ font_level?: string;
381
+ bold?: boolean;
382
+ italic?: boolean;
383
+ underline?: boolean;
384
+ strikethrough?: boolean;
385
+ }
386
+
387
+ /**
388
+ * 富文本节点
389
+ */
390
+ export interface RichTextNode {
391
+ /** 原始文本 */
392
+ text: string;
393
+ /** 原始文本(可能与text相同) */
394
+ orig_text: string;
395
+ /** 节点类型 */
396
+ type: RichTextNodeType;
397
+ /** 跳转链接 */
398
+ jump_url: string;
399
+ /** 图标URL */
400
+ icon_url: string;
401
+ /** 图标名称 */
402
+ icon_name: string;
403
+ /** 资源ID(如被@用户的UID) */
404
+ rid: string;
405
+ /** 表情信息(仅当type为EMOJI时存在) */
406
+ emoji: EmojiInfo | null;
407
+ /** 商品信息 */
408
+ goods: GoodsInfo | null;
409
+ /** 样式 */
410
+ style: TextStyle | null;
411
+ /** 图片列表 */
412
+ pics: any[]; // 实际数据中为空,暂保留any
413
+ /** 视频信息 */
414
+ video: any | null;
415
+ }
416
+
417
+ /**
418
+ * 文本节点中的单词节点
419
+ */
420
+ export interface TextNodeWord {
421
+ words: string;
422
+ font_size: number;
423
+ color: string;
424
+ dark_color: string;
425
+ style: {
426
+ bold: boolean;
427
+ italic: boolean;
428
+ strikethrough: boolean;
429
+ underline: boolean;
430
+ background: string;
431
+ };
432
+ font_level: string;
433
+ translated_words: string;
434
+ bili_theme: string;
435
+ [key: string]: any; // 额外未知字段
436
+ }
437
+
438
+ /**
439
+ * 文本节点
440
+ */
441
+ export interface TextNode {
442
+ type: 'TEXT_NODE_TYPE_WORD' | 'TEXT_NODE_TYPE_RICH' | string;
443
+ word?: TextNodeWord;
444
+ rich?: RichTextNode;
445
+ formula?: any;
446
+ user?: any;
447
+ }
448
+
449
+ /**
450
+ * 段落(用于富文本描述)
451
+ */
452
+ export interface Paragraph {
453
+ /** 段落类型,如1表示普通段落 */
454
+ para_type: number;
455
+ /** 对齐方式 */
456
+ align: number;
457
+ /** 格式信息(可能为null) */
458
+ format: null | any;
459
+ /** 文本内容(若为文本段落) */
460
+ text?: {
461
+ nodes: TextNode[];
462
+ };
463
+ /** 图片内容(若为图片段落) */
464
+ pic?: null | any;
465
+ /** 列表内容(若为列表段落) */
466
+ list?: null | ParagraphList;
467
+ /** 链接卡片(若为链接段落) */
468
+ link_card?: null | any;
469
+ /** 代码块(若为代码段落) */
470
+ code?: null | any;
471
+ /** 标题(若为标题段落) */
472
+ heading?: null | any;
473
+ /** 引用块(若为引用段落) */
474
+ blockquote?: null | any;
475
+ }
476
+
477
+ /**
478
+ * 列表段落结构
479
+ */
480
+ export interface ParagraphList {
481
+ style: number; // 列表样式,如2
482
+ start: number; // 起始序号
483
+ items: any[]; // 列表项(可能有内容)
484
+ children: Array<{
485
+ order_style: null | any;
486
+ level: number;
487
+ order: number;
488
+ children: Paragraph[];
489
+ }>;
490
+ theme: string;
491
+ }
492
+
493
+ /**
494
+ * 动态描述(文本+富文本)
495
+ */
496
+ export interface SpaceDataItemDesc {
497
+ /** 纯文本描述 */
498
+ text: string;
499
+ /** 富文本节点数组 */
500
+ rich_text_nodes: RichTextNode[];
501
+ /** 段落数组(结构化描述) */
502
+ paragraphs: Paragraph[];
503
+ /** 是否有更多内容(需展开) */
504
+ has_more: boolean;
505
+ }
506
+
507
+ /**
508
+ * 视频稿件信息(MAJOR_TYPE_ARCHIVE)
509
+ */
510
+ export interface SpaceDataItemArchive {
511
+ /** 类型,通常为1 */
512
+ type: number;
513
+ /** BV号 */
514
+ bvid: string;
515
+ /** AV号 */
516
+ aid: string;
517
+ /** 封面图片URL */
518
+ cover: string;
519
+ /** 视频跳转链接 */
520
+ jump_url: string;
521
+ /** 视频统计数据 */
522
+ stat: {
523
+ danmaku: string; // 弹幕数
524
+ play: string; // 播放量
525
+ vt: string; // 未知字段
526
+ };
527
+ /** 时长文本,如"01:44" */
528
+ duration_text: string;
529
+ /** 视频标题 */
530
+ title: string;
531
+ /** 视频描述 */
532
+ desc: string;
533
+ /** 视频徽章(如"投稿视频"、"合作视频") */
534
+ badge: {
535
+ icon_url: string;
536
+ text: string;
537
+ bg_color: string;
538
+ color: string;
539
+ };
540
+ /** 未知字段 */
541
+ enable_vt: number;
542
+ /** 未知字段 */
543
+ disable_preview: number;
544
+ /** 首播在线信息 */
545
+ premiere_online: string;
546
+ /** 统计隐藏标志 */
547
+ stat_hidden: number;
548
+ }
549
+
550
+ /**
551
+ * Opus(专栏/图文)中的图片信息
552
+ */
553
+ export interface OpusPic {
554
+ url: string;
555
+ width: number;
556
+ height: number;
557
+ size: number; // 文件大小(KB)
558
+ live_url: string;
559
+ aigc: number;
560
+ warning: null | any;
561
+ }
562
+
563
+ /**
564
+ * Opus(专栏/图文)的摘要信息(与SpaceDataItemDesc结构相同,复用)
565
+ */
566
+ export type OpusSummary = SpaceDataItemDesc;
567
+
568
+ /**
569
+ * Opus(专栏/图文)信息(MAJOR_TYPE_OPUS)
570
+ */
571
+ export interface SpaceDataItemOpus {
572
+ /** 跳转链接 */
573
+ jump_url: string;
574
+ /** 标题 */
575
+ title: string;
576
+ /** 摘要信息 */
577
+ summary: OpusSummary;
578
+ /** 样式 */
579
+ style: number;
580
+ /** 图片列表 */
581
+ pics: OpusPic[];
582
+ /** 折叠操作文本,如["全文"] */
583
+ fold_action: string[];
584
+ }
585
+
586
+ /**
587
+ * 主模块(动态核心内容)
588
+ */
589
+ export interface SpaceDataItemMajor {
590
+ /** 主类型,如"MAJOR_TYPE_ARCHIVE"(视频)、"MAJOR_TYPE_OPUS"(专栏/图文) */
591
+ type: string;
592
+ none: any | null;
593
+ blocked: any | null;
594
+ archive?: SpaceDataItemArchive; // 视频类型存在
595
+ opus?: SpaceDataItemOpus; // Opus类型存在
596
+ // 其他可能类型:draw(纯图文)、article(文章)、pgc(剧集)等,可根据需要扩展
597
+ }
598
+
599
+ /**
600
+ * 投票模块
601
+ */
602
+ export interface VoteAdditional {
603
+ vote_id: string;
604
+ choice_cnt: string;
605
+ default_share: string;
606
+ title: string;
607
+ desc: string;
608
+ end_time: string;
609
+ join_num: string;
610
+ status: string;
611
+ type: string;
612
+ uid: string;
613
+ jump_url: string;
614
+ button: {
615
+ type: number;
616
+ jump_style: {
617
+ icon_url: string;
618
+ text: string;
619
+ interactive: null | any;
620
+ bg_style: number;
621
+ toast: string;
622
+ disable: number;
623
+ };
624
+ jump_url: string;
625
+ check: null | any;
626
+ uncheck: null | any;
627
+ status: number;
628
+ click_type: number;
629
+ };
630
+ upower_action_state: number;
631
+ upower_level: string;
632
+ }
633
+
634
+ /**
635
+ * 通用附加模块(如游戏推广)
636
+ */
637
+ export interface CommonAdditional {
638
+ button: {
639
+ type: number;
640
+ jump_style: {
641
+ icon_url: string;
642
+ text: string;
643
+ interactive: null | any;
644
+ bg_style: number;
645
+ toast: string;
646
+ disable: number;
647
+ };
648
+ jump_url: string;
649
+ check: null | any;
650
+ uncheck: null | any;
651
+ status: number;
652
+ click_type: number;
653
+ };
654
+ sub_type: string; // 如"game"
655
+ head_text: string; // 如"相关游戏"
656
+ jump_url: string;
657
+ id_str: string;
658
+ cover: string;
659
+ style: number;
660
+ title: string;
661
+ desc1: string;
662
+ desc2: string;
663
+ }
664
+
665
+ /**
666
+ * 附加模块(如投票、商品等)
667
+ */
668
+ export interface SpaceDataItemAdditional {
669
+ type: string; // 如"ADDITIONAL_TYPE_VOTE", "ADDITIONAL_TYPE_COMMON"
670
+ goods: GoodsInfo | null;
671
+ vote?: VoteAdditional;
672
+ common?: CommonAdditional;
673
+ match?: any | null;
674
+ ugc?: any | null;
675
+ reserve?: any | null;
676
+ upower_lottery?: any | null;
677
+ }
678
+
679
+ /**
680
+ * 动态模块(核心内容模块)
681
+ */
682
+ export interface SpaceDataItemDynamic {
683
+ /** 关联话题 */
684
+ topic: null | SpaceDataItemTopic;
685
+ /** 描述内容(带富文本) */
686
+ desc: null | SpaceDataItemDesc;
687
+ /** 主内容(视频/专栏等) */
688
+ major: null | SpaceDataItemMajor;
689
+ /** 附加内容(如投票) */
690
+ additional: null | SpaceDataItemAdditional;
691
+ }
692
+
693
+ /**
694
+ * 统计详情(点赞/评论/转发)
695
+ */
696
+ export interface SpaceDataItemStatDetail {
697
+ /** 是否可用(如当前用户是否已点赞) */
698
+ status: boolean;
699
+ /** 计数 */
700
+ count: number;
701
+ /** 是否禁止操作 */
702
+ forbidden: boolean;
703
+ /** 是否禁用 */
704
+ disabled: boolean;
705
+ /** 是否静默 */
706
+ silent: boolean;
707
+ /** 是否隐藏 */
708
+ hidden: boolean;
709
+ }
710
+
711
+ /**
712
+ * 统计模块
713
+ */
714
+ export interface SpaceDataItemStat {
715
+ /** 转发统计 */
716
+ forward: SpaceDataItemStatDetail;
717
+ /** 评论统计 */
718
+ comment: SpaceDataItemStatDetail;
719
+ /** 点赞统计 */
720
+ like: SpaceDataItemStatDetail;
721
+ }
722
+
723
+ /**
724
+ * 互动项(如“xxx赞了”)
725
+ */
726
+ export interface SpaceDataItemInteractionItem {
727
+ /** 类型,0表示普通互动 */
728
+ type: number;
729
+ /** 互动描述 */
730
+ desc: SpaceDataItemDesc;
731
+ }
732
+
733
+ /**
734
+ * 互动模块
735
+ */
736
+ export interface SpaceDataItemInteraction {
737
+ items: SpaceDataItemInteractionItem[];
738
+ }
739
+
740
+ /**
741
+ * 标签模块(如置顶)
742
+ */
743
+ export interface ModuleTag {
744
+ text: string;
745
+ }
746
+
747
+ /**
748
+ * 动态的所有模块集合
749
+ */
750
+ export interface SpaceDataItemModules {
751
+ /** 标签模块(如“置顶”) */
752
+ module_tag: null | ModuleTag;
753
+ /** 作者模块 */
754
+ module_author: SpaceDataItemAuthor;
755
+ /** 更多操作模块 */
756
+ module_more: SpaceDataItemMore;
757
+ /** 争议模块(一般为null,如有则定义) */
758
+ module_dispute: any | null;
759
+ /** 核心动态模块 */
760
+ module_dynamic: SpaceDataItemDynamic;
761
+ /** 扩展模块(一般为null) */
762
+ module_extend: any | null;
763
+ /** 统计模块 */
764
+ module_stat: SpaceDataItemStat;
765
+ /** 互动模块(可能为null) */
766
+ module_interaction: SpaceDataItemInteraction | null;
767
+ /** 分享信息模块(一般为null) */
768
+ module_share_info: any | null;
769
+ /** 折叠模块(一般为null) */
770
+ module_fold: any | null;
771
+ }
772
+
773
+ /**
774
+ * 动态基础信息
775
+ */
776
+ export interface SpaceDataItemBasic {
777
+ /** 资源ID字符串(如稿件ID、专栏ID) */
778
+ rid_str: string;
779
+ /** 评论类型(1=视频,2=动态,12=专栏等) */
780
+ comment_type: number;
781
+ /** 评论ID字符串 */
782
+ comment_id_str: string;
783
+ /** 点赞图标 */
784
+ like_icon: LikeIcon;
785
+ /** 是否审核中 */
786
+ in_audit: boolean;
787
+ /** 是否仅粉丝可见 */
788
+ is_only_fans: boolean;
789
+ /** 是否可编辑 */
790
+ editable: boolean;
791
+ /** 打开App额外参数 */
792
+ open_app_extra: string;
793
+ /** 跳转链接 */
794
+ jump_url: string;
795
+ /** 是否AI生成内容 */
796
+ aigc: boolean;
797
+ }
798
+
799
+ /**
800
+ * 单个空间动态项
801
+ */
802
+ export interface SpaceDataItem {
803
+ /** 动态ID字符串 */
804
+ id_str: string;
805
+ /** 动态类型,如"DYNAMIC_TYPE_AV"(视频)、"DYNAMIC_TYPE_FORWARD"(转发)、"DYNAMIC_TYPE_ARTICLE"(专栏)、"DYNAMIC_TYPE_DRAW"(图文)等 */
806
+ type: string;
807
+ /** 基础信息 */
808
+ basic: SpaceDataItemBasic;
809
+ /** 是否可见 */
810
+ visible: boolean;
811
+ /** 各模块数据 */
812
+ modules: SpaceDataItemModules;
813
+ /** 原始动态(如果是转发,则orig为被转发的原动态) */
814
+ orig: SpaceDataItem | null;
815
+ }
816
+
817
+ /**
818
+ * 空间动态列表响应数据
819
+ */
820
+ export interface SpaceData {
821
+ /** 是否有更多 */
822
+ has_more: boolean;
823
+ /** 动态项列表 */
824
+ items: SpaceDataItem[];
825
+ }