fix(dashboard): inline isBuiltinWorkflowId — unbreak the app build

The dashboard app build aliases "@fusion/core" to its types-only entry
(core/src/types.ts), which doesn't re-export builtin-workflows, so the Vite/
Rollup bundle failed on `import { isBuiltinWorkflowId } from "@fusion/core"`
(tsc/vitest resolve it via source/dist, so they passed — only the production
build caught it). Inline the one-line "builtin:" prefix check in the editor
instead of pulling the eager BUILTIN_WORKFLOWS construction into the browser
bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-06-03 17:59:29 -07:00
parent 8bb02f7d3c
commit d5397d3f69

View File

@@ -16,7 +16,7 @@ import {
} from "@xyflow/react";
import { X, Plus, Trash2, Save, MessageSquare, Terminal, Shield, GitMerge, Loader2, HelpCircle } from "lucide-react";
import type { WorkflowDefinition } from "@fusion/core";
import { getErrorMessage, isBuiltinWorkflowId } from "@fusion/core";
import { getErrorMessage } from "@fusion/core";
import {
fetchWorkflows,
createWorkflow,
@@ -39,6 +39,13 @@ import { CustomModelDropdown } from "./CustomModelDropdown";
type ExecutorKind = "model" | "agent" | "skill" | "cli";
// Mirror of @fusion/core's isBuiltinWorkflowId / BUILTIN_WORKFLOW_ID_PREFIX.
// Inlined because the dashboard app build aliases "@fusion/core" to its
// types-only entry (which doesn't re-export builtin-workflows), and importing
// the function would pull the eager BUILTIN_WORKFLOWS construction into the
// browser bundle for a one-line prefix check.
const isBuiltinWorkflowId = (id: string): boolean => id.startsWith("builtin:");
function getModelDropdownValue(provider: string, modelId: string): string {
return provider && modelId ? `${provider}/${modelId}` : "";
}