package com.correx.core.events.events

import com.correx.core.events.types.SessionId
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * One workflow the router suggests for an operator request it cannot answer or steer directly, with
 * a short [reason]. [workflowId] is one of the registered workflow ids the router was shown.
 */
@Serializable
data class ProposedWorkflow(
    val workflowId: String,
    val reason: String = "",
)

/**
 * The router triaged an operator request to one or more candidate workflows (option (a) of its
 * triage path). Recorded as a fact (invariants #1/#9): the client renders [candidates] as a choice
 * panel and, on selection, launches the chosen workflow seeded with [originalRequest] — or, via the
 * panel's manual-answer slot, continues the conversation. Non-authoritative: nothing runs until the
 * operator picks, so this never starts a workflow on its own.
 */
@Serializable
@SerialName("WorkflowProposed")
data class WorkflowProposedEvent(
    val sessionId: SessionId,
    val proposalId: String,
    val prompt: String,
    val candidates: List<ProposedWorkflow>,
    val originalRequest: String = "",
) : EventPayload
