comfyui-mcp 0.52.190 → 0.52.192

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.
@@ -42,14 +42,22 @@ export const PLAIN_NODE_ID_PATTERN = /^-?\d+$/;
42
42
  */
43
43
  const QUALIFIED = /^-?\d+(?::\d+)+$/;
44
44
  /**
45
- * Both spellings in ONE pattern, so it can be handed to `z.string().regex()`.
45
+ * #2855 a named id the graph readers print for API-style / string-id graphs
46
+ * (`sampler`, `mac_studio_vlm`). Must start with a letter or underscore so it
47
+ * cannot collide with the integer/`42px` cases: `42px` is still refused, never
48
+ * truncated via parseInt.
49
+ */
50
+ const NAMED = /^[A-Za-z_][A-Za-z0-9_-]*$/;
51
+ /**
52
+ * Integer, subgraph-qualified, and named spellings in ONE pattern, so it can be
53
+ * handed to `z.string().regex()`.
46
54
  *
47
55
  * That matters beyond tidiness: `.regex()` puts a `pattern` on the advertised MCP
48
56
  * input schema, while `.refine()` renders as a bare `{"type":"string"}` (measured
49
57
  * with zod 4's toJSONSchema). Validating through a refine would therefore have told
50
58
  * every client LESS about a node id than the old integer-only rule did.
51
59
  */
52
- export const NODE_ID_PATTERN = /^-?\d+(?::\d+)*$/;
60
+ export const NODE_ID_PATTERN = /^(?:-?\d+(?::\d+)*|[A-Za-z_][A-Za-z0-9_-]*)$/;
53
61
  /** Does this string name a node at all — either spelling? */
54
62
  export function isNodeIdString(v) {
55
63
  return NODE_ID_PATTERN.test(v);
@@ -62,20 +70,22 @@ export function isQualifiedNodeId(v) {
62
70
  * Normalize an accepted id to what goes on the wire.
63
71
  *
64
72
  * A plain id becomes the NUMBER the panel has always received, so nothing about
65
- * the existing surface changes. A qualified id is returned VERBATIM parsing it
66
- * is precisely the bug. Callers must therefore treat a node id as `number | string`
67
- * rather than assuming the number.
73
+ * the existing surface changes. A qualified id and a named id are returned
74
+ * VERBATIM — parsing them is precisely the bug. Callers must therefore treat a
75
+ * node id as `number | string` rather than assuming the number.
68
76
  */
69
77
  export function normalizeNodeId(v) {
70
78
  if (typeof v === "number")
71
79
  return v;
72
80
  if (QUALIFIED.test(v))
73
81
  return v;
82
+ if (NAMED.test(v))
83
+ return v;
74
84
  return Number.parseInt(v, 10);
75
85
  }
76
- /** The message a rejected id gets. Names the qualified shape explicitly, because a
77
- * caller holding `263:78` needs to know whether it is unsupported or malformed. */
78
- export const NODE_ID_MESSAGE = "a node id must be an integer (e.g. 42) or a subgraph-qualified id (e.g. 120:104)";
86
+ /** The message a rejected id gets. Names the qualified and named shapes, because a
87
+ * caller holding `263:78` or `sampler` needs to know whether it is unsupported or malformed. */
88
+ export const NODE_ID_MESSAGE = "a node id must be an integer (e.g. 42), a subgraph-qualified id (e.g. 120:104), or a named id the graph readers printed (e.g. sampler)";
79
89
  /**
80
90
  * #1889 — a bare `z.union` renders as the word `Invalid input` and nothing else.
81
91
  *
@@ -1 +1 @@
1
- {"version":3,"file":"node-id.js","sourceRoot":"","sources":["../../src/orchestrator/node-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAElD,6DAA6D;AAC7D,MAAM,UAAU,cAAc,CAAC,CAAS;IACtC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,CAAS;IACzC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,CAAkB;IAChD,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,I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AAW,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3F,CAAC"}
@@ -16606,8 +16606,9 @@ function validatePanelEditNodeArgs(args) {
16606
16606
  * number the wire has always carried, so the round trip closes.
16607
16607
  *
16608
16608
  * STRICT about what counts as a node id: an integer, a string that is exactly an
16609
- * integer, or a subgraph-qualified id (`"120:104"`). `"42px"`, `"4.5"` and `""`
16610
- * are still rejected.
16609
+ * integer, a subgraph-qualified id (`"120:104"`), or a named id the readers print
16610
+ * (`"sampler"`). `"42px"`, `"4.5"` and `""` are still rejected. Named ids stay
16611
+ * strings — `Number.parseInt("sampler")` is NaN and must not reach the panel.
16611
16612
  *
16612
16613
  * #1425 added the qualified shape — the "separate, deliberate change to the wire
16613
16614
  * contract" this comment used to defer. Unpacking a subgraph leaves genuine ROOT