koishi-plugin-aka-comfy-agent 0.2.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 +19 -0
- package/dist/index.d.mts +50 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +1781 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1753 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# aka-comfy-agent
|
|
2
|
+
|
|
3
|
+
自用 ComfyUI Koishi 插件。
|
|
4
|
+
|
|
5
|
+
通过 ComfyUI 提供图像生成与对话式 agent loop 的 Koishi 插件,供个人使用。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install koishi-plugin-aka-comfy-agent
|
|
11
|
+
# 或
|
|
12
|
+
yarn add koishi-plugin-aka-comfy-agent
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
在 Koishi 中启用插件 `aka-comfy-agent` 并配置 LLM(main / vision)与 ComfyUI 地址后使用。
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
MIT
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Schema, Context } from 'koishi';
|
|
2
|
+
|
|
3
|
+
interface LlmProviderConfig {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** 空 = 自动拉取 {baseUrl}/models 取第一个 */
|
|
8
|
+
model: string;
|
|
9
|
+
/** 该模型专属系统提示(默认 = prompts.ts 里的角色设定;留空则用默认) */
|
|
10
|
+
systemPrompt: string;
|
|
11
|
+
/** 视觉模型请求正文(仅 vision 使用;留空则用默认) */
|
|
12
|
+
userText: string;
|
|
13
|
+
}
|
|
14
|
+
interface Config {
|
|
15
|
+
mainLLM: LlmProviderConfig;
|
|
16
|
+
visionLLM: LlmProviderConfig;
|
|
17
|
+
comfy: {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
timeoutMs: number;
|
|
20
|
+
};
|
|
21
|
+
/** 背景色兜底:DS 未给或非法时用此值 */
|
|
22
|
+
defaultBackgroundColor: string;
|
|
23
|
+
session: {
|
|
24
|
+
maxTurns: number;
|
|
25
|
+
idleTimeoutMs: number;
|
|
26
|
+
perUserInGroup: boolean;
|
|
27
|
+
maxDiagnoseRetries: number;
|
|
28
|
+
};
|
|
29
|
+
/** 生成前确认闸:command=comfy 命令路径,chatluna=ChatLuna 工具路径(工具无法交互确认) */
|
|
30
|
+
confirmBeforeGenerate: {
|
|
31
|
+
command: boolean;
|
|
32
|
+
chatluna: boolean;
|
|
33
|
+
};
|
|
34
|
+
visionCrosscheckRounds: number;
|
|
35
|
+
chatlunaEnabled: boolean;
|
|
36
|
+
chatlunaRoomLastGenerated: boolean;
|
|
37
|
+
}
|
|
38
|
+
declare const Config: Schema<Config>;
|
|
39
|
+
|
|
40
|
+
declare const name = "aka-comfy-agent";
|
|
41
|
+
/**
|
|
42
|
+
* 声明可选依赖 chatluna,避免 ctx.chatluna 访问触发
|
|
43
|
+
* "property chatluna is not registered" 警告(与 aka-ai-generator 桥一致)。
|
|
44
|
+
*/
|
|
45
|
+
declare const inject: {
|
|
46
|
+
readonly optional: readonly ["chatluna"];
|
|
47
|
+
};
|
|
48
|
+
declare function apply(ctx: Context, config: Config): void;
|
|
49
|
+
|
|
50
|
+
export { Config, apply, inject, name };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Schema, Context } from 'koishi';
|
|
2
|
+
|
|
3
|
+
interface LlmProviderConfig {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** 空 = 自动拉取 {baseUrl}/models 取第一个 */
|
|
8
|
+
model: string;
|
|
9
|
+
/** 该模型专属系统提示(默认 = prompts.ts 里的角色设定;留空则用默认) */
|
|
10
|
+
systemPrompt: string;
|
|
11
|
+
/** 视觉模型请求正文(仅 vision 使用;留空则用默认) */
|
|
12
|
+
userText: string;
|
|
13
|
+
}
|
|
14
|
+
interface Config {
|
|
15
|
+
mainLLM: LlmProviderConfig;
|
|
16
|
+
visionLLM: LlmProviderConfig;
|
|
17
|
+
comfy: {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
timeoutMs: number;
|
|
20
|
+
};
|
|
21
|
+
/** 背景色兜底:DS 未给或非法时用此值 */
|
|
22
|
+
defaultBackgroundColor: string;
|
|
23
|
+
session: {
|
|
24
|
+
maxTurns: number;
|
|
25
|
+
idleTimeoutMs: number;
|
|
26
|
+
perUserInGroup: boolean;
|
|
27
|
+
maxDiagnoseRetries: number;
|
|
28
|
+
};
|
|
29
|
+
/** 生成前确认闸:command=comfy 命令路径,chatluna=ChatLuna 工具路径(工具无法交互确认) */
|
|
30
|
+
confirmBeforeGenerate: {
|
|
31
|
+
command: boolean;
|
|
32
|
+
chatluna: boolean;
|
|
33
|
+
};
|
|
34
|
+
visionCrosscheckRounds: number;
|
|
35
|
+
chatlunaEnabled: boolean;
|
|
36
|
+
chatlunaRoomLastGenerated: boolean;
|
|
37
|
+
}
|
|
38
|
+
declare const Config: Schema<Config>;
|
|
39
|
+
|
|
40
|
+
declare const name = "aka-comfy-agent";
|
|
41
|
+
/**
|
|
42
|
+
* 声明可选依赖 chatluna,避免 ctx.chatluna 访问触发
|
|
43
|
+
* "property chatluna is not registered" 警告(与 aka-ai-generator 桥一致)。
|
|
44
|
+
*/
|
|
45
|
+
declare const inject: {
|
|
46
|
+
readonly optional: readonly ["chatluna"];
|
|
47
|
+
};
|
|
48
|
+
declare function apply(ctx: Context, config: Config): void;
|
|
49
|
+
|
|
50
|
+
export { Config, apply, inject, name };
|