koishi-plugin-aka-comfy-agent 0.2.1 → 0.2.3

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 CHANGED
@@ -12,17 +12,17 @@ interface LlmProviderConfig {
12
12
  userText: string;
13
13
  }
14
14
  /**
15
- * 程序级锚点 / 背景模板的可配置覆盖(框架化 = 默认留空,回退 prompts.ts 框架默认)。
16
- * 完整措辞只保留在私有文档,经此处 koishi.yml 配置还原,无需改源码。
15
+ * 程序级锚点 / 背景模板覆盖。
16
+ * 留空时使用插件内置默认措辞。
17
17
  */
18
18
  interface PromptOverrideConfig {
19
- /** 身份锁定锚点(完整措辞;留空 = 用 prompts.ts 框架默认) */
19
+ /** 身份锁定锚点完整措辞(留空用内置默认) */
20
20
  identityAnchor: string;
21
- /** 三点布光光场锚点(完整措辞;留空 = 用 prompts.ts 框架默认) */
21
+ /** 三点布光光场锚点完整措辞(留空用内置默认) */
22
22
  lightfieldAnchor: string;
23
- /** 背景替换模板,含 {color} 占位(留空 = 用 prompts.ts 框架默认) */
23
+ /** 背景替换模板({color} 替换为背景色,留空用内置默认) */
24
24
  backgroundClauseTemplate: string;
25
- /** 背景覆盖模板,含 {desc} 占位(留空 = 用 prompts.ts 框架默认) */
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
- * 程序级锚点 / 背景模板的可配置覆盖(框架化 = 默认留空,回退 prompts.ts 框架默认)。
16
- * 完整措辞只保留在私有文档,经此处 koishi.yml 配置还原,无需改源码。
15
+ * 程序级锚点 / 背景模板覆盖。
16
+ * 留空时使用插件内置默认措辞。
17
17
  */
18
18
  interface PromptOverrideConfig {
19
- /** 身份锁定锚点(完整措辞;留空 = 用 prompts.ts 框架默认) */
19
+ /** 身份锁定锚点完整措辞(留空用内置默认) */
20
20
  identityAnchor: string;
21
- /** 三点布光光场锚点(完整措辞;留空 = 用 prompts.ts 框架默认) */
21
+ /** 三点布光光场锚点完整措辞(留空用内置默认) */
22
22
  lightfieldAnchor: string;
23
- /** 背景替换模板,含 {color} 占位(留空 = 用 prompts.ts 框架默认) */
23
+ /** 背景替换模板({color} 替换为背景色,留空用内置默认) */
24
24
  backgroundClauseTemplate: string;
25
- /** 背景覆盖模板,含 {desc} 占位(留空 = 用 prompts.ts 框架默认) */
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
@@ -32,8 +32,8 @@ var import_koishi3 = require("koishi");
32
32
  var import_koishi = require("koishi");
33
33
 
34
34
  // src/llm/prompts.ts
35
- var MAIN_SYSTEM_PROMPT = `You are the edit-intent author for an image re-render pipeline. The pipeline prepends fixed identity, backdrop and lighting anchors before your output. Describe only the user's requested look (material or optical adjustments; a background change or light override when explicitly asked) as one short natural English clause. Placeholder default; the full prompt is restored via config override from the private design doc.`;
36
- var GLM_PROBE_PROMPT = `You are an asset extractor for a character image. From the screenshot, list every visual detail that a re-render could drift, and output a structured English JSON inventory (species, per-part colors, accessories, body surface, tail, pose, background). Do not invent details; use "none" when absent. Placeholder default; full prompt (with exact schema) is in the private design doc.`;
35
+ var MAIN_SYSTEM_PROMPT = `You are the edit-intent author for an image re-render pipeline. The pipeline prepends fixed identity, backdrop and lighting anchors before your output. Describe only the user's requested look — material or optical adjustments, or a background change / light override when explicitly asked — as one short natural English clause.`;
36
+ var GLM_PROBE_PROMPT = `You are an asset extractor for a character image. From the screenshot, list every visual detail that a re-render could drift, and output a structured English JSON inventory covering species, per-part colors, accessories, body surface, tail, pose, and background. Do not invent details; use "none" when absent.`;
37
37
  var VISION_USER_TEXT = "分析这张游戏角色截图,输出资产清单 JSON。";
38
38
  var VISION_CROSSCHECK_TEXT = `这是对同一张源图的【资产清单对抗复核】。
39
39
 
@@ -42,19 +42,19 @@ var VISION_CROSSCHECK_TEXT = `这是对同一张源图的【资产清单对抗
42
42
 
43
43
  请基于源图逐项对抗验证上一轮的每一项字段,明确指出错误/遗漏/脑补,修正会导致重绘跑偏的项,保持英文枚举与同一 schema 不变;不确定时写 "none"。只输出修正后的权威 JSON。`;
44
44
  var VISION_REPORT_LABEL = "资产清单(GLM 修正后)";
45
- var IDENTITY_ANCHOR = `Preserve the subject, its pose, outfit, accessories and colors of the source image exactly, keeping the same composition and framing, at high resolution, with no UI and no watermark. (Generic placeholder; the full locked wording is in the private design doc.)`;
46
- var LIGHTFIELD_ANCHOR = `Evenly light the character's front with gentle volume, keep the shadows soft and the face readable, and add a subtle rim so the silhouette lifts off the backdrop with a soft contact shadow. (Generic placeholder; the full locked wording is in the private design doc.)`;
45
+ var IDENTITY_ANCHOR = `Preserve the subject, its pose, outfit, accessories and colors of the source image exactly, keeping the same composition and framing, at high resolution, with no UI and no watermark.`;
46
+ var LIGHTFIELD_ANCHOR = `Evenly light the character's front with gentle volume, keep the shadows soft and the face readable, and add a subtle rim so the silhouette lifts off the backdrop with a soft contact shadow.`;
47
47
  function buildBackdropClause(color, template) {
48
48
  const c = (color || "yellow").trim().toLowerCase();
49
49
  const t = template?.trim();
50
50
  if (t) return t.replace("{color}", c);
51
- return `Place the character on a plain solid ${c} seamless studio backdrop that fully replaces the source background. (Generic placeholder; full wording in private doc.)`;
51
+ return `Place the character on a plain solid ${c} seamless studio backdrop that fully replaces the source background.`;
52
52
  }
53
53
  function buildBackdropFromOverride(desc, template) {
54
54
  const d = (desc || "").trim().replace(/\s+/g, " ");
55
55
  const t = template?.trim();
56
56
  if (t) return t.replace("{desc}", d);
57
- return `Place the character against ${d}, fully replacing the source background. (Generic placeholder; full wording in private doc.)`;
57
+ return `Place the character against ${d}, fully replacing the source background.`;
58
58
  }
59
59
 
60
60
  // src/config.ts
@@ -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("身份锁定锚点完整措辞(留空=用 prompts.ts 框架默认;完整原文见私有文档)"),
79
- lightfieldAnchor: import_koishi.Schema.string().role("textarea").default("").description("三点布光光场锚点完整措辞(留空=用 prompts.ts 框架默认;完整原文见私有文档)"),
80
- backgroundClauseTemplate: import_koishi.Schema.string().role("textarea").default("").description("背景替换模板,含 {color} 占位(留空=用 prompts.ts 框架默认;完整原文见私有文档)"),
81
- backgroundOverrideTemplate: import_koishi.Schema.string().role("textarea").default("").description("背景覆盖模板,含 {desc} 占位(留空=用 prompts.ts 框架默认;完整原文见私有文档)")
82
- }).description("程序级锚点/背景模板覆盖(框架化:发布包默认空,完整措辞经此 koishi.yml 配置还原,无需改源码)"),
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: 下拉占位已注册 key=%s cur=%s", label, key, cur || "(空)");
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");