feat(web): complete product workflow implementation
This commit is contained in:
@@ -4,6 +4,13 @@ export const WEB_ENGINE_CAPABILITY_REGISTRY_SCHEMA = 1 as const;
|
||||
export type WebEngineCommandType = WebEngineEditCommand["type"];
|
||||
export type WebEngineCommandRoute = "MAIN_AUTHORITATIVE" | "MAIN_GUARDED" | "LOCAL_HISTORY" | "PREVIEW";
|
||||
|
||||
export type WebEngineOperatorCommand = "listBlenderOperators" | "invokeBlenderOperator";
|
||||
|
||||
export interface WebEngineOperatorCapability {
|
||||
readonly route: "MAIN_READ" | "MAIN_AUTHORITATIVE";
|
||||
readonly implementation: "SOURCE_BACKED";
|
||||
}
|
||||
|
||||
export interface WebEngineCommandCapability {
|
||||
readonly family: string;
|
||||
readonly route: WebEngineCommandRoute;
|
||||
@@ -117,6 +124,12 @@ export const WEB_ENGINE_COMMAND_CAPABILITIES = {
|
||||
redo: { family: "HISTORY", route: "LOCAL_HISTORY", implementation: "SOURCE_BACKED" },
|
||||
} satisfies Record<WebEngineCommandType, WebEngineCommandCapability>;
|
||||
|
||||
/** Native operators are deliberately a separate registry from edit commands. */
|
||||
export const WEB_ENGINE_OPERATOR_CAPABILITIES = {
|
||||
listBlenderOperators: { route: "MAIN_READ", implementation: "SOURCE_BACKED" },
|
||||
invokeBlenderOperator: { route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
|
||||
} satisfies Record<WebEngineOperatorCommand, WebEngineOperatorCapability>;
|
||||
|
||||
export function getWebEngineCommandCapability(type: unknown): WebEngineCommandCapability | null {
|
||||
if (typeof type !== "string") return null;
|
||||
return Object.prototype.hasOwnProperty.call(WEB_ENGINE_COMMAND_CAPABILITIES, type)
|
||||
|
||||
Reference in New Issue
Block a user