koishi-plugin-aka-comfy-agent 0.2.2 → 0.2.4
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/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +13 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -12,17 +12,17 @@ interface LlmProviderConfig {
|
|
|
12
12
|
userText: string;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* 程序级锚点 /
|
|
16
|
-
*
|
|
15
|
+
* 程序级锚点 / 背景模板覆盖。
|
|
16
|
+
* 留空时使用插件内置默认措辞。
|
|
17
17
|
*/
|
|
18
18
|
interface PromptOverrideConfig {
|
|
19
|
-
/**
|
|
19
|
+
/** 身份锁定锚点完整措辞(留空用内置默认) */
|
|
20
20
|
identityAnchor: string;
|
|
21
|
-
/**
|
|
21
|
+
/** 三点布光光场锚点完整措辞(留空用内置默认) */
|
|
22
22
|
lightfieldAnchor: string;
|
|
23
|
-
/**
|
|
23
|
+
/** 背景替换模板({color} 替换为背景色,留空用内置默认) */
|
|
24
24
|
backgroundClauseTemplate: string;
|
|
25
|
-
/**
|
|
25
|
+
/** 背景覆盖模板({desc} 替换为背景描述,留空用内置默认) */
|
|
26
26
|
backgroundOverrideTemplate: string;
|
|
27
27
|
}
|
|
28
28
|
interface Config {
|
|
@@ -34,7 +34,7 @@ interface Config {
|
|
|
34
34
|
};
|
|
35
35
|
/** 背景色兜底:DS 未给或非法时用此值 */
|
|
36
36
|
defaultBackgroundColor: string;
|
|
37
|
-
/**
|
|
37
|
+
/** 锚点与背景模板覆盖 */
|
|
38
38
|
prompt: PromptOverrideConfig;
|
|
39
39
|
session: {
|
|
40
40
|
maxTurns: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,17 +12,17 @@ interface LlmProviderConfig {
|
|
|
12
12
|
userText: string;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* 程序级锚点 /
|
|
16
|
-
*
|
|
15
|
+
* 程序级锚点 / 背景模板覆盖。
|
|
16
|
+
* 留空时使用插件内置默认措辞。
|
|
17
17
|
*/
|
|
18
18
|
interface PromptOverrideConfig {
|
|
19
|
-
/**
|
|
19
|
+
/** 身份锁定锚点完整措辞(留空用内置默认) */
|
|
20
20
|
identityAnchor: string;
|
|
21
|
-
/**
|
|
21
|
+
/** 三点布光光场锚点完整措辞(留空用内置默认) */
|
|
22
22
|
lightfieldAnchor: string;
|
|
23
|
-
/**
|
|
23
|
+
/** 背景替换模板({color} 替换为背景色,留空用内置默认) */
|
|
24
24
|
backgroundClauseTemplate: string;
|
|
25
|
-
/**
|
|
25
|
+
/** 背景覆盖模板({desc} 替换为背景描述,留空用内置默认) */
|
|
26
26
|
backgroundOverrideTemplate: string;
|
|
27
27
|
}
|
|
28
28
|
interface Config {
|
|
@@ -34,7 +34,7 @@ interface Config {
|
|
|
34
34
|
};
|
|
35
35
|
/** 背景色兜底:DS 未给或非法时用此值 */
|
|
36
36
|
defaultBackgroundColor: string;
|
|
37
|
-
/**
|
|
37
|
+
/** 锚点与背景模板覆盖 */
|
|
38
38
|
prompt: PromptOverrideConfig;
|
|
39
39
|
session: {
|
|
40
40
|
maxTurns: number;
|
package/dist/index.js
CHANGED
|
@@ -75,11 +75,11 @@ var Config = import_koishi.Schema.object({
|
|
|
75
75
|
}).description("ComfyUI"),
|
|
76
76
|
defaultBackgroundColor: import_koishi.Schema.string().default("yellow").description("背景色兜底(DS 未给或非法时使用;英文颜色词)"),
|
|
77
77
|
prompt: import_koishi.Schema.object({
|
|
78
|
-
identityAnchor: import_koishi.Schema.string().role("textarea").default("").description("
|
|
79
|
-
lightfieldAnchor: import_koishi.Schema.string().role("textarea").default("").description("
|
|
80
|
-
backgroundClauseTemplate: import_koishi.Schema.string().role("textarea").default("").description("
|
|
81
|
-
backgroundOverrideTemplate: import_koishi.Schema.string().role("textarea").default("").description("
|
|
82
|
-
}).description("
|
|
78
|
+
identityAnchor: import_koishi.Schema.string().role("textarea").default("").description("身份锁定锚点完整措辞"),
|
|
79
|
+
lightfieldAnchor: import_koishi.Schema.string().role("textarea").default("").description("三点布光光场锚点完整措辞"),
|
|
80
|
+
backgroundClauseTemplate: import_koishi.Schema.string().role("textarea").default("").description("背景替换模板({color} 替换为背景色)"),
|
|
81
|
+
backgroundOverrideTemplate: import_koishi.Schema.string().role("textarea").default("").description("背景覆盖模板({desc} 替换为背景描述)")
|
|
82
|
+
}).description("锚点与背景模板覆盖"),
|
|
83
83
|
session: import_koishi.Schema.object({
|
|
84
84
|
maxTurns: import_koishi.Schema.number().min(1).max(50).default(10).description("最大轮次"),
|
|
85
85
|
idleTimeoutMs: import_koishi.Schema.number().min(6e4).max(24 * 60 * 60 * 1e3).default(10 * 60 * 1e3).description("空闲销毁(ms)"),
|
|
@@ -1313,7 +1313,7 @@ function apply(ctx, config) {
|
|
|
1313
1313
|
} else {
|
|
1314
1314
|
schemaScope.set(key, import_koishi3.Schema.string().description("模型(探测中,完成后可选)"));
|
|
1315
1315
|
}
|
|
1316
|
-
logger.info("%s:
|
|
1316
|
+
logger.info("%s: 下拉预注册完成 key=%s cur=%s", label, key, cur || "(空)");
|
|
1317
1317
|
};
|
|
1318
1318
|
seedDynamic("main", config.mainLLM, "aka-comfy-agent.models.main");
|
|
1319
1319
|
seedDynamic("vision", config.visionLLM, "aka-comfy-agent.models.vision");
|
|
@@ -1506,7 +1506,7 @@ function apply(ctx, config) {
|
|
|
1506
1506
|
store.set(newSession.key, newSession);
|
|
1507
1507
|
if (config.confirmBeforeGenerate.command && downloaded.dataUrl) {
|
|
1508
1508
|
try {
|
|
1509
|
-
await reportProgress(session, void 0, `已收到图片(${(downloaded.buffer.length / 1048576).toFixed(1)} MB
|
|
1509
|
+
await reportProgress(session, void 0, `已收到图片(${(downloaded.buffer.length / 1048576).toFixed(1)} MB),正在解析角色资产清单…`);
|
|
1510
1510
|
const analysis = await runAnalysisOnly(brainDeps(), downloaded.dataUrl);
|
|
1511
1511
|
newSession.materialAnalysis = analysis;
|
|
1512
1512
|
newSession.pendingConfirm = { analysis, intent };
|
|
@@ -1548,7 +1548,7 @@ function apply(ctx, config) {
|
|
|
1548
1548
|
opts
|
|
1549
1549
|
);
|
|
1550
1550
|
genProgress = void 0;
|
|
1551
|
-
await reportProgress(session, mid, "生成完毕
|
|
1551
|
+
await reportProgress(session, mid, "生成完毕");
|
|
1552
1552
|
const parts = [];
|
|
1553
1553
|
parts.push(import_koishi3.h.image(result.imageBuffer, mimeFromFilename(result.filename)));
|
|
1554
1554
|
const noteLine = result.note ? `做法:${result.note}
|
|
@@ -1757,13 +1757,8 @@ function errMsg2(err) {
|
|
|
1757
1757
|
return err instanceof Error ? err.message : String(err);
|
|
1758
1758
|
}
|
|
1759
1759
|
function statusBar(convo, maxTurns, state) {
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
``,
|
|
1763
|
-
label,
|
|
1764
|
-
`想继续调整就直接发文字(如「毛再蓬一点」「背景换红」),会在这张图上迭代。`,
|
|
1765
|
-
`离开循环回到聊天:直接发「退出」。`
|
|
1766
|
-
].join("\n");
|
|
1760
|
+
return `
|
|
1761
|
+
第 ${convo.turns}/${maxTurns} 轮${state ? `|${state}` : ""}:直接发文字改图;发「退出」离开循环。`;
|
|
1767
1762
|
}
|
|
1768
1763
|
var CONFIRM_WORDS = /* @__PURE__ */ new Set(["确认", "开始", "生成", "可以", "好", "好的", "ok", "OK", "Ok", "oK", "yes", "Yes", "YES", "go", "start", "没问题", "就这个", "就这样", "同意", "干"]);
|
|
1769
1764
|
function isConfirmWord(text) {
|
|
@@ -1789,14 +1784,12 @@ function isExitIntent(text) {
|
|
|
1789
1784
|
function formatConfirmPrompt(analysis, intent) {
|
|
1790
1785
|
const preview = analysis && analysis.length > 900 ? `${analysis.slice(0, 900)}…` : analysis || "(无)";
|
|
1791
1786
|
return [
|
|
1792
|
-
|
|
1793
|
-
`意图:${intent || "(未提供,将按材质分层做保守增强)"}`,
|
|
1787
|
+
`意图:${intent || "(未提供,保守增强)"}`,
|
|
1794
1788
|
``,
|
|
1795
|
-
|
|
1789
|
+
`资产清单:`,
|
|
1796
1790
|
preview,
|
|
1797
1791
|
``,
|
|
1798
|
-
|
|
1799
|
-
`【COMFY 循环 · 待确认】想离开循环回聊天:直接发「清空」或「退出」。`
|
|
1792
|
+
`回复「确认」生成;或直接说修正点(会并入后再确认)。「退出」可离开。`
|
|
1800
1793
|
].join("\n");
|
|
1801
1794
|
}
|
|
1802
1795
|
// Annotate the CommonJS export names for ESM import in node:
|