@anyul/koishi-plugin-rss 5.2.47 → 5.3.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/README.md CHANGED
@@ -1,11 +1,33 @@
1
1
  # koishi-plugin-rss-owl
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@anyul/koishi-plugin-rss?style=flat-square)](https://www.npmjs.com/package/@anyul/koishi-plugin-rss)
4
- ![version](https://img.shields.io/badge/version-5.2.3-brightgreen)
4
+ ![version](https://img.shields.io/badge/version-5.3.0-brightgreen)
5
5
 
6
6
  > 功能强大的 Koishi RSS 订阅插件,支持多种订阅源、图片渲染、AI 摘要等高级功能
7
7
 
8
- 当前文档基于 `v5.2.3`,已同步命令模块化、入口装配层收敛与最新模板名称。
8
+ 当前文档基于 `v5.3.0`,已同步命令模块化、原生子命令树、短别名与统一输出风格。
9
+
10
+ ## 📖 命令文档
11
+
12
+ 完整命令参考见 **[docs/COMMANDS.md](docs/COMMANDS.md)**,包含所有命令的用法、选项、示例与短别名速查表。
13
+
14
+ ### 命令短别名
15
+
16
+ 为方便聊天输入,每个命令都注册了 `rs` + 2 字母短别名(与完整写法等价):
17
+
18
+ | 短别名 | 完整命令 | 短别名 | 完整命令 |
19
+ |--------|---------|--------|---------|
20
+ | `rsls` | `rsso.list` | `rshm` | `rsso.html` |
21
+ | `rsed` | `rsso.edit` | `rsak` | `rsso.ask` |
22
+ | `rsrm` | `rsso.remove` | `rswt` | `rsso.watch` |
23
+ | `rspl` | `rsso.pull` | `rsc` | `rsso.cache` |
24
+ | `rsfw` | `rsso.follow` | `rsq` | `rsso.queue` |
25
+
26
+ ```text
27
+ rsls # = rsso.list
28
+ rsed 1 -t "新标题" # = rsso.edit 1 -t "新标题"
29
+ rsc list # = rsso.cache list
30
+ ```
9
31
 
10
32
  ## ✨ 功能特性
11
33
 
@@ -718,6 +740,15 @@ debug: "details" # 显示所有调试信息
718
740
 
719
741
  ## 📜 更新日志
720
742
 
743
+ ### 5.2.48 (2026-06-20)
744
+
745
+ #### 修复多视频 album 重复发送
746
+
747
+ - 🐛 **多视频只下载第一个** - tdl 调用恒加 `--group`,自动检测相册/分组消息下载全部视频(单视频无副作用)
748
+ - 🐛 **同一视频发 N 次** - `restoreTelegramVideos` 改为按位置配对:第 i 个 "Video is too big" blockquote ← 第 i 个下载视频,各自保留独立 poster
749
+ - 🔄 **数量不匹配容错** - blockquote 多于视频:多出保留占位图;视频多于 blockquote:多出追加到文末
750
+ - 🧩 `pickLargestVideo` → `pickVideoFiles`:收集全部视频按文件名排序(msgID 递增 = 专辑顺序);新增 `extractTooBigPosters` 取所有 poster
751
+
721
752
  ### 5.2.47 (2026-06-18)
722
753
 
723
754
  #### 代码审查修复(健壮性 + 性能)
@@ -1,6 +1,7 @@
1
1
  import { Context } from 'koishi';
2
2
  import type { Config } from '../types';
3
3
  import { NotificationQueueManager } from '../core/notification-queue';
4
+ import { type CachedMessage, type MessageCacheManager } from '../utils/message-cache';
4
5
  /**
5
6
  * 管理类命令依赖
6
7
  */
@@ -9,12 +10,43 @@ export interface ManagementCommandDeps {
9
10
  config: Config;
10
11
  queueManager: NotificationQueueManager;
11
12
  }
13
+ interface CacheCommandContext {
14
+ cache: MessageCacheManager;
15
+ platform: string;
16
+ guildId: string;
17
+ authority: number;
18
+ logContext?: Record<string, any>;
19
+ }
12
20
  /**
13
21
  * 注册管理类命令
22
+ *
23
+ * 设计要点(命令系统统一):
24
+ * - cache/queue 父命令【不带 .action()】,由 Koishi 原生「无 action → 显示 help」接管,
25
+ * 自动在 help 菜单/网页控制台列出子命令树。
26
+ * - 子命令注册为 rssowl.cache.list / rssowl.cache.stats 等真正的嵌套命令;
27
+ * 用户在聊天里输入 "rsso.cache list"(带空格)时,Koishi 核心路由
28
+ * (inferCommand, core index.mjs:1377-1405)会自动解析到 rssowl.cache.list 子命令,
29
+ * 输入方式与旧版完全一致,但获得了菜单可见性。
30
+ * - 父命令 rssowl.cache 必须无位置参数(`ctx.command('rssowl.cache', ...)`),
31
+ * 否则路由会在父命令处 break,导致 list 被当作位置参数而非子命令。
14
32
  */
15
33
  export declare function registerManagementCommands(deps: ManagementCommandDeps): void;
34
+ declare function handleCacheList(cmdCtx: CacheCommandContext, args: string[], config: Config): Promise<string>;
35
+ declare function handleCacheMessage(cmdCtx: CacheCommandContext, args: string[], config: Config): Promise<string>;
36
+ declare function handleCacheSearch(cmdCtx: CacheCommandContext, args: string[], config: Config): Promise<string>;
37
+ declare function handleCacheStats(cmdCtx: CacheCommandContext, config: Config): Promise<string>;
38
+ declare function handleCacheClear(cmdCtx: CacheCommandContext, config: Config): Promise<string>;
39
+ declare function handleCacheCleanup(cmdCtx: CacheCommandContext, args: string[], config: Config): Promise<string>;
40
+ declare function handleCachePull(ctx: Context, queueManager: NotificationQueueManager, session: any, cmdCtx: CacheCommandContext, args: string[], config: Config): Promise<string>;
41
+ /**
42
+ * 按真实数据库 ID 取缓存消息,并校验其归属当前群组(防跨群越权)。
43
+ * 即使攻击者猜到其他群的 ID,也会因 platform/guildId 不匹配而被拦截。
44
+ */
45
+ declare function resolveCacheMessageById(cmdCtx: CacheCommandContext, realId: number): Promise<CachedMessage | null>;
16
46
  export { registerSubscriptionManagementCommands } from './subscription-management';
17
47
  export { registerSubscriptionEditCommand } from './subscription-edit';
18
48
  export { registerSubscriptionCreateCommand } from './subscription-create';
19
49
  export { registerWebMonitorCommands } from './web-monitor';
20
50
  export { createCommandRuntimeDeps } from './runtime';
51
+ export type { CacheCommandContext };
52
+ export { resolveCacheMessageById, handleCacheList, handleCacheMessage, handleCacheSearch, handleCacheStats, handleCacheClear, handleCacheCleanup, handleCachePull, };