import { jsx as _jsx } from "react/jsx-runtime";
import { AgentGraphView } from './agent-graph-view.js';
const meta = {
    title: 'AgentEditor/AgentGraphView',
    component: AgentGraphView,
    parameters: { layout: 'padded' },
    decorators: [
        (Story) => (_jsx("div", { className: "max-w-3xl", children: _jsx(Story, {}) })),
    ],
};
export default meta;
const FEATURE_AGENT_GRAPH = {
    agentType: 'feature-agent',
    nodes: [
        { id: 'analyze', label: 'Analyze' },
        { id: 'plan', label: 'Plan' },
        { id: 'implement', label: 'Implement' },
        { id: 'merge', label: 'Merge' },
    ],
    edges: [
        { from: 'analyze', to: 'plan' },
        { from: 'plan', to: 'implement' },
        { from: 'implement', to: 'merge' },
    ],
};
const noopSave = async () => ({ ok: true });
const noopReset = async () => ({ ok: true });
export const FeatureAgent = {
    args: {
        graph: FEATURE_AGENT_GRAPH,
        bundled: FEATURE_AGENT_GRAPH,
        hasOverride: false,
        onSaveOverride: noopSave,
        onResetOverride: noopReset,
    },
};
export const Overridden = {
    args: {
        graph: {
            ...FEATURE_AGENT_GRAPH,
            nodes: [
                ...FEATURE_AGENT_GRAPH.nodes,
                { id: 'review', label: 'Review (custom)', description: 'extra advisory step' },
            ],
            edges: [
                ...FEATURE_AGENT_GRAPH.edges.filter((e) => e.to !== 'merge'),
                { from: 'implement', to: 'review' },
                { from: 'review', to: 'merge' },
            ],
        },
        bundled: FEATURE_AGENT_GRAPH,
        hasOverride: true,
        onSaveOverride: noopSave,
        onResetOverride: noopReset,
    },
};
export const Editing = {
    args: {
        graph: FEATURE_AGENT_GRAPH,
        bundled: FEATURE_AGENT_GRAPH,
        hasOverride: false,
        initialEditing: true,
        onSaveOverride: noopSave,
        onResetOverride: noopReset,
    },
};
export const SaveError = {
    args: {
        graph: FEATURE_AGENT_GRAPH,
        bundled: FEATURE_AGENT_GRAPH,
        hasOverride: false,
        initialEditing: true,
        onSaveOverride: async () => ({ ok: false, error: 'Network error: could not reach server' }),
        onResetOverride: noopReset,
    },
};
export const Empty = { args: { graph: null } };
