@forgetmelody/koishi-plugin-best-cave 0.0.0-stage → 1.0.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.
@@ -0,0 +1,99 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { Config, CaveObject } from './index';
3
+ import { FileManager } from './FileManager';
4
+ /**
5
+ * @description 定义了数据库 \`cave_meta\` 表的结构模型。
6
+ */
7
+ export interface CaveMetaObject {
8
+ cave: number;
9
+ rating: number;
10
+ type: string;
11
+ keywords: string[];
12
+ }
13
+ declare module 'koishi' {
14
+ interface Tables {
15
+ cave_meta: CaveMetaObject;
16
+ }
17
+ }
18
+ /**
19
+ * @class AIManager
20
+ * @description AI 管理器,作为连接 AI 服务与回声洞功能的核心模块。
21
+ */
22
+ export declare class AIManager {
23
+ private ctx;
24
+ private config;
25
+ private logger;
26
+ private fileManager;
27
+ private http;
28
+ private endpointIndex;
29
+ private retryTime;
30
+ /**
31
+ * @description 用于分析的 AI 系统提示词。
32
+ */
33
+ private readonly ANALYSIS_SYSTEM_PROMPT;
34
+ /**
35
+ * @description 用于查重的 AI 系统提示词。
36
+ */
37
+ private readonly DUPLICATE_SYSTEM_PROMPT;
38
+ /**
39
+ * @constructor
40
+ * @description AIManager 的构造函数。
41
+ * @param {Context} ctx - Koishi 的上下文对象。
42
+ * @param {Config} config - 插件的配置对象。
43
+ * @param {Logger} logger - 日志记录器实例。
44
+ * @param {FileManager} fileManager - 文件管理器实例。
45
+ */
46
+ constructor(ctx: Context, config: Config, logger: Logger, fileManager: FileManager);
47
+ /**
48
+ * @description 注册与 AI 功能相关的管理命令。
49
+ * @param {any} cave - \`cave\` 命令的实例,用于挂载子命令。
50
+ */
51
+ registerCommands(cave: any): void;
52
+ /**
53
+ * @description 检查新内容是否与数据库中已存在的回声洞重复。
54
+ * @param {CaveMetaObject} newAnalysis - 新内容经过 AI 分析后的元数据。
55
+ * @param {CaveObject} newCave - 待检查的新回声洞的完整对象。
56
+ * @returns {Promise<number[]>} - 一个 Promise,解析为重复的回声洞 ID 数组。如果不重复或检查失败,则为空数组。
57
+ */
58
+ checkForDuplicates(newAnalysis: CaveMetaObject, newCave: CaveObject): Promise<number[]>;
59
+ /**
60
+ * @description 对一个或多个回声洞内容进行 AI 分析。
61
+ * @param {CaveObject[]} caves - 需要分析的回声洞对象数组。
62
+ * @param {{ fileName: string; buffer: Buffer }[]} [mediaBuffers] - 可选的媒体文件缓存。
63
+ * @returns {Promise<CaveMetaObject[]>} - 一个 Promise,解析为分析结果(\`CaveMetaObject\`)的数组。
64
+ */
65
+ analyze(caves: CaveObject[], mediaBuffers?: {
66
+ fileName: string;
67
+ buffer: Buffer;
68
+ }[]): Promise<CaveMetaObject[]>;
69
+ /**
70
+ * @description 准备单个回声洞的内容(文本和图片)以供 AI 模型处理。
71
+ * @param {CaveObject} cave - 要处理的回声洞对象。
72
+ * @param {Map<string, Buffer>} [mediaMap] - 媒体文件的缓存 Map。
73
+ * @returns {Promise<any[] | null>} - 一个 Promise,解析为适合 AI 请求的 content 数组,如果回声洞为空则返回 null。
74
+ */
75
+ private prepareContent;
76
+ /**
77
+ * @description 使用 AI 批量判断一个主要回声洞是否与一组候选回声洞中的任何一个重复。
78
+ * @param {CaveObject} mainCave - 主要的回声洞。
79
+ * @param {CaveObject[]} candidateCaves - 用于比较的候选回声洞数组。
80
+ * @returns {Promise<number[]>} - 一个 Promise,解析为重复的回声洞 ID 数组。如果不重复或检查失败,则为空数组。
81
+ */
82
+ private IsDuplicate;
83
+ /**
84
+ * @description 计算两组关键词之间的相似度(Jaccard 相似系数)。
85
+ * @param {string[]} keywordsA - 第一组关键词。
86
+ * @param {string[]} keywordsB - 第二组关键词。
87
+ * @returns {number} - 返回 0 到 100 之间的相似度百分比。
88
+ */
89
+ private calculateSimilarity;
90
+ /**
91
+ * @description 向配置的 AI 服务端点发送请求的通用方法。
92
+ * @template T - 期望从 AI 响应中解析出的 JSON 对象的类型。
93
+ * @param {any[]} messages - 发送给 AI 的消息数组。
94
+ * @param {string} systemPrompt - 系统提示词。
95
+ * @returns {Promise<T>} - 一个 Promise,解析为从 AI 响应中解析出的 JSON 对象。
96
+ * @throws {Error} - 如果 AI 服务持续失败或响应无法解析,则抛出错误。
97
+ */
98
+ private requestAI;
99
+ }
@@ -0,0 +1,36 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { FileManager } from './FileManager';
3
+ import { Config } from './index';
4
+ /**
5
+ * @class DataManager
6
+ * @description 负责处理回声洞数据的导入和导出功能。
7
+ */
8
+ export declare class DataManager {
9
+ private ctx;
10
+ private config;
11
+ private fileManager;
12
+ private logger;
13
+ /**
14
+ * @constructor
15
+ * @param ctx Koishi 上下文,用于数据库操作。
16
+ * @param config 插件配置。
17
+ * @param fileManager 文件管理器实例。
18
+ * @param logger 日志记录器实例。
19
+ */
20
+ constructor(ctx: Context, config: Config, fileManager: FileManager, logger: Logger);
21
+ /**
22
+ * @description 注册 `.export` 和 `.import` 子命令。
23
+ * @param cave - 主 `cave` 命令实例。
24
+ */
25
+ registerCommands(cave: any): void;
26
+ /**
27
+ * @description 导出所有 'active' 状态的回声洞数据到 `cave.json`。
28
+ * @returns 描述导出结果的消息字符串。
29
+ */
30
+ exportData(): Promise<string>;
31
+ /**
32
+ * @description 从 `cave.json` 文件导入回声洞数据。
33
+ * @returns 描述导入结果的消息字符串。
34
+ */
35
+ importData(): Promise<string>;
36
+ }
@@ -0,0 +1,48 @@
1
+ import { Logger } from 'koishi';
2
+ import { Config } from './index';
3
+ /**
4
+ * @class FileManager
5
+ * @description 封装了对文件的存储、读取和删除操作。
6
+ * 能根据配置自动选择使用本地文件系统或 AWS S3 作为存储后端。
7
+ * 内置 Promise 文件锁,防止本地文件的并发写入冲突。
8
+ */
9
+ export declare class FileManager {
10
+ private logger;
11
+ private resourceDir;
12
+ private locks;
13
+ private s3Client?;
14
+ private s3Bucket?;
15
+ /**
16
+ * @constructor
17
+ * @param baseDir Koishi 应用的基础数据目录 (ctx.baseDir)。
18
+ * @param config 插件的配置对象。
19
+ * @param logger 日志记录器实例。
20
+ */
21
+ constructor(baseDir: string, config: Config, logger: Logger);
22
+ /**
23
+ * @description 使用文件锁安全地执行异步文件操作,防止并发读写冲突。
24
+ * @template T 异步操作的返回类型。
25
+ * @param fullPath 需要加锁的文件的完整路径。
26
+ * @param operation 要执行的异步函数。
27
+ * @returns 异步操作的结果。
28
+ */
29
+ private withLock;
30
+ /**
31
+ * @description 保存文件,自动选择 S3 或本地存储。
32
+ * @param fileName 用作 S3 Key 或本地文件名。
33
+ * @param data 要写入的 Buffer 数据。
34
+ * @returns 保存时使用的文件名。
35
+ */
36
+ saveFile(fileName: string, data: Buffer): Promise<string>;
37
+ /**
38
+ * @description 读取文件,自动从 S3 或本地存储读取。
39
+ * @param fileName 要读取的文件名/标识符。
40
+ * @returns 文件的 Buffer 数据。
41
+ */
42
+ readFile(fileName: string): Promise<Buffer>;
43
+ /**
44
+ * @description 删除文件,自动从 S3 或本地删除。
45
+ * @param fileIdentifier 要删除的文件名/标识符。
46
+ */
47
+ deleteFile(fileIdentifier: string): Promise<void>;
48
+ }
@@ -0,0 +1,73 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { Config } from './index';
3
+ import { FileManager } from './FileManager';
4
+ /**
5
+ * @description 数据库 `cave_hash` 表的完整对象模型。
6
+ */
7
+ export interface CaveHashObject {
8
+ cave: number;
9
+ hash: string;
10
+ type: 'text' | 'image';
11
+ }
12
+ /**
13
+ * @class HashManager
14
+ * @description 负责生成、存储和比较文本与图片的哈希值。
15
+ * 实现了基于 Simhash 的文本查重和基于 DCT 感知哈希 (pHash) 的图片查重方案。
16
+ */
17
+ export declare class HashManager {
18
+ private ctx;
19
+ private config;
20
+ private logger;
21
+ private fileManager;
22
+ /**
23
+ * @constructor
24
+ * @param ctx - Koishi 上下文,用于数据库操作。
25
+ * @param config - 插件配置,用于获取相似度阈值等。
26
+ * @param logger - 日志记录器实例。
27
+ * @param fileManager - 文件管理器实例,用于读取图片文件。
28
+ */
29
+ constructor(ctx: Context, config: Config, logger: Logger, fileManager: FileManager);
30
+ /**
31
+ * @description 注册与哈希功能相关的子命令。
32
+ * @param cave - 主 `cave` 命令实例。
33
+ */
34
+ registerCommands(cave: any): void;
35
+ /**
36
+ * @description 扫描并修复单个图片 Buffer,移除文件结束符之后的多余数据。
37
+ * @param imageBuffer - 原始的图片 Buffer。
38
+ * @returns 修复后的图片 Buffer。如果无需修复,则返回原始 Buffer。
39
+ */
40
+ sanitizeImageBuffer(imageBuffer: Buffer): Buffer;
41
+ /**
42
+ * @description 执行一维离散余弦变换 (DCT-II) 的方法。
43
+ * @param input - 输入的数字数组。
44
+ * @returns DCT 变换后的数组。
45
+ */
46
+ private dct1D;
47
+ /**
48
+ * @description 执行二维离散余弦变换 (DCT-II) 的方法。
49
+ * 通过对行和列分别应用一维 DCT 来实现。
50
+ * @param matrix - 输入的 N x N 像素亮度矩阵。
51
+ * @returns DCT 变换后的 N x N 系数矩阵。
52
+ */
53
+ private dct2D;
54
+ /**
55
+ * @description pHash 算法核心实现,使用 Jimp 和自定义 DCT。
56
+ * @param imageBuffer - 图片的 Buffer。
57
+ * @returns 64位十六进制 pHash 字符串。
58
+ */
59
+ generatePHash(imageBuffer: Buffer): Promise<string>;
60
+ /**
61
+ * @description 根据汉明距离计算相似度百分比。
62
+ * @param hex1 - 第一个哈希。
63
+ * @param hex2 - 第二个哈希。
64
+ * @returns 相似度 (0-100)。
65
+ */
66
+ calculateSimilarity(hex1: string, hex2: string): number;
67
+ /**
68
+ * @description 为文本生成 64 位 Simhash 字符串。
69
+ * @param text - 需要处理的文本。
70
+ * @returns 16位十六进制 Simhash 字符串。
71
+ */
72
+ generateTextSimhash(text: string): string;
73
+ }
@@ -0,0 +1,45 @@
1
+ import { Context } from 'koishi';
2
+ /** 数据库 `cave_user` 表的结构。 */
3
+ export interface UserName {
4
+ userId: string;
5
+ nickname: string;
6
+ }
7
+ declare module 'koishi' {
8
+ interface Tables {
9
+ cave_user: UserName;
10
+ }
11
+ }
12
+ /**
13
+ * @class NameManager
14
+ * @description 负责管理用户在回声洞中的自定义昵称。
15
+ */
16
+ export declare class NameManager {
17
+ private ctx;
18
+ /**
19
+ * @constructor
20
+ * @param ctx - Koishi 上下文,用于初始化数据库模型。
21
+ */
22
+ constructor(ctx: Context);
23
+ /**
24
+ * @description 注册 `.name` 子命令,用于管理用户昵称。
25
+ * @param cave - 主 `cave` 命令实例。
26
+ */
27
+ registerCommands(cave: any): void;
28
+ /**
29
+ * @description 设置或更新指定用户的昵称。
30
+ * @param userId - 目标用户的 ID。
31
+ * @param nickname - 要设置的新昵称。
32
+ */
33
+ setNickname(userId: string, nickname: string): Promise<void>;
34
+ /**
35
+ * @description 获取指定用户的昵称。
36
+ * @param userId - 目标用户的 ID。
37
+ * @returns 用户的昵称字符串或 null。
38
+ */
39
+ getNickname(userId: string): Promise<string | null>;
40
+ /**
41
+ * @description 清除指定用户的昵称设置。
42
+ * @param userId - 目标用户的 ID。
43
+ */
44
+ clearNickname(userId: string): Promise<void>;
45
+ }
@@ -0,0 +1,31 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { CaveObject, Config } from './index';
3
+ import { FileManager } from './FileManager';
4
+ /**
5
+ * @class PendManager
6
+ * @description 负责处理回声洞的审核流程,处理新洞的提交、审核通知和审核操作。
7
+ */
8
+ export declare class PendManager {
9
+ private ctx;
10
+ private config;
11
+ private fileManager;
12
+ private logger;
13
+ /**
14
+ * @param ctx Koishi 上下文。
15
+ * @param config 插件配置。
16
+ * @param fileManager 文件管理器实例。
17
+ * @param logger 日志记录器实例。
18
+ * @param reusableIds 可复用 ID 的内存缓存。
19
+ */
20
+ constructor(ctx: Context, config: Config, fileManager: FileManager, logger: Logger);
21
+ /**
22
+ * @description 注册与审核相关的子命令。
23
+ * @param cave - 主 `cave` 命令实例。
24
+ */
25
+ registerCommands(cave: any): void;
26
+ /**
27
+ * @description 将新回声洞提交到管理群组以供审核。
28
+ * @param cave 新创建的、状态为 'pending' 的回声洞对象。
29
+ */
30
+ sendForPend(cave: CaveObject): Promise<void>;
31
+ }
package/lib/Utils.d.ts ADDED
@@ -0,0 +1,100 @@
1
+ import { Context, h, Logger, Session } from 'koishi';
2
+ import { CaveObject, Config, StoredElement } from './index';
3
+ import { FileManager } from './FileManager';
4
+ import { HashManager } from './HashManager';
5
+ import { AIManager } from './AIManager';
6
+ import { PendManager } from './PendManager';
7
+ /**
8
+ * @description 构建一条用于发送的完整回声洞消息,处理不同存储后端的资源链接。
9
+ * @param cave 回声洞对象。
10
+ * @param config 插件配置。
11
+ * @param fileManager 文件管理器实例。
12
+ * @param logger 日志记录器实例。
13
+ * @param platform 目标平台名称 (e.g., 'onebot')。
14
+ * @param prefix 可选的消息前缀 (e.g., '已删除', '待审核')。
15
+ * @returns 包含多条消息的数组,每条消息是一个 (string | h)[] 数组。
16
+ */
17
+ export declare function buildCaveMessage(cave: CaveObject, config: Config, fileManager: FileManager, logger: Logger, platform?: string, prefix?: string): Promise<(string | h)[][]>;
18
+ /**
19
+ * @description 直接调用 QQ 官方机器人 API 发送带自定义键盘的 Markdown 消息。
20
+ * @param session 当前会话。
21
+ * @param content Markdown 文本内容。
22
+ */
23
+ export declare function sendQQCaveMarkdown(session: Session, content: string): Promise<void>;
24
+ /**
25
+ * @description 发送一条回声洞。QQ 平台使用单条 Markdown + 自定义键盘消息,其余平台保持原有逻辑。
26
+ * @param session 当前会话。
27
+ * @param cave 回声洞对象。
28
+ * @param config 插件配置。
29
+ * @param fileManager 文件管理器实例。
30
+ * @param logger 日志记录器实例。
31
+ * @param prefix 可选的消息前缀。
32
+ */
33
+ export declare function sendCave(session: Session, cave: CaveObject, config: Config, fileManager: FileManager, logger: Logger, prefix?: string): Promise<void>;
34
+ /**
35
+ * @description 解析指令中的回声洞序号,兼容空格、| 与逗号等多种分隔写法。
36
+ * @param inputs 指令参数的原始值。
37
+ * @returns ids 为去重后的合法序号,invalid 为无法解析的原始片段。
38
+ */
39
+ export declare function parseCaveIds(inputs: unknown[]): {
40
+ ids: number[];
41
+ invalid: string[];
42
+ };
43
+ /**
44
+ * @description 获取下一个可用的回声洞 ID,采用“回收ID > 扫描空缺 > 最大ID+1”策略。
45
+ * @param ctx Koishi 上下文。
46
+ * @param reusableIds 可复用 ID 的内存缓存。
47
+ * @returns 可用的新 ID。
48
+ */
49
+ export declare function getNextCaveId(ctx: Context, reusableIds: Set<number>): Promise<number>;
50
+ /**
51
+ * @description 解析消息元素,分离出文本和待下载的媒体文件。
52
+ * @param sourceElements 原始的 Koishi 消息元素数组。
53
+ * @param newId 这条回声洞的新 ID。
54
+ * @param session 触发操作的会话。
55
+ * @param config 插件配置。
56
+ * @param logger 日志实例。
57
+ * @param creationTime 统一的创建时间戳,用于生成文件名。
58
+ * @returns 包含数据库元素和待保存媒体列表的对象。
59
+ */
60
+ export declare function processMessageElements(sourceElements: h[], newId: number, session: Session, creationTime: Date): Promise<{
61
+ finalElementsForDb: StoredElement[];
62
+ mediaToSave: {
63
+ sourceUrl: string;
64
+ fileName: string;
65
+ }[];
66
+ }>;
67
+ /**
68
+ * @description 根据提供的配对关系,将项目 ID 进行聚类。
69
+ * @param pairs 一个由 [number, number] 组成的数组,代表需要合并的项目 ID 配对。
70
+ * @returns 返回一个二维数组,每个子数组代表一个大小大于1的聚类。
71
+ */
72
+ export declare function clusterItemsFromPairs(pairs: [number, number][]): number[][];
73
+ /**
74
+ * @description 通用的 LSH (局部敏感哈希) 候选对生成器。
75
+ * @param items 要处理的项目数组。
76
+ * @param getBucketInfo 一个函数,接收单个项目,并返回其唯一 ID 和一个桶键数组。
77
+ * @returns 一个 Set,包含所有候选对的字符串键 (e.g., "123-456")。
78
+ */
79
+ export declare function generateFromLSH<T>(items: T[], getBucketInfo: (item: T) => {
80
+ id: number;
81
+ keys: string[];
82
+ }): Set<string>;
83
+ /**
84
+ * @description 处理新回声洞创建后的后续逻辑,包括媒体下载、查重、AI分析、哈希存储和状态更新。
85
+ * @param ctx Koishi 上下文。
86
+ * @param config 插件配置。
87
+ * @param fileManager 文件管理器实例。
88
+ * @param logger 日志记录器实例。
89
+ * @param reusableIds 可复用 ID 的内存缓存。
90
+ * @param newCave 已初步创建(status: 'preload')的回声洞对象。
91
+ * @param mediaToSave 待保存的媒体文件列表。
92
+ * @param session 触发操作的会话。
93
+ * @param hashManager 哈希管理器实例(如果启用)。
94
+ * @param aiManager AI管理器实例(如果启用)。
95
+ * @param reviewManager 审核管理器实例(如果启用)。
96
+ */
97
+ export declare function processNewCave(ctx: Context, config: Config, fileManager: FileManager, logger: Logger, reusableIds: Set<number>, newCave: CaveObject, session: Session, mediaToSave: {
98
+ sourceUrl: string;
99
+ fileName: string;
100
+ }[], hashManager: HashManager | null, aiManager: AIManager | null, reviewManager: PendManager | null): Promise<void>;
package/lib/index.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ import { Context, Schema } from 'koishi';
2
+ import { CaveHashObject } from './HashManager';
3
+ import { CaveMetaObject } from './AIManager';
4
+ export declare const name = "best-cave";
5
+ export declare const inject: string[];
6
+ export declare const usage = "\n<div style=\"border-radius: 10px; border: 1px solid #ddd; padding: 16px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);\">\n <h2 style=\"margin-top: 0; color: #4a6ee0;\">\uD83D\uDCCC \u63D2\u4EF6\u8BF4\u660E</h2>\n <p>\uD83D\uDCD6 <strong>\u4F7F\u7528\u6587\u6863</strong>\uFF1A\u8BF7\u70B9\u51FB\u5DE6\u4E0A\u89D2\u7684 <strong>\u63D2\u4EF6\u4E3B\u9875</strong> \u67E5\u770B\u63D2\u4EF6\u4F7F\u7528\u6587\u6863</p>\n <p>\uD83D\uDD0D <strong>\u66F4\u591A\u63D2\u4EF6</strong>\uFF1A\u53EF\u8BBF\u95EE <a href=\"https://github.com/YisRime\" style=\"color:#4a6ee0;text-decoration:none;\">\u82E1\u6DDE\u7684 GitHub</a> \u67E5\u770B\u672C\u4EBA\u7684\u6240\u6709\u63D2\u4EF6</p>\n</div>\n<div style=\"border-radius: 10px; border: 1px solid #ddd; padding: 16px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);\">\n <h2 style=\"margin-top: 0; color: #e0574a;\">\u2764\uFE0F \u652F\u6301\u4E0E\u53CD\u9988</h2>\n <p>\uD83C\uDF1F \u559C\u6B22\u8FD9\u4E2A\u63D2\u4EF6\uFF1F\u8BF7\u5728 <a href=\"https://github.com/YisRime\" style=\"color:#e0574a;text-decoration:none;\">GitHub</a> \u4E0A\u7ED9\u6211\u4E00\u4E2A Star\uFF01</p>\n <p>\uD83D\uDC1B \u9047\u5230\u95EE\u9898\uFF1F\u8BF7\u901A\u8FC7 <strong>Issues</strong> \u63D0\u4EA4\u53CD\u9988\uFF0C\u6216\u52A0\u5165 QQ \u7FA4 <a href=\"https://qm.qq.com/q/PdLMx9Jowq\" style=\"color:#e0574a;text-decoration:none;\"><strong>855571375</strong></a> \u8FDB\u884C\u4EA4\u6D41</p>\n</div>\n";
7
+ /**
8
+ * @description 存储在合并转发中的单个节点的数据结构。
9
+ */
10
+ export interface ForwardNode {
11
+ userId: string;
12
+ userName: string;
13
+ elements: StoredElement[];
14
+ }
15
+ /**
16
+ * @description 存储在数据库中的单个消息元素。
17
+ */
18
+ export interface StoredElement {
19
+ type: 'text' | 'image' | 'video' | 'audio' | 'file' | 'at' | 'forward' | 'reply' | 'face';
20
+ content?: string | ForwardNode[];
21
+ file?: string;
22
+ }
23
+ /**
24
+ * @description 数据库 \`cave\` 表的完整对象模型。
25
+ */
26
+ export interface CaveObject {
27
+ id: number;
28
+ elements: StoredElement[];
29
+ channelId: string;
30
+ userId: string;
31
+ userName: string;
32
+ status: 'active' | 'delete' | 'pending' | 'preload';
33
+ time: Date;
34
+ }
35
+ declare module 'koishi' {
36
+ interface Tables {
37
+ cave: CaveObject;
38
+ cave_hash: CaveHashObject;
39
+ cave_meta: CaveMetaObject;
40
+ }
41
+ }
42
+ export interface Config {
43
+ perChannel: boolean;
44
+ adminChannel: string;
45
+ enableName: boolean;
46
+ enableIO: boolean;
47
+ enablePend: boolean;
48
+ caveFormat: string;
49
+ enableSimilarity: boolean;
50
+ textThreshold: number;
51
+ imageThreshold: number;
52
+ localPath?: string;
53
+ enableS3: boolean;
54
+ endpoint?: string;
55
+ region?: string;
56
+ accessKeyId?: string;
57
+ secretAccessKey?: string;
58
+ bucket?: string;
59
+ publicUrl?: string;
60
+ enableAI: boolean;
61
+ endpoints?: {
62
+ url: string;
63
+ key: string;
64
+ model: string;
65
+ }[];
66
+ enableApprove: boolean;
67
+ approveThreshold: number;
68
+ onAIReviewFail: boolean;
69
+ systemPrompt: string;
70
+ }
71
+ export declare const Config: Schema<Config>;
72
+ export declare function apply(ctx: Context, config: Config): void;