comfyui-mcp 0.50.1 → 0.50.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/dist/comfyui/fetch.js +61 -8
- package/dist/comfyui/fetch.js.map +1 -1
- package/dist/orchestrator/call-tool-admission.js +18 -3
- package/dist/orchestrator/call-tool-admission.js.map +1 -1
- package/dist/orchestrator/index.js +18 -3
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/panel-tools.js +165 -10
- package/dist/orchestrator/panel-tools.js.map +1 -1
- package/dist/orchestrator/run-completion-journal.js +129 -34
- package/dist/orchestrator/run-completion-journal.js.map +1 -1
- package/dist/services/download-cache.js +6 -20
- package/dist/services/download-cache.js.map +1 -1
- package/dist/services/live-widget-overlay.js +139 -0
- package/dist/services/live-widget-overlay.js.map +1 -0
- package/dist/services/model-resolver.js +63 -7
- package/dist/services/model-resolver.js.map +1 -1
- package/dist/services/panel-recovery.js +32 -3
- package/dist/services/panel-recovery.js.map +1 -1
- package/dist/services/session-scope.js +17 -0
- package/dist/services/session-scope.js.map +1 -1
- package/dist/services/ui-bridge.js +16 -2
- package/dist/services/ui-bridge.js.map +1 -1
- package/dist/services/update-comfyui.js +160 -2
- package/dist/services/update-comfyui.js.map +1 -1
- package/dist/services/workflow-converter.js +10 -1
- package/dist/services/workflow-converter.js.map +1 -1
- package/dist/tools/image-management.js +19 -3
- package/dist/tools/image-management.js.map +1 -1
- package/dist/tools/model-management.js +58 -7
- package/dist/tools/model-management.js.map +1 -1
- package/dist/tools/skills-access.js +8 -3
- package/dist/tools/skills-access.js.map +1 -1
- package/dist/tools/vocabulary.js +88 -0
- package/dist/tools/vocabulary.js.map +1 -1
- package/dist/utils/errors.js +45 -1
- package/dist/utils/errors.js.map +1 -1
- package/package.json +1 -1
- package/scripts/export-vocabulary.mts +33 -5
package/dist/comfyui/fetch.js
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
import { getComfyUIAuthHeaders } from "../config.js";
|
|
2
|
+
import { describeFetchFailure, isBareFetchFailure } from "../utils/errors.js";
|
|
3
|
+
/** The request target, for the diagnostic. Never throws on an odd input. */
|
|
4
|
+
function targetOf(input) {
|
|
5
|
+
try {
|
|
6
|
+
if (typeof input === "string")
|
|
7
|
+
return input;
|
|
8
|
+
if (input instanceof URL)
|
|
9
|
+
return input.href;
|
|
10
|
+
return input.url ?? String(input);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return String(input);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Turn a network-layer throw into a diagnostic that says WHAT was attempted.
|
|
18
|
+
*
|
|
19
|
+
* `TypeError: fetch failed` was reaching tool results verbatim: #954 saw it from
|
|
20
|
+
* the workflow-templates listing (now `list_packs` action:"list_templates") and
|
|
21
|
+
* could not tell which host was tried, and #952 saw it from the readonly tools
|
|
22
|
+
* while the panel bridge was working fine — reading it, reasonably, as "the tool
|
|
23
|
+
* is broken" when the headless target was simply a different (unreachable)
|
|
24
|
+
* address than the one the panel is bound to.
|
|
25
|
+
*
|
|
26
|
+
* The two ARE separate targets by design: the panel talks to whichever ComfyUI
|
|
27
|
+
* the browser is on, while these calls go to the configured COMFYUI_URL. That is
|
|
28
|
+
* not a bug, but it is invisible unless the failure names the address.
|
|
29
|
+
*/
|
|
30
|
+
function describeComfyFetchFailure(err, target) {
|
|
31
|
+
const { message, code } = describeFetchFailure(err);
|
|
32
|
+
const wrapped = new Error(`${message} — while requesting ${target}. ` +
|
|
33
|
+
`That is the headless ComfyUI target (COMFYUI_URL); a CONNECTED sidebar panel does not imply this address is reachable, ` +
|
|
34
|
+
`because the panel talks to whichever ComfyUI its browser tab is on. ` +
|
|
35
|
+
`Check the target with install_comfyui (action:"environment"), and confirm the server is up with get_system_stats (action:"health").`, { cause: err });
|
|
36
|
+
if (code)
|
|
37
|
+
wrapped.code = code;
|
|
38
|
+
return wrapped;
|
|
39
|
+
}
|
|
2
40
|
/**
|
|
3
41
|
* `fetch` wrapper for ComfyUI HTTP requests that injects the configured generic
|
|
4
42
|
* auth header(s) (COMFYUI_AUTH_* — for self-hosted ComfyUI behind a reverse
|
|
@@ -9,15 +47,30 @@ import { getComfyUIAuthHeaders } from "../config.js";
|
|
|
9
47
|
* server. Non-ComfyUI requests (HuggingFace, Civitai, Comfy Cloud) keep using
|
|
10
48
|
* plain `fetch` — Comfy Cloud has its own X-API-Key path in cloud-client.ts.
|
|
11
49
|
*/
|
|
12
|
-
export function comfyuiFetch(input, init = {}) {
|
|
50
|
+
export async function comfyuiFetch(input, init = {}) {
|
|
13
51
|
const auth = getComfyUIAuthHeaders();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
52
|
+
let request;
|
|
53
|
+
if (Object.keys(auth).length === 0) {
|
|
54
|
+
request = fetch(input, init);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const headers = new Headers(init.headers);
|
|
58
|
+
for (const [name, value] of Object.entries(auth)) {
|
|
59
|
+
if (!headers.has(name))
|
|
60
|
+
headers.set(name, value);
|
|
61
|
+
}
|
|
62
|
+
request = fetch(input, { ...init, headers });
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
return await request;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
// ONLY the opaque undici failure is rewritten. An AbortError, a timeout with
|
|
69
|
+
// its own message, or anything else already says what happened, and
|
|
70
|
+
// replacing that text would be a downgrade.
|
|
71
|
+
if (!isBareFetchFailure(err))
|
|
72
|
+
throw err;
|
|
73
|
+
throw describeComfyFetchFailure(err, targetOf(input));
|
|
20
74
|
}
|
|
21
|
-
return fetch(input, { ...init, headers });
|
|
22
75
|
}
|
|
23
76
|
//# sourceMappingURL=fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/comfyui/fetch.ts"],"names":[],"mapp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,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,6EAA6E;QAC7E,oEAAoE;QACpE,4CAA4C;QAC5C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;YAAE,MAAM,GAAG,CAAC;QACxC,MAAM,yBAAyB,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* decision is a pure, unit-testable function — the dispatcher is a one-line
|
|
5
5
|
* call site.
|
|
6
6
|
*/
|
|
7
|
-
import { retiredToolMessage } from "../tools/vocabulary.js";
|
|
7
|
+
import { retiredToolMessage, TOOL_NAMES } from "../tools/vocabulary.js";
|
|
8
8
|
/** The direct tool channel: a mobile client can invoke these READ/DOWNLOAD backend
|
|
9
9
|
* tools without an agent turn (structured nav data + rig downloads). The
|
|
10
10
|
* bridge is already token-gated; this whitelist keeps call_tool to non-destructive
|
|
@@ -434,8 +434,23 @@ export function callToolAdmission(tool, args) {
|
|
|
434
434
|
const retired = retiredToolMessage(tool);
|
|
435
435
|
if (retired !== undefined)
|
|
436
436
|
return retired;
|
|
437
|
-
if (!CALL_TOOL_WHITELIST.has(tool))
|
|
438
|
-
|
|
437
|
+
if (!CALL_TOOL_WHITELIST.has(tool)) {
|
|
438
|
+
// Distinguish "does not exist" from "exists, but not on THIS channel" (#908).
|
|
439
|
+
// The bare "is not permitted" was a dead end: the panel's RunPod Deploy/Start
|
|
440
|
+
// buttons returned it verbatim for ~2 weeks after #278 correctly removed those
|
|
441
|
+
// two tools from this whitelist (both start BILLING, and a confirmation-less
|
|
442
|
+
// mirrored tab must not spend money). The exclusion was right; the message
|
|
443
|
+
// told nobody what had happened or what to do instead, so it read as "the
|
|
444
|
+
// panel is broken" rather than "this channel deliberately does not carry it".
|
|
445
|
+
const exists = TOOL_NAMES.includes(tool);
|
|
446
|
+
return exists
|
|
447
|
+
? `tool "${tool}" exists but is not available on the direct call_tool channel ` +
|
|
448
|
+
`(the canvas-less path used by mobile, mirrored tabs and panel buttons). This is a ` +
|
|
449
|
+
`deliberate exclusion, not a missing tool — some tools are withheld here because they ` +
|
|
450
|
+
`spend money or mutate state that this channel cannot confirm with the user. Ask the ` +
|
|
451
|
+
`agent to run it instead: the agent session carries the full tool surface and can confirm.`
|
|
452
|
+
: `tool "${tool}" is not permitted`;
|
|
453
|
+
}
|
|
439
454
|
const actions = CALL_TOOL_ACTION_WHITELIST.get(tool);
|
|
440
455
|
if (actions !== undefined) {
|
|
441
456
|
const action = typeof args.action === "string" ? args.action : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-tool-admission.js","sourceRoot":"","sources":["../../src/orchestrator/call-tool-admission.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"call-tool-admission.js","sourceRoot":"","sources":["../../src/orchestrator/call-tool-admission.ts"],"names":[],"mappings":"AAAA;;;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ACxC,CAAC;IACD,MAAM,OAAO,GAAG,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACjD,OAAO,SAAS,IAAI,kCAAkC,MAAM,IAAI,WAAW,GAAG,CAAC;QACjF,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -4110,7 +4110,14 @@ export async function runPanelOrchestrator() {
|
|
|
4110
4110
|
// Journal the BLIND-STRIPPED copy: a replay must not resurrect pixels
|
|
4111
4111
|
// the blind gate removed on arrival. `null` = the panel re-sent a
|
|
4112
4112
|
// completion this tab was already given; suppressed, never duplicated.
|
|
4113
|
-
|
|
4113
|
+
// #704 — WHO this completion is being reported to. The tab it arrived on
|
|
4114
|
+
// is an address that churns across a panel reconnect (a new `tmp:` id, no
|
|
4115
|
+
// same-socket migration to follow); the conversation is what actually
|
|
4116
|
+
// queued the run, so it is what decides "this is the run YOU queued"
|
|
4117
|
+
// versus the origin-UNDETERMINED warning.
|
|
4118
|
+
const entry = RunCompletions.record(event.tab_id, evForTab, {
|
|
4119
|
+
conversation: agentKeyFor(event.tab_id),
|
|
4120
|
+
});
|
|
4114
4121
|
logger.info(`[panel-orchestrator] tab ${event.tab_id.slice(0, 8)} run completion for ${describeCorrelation(entry.correlation)}${entry.possibleRepeat ? " (flagged as a possible repeat)" : ""}`);
|
|
4115
4122
|
flushRunCompletions(event.tab_id);
|
|
4116
4123
|
return;
|
|
@@ -4191,8 +4198,12 @@ export async function runPanelOrchestrator() {
|
|
|
4191
4198
|
// their arrival and are still delivered.
|
|
4192
4199
|
// #486 — and the questions it asked: answers stay journaled and are still
|
|
4193
4200
|
// reported, but lose the fingerprint that let them satisfy a re-ask.
|
|
4201
|
+
// #704 — close by CONVERSATION as well as by member tab: a ticket whose tab
|
|
4202
|
+
// was re-registered under a new id on a reconnect is reachable from no member
|
|
4203
|
+
// tab at all, and the replacement conversation reuses the same key string, so
|
|
4204
|
+
// only deleting it ends the old conversation's ownership.
|
|
4194
4205
|
for (const t of conversationMemberTabs(tabId)) {
|
|
4195
|
-
RunCompletions.closeRuns(t);
|
|
4206
|
+
RunCompletions.closeRuns(t, key);
|
|
4196
4207
|
AskAnswers.closeAsks(t);
|
|
4197
4208
|
}
|
|
4198
4209
|
pushToConversation(key, { type: "session", session_id: null });
|
|
@@ -4279,8 +4290,12 @@ export async function runPanelOrchestrator() {
|
|
|
4279
4290
|
// historical session's own render. #884: the boundary is conversation-wide.
|
|
4280
4291
|
// #486 — likewise its questions: answers stay journaled and are still
|
|
4281
4292
|
// reported, but lose the fingerprint that let them satisfy a re-ask.
|
|
4293
|
+
// #704 — close by CONVERSATION as well as by member tab: a ticket whose tab
|
|
4294
|
+
// was re-registered under a new id on a reconnect is reachable from no member
|
|
4295
|
+
// tab at all, and the replacement conversation reuses the same key string, so
|
|
4296
|
+
// only deleting it ends the old conversation's ownership.
|
|
4282
4297
|
for (const t of conversationMemberTabs(tabId)) {
|
|
4283
|
-
RunCompletions.closeRuns(t);
|
|
4298
|
+
RunCompletions.closeRuns(t, key);
|
|
4284
4299
|
AskAnswers.closeAsks(t);
|
|
4285
4300
|
}
|
|
4286
4301
|
if (sid)
|