Files
workinf_Blender_Wasm/web/protocol/blender-operator.ts
mes123456 e2e81c7c00
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
feat(web): classify and route complete Blender inventory
2026-09-06 21:10:31 +08:00

99 lines
2.6 KiB
TypeScript

export type BlenderOperatorPropertyType = "boolean" | "number" | "enum" | "string";
export type BlenderOperatorPropertyValue = string | number | boolean;
export interface BlenderOperatorEnumItem {
value: string;
label: string;
}
export interface BlenderOperatorPropertySpec {
name: string;
type: BlenderOperatorPropertyType;
required: boolean;
label?: string;
description?: string;
defaultValue?: BlenderOperatorPropertyValue;
min?: number;
max?: number;
enumItems?: BlenderOperatorEnumItem[];
}
export interface BlenderOperatorDescriptor {
id: string;
label: string;
description?: string;
family: string;
context: "scene" | "object" | "main";
backgroundSafe: true;
properties: BlenderOperatorPropertySpec[];
}
export interface BlenderOperatorInvocation {
operator: string;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
}
export type BlenderFeatureRoute = "WEB_MAIN" | "SERVER_NATIVE" | "BROWSER_EQUIVALENT" | "UNAVAILABLE";
export interface BlenderFeatureRouteLocation {
path: string;
line?: number;
evidence?: string;
}
/** Source-unit route metadata used by the F3 feature palette. */
export interface BlenderFeatureRouteEntry {
id: string;
kind: string;
identifier: string;
family: string;
route: BlenderFeatureRoute;
reason: string;
label?: string;
description?: string;
properties?: BlenderOperatorPropertySpec[];
locations?: BlenderFeatureRouteLocation[];
}
export interface BlenderFeatureRouteInvocation {
route: BlenderFeatureRouteEntry;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
}
/** SERVER_NATIVE jobs deliberately carry only typed scalar operator properties. */
export const BLENDER_OPERATOR_BACKGROUND_CONTEXT = "BACKGROUND" as const;
export type BlenderMacroStepKind = "MAIN_COMMAND" | "SERVER_NATIVE" | "CONTEXT_DEPENDENT";
export interface BlenderMacroStep {
id: string;
kind: BlenderMacroStepKind;
context: "MAIN" | "BACKGROUND" | "UI";
operator?: string;
command?: Record<string, unknown>;
source: BlenderFeatureRouteLocation[];
}
/** A bounded, source-backed native plan assembled from Blender operator units. */
export interface BlenderMacroDescriptor {
id: string;
label: string;
description?: string;
family: string;
route: BlenderFeatureRoute;
contextDependent: boolean;
source: BlenderFeatureRouteLocation[];
steps: BlenderMacroStep[];
properties?: BlenderOperatorPropertySpec[];
}
export interface BlenderMacroInvocation {
macro: string;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
serverJob?: Record<string, unknown>;
}