13 lines
647 B
TypeScript
13 lines
647 B
TypeScript
import { isZcodeWorkspaceAuthorized } from "./authorization";
|
|
/** Agent/Auto Agent/presets always use native ZCode. Claw and direct media modes retain their routes. */
|
|
export function shouldUseCanvasAgentRuntime(body: {
|
|
composerMode?: string;
|
|
workspaceVariant?: string;
|
|
agentPresetId?: string;
|
|
resumeRunId?: string;
|
|
contextPayload?: { source?: string; projectId?: string };
|
|
message?: { parts?: Array<{ type?: string; text?: string }> };
|
|
}) {
|
|
return body.composerMode === "agent" && body.contextPayload?.source === "canvas" && Boolean(body.contextPayload.projectId) && isZcodeWorkspaceAuthorized(body.workspaceVariant || "canvas");
|
|
}
|