comfyui-mcp 0.50.68 → 0.50.69

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.
@@ -1,5 +1,6 @@
1
1
  import { getComfyUIAuthHeaders } from "../config.js";
2
2
  import { describeFetchFailure, isBareFetchFailure } from "../utils/errors.js";
3
+ import { sameOrigin } from "../utils/origin.js";
3
4
  /** The request target, for the diagnostic. Never throws on an odd input. */
4
5
  export function targetOf(input) {
5
6
  try {
@@ -78,8 +79,20 @@ export function describeTargetDrift(target) {
78
79
  if (!want)
79
80
  return "";
80
81
  const distinct = [...new Set(origins)];
81
- if (distinct.includes(want)) {
82
- return (` A connected panel is on this same origin, so this is NOT a wrong-address problem: ` +
82
+ // #1175 — `includes` compares spellings, not servers. A panel on
83
+ // http://127.0.0.1:8188 against a target of http://localhost:8188 is ONE
84
+ // ComfyUI, and reporting it as "a DIFFERENT address" sent a reporter to point
85
+ // COMFYUI_URL at the origin it was already pointed at.
86
+ const match = distinct.find((o) => sameOrigin(o, want));
87
+ if (match !== undefined) {
88
+ // Name BOTH spellings when they differ textually. "This same origin" reads
89
+ // as a contradiction next to two visibly different strings, and the reader
90
+ // has no way to know the comparison was alias-aware — which is what sent the
91
+ // #1175 reporter looking for a target mismatch that did not exist.
92
+ const alias = match === want
93
+ ? ""
94
+ : ` (spelled ${match} there and ${want} here — the same host, so this is not a mismatch)`;
95
+ return (` A connected panel is on this same origin${alias}, so this is NOT a wrong-address problem: ` +
83
96
  `the browser can reach ${want} and this process cannot (a firewall, a container ` +
84
97
  `boundary, or a server bound to one interface).`);
85
98
  }
@@ -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;AAE9E,4EAA4E;AAC5E,MA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AAM,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,MAAM,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,2EAA2E;QAC3E,yEAAyE;QACzE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,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"}
@@ -0,0 +1,84 @@
1
+ // Comparing two ORIGINS for "is this the same server" (#1175).
2
+ //
3
+ // `http://127.0.0.1:8188` and `http://localhost:8188` are the same ComfyUI, and
4
+ // comparing the strings says they are not. A reporter's panel was on the first
5
+ // while the headless target was the second — the headless restart worked and
6
+ // then probed 127.0.0.1:8188, proving they were one instance — and the
7
+ // orchestrator still reported "a DIFFERENT address" and advised pointing
8
+ // COMFYUI_URL at an origin it was already pointed at.
9
+ //
10
+ // The same blindness scopes the workflow-instance fence, which is keyed by
11
+ // origin: a fence adopted under one spelling would refuse under the other. That
12
+ // half is not hypothetical either, because the relay path now DERIVES its origin
13
+ // from COMFYUI_URL (#1077) while the loopback path OBSERVES the browser's — two
14
+ // independent sources that can easily disagree only in spelling.
15
+ //
16
+ // WHY THIS IS ITS OWN MODULE. Three loopback notions already exist
17
+ // (`isLoopbackServerUrl`, `port-owner`'s LOOPBACK/WILDCARD split,
18
+ // `env-capabilities`' LOCAL/REMOTE test) and they legitimately differ — one
19
+ // treats `0.0.0.0` as local, another must keep bind-wildcards separate from
20
+ // connect addresses. None of them answers "are these two origins the same
21
+ // server", so this adds that one question rather than bending any of them.
22
+ /**
23
+ * Loopback spellings treated as ONE host.
24
+ *
25
+ * Deliberately the exact four, not all of 127.0.0.0/8: two servers really can
26
+ * bind 127.0.0.1:8188 and 127.0.0.2:8188 at the same time, and calling those the
27
+ * same origin would be a false identity — the failure this exists to prevent,
28
+ * mirrored. `localhost` can resolve to ::1 rather than 127.0.0.1 on some
29
+ * systems, which is the one genuine assumption here; it is the right one,
30
+ * because when it is wrong the resulting message ("the browser can reach this
31
+ * and this process cannot — a firewall, a container boundary, or a server bound
32
+ * to one interface") is a BETTER description of a v4/v6 split than "point
33
+ * COMFYUI_URL somewhere else" was.
34
+ *
35
+ * `[::1]` carries its brackets because that is what `URL.hostname` returns for
36
+ * an IPv6 literal — a bare `"::1"` here would be dead code, since every input
37
+ * reaches this set through `new URL()`.
38
+ */
39
+ const LOOPBACK_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);
40
+ /** The canonical loopback spelling, so every alias collapses to one key. */
41
+ const LOOPBACK_CANONICAL = "localhost";
42
+ /**
43
+ * `scheme://host[:port]` with loopback aliases collapsed, or undefined when
44
+ * `url` is not a URL. The SCHEME is never collapsed: http and https on one host
45
+ * are different origins by every other rule in this codebase, and a proxy can
46
+ * genuinely serve different things on each.
47
+ */
48
+ export function canonicalOrigin(url) {
49
+ if (typeof url !== "string" || !url.trim())
50
+ return undefined;
51
+ let parsed;
52
+ try {
53
+ parsed = new URL(url.trim());
54
+ }
55
+ catch {
56
+ return undefined;
57
+ }
58
+ const origin = parsed.origin;
59
+ // A scheme with no authority (file:, data:) has the literal origin "null".
60
+ if (!origin || origin === "null")
61
+ return undefined;
62
+ // A single trailing dot is the fully-qualified spelling of the same name
63
+ // (`localhost.` is `localhost` rooted at the DNS root), and browsers will send
64
+ // it verbatim as an Origin. Stripped before the lookup, and only for the
65
+ // lookup — a non-loopback host keeps whatever spelling it arrived with, since
66
+ // rewriting it would change an origin nobody asked us to normalise.
67
+ const host = parsed.hostname.toLowerCase();
68
+ const bare = host.endsWith(".") ? host.slice(0, -1) : host;
69
+ const canonHost = LOOPBACK_HOSTS.has(bare) ? LOOPBACK_CANONICAL : host;
70
+ // Rebuild rather than string-replace: `parsed.port` is "" for a default port,
71
+ // which is exactly the normalisation `origin` already applies, and a host can
72
+ // otherwise appear inside the scheme or a userinfo section.
73
+ return `${parsed.protocol}//${canonHost}${parsed.port ? `:${parsed.port}` : ""}`;
74
+ }
75
+ /** True when two URLs name the same origin, loopback aliases included. */
76
+ export function sameOrigin(a, b) {
77
+ const left = canonicalOrigin(a);
78
+ const right = canonicalOrigin(b);
79
+ // Two unparseable inputs are not "the same origin" — that would make every
80
+ // piece of junk equal to every other, and callers use this to decide whether
81
+ // to report a mismatch.
82
+ return left !== undefined && left === right;
83
+ }
84
+ //# sourceMappingURL=origin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"origin.js","sourceRoot":"","sources":["../../src/utils/origin.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,uEAAuE;AACvE,yEAAyE;AACzE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,mEAAmE;AACnE,kEAAkE;AAClE,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAE3E;;;;;;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AAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACnF,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,UAAU,CAAC,CAAqB,EAAE,CAAqB;IACrE,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IACjC,2EAA2E;IAC3E,6EAA6E;IAC7E,wBAAwB;IACxB,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comfyui-mcp",
3
- "version": "0.50.68",
3
+ "version": "0.50.69",
4
4
  "mcpName": "io.github.artokun/comfyui-mcp",
5
5
  "description": "Local-first, agent-native control plane for ComfyUI — MCP server + autonomous sidebar agent that drives your live graph in natural language on ANY LLM: Claude/ChatGPT/Gemini on your subscription (no API key), free local models via Ollama (fully offline), or any hosted model via an OpenAI-compatible endpoint (DeepSeek, GLM, MiMo, OpenRouter). Generate images, video & audio, author and run workflows, manage models and custom nodes; a compact tool-router mode keeps even 4B models effective, and a built-in LLM Arena benchmarks them on real ComfyUI tasks. Also a Claude Code plugin with skills, slash commands, and installer packs. Local, LAN, VPS, or Comfy Cloud.",
6
6
  "homepage": "https://comfyui-mcp.artokun.io/docs",