comfyui-mcp 0.52.60 → 0.52.61

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.
@@ -3989,6 +3989,46 @@ function rewriteToolResultJson(res, payload) {
3989
3989
  content: res.content.map((c, i) => i === idx && c.type === "text" ? { ...c, text: JSON.stringify(payload, null, 2) } : c),
3990
3990
  };
3991
3991
  }
3992
+ /**
3993
+ * #2075 — a verified widget write that fell back to last-observed schema still
3994
+ * succeeded. The panel's `schema_note` (#1223) tells the agent the live probes
3995
+ * went silent and to re-read "once ComfyUI is responding again", which makes a
3996
+ * routine canvas edit look degraded while ComfyUI and the panel bridge are
3997
+ * healthy.
3998
+ *
3999
+ * Sibling panel#1582 skips re-waiting on later writes once silence is known.
4000
+ * This report is the write immediately after adding a node: that add records a
4001
+ * live map and unlatches the skip, so the next set_widget re-probes, times out
4002
+ * inside the 2000 ms snapshot budget, and re-emits the note. Matched on the
4003
+ * panel's own snapshotAuthorizationNote wording. Used ONLY to drop the note
4004
+ * from a write the panel already verified against an unchanged backend —
4005
+ * never to authorize anything, never on a refusal, never when `set` is missing.
4006
+ */
4007
+ function stripVerifiedLastObservedSchemaNote(res) {
4008
+ if (res.isError)
4009
+ return res;
4010
+ const payload = parseToolResultJson(res);
4011
+ if (!payload)
4012
+ return res;
4013
+ if (payload.schema_source !== "last-observed")
4014
+ return res;
4015
+ if (typeof payload.schema_note !== "string")
4016
+ return res;
4017
+ const note = payload.schema_note;
4018
+ if (!/write SUCCEEDED and was verified/i.test(note))
4019
+ return res;
4020
+ if (!/last whole \/?object_info observed/i.test(note))
4021
+ return res;
4022
+ if (!/backend has not reconnected/i.test(note))
4023
+ return res;
4024
+ const set = payload.set;
4025
+ if (!set || typeof set !== "object" || Array.isArray(set))
4026
+ return res;
4027
+ const next = { ...payload };
4028
+ delete next.schema_note;
4029
+ delete next.schema_source;
4030
+ return rewriteToolResultJson(res, next);
4031
+ }
3992
4032
  async function exitSubgraphLevels(ctx, count) {
3993
4033
  const failures = [];
3994
4034
  for (let i = 0; i < count; i++) {
@@ -12164,7 +12204,7 @@ export function buildPanelToolDefs() {
12164
12204
  // to the raw success reply so a later appendToolResultText disclosure
12165
12205
  // (which makes the text no longer parse as JSON) cannot dodge it.
12166
12206
  const echoFull = args.echo === "full";
12167
- const write = async (nodeId, widget) => summarizeSetWidgetEcho(await ctx.call({ cmd: "graph_set_widget", node_id: nodeId, widget, value }, OBJECT_INFO_REFRESH_ACK_TIMEOUT_MS), echoFull);
12207
+ const write = async (nodeId, widget) => stripVerifiedLastObservedSchemaNote(summarizeSetWidgetEcho(await ctx.call({ cmd: "graph_set_widget", node_id: nodeId, widget, value }, OBJECT_INFO_REFRESH_ACK_TIMEOUT_MS), echoFull));
12168
12208
  let first = await write(args.node_id, args.widget);
12169
12209
  if (!first.isError) {
12170
12210
  markPanelSchemaReady(panelSchemaKey(ctx));