/**
 * Describes the semantic context of a task insertion operation.
 *
 * Every `+` interaction on the canvas produces an `InsertionContext` that
 * tells the picker what kind of insertion is intended, what the surrounding
 * graph topology looks like, and which node triggered it. The picker uses
 * this to generate contextual suggestions, filter incompatible kinds, and
 * render an appropriate header.
 */
/**
 * Builds a human-readable header string describing the insertion action.
 *
 * Examples:
 * - "Insert between classify_ticket and route_by_severity"
 * - "Add after run_analyst"
 * - "Add case to classify_user"
 * - "Add parallel branch"
 */
export function buildInsertionHeader(context) {
    switch (context.mode) {
        case "edge-splice": {
            const src = context.sourceDisplayName ?? context.sourceNodeId ?? "…";
            const tgt = context.targetDisplayName ?? context.targetNodeId ?? "…";
            return `Insert between ${src} and ${tgt}`;
        }
        case "append-after": {
            const src = context.sourceDisplayName ?? context.sourceNodeId ?? "…";
            return `Add after ${src}`;
        }
        case "add-at-position":
            return "Add task";
        case "add-switch-case": {
            const src = context.sourceDisplayName ?? context.sourceNodeId ?? "switch";
            return `Add case to ${src}`;
        }
        case "add-fork-branch": {
            const src = context.sourceDisplayName ?? context.sourceNodeId ?? "fork";
            return `Add branch to ${src}`;
        }
        case "add-catch-handler": {
            const src = context.sourceDisplayName ?? context.sourceNodeId ?? "try/catch";
            return `Add catch handler to ${src}`;
        }
    }
}
//# sourceMappingURL=insertion-context.js.map