comfyui-mcp
Version:
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),
89 lines • 2.62 kB
JavaScript
export class ComfyUIError extends Error {
code;
details;
constructor(message, code, details) {
super(message);
this.code = code;
this.details = details;
this.name = "ComfyUIError";
}
toToolResult() {
return {
isError: true,
content: [
{
type: "text",
text: JSON.stringify({
error: this.code,
message: this.message,
details: this.details,
}),
},
],
};
}
}
export class ConnectionError extends ComfyUIError {
constructor(message) {
super(message, "CONNECTION_ERROR");
this.name = "ConnectionError";
}
}
export class WorkflowExecutionError extends ComfyUIError {
constructor(message, details) {
super(message, "WORKFLOW_EXECUTION_ERROR", details);
this.name = "WorkflowExecutionError";
}
}
export class ValidationError extends ComfyUIError {
constructor(message) {
super(message, "VALIDATION_ERROR");
this.name = "ValidationError";
}
}
export class RegistryError extends ComfyUIError {
constructor(message, details) {
super(message, "REGISTRY_ERROR", details);
this.name = "RegistryError";
}
}
export class ModelError extends ComfyUIError {
constructor(message, details) {
super(message, "MODEL_ERROR", details);
this.name = "ModelError";
}
}
export class ProcessControlError extends ComfyUIError {
constructor(message, details) {
super(message, "PROCESS_CONTROL_ERROR", details);
this.name = "ProcessControlError";
}
}
export class RemoteModeError extends ComfyUIError {
constructor(message, details) {
super(message, "REMOTE_MODE_ERROR", details);
this.name = "RemoteModeError";
}
}
export class NodeSnapshotError extends ComfyUIError {
constructor(message, details) {
super(message, "NODE_SNAPSHOT_ERROR", details);
this.name = "NodeSnapshotError";
}
}
export class NodeBisectError extends ComfyUIError {
constructor(message, details) {
super(message, "NODE_BISECT_ERROR", details);
this.name = "NodeBisectError";
}
}
export function errorToToolResult(err) {
if (err instanceof ComfyUIError)
return err.toToolResult();
const message = err instanceof Error ? err.message : String(err);
return {
isError: true,
content: [{ type: "text", text: message }],
};
}
//# sourceMappingURL=errors.js.map