feat(web): complete Blender route runtime execution
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-07 00:12:32 +08:00
parent e2e81c7c00
commit e9bfef0c5a
35 changed files with 57527 additions and 75 deletions

View File

@@ -180,12 +180,12 @@ function validateOperatorInvocation(value: unknown): WebEngineOperatorInvocation
if (typeof properties !== "object" || properties === null || Array.isArray(properties) || !validOperatorJson(properties)) {
throw report("INVALID_ARGUMENT", "invokeBlenderOperator properties must be typed JSON", true);
}
if (params.baseRevision !== undefined && (!Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
if (params.baseRevision !== undefined && (typeof params.baseRevision !== "number" || !Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
throw report("REVISION_CONFLICT", "invokeBlenderOperator baseRevision must be a non-negative integer", true);
}
return {
operator: params.operator,
properties: properties as Record<string, WebEngineOperatorProperty>,
properties: properties as NonNullable<WebEngineOperatorInvocation["properties"]>,
...(params.baseRevision === undefined ? {} : { baseRevision: params.baseRevision as number }),
};
}
@@ -209,7 +209,7 @@ function validateMacroInvocation(value: unknown): void {
(typeof params.serverJob !== "object" || params.serverJob === null || Array.isArray(params.serverJob) || !validOperatorJson(params.serverJob))) {
throw report("INVALID_ARGUMENT", "invokeBlenderMacro serverJob must be typed JSON", true);
}
if (params.baseRevision !== undefined && (!Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
if (params.baseRevision !== undefined && (typeof params.baseRevision !== "number" || !Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
throw report("REVISION_CONFLICT", "invokeBlenderMacro baseRevision must be a non-negative integer", true);
}
}
@@ -232,7 +232,7 @@ function validateFeatureRouteInvocation(value: unknown): void {
if (params.properties !== undefined && (typeof params.properties !== "object" || params.properties === null || Array.isArray(params.properties) || !validOperatorJson(params.properties))) {
throw report("INVALID_ARGUMENT", "invokeFeatureRoute properties must be typed JSON", true);
}
if (params.baseRevision !== undefined && (!Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
if (params.baseRevision !== undefined && (typeof params.baseRevision !== "number" || !Number.isSafeInteger(params.baseRevision) || params.baseRevision < 0)) {
throw report("REVISION_CONFLICT", "invokeFeatureRoute baseRevision must be a non-negative integer", true);
}
if (route.route === "SERVER_NATIVE") {
@@ -1230,7 +1230,7 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
}
case "setCompositorNodeGraph": {
if (!currentSnapshot?.scenes.some((candidate) => candidate.id === payload.sceneId) || !payload.graph || typeof payload.graph !== "object") throw report("COMPOSITOR_GRAPH_INVALID", "Compositor graph target is invalid");
const graph = payload.graph as Record<string, unknown>;
const graph = payload.graph as unknown as Record<string, unknown>;
if (graph.schemaVersion !== 1 || typeof graph.id !== "string" || graph.id.length === 0 || !Array.isArray(graph.nodes) || !Array.isArray(graph.links) || graph.nodes.length > 4096 || graph.links.length > 16384) throw report("COMPOSITOR_GRAPH_INVALID", "Compositor graph schema or bounds are invalid");
return;
}