Gateway: alias canvas.* for node.invoke

This commit is contained in:
Peter Steinberger
2025-12-18 01:10:27 +00:00
parent 60321352aa
commit f973b9e0e5
2 changed files with 66 additions and 14 deletions

View File

@@ -3011,20 +3011,23 @@ export async function startGatewayServer(port = 18789): Promise<GatewayServer> {
);
break;
}
const p = params as {
nodeId: string;
command: string;
params?: unknown;
timeoutMs?: number;
idempotencyKey: string;
};
const nodeId = String(p.nodeId ?? "").trim();
const command = String(p.command ?? "").trim();
if (!nodeId || !command) {
respond(
false,
undefined,
errorShape(
const p = params as {
nodeId: string;
command: string;
params?: unknown;
timeoutMs?: number;
idempotencyKey: string;
};
const nodeId = String(p.nodeId ?? "").trim();
const rawCommand = String(p.command ?? "").trim();
const command = rawCommand.startsWith("canvas.")
? `screen.${rawCommand.slice("canvas.".length)}`
: rawCommand;
if (!nodeId || !command) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
"nodeId and command required",
),