comfyui-mcp 0.51.41 → 0.51.43
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 +24 -4
- package/dist/comfyui/fetch.js.map +1 -1
- package/dist/orchestrator/index.js +10 -0
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/services/live-interpreter.js +30 -5
- package/dist/services/live-interpreter.js.map +1 -1
- package/dist/services/panel-origin-channel.js +350 -0
- package/dist/services/panel-origin-channel.js.map +1 -0
- package/dist/services/workspace-env.js +45 -8
- package/dist/services/workspace-env.js.map +1 -1
- package/package.json +1 -1
package/dist/comfyui/fetch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getComfyUIAuthHeaders } from "../config.js";
|
|
2
2
|
import { describeFetchFailure, isBareFetchFailure } from "../utils/errors.js";
|
|
3
3
|
import { sameOrigin } from "../utils/origin.js";
|
|
4
|
+
import { readPublishedPanelOrigins } from "../services/panel-origin-channel.js";
|
|
4
5
|
/** The request target, for the diagnostic. Never throws on an odd input. */
|
|
5
6
|
export function targetOf(input) {
|
|
6
7
|
try {
|
|
@@ -33,6 +34,24 @@ function methodOf(input, init) {
|
|
|
33
34
|
* answer to "which ComfyUI is this tab actually on".
|
|
34
35
|
*/
|
|
35
36
|
let connectedPanelOrigins = null;
|
|
37
|
+
/**
|
|
38
|
+
* #1415 — WHERE THESE CALLS ACTUALLY RUN.
|
|
39
|
+
*
|
|
40
|
+
* Injection covers the orchestrator process, and almost nothing that fails this
|
|
41
|
+
* way lives there: every headless comfyui tool runs in the SPAWNED stdio child,
|
|
42
|
+
* which never loads orchestrator/index.js and has no bridge to inject from. So
|
|
43
|
+
* the comparison #952 built was silently skipped in exactly the sessions it was
|
|
44
|
+
* written for — the reporter's panel worked, `list_packs (action:"list_templates")`
|
|
45
|
+
* failed against a dead COMFYUI_URL, and the error made no comparison at all.
|
|
46
|
+
*
|
|
47
|
+
* The child reads the set the orchestrator publishes into the progress dir it
|
|
48
|
+
* already shares with it (services/panel-origin-channel.ts). Still a leaf
|
|
49
|
+
* dependency — a file read, not the bridge. An INJECTED source always wins: where
|
|
50
|
+
* the bridge is in the same process it is both fresher and authoritative.
|
|
51
|
+
*/
|
|
52
|
+
function panelOrigins() {
|
|
53
|
+
return connectedPanelOrigins ? connectedPanelOrigins() : readPublishedPanelOrigins();
|
|
54
|
+
}
|
|
36
55
|
/** Install the panel-origin source. Pass null to clear (tests, shutdown). */
|
|
37
56
|
export function setConnectedPanelOrigins(fn) {
|
|
38
57
|
connectedPanelOrigins = fn;
|
|
@@ -60,14 +79,15 @@ function originOf(target) {
|
|
|
60
79
|
* the reader chasing the explanation the old text volunteered.
|
|
61
80
|
* The panel reaches it from the browser; this process does not
|
|
62
81
|
* (a firewall, a container boundary, a bound interface).
|
|
63
|
-
* - UNKNOWN → no panel connected, no origin source installed
|
|
64
|
-
*
|
|
65
|
-
* an absent comparison is not
|
|
82
|
+
* - UNKNOWN → no panel connected, no origin source installed AND nothing
|
|
83
|
+
* published on the channel, or the handshake carried no usable
|
|
84
|
+
* Origin. Say nothing about drift; an absent comparison is not
|
|
85
|
+
* a negative result.
|
|
66
86
|
*/
|
|
67
87
|
export function describeTargetDrift(target) {
|
|
68
88
|
const origins = (() => {
|
|
69
89
|
try {
|
|
70
|
-
return
|
|
90
|
+
return panelOrigins();
|
|
71
91
|
}
|
|
72
92
|
catch {
|
|
73
93
|
return []; // a broken source must never replace the real network error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/comfyui/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot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,CAAC;QAC1C,CAAC;QACD,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,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
|
@@ -34,6 +34,7 @@ import { TurnOriginTracker, makeScopeRepinHandler, makeScopeTargetResolver, } fr
|
|
|
34
34
|
import { listSessions, loadTranscript } from "./history.js";
|
|
35
35
|
import { uploadImageHttp, resetClient } from "../comfyui/client.js";
|
|
36
36
|
import { setConnectedPanelOrigins } from "../comfyui/fetch.js";
|
|
37
|
+
import { publishConnectedPanelOrigins } from "../services/panel-origin-channel.js";
|
|
37
38
|
import { logger } from "../utils/logger.js";
|
|
38
39
|
import { assembleVocabularyHash, describeVocabularySkew } from "../tools/vocabulary.js";
|
|
39
40
|
import { buildPanelToolDefs } from "./panel-tools.js";
|
|
@@ -5121,6 +5122,15 @@ export async function runPanelOrchestrator() {
|
|
|
5121
5122
|
// no saved state
|
|
5122
5123
|
}
|
|
5123
5124
|
const pollDownloads = () => {
|
|
5125
|
+
// #1415 — the OTHER half of the #952 drift comparison installed above. That
|
|
5126
|
+
// source only serves THIS process, and the tools that fail with `fetch
|
|
5127
|
+
// failed` run in the spawned comfyui children, which have no bridge. Publish
|
|
5128
|
+
// the current set into the progress dir they already share so a child's
|
|
5129
|
+
// failure can make the same comparison. Level-triggered on this tick (not on
|
|
5130
|
+
// connect/disconnect events) so a tab that goes away blanks it within 700ms —
|
|
5131
|
+
// the child must never quote a panel that has since disconnected. Writes only
|
|
5132
|
+
// when the set changed.
|
|
5133
|
+
publishConnectedPanelOrigins(progressDir, bridge.connectedServerOrigins());
|
|
5124
5134
|
let files = [];
|
|
5125
5135
|
try {
|
|
5126
5136
|
files = readdirSync(progressDir).filter((f) => f.endsWith(".json"));
|