- An answer past Antigravity's size is filed away unread (eight LoRA searches in the exam): search_models answers small (loaders once, four trigger words, a LoRA's author weight); describe_canvas gives a big canvas's last nodes a line each; mcp_fit.py keeps any other list answer within the size and names what it left out. - An empty canvas: run_workflow, describe_canvas and get_situation say to open a workflow first; get_image_info says a picture's workflow opens with open_workflow. - ask_user does not put a "test" question to the user; a task's picture count counts what its runs made. - AMB failed to load now and then: ComfyUI loads every file at once and ui_ai_workbench.js set ui_ai_toolbox.js's sideHost before it was made when the toolbox file ran first. Connected on first draw now; tests/load_order.mjs runs every file first. - input_facts moved to api/picture_mask.py to keep mcp_tools.py short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.7 KiB
JavaScript
35 lines
1.7 KiB
JavaScript
// A page that answers anything (tests/load_order.mjs): every property, call and construction of the
|
|
// browser's and ComfyUI's objects gives the same stand-in, so a module's top level runs in Node.
|
|
import { register } from 'node:module';
|
|
|
|
const stand = new Proxy(function stand() {}, {
|
|
get(target, key) {
|
|
if (key === Symbol.toPrimitive) return () => '';
|
|
if (key === Symbol.iterator) return function* none() {};
|
|
if (key === 'then') return undefined; // not a promise: awaiting it goes on
|
|
if (key === 'prototype') return target.prototype;
|
|
if (key === 'length') return 0;
|
|
return stand;
|
|
},
|
|
set: () => true,
|
|
has: () => true,
|
|
apply: () => stand,
|
|
construct: () => stand,
|
|
});
|
|
globalThis.__loadOrderStand = stand;
|
|
const BROWSER = ['window', 'document', 'localStorage', 'sessionStorage', 'navigator', 'location', 'history', 'screen',
|
|
'HTMLElement', 'HTMLCanvasElement', 'Element', 'Node', 'CustomEvent', 'Event', 'EventTarget', 'MutationObserver',
|
|
'ResizeObserver', 'IntersectionObserver', 'Image', 'Audio', 'AudioContext', 'requestAnimationFrame', 'cancelAnimationFrame',
|
|
'getComputedStyle', 'matchMedia', 'customElements', 'DOMParser', 'FileReader', 'Worker', 'indexedDB', 'devicePixelRatio',
|
|
'LiteGraph', 'LGraphCanvas', 'LGraphNode', 'comfyAPI', 'CanvasRenderingContext2D', 'alert', 'confirm', 'prompt'];
|
|
for (const name of BROWSER) {
|
|
if (!(name in globalThis) || name === 'navigator' || name === 'location') {
|
|
try {
|
|
Object.defineProperty(globalThis, name, { value: stand, configurable: true, writable: true });
|
|
} catch {
|
|
// a name Node keeps read-only stays its own
|
|
}
|
|
}
|
|
}
|
|
register('./hooks.mjs', import.meta.url);
|