package com.huimv.employment.integration.kb;

/**
 * 会话落库场景：SSE 收集结果。
 */
public class ConsoleChatCollectResult {

    private final String assistantText;
    private final boolean completed;
    /** 未转发的最后一条终端 SSE 原始行，可为 null */
    private final String heldTerminalLine;
    /**
     * 流中 MCP 草稿工具（generate/update）相关片段，供注入 show_employment_draft；
     * 可能含 plugin_call / plugin_call_output，展示文案里通常没有这些内容。
     */
    private final String mcpDraftEvidence;
    /** 从 MCP 草稿工具响应中解析到的最后一个非空 draft_id，可为 null */
    private final Long mcpDraftId;

    public ConsoleChatCollectResult(String assistantText,
                                    boolean completed,
                                    String heldTerminalLine,
                                    String mcpDraftEvidence,
                                    Long mcpDraftId) {
        this.assistantText = assistantText == null ? "" : assistantText;
        this.completed = completed;
        this.heldTerminalLine = heldTerminalLine;
        this.mcpDraftEvidence = mcpDraftEvidence == null ? "" : mcpDraftEvidence;
        this.mcpDraftId = mcpDraftId;
    }

    public String getAssistantText() {
        return assistantText;
    }

    public boolean isCompleted() {
        return completed;
    }

    public String getHeldTerminalLine() {
        return heldTerminalLine;
    }

    public String getMcpDraftEvidence() {
        return mcpDraftEvidence;
    }

    public Long getMcpDraftId() {
        return mcpDraftId;
    }
}
