@ai-fux/fux-dsh-comfymcp 0.5.1 → 0.5.2
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/cordis.patch.yml +183 -183
- package/index.js +8 -6
- package/lib/bridge.js +23 -0
- package/lib/catalog.js +11 -0
- package/package.json +4 -4
package/cordis.patch.yml
CHANGED
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
# fux-dsh-comfymcp bundle patch:两段操作。
|
|
2
|
-
# ① 插件自身行:全部路径类配置不落机器绝对路径(Linux/新机零手工修正)——
|
|
3
|
-
# 内嵌模式服务端走插件包内 vendor/,主目录/工作流/产物缺省派生自 DSH 内置数据目录;
|
|
4
|
-
# 真实 ComfyUI 后端等高级入口经设置页按机器填写(优先级:env > 覆盖层 > 行配置 > 默认)。
|
|
5
|
-
# ② 覆盖 shipped preset-standard:ask_user_question 切计时模式(吸收原 @local/dsh-preset-timed-ask
|
|
6
|
-
# 预设包,该包退役)。mode 由本插件覆盖层 timedAsk 开关驱动(设置页「ask_user 倒计时卡片」,
|
|
7
|
-
# 写 $DSH_HOME/comfymcp/config-overlay.json,重启 DSH 生效;缺省/读不到 → timed)。
|
|
8
|
-
# 来源:dsh-web-app/presets/standard.patch.yml(仅 tool-ask-user 条目不同)。
|
|
9
|
-
# 注意:DSH 升级若 preset-standard 有变更,需同步本段(官方 README 同样要求手工维护该覆盖)。
|
|
10
|
-
- insert:
|
|
11
|
-
- id: fux-dsh-comfymcp
|
|
12
|
-
# 行 name = 包名(运行时按包名对行);id 用去 scope 短 id(模板规约)。
|
|
13
|
-
# 裸包名按 Node 解析链从 dsh 安装可见(包已 link 进部署 node_modules)。
|
|
14
|
-
# 长驻进程内模块记录/生成快照按进程冻结,改动后需重启 DSH 才重载。
|
|
15
|
-
name: "@ai-fux/fux-dsh-comfymcp"
|
|
16
|
-
config:
|
|
17
|
-
endpoint: http://127.0.0.1:18800/mcp
|
|
18
|
-
hostCommand: node
|
|
19
|
-
# hostEntry 缺省为空:内嵌模式走插件包内 vendor/comfy-mcp-server.mjs;
|
|
20
|
-
# 仅远程 spawn 模式才需要在设置页显式填宿主入口。
|
|
21
|
-
# 工作流/产物/结构化数据统一收敛在插件主目录下(缺省 DSH 内置数据目录
|
|
22
|
-
# $DSH_HOME/comfymcp/,子目录 workflows|artifacts|data,node:path 派生跨平台);
|
|
23
|
-
# 需要检索 ComfyUI 自带模板库时在设置页追加该目录即可。
|
|
24
|
-
# workflowDirs: []
|
|
25
|
-
saveSubdir: dsh-generated
|
|
26
|
-
artifactsDir: ''
|
|
27
|
-
autoUnloadModel: true
|
|
28
|
-
autoConnect: true
|
|
29
|
-
requestTimeoutMs: 30000
|
|
30
|
-
callTimeoutMs: 300000
|
|
31
|
-
# 内嵌 comfy-mcp 服务端:插件自动拉起(port 0 随机端口),无需单独部署/启动。
|
|
32
|
-
# 服务端程序已内置在插件包(vendor/comfy-mcp-server.mjs),无需配置路径;
|
|
33
|
-
# env DSH_COMFYMCP_SERVER_ENTRY 或设置页可显式覆盖。
|
|
34
|
-
# 关闭(设置页「远程地址」模式)则连接上方 endpoint 指向的外置服务。
|
|
35
|
-
embeddedServer: true
|
|
36
|
-
# ComfyUI 服务地址:官方默认端口 8188;ComfyUI 在别的机器时改成 http://<IP>:8188(设置页可改,保存热重启内置服务)
|
|
37
|
-
comfyuiUrl: http://127.0.0.1:8188
|
|
38
|
-
# 内嵌后端缺省 mock(零依赖开箱跑通全链路)。接真实 ComfyUI:设置页「后端入口」
|
|
39
|
-
# 指向 ComfyUI 的 MCP 桥接程序(如 fux-comfyui-mcp.mjs),后端类型随入口自动切 stdio。
|
|
40
|
-
# embeddedBackend: mock
|
|
41
|
-
# embeddedBackendCommand: node
|
|
42
|
-
# embeddedBackendArgs: ''
|
|
43
|
-
- id: preset-standard
|
|
44
|
-
name: '@deepseek-ai/dsh-agent-preset'
|
|
45
|
-
config:
|
|
46
|
-
id: standard
|
|
47
|
-
order: 1
|
|
48
|
-
plugins:
|
|
49
|
-
- id: persona
|
|
50
|
-
name: '@deepseek-ai/dsh-persona'
|
|
51
|
-
config:
|
|
52
|
-
suffix: Your working directory is {{cwd}}.
|
|
53
|
-
prefix: You are a coding agent powered by the {{model}} model.
|
|
54
|
-
- id: agent-instructions
|
|
55
|
-
name: '@deepseek-ai/dsh-agent-instructions'
|
|
56
|
-
config:
|
|
57
|
-
maxBytes: 65536
|
|
58
|
-
- id: tool-bash
|
|
59
|
-
name: '@deepseek-ai/dsh-tool-bash'
|
|
60
|
-
disabled: !!js process.platform === 'win32'
|
|
61
|
-
- id: tool-pwsh
|
|
62
|
-
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
63
|
-
disabled: !!js process.platform !== 'win32'
|
|
64
|
-
- id: tool-fs
|
|
65
|
-
name: '@deepseek-ai/dsh-tool-fs'
|
|
66
|
-
- id: tool-fs-search
|
|
67
|
-
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
68
|
-
config:
|
|
69
|
-
sampleOverCapGlobResults: false
|
|
70
|
-
- id: tool-jobs
|
|
71
|
-
name: '@deepseek-ai/dsh-tool-jobs'
|
|
72
|
-
- id: skill-filesystem
|
|
73
|
-
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
74
|
-
- id: tool-skill
|
|
75
|
-
name: '@deepseek-ai/dsh-tool-skill'
|
|
76
|
-
- id: command-goal
|
|
77
|
-
name: '@deepseek-ai/dsh-command-goal'
|
|
78
|
-
- id: tool-goal
|
|
79
|
-
name: '@deepseek-ai/dsh-tool-goal'
|
|
80
|
-
- id: planning
|
|
81
|
-
name: cordis:group
|
|
82
|
-
group: true
|
|
83
|
-
isolate:
|
|
84
|
-
planMode: true
|
|
85
|
-
config:
|
|
86
|
-
- id: plan-mode
|
|
87
|
-
name: '@deepseek-ai/dsh-plan-mode'
|
|
88
|
-
config:
|
|
89
|
-
section: |
|
|
90
|
-
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
91
|
-
|
|
92
|
-
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
93
|
-
|
|
94
|
-
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
95
|
-
|
|
96
|
-
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find it.
|
|
97
|
-
- id: compaction
|
|
98
|
-
name: cordis:group
|
|
99
|
-
group: true
|
|
100
|
-
isolate:
|
|
101
|
-
compaction: true
|
|
102
|
-
toolResultPruner: true
|
|
103
|
-
config:
|
|
104
|
-
- id: compaction-basic
|
|
105
|
-
name: '@deepseek-ai/dsh-compaction-basic'
|
|
106
|
-
- id: command-compact
|
|
107
|
-
name: '@deepseek-ai/dsh-command-compact'
|
|
108
|
-
- id: tool-result-pruner
|
|
109
|
-
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
110
|
-
config:
|
|
111
|
-
thresholdChars: 8192
|
|
112
|
-
headChars: 4096
|
|
113
|
-
tailChars: 1024
|
|
114
|
-
- id: delegation
|
|
115
|
-
name: cordis:group
|
|
116
|
-
group: true
|
|
117
|
-
isolate:
|
|
118
|
-
workflowEngine: true
|
|
119
|
-
config:
|
|
120
|
-
- id: tool-subagent-control
|
|
121
|
-
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
122
|
-
- id: tool-subagent-list-agents
|
|
123
|
-
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
124
|
-
- id: tool-subagent
|
|
125
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
126
|
-
config:
|
|
127
|
-
provider: spawn
|
|
128
|
-
toolName: subagent
|
|
129
|
-
modelSelectionSettings: true
|
|
130
|
-
backgroundMode: continuable
|
|
131
|
-
- id: tool-subagent-fork
|
|
132
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
133
|
-
config:
|
|
134
|
-
provider: fork
|
|
135
|
-
toolName: subagent_fork
|
|
136
|
-
backgroundMode: continuable
|
|
137
|
-
- id: tool-subagent-codex
|
|
138
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
139
|
-
disabled: true
|
|
140
|
-
config:
|
|
141
|
-
provider: codex
|
|
142
|
-
toolName: subagent_codex
|
|
143
|
-
backgroundMode: one-shot
|
|
144
|
-
maxDepth: provider-managed
|
|
145
|
-
- id: tool-subagent-claude-code
|
|
146
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
147
|
-
disabled: true
|
|
148
|
-
config:
|
|
149
|
-
provider: claude-code
|
|
150
|
-
toolName: subagent_claude_code
|
|
151
|
-
backgroundMode: one-shot
|
|
152
|
-
maxDepth: provider-managed
|
|
153
|
-
- id: workflow-ptc
|
|
154
|
-
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
155
|
-
config:
|
|
156
|
-
provider: spawn
|
|
157
|
-
- id: tool-workflow
|
|
158
|
-
name: '@deepseek-ai/dsh-tool-workflow'
|
|
159
|
-
- id: tool-ralph
|
|
160
|
-
name: '@deepseek-ai/dsh-tool-ralph'
|
|
161
|
-
disabled: true
|
|
162
|
-
config:
|
|
163
|
-
subagentProvider: spawn
|
|
164
|
-
maxRounds: 64
|
|
165
|
-
- id: tool-ask-user
|
|
166
|
-
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
167
|
-
config:
|
|
168
|
-
mode: !!js (function(){try{var o=JSON.parse(require('fs').readFileSync(require('path').join(process.env.DSH_HOME||require('path').join(process.cwd(),'data','.dsh'),'comfymcp','config-overlay.json'),'utf8'));return o.timedAsk===false?'legacy':'timed'}catch(e){return 'timed'}})()
|
|
169
|
-
timeout: 30
|
|
170
|
-
- id: tool-todo
|
|
171
|
-
name: '@deepseek-ai/dsh-tool-todo'
|
|
172
|
-
config:
|
|
173
|
-
allowParallelInProgress: true
|
|
174
|
-
- id: tool-web
|
|
175
|
-
name: '@deepseek-ai/dsh-tool-web'
|
|
176
|
-
config:
|
|
177
|
-
fetch: true
|
|
178
|
-
searchTimeoutMs: 60000
|
|
179
|
-
- id: present
|
|
180
|
-
name: '@deepseek-ai/dsh-tool-present'
|
|
181
|
-
- id: tool-plugin-manager
|
|
182
|
-
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
183
|
-
disabled: true
|
|
1
|
+
# fux-dsh-comfymcp bundle patch:两段操作。
|
|
2
|
+
# ① 插件自身行:全部路径类配置不落机器绝对路径(Linux/新机零手工修正)——
|
|
3
|
+
# 内嵌模式服务端走插件包内 vendor/,主目录/工作流/产物缺省派生自 DSH 内置数据目录;
|
|
4
|
+
# 真实 ComfyUI 后端等高级入口经设置页按机器填写(优先级:env > 覆盖层 > 行配置 > 默认)。
|
|
5
|
+
# ② 覆盖 shipped preset-standard:ask_user_question 切计时模式(吸收原 @local/dsh-preset-timed-ask
|
|
6
|
+
# 预设包,该包退役)。mode 由本插件覆盖层 timedAsk 开关驱动(设置页「ask_user 倒计时卡片」,
|
|
7
|
+
# 写 $DSH_HOME/comfymcp/config-overlay.json,重启 DSH 生效;缺省/读不到 → timed)。
|
|
8
|
+
# 来源:dsh-web-app/presets/standard.patch.yml(仅 tool-ask-user 条目不同)。
|
|
9
|
+
# 注意:DSH 升级若 preset-standard 有变更,需同步本段(官方 README 同样要求手工维护该覆盖)。
|
|
10
|
+
- insert:
|
|
11
|
+
- id: fux-dsh-comfymcp
|
|
12
|
+
# 行 name = 包名(运行时按包名对行);id 用去 scope 短 id(模板规约)。
|
|
13
|
+
# 裸包名按 Node 解析链从 dsh 安装可见(包已 link 进部署 node_modules)。
|
|
14
|
+
# 长驻进程内模块记录/生成快照按进程冻结,改动后需重启 DSH 才重载。
|
|
15
|
+
name: "@ai-fux/fux-dsh-comfymcp"
|
|
16
|
+
config:
|
|
17
|
+
endpoint: http://127.0.0.1:18800/mcp
|
|
18
|
+
hostCommand: node
|
|
19
|
+
# hostEntry 缺省为空:内嵌模式走插件包内 vendor/comfy-mcp-server.mjs;
|
|
20
|
+
# 仅远程 spawn 模式才需要在设置页显式填宿主入口。
|
|
21
|
+
# 工作流/产物/结构化数据统一收敛在插件主目录下(缺省 DSH 内置数据目录
|
|
22
|
+
# $DSH_HOME/comfymcp/,子目录 workflows|artifacts|data,node:path 派生跨平台);
|
|
23
|
+
# 需要检索 ComfyUI 自带模板库时在设置页追加该目录即可。
|
|
24
|
+
# workflowDirs: []
|
|
25
|
+
saveSubdir: dsh-generated
|
|
26
|
+
artifactsDir: ''
|
|
27
|
+
autoUnloadModel: true
|
|
28
|
+
autoConnect: true
|
|
29
|
+
requestTimeoutMs: 30000
|
|
30
|
+
callTimeoutMs: 300000
|
|
31
|
+
# 内嵌 comfy-mcp 服务端:插件自动拉起(port 0 随机端口),无需单独部署/启动。
|
|
32
|
+
# 服务端程序已内置在插件包(vendor/comfy-mcp-server.mjs),无需配置路径;
|
|
33
|
+
# env DSH_COMFYMCP_SERVER_ENTRY 或设置页可显式覆盖。
|
|
34
|
+
# 关闭(设置页「远程地址」模式)则连接上方 endpoint 指向的外置服务。
|
|
35
|
+
embeddedServer: true
|
|
36
|
+
# ComfyUI 服务地址:官方默认端口 8188;ComfyUI 在别的机器时改成 http://<IP>:8188(设置页可改,保存热重启内置服务)
|
|
37
|
+
comfyuiUrl: http://127.0.0.1:8188
|
|
38
|
+
# 内嵌后端缺省 mock(零依赖开箱跑通全链路)。接真实 ComfyUI:设置页「后端入口」
|
|
39
|
+
# 指向 ComfyUI 的 MCP 桥接程序(如 fux-comfyui-mcp.mjs),后端类型随入口自动切 stdio。
|
|
40
|
+
# embeddedBackend: mock
|
|
41
|
+
# embeddedBackendCommand: node
|
|
42
|
+
# embeddedBackendArgs: ''
|
|
43
|
+
- id: preset-standard
|
|
44
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
45
|
+
config:
|
|
46
|
+
id: standard
|
|
47
|
+
order: 1
|
|
48
|
+
plugins:
|
|
49
|
+
- id: persona
|
|
50
|
+
name: '@deepseek-ai/dsh-persona'
|
|
51
|
+
config:
|
|
52
|
+
suffix: Your working directory is {{cwd}}.
|
|
53
|
+
prefix: You are a coding agent powered by the {{model}} model.
|
|
54
|
+
- id: agent-instructions
|
|
55
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
56
|
+
config:
|
|
57
|
+
maxBytes: 65536
|
|
58
|
+
- id: tool-bash
|
|
59
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
60
|
+
disabled: !!js process.platform === 'win32'
|
|
61
|
+
- id: tool-pwsh
|
|
62
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
63
|
+
disabled: !!js process.platform !== 'win32'
|
|
64
|
+
- id: tool-fs
|
|
65
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
66
|
+
- id: tool-fs-search
|
|
67
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
68
|
+
config:
|
|
69
|
+
sampleOverCapGlobResults: false
|
|
70
|
+
- id: tool-jobs
|
|
71
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
72
|
+
- id: skill-filesystem
|
|
73
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
74
|
+
- id: tool-skill
|
|
75
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
76
|
+
- id: command-goal
|
|
77
|
+
name: '@deepseek-ai/dsh-command-goal'
|
|
78
|
+
- id: tool-goal
|
|
79
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
80
|
+
- id: planning
|
|
81
|
+
name: cordis:group
|
|
82
|
+
group: true
|
|
83
|
+
isolate:
|
|
84
|
+
planMode: true
|
|
85
|
+
config:
|
|
86
|
+
- id: plan-mode
|
|
87
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
88
|
+
config:
|
|
89
|
+
section: |
|
|
90
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
91
|
+
|
|
92
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
93
|
+
|
|
94
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
95
|
+
|
|
96
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find it.
|
|
97
|
+
- id: compaction
|
|
98
|
+
name: cordis:group
|
|
99
|
+
group: true
|
|
100
|
+
isolate:
|
|
101
|
+
compaction: true
|
|
102
|
+
toolResultPruner: true
|
|
103
|
+
config:
|
|
104
|
+
- id: compaction-basic
|
|
105
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
106
|
+
- id: command-compact
|
|
107
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
108
|
+
- id: tool-result-pruner
|
|
109
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
110
|
+
config:
|
|
111
|
+
thresholdChars: 8192
|
|
112
|
+
headChars: 4096
|
|
113
|
+
tailChars: 1024
|
|
114
|
+
- id: delegation
|
|
115
|
+
name: cordis:group
|
|
116
|
+
group: true
|
|
117
|
+
isolate:
|
|
118
|
+
workflowEngine: true
|
|
119
|
+
config:
|
|
120
|
+
- id: tool-subagent-control
|
|
121
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
122
|
+
- id: tool-subagent-list-agents
|
|
123
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
124
|
+
- id: tool-subagent
|
|
125
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
126
|
+
config:
|
|
127
|
+
provider: spawn
|
|
128
|
+
toolName: subagent
|
|
129
|
+
modelSelectionSettings: true
|
|
130
|
+
backgroundMode: continuable
|
|
131
|
+
- id: tool-subagent-fork
|
|
132
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
133
|
+
config:
|
|
134
|
+
provider: fork
|
|
135
|
+
toolName: subagent_fork
|
|
136
|
+
backgroundMode: continuable
|
|
137
|
+
- id: tool-subagent-codex
|
|
138
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
139
|
+
disabled: true
|
|
140
|
+
config:
|
|
141
|
+
provider: codex
|
|
142
|
+
toolName: subagent_codex
|
|
143
|
+
backgroundMode: one-shot
|
|
144
|
+
maxDepth: provider-managed
|
|
145
|
+
- id: tool-subagent-claude-code
|
|
146
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
147
|
+
disabled: true
|
|
148
|
+
config:
|
|
149
|
+
provider: claude-code
|
|
150
|
+
toolName: subagent_claude_code
|
|
151
|
+
backgroundMode: one-shot
|
|
152
|
+
maxDepth: provider-managed
|
|
153
|
+
- id: workflow-ptc
|
|
154
|
+
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
155
|
+
config:
|
|
156
|
+
provider: spawn
|
|
157
|
+
- id: tool-workflow
|
|
158
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
159
|
+
- id: tool-ralph
|
|
160
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
161
|
+
disabled: true
|
|
162
|
+
config:
|
|
163
|
+
subagentProvider: spawn
|
|
164
|
+
maxRounds: 64
|
|
165
|
+
- id: tool-ask-user
|
|
166
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
167
|
+
config:
|
|
168
|
+
mode: !!js (function(){try{var o=JSON.parse(require('fs').readFileSync(require('path').join(process.env.DSH_HOME||require('path').join(process.cwd(),'data','.dsh'),'comfymcp','config-overlay.json'),'utf8'));return o.timedAsk===false?'legacy':'timed'}catch(e){return 'timed'}})()
|
|
169
|
+
timeout: 30
|
|
170
|
+
- id: tool-todo
|
|
171
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
172
|
+
config:
|
|
173
|
+
allowParallelInProgress: true
|
|
174
|
+
- id: tool-web
|
|
175
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
176
|
+
config:
|
|
177
|
+
fetch: true
|
|
178
|
+
searchTimeoutMs: 60000
|
|
179
|
+
- id: present
|
|
180
|
+
name: '@deepseek-ai/dsh-tool-present'
|
|
181
|
+
- id: tool-plugin-manager
|
|
182
|
+
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
183
|
+
disabled: true
|
package/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { createWorkbenchMethods } from './lib/workbench.js'
|
|
|
25
25
|
import * as persist from './lib/persist.js'
|
|
26
26
|
|
|
27
27
|
export const name = '@ai-fux/fux-dsh-comfymcp'
|
|
28
|
-
export const version = '0.5.
|
|
28
|
+
export const version = '0.5.2'
|
|
29
29
|
export const description =
|
|
30
30
|
'comfy-mcp 对接:自然语言设计可运行 ComfyUI 工作流、定制表单确认、强制保存运行与成果物回显。'
|
|
31
31
|
|
|
@@ -41,10 +41,17 @@ export function apply(ctx, config) {
|
|
|
41
41
|
console.log(
|
|
42
42
|
`[dsh-comfymcp-client] 主目录 ${effective.homeDir}(workflows=${effective.workflowDirs[0]} | artifacts=${effective.artifactsDir} | data=${effective.dataDir})`,
|
|
43
43
|
)
|
|
44
|
+
// 开发模式活值:applyOverlay 保存 devMode 后 bridge.config 原地更新,
|
|
45
|
+
// devLog/comfymcp_dev 按调用时取值即时生效(无需重启 DSH);覆盖层保证重启后仍开启。
|
|
46
|
+
const isDevMode = () => bridge.config.devMode === true
|
|
47
|
+
// 开发日志先于桥接创建:运行失败/探测失败无条件落 dev-log.jsonl(非开发模式也固定留档),
|
|
48
|
+
// 供 comfymcp_dev(action=report) 事后读取反馈;devMode 只影响报告指引,不门控记录。
|
|
49
|
+
const devLog = createDevLog({ dataDir: effective.dataDir, devMode: isDevMode })
|
|
44
50
|
const bridge = new ComfymcpBridge(effective, {
|
|
45
51
|
// 插件自身目录:内置 comfy-mcp-server(vendor/)的定位基准
|
|
46
52
|
pluginDir: dirname(fileURLToPath(import.meta.url)),
|
|
47
53
|
log: (line) => console.log(`[dsh-comfymcp-client] ${line}`),
|
|
54
|
+
devLog,
|
|
48
55
|
})
|
|
49
56
|
|
|
50
57
|
ctx.effect(() => {
|
|
@@ -75,11 +82,6 @@ export function apply(ctx, config) {
|
|
|
75
82
|
}
|
|
76
83
|
// 业务配置(首次生成的工作流选择优化):工具层与工作台共用同一个存储实例
|
|
77
84
|
const business = createBusinessStore({ dataDir: effective.dataDir })
|
|
78
|
-
// 开发模式活值:applyOverlay 保存 devMode 后 bridge.config 原地更新,
|
|
79
|
-
// devLog/comfymcp_dev 按调用时取值即时生效(无需重启 DSH);覆盖层保证重启后仍开启。
|
|
80
|
-
const isDevMode = () => bridge.config.devMode === true
|
|
81
|
-
// 开发日志:异常/告警进环形缓冲 + dev-log.jsonl,供 comfymcp_dev 出报告(开发模式专用)
|
|
82
|
-
const devLog = createDevLog({ dataDir: effective.dataDir, devMode: isDevMode })
|
|
83
85
|
const tools = createTools({ define: defineTool, bridge, askUser, business, devLog, devMode: isDevMode })
|
|
84
86
|
for (const tool of tools) {
|
|
85
87
|
disposers.push(ctx.tools.register(tool))
|
package/lib/bridge.js
CHANGED
|
@@ -64,6 +64,9 @@ export class ComfymcpBridge {
|
|
|
64
64
|
})
|
|
65
65
|
this.client = null
|
|
66
66
|
this.hostFallback = null
|
|
67
|
+
// 开发日志(可选注入):运行失败/中止无条件落 dev-log.jsonl——非开发模式也要固定留档,
|
|
68
|
+
// 供事后 comfymcp_dev(action=report) 读报告反馈问题(记录不受 devMode 门控)。
|
|
69
|
+
this.devLog = options.devLog ?? null
|
|
67
70
|
this.embedded = null
|
|
68
71
|
this.pluginDir = typeof options.pluginDir === 'string' ? options.pluginDir : ''
|
|
69
72
|
this.runs = new Map()
|
|
@@ -406,9 +409,28 @@ export class ComfymcpBridge {
|
|
|
406
409
|
if (drop !== undefined) this.runs.delete(drop)
|
|
407
410
|
}
|
|
408
411
|
this.persistRuns()
|
|
412
|
+
this.logRunOutcome(record, null)
|
|
409
413
|
return record
|
|
410
414
|
}
|
|
411
415
|
|
|
416
|
+
/** 运行结论留档:failed/aborted 无条件进开发日志(非开发模式也记录,source=run)。 */
|
|
417
|
+
logRunOutcome(record, previousState) {
|
|
418
|
+
const state = record?.state
|
|
419
|
+
if (state !== 'failed' && state !== 'aborted') return
|
|
420
|
+
if (previousState === 'failed' || previousState === 'aborted') return
|
|
421
|
+
try {
|
|
422
|
+
this.devLog?.add({
|
|
423
|
+
level: 'error',
|
|
424
|
+
source: 'run',
|
|
425
|
+
tool: 'comfymcp_run_workflow',
|
|
426
|
+
message: `运行「${record?.name ?? record?.id ?? '?'}」${state === 'failed' ? '失败' : '中止'}${record?.error ? ':' + record.error : ''}`,
|
|
427
|
+
...(record?.id === undefined ? {} : { where: record.id }),
|
|
428
|
+
})
|
|
429
|
+
} catch {
|
|
430
|
+
/* 日志失败不影响主流程 */
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
412
434
|
/** 更新一条运行记录(运行中 → 完成/失败),保持顺序并落盘。 */
|
|
413
435
|
updateRun(id, patch = {}) {
|
|
414
436
|
const current = this.runs.get(id)
|
|
@@ -416,6 +438,7 @@ export class ComfymcpBridge {
|
|
|
416
438
|
const next = { ...current, ...patch, id }
|
|
417
439
|
this.runs.set(id, next)
|
|
418
440
|
this.persistRuns()
|
|
441
|
+
this.logRunOutcome(next, current.state)
|
|
419
442
|
return next
|
|
420
443
|
}
|
|
421
444
|
|
package/lib/catalog.js
CHANGED
|
@@ -134,6 +134,8 @@ export function createTools({ define, bridge, askUser, business = null, devLog =
|
|
|
134
134
|
// 最近一次业务配置命中(comfymcp_business match):push_form 的标题自动以业务类显示名开头,
|
|
135
135
|
// 用户在表单上直接看到「这次按哪个业务类跑」,不用读工具输出才知道。
|
|
136
136
|
let lastBusinessMatch = null
|
|
137
|
+
// 最近一次 status 探测失败文本(去重:同一错误只记一条,恢复记一条 info)
|
|
138
|
+
let lastProbeError = ''
|
|
137
139
|
|
|
138
140
|
tools.push(
|
|
139
141
|
defineTool({
|
|
@@ -148,6 +150,15 @@ export function createTools({ define, bridge, askUser, business = null, devLog =
|
|
|
148
150
|
},
|
|
149
151
|
async execute() {
|
|
150
152
|
const probe = await bridge.probe()
|
|
153
|
+
// 探测失败无条件留档(非开发模式也记录):同一错误只记一次,恢复时记一条 info。
|
|
154
|
+
const message = probe.ok === true ? '' : (typeof probe.error === 'string' && probe.error.length > 0 ? probe.error : 'comfy-mcp 探测失败')
|
|
155
|
+
if (message !== '' && message !== lastProbeError) {
|
|
156
|
+
lastProbeError = message
|
|
157
|
+
log.add({ level: 'error', source: 'probe', tool: 'comfymcp_status', message })
|
|
158
|
+
} else if (message === '' && lastProbeError !== '') {
|
|
159
|
+
lastProbeError = ''
|
|
160
|
+
log.add({ level: 'info', source: 'probe', tool: 'comfymcp_status', message: 'comfy-mcp 连接恢复' })
|
|
161
|
+
}
|
|
151
162
|
return probe
|
|
152
163
|
},
|
|
153
164
|
}),
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-fux/fux-dsh-comfymcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DSH 插件:对接 comfy-mcp 服务(自然语言设计可运行工作流、定制表单、运行与成果物回显)。",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "easymor2024-ychen",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/ai-fux/fux-dsh-comfymcp#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/ai-fux/fux-dsh-comfymcp.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/ai-fux/fux-dsh-comfymcp/issues"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"dsh",
|