
import { URI } from '../../../../base/common/uri.js';

var ChatSessionStatus;
(function(ChatSessionStatus) {
    ChatSessionStatus[ChatSessionStatus["Failed"] = 0] = "Failed";
    ChatSessionStatus[ChatSessionStatus["Completed"] = 1] = "Completed";
    ChatSessionStatus[ChatSessionStatus["InProgress"] = 2] = "InProgress";
    ChatSessionStatus[ChatSessionStatus["NeedsInput"] = 3] = "NeedsInput";
})(ChatSessionStatus || (ChatSessionStatus = {}));
const localChatSessionType = "local";
const agentOptionId = "agent";
var ChatSessionOptionsMap;
(function(ChatSessionOptionsMap) {
    function fromRecord(obj) {
        return ( new Map(Object.entries(obj)));
    }
    ChatSessionOptionsMap.fromRecord = fromRecord;
    function toRecord(map) {
        const record = Object.create(null);
        for (const [key, value] of map) {
            record[key] = value;
        }
        return record;
    }
    ChatSessionOptionsMap.toRecord = toRecord;
    function toStrValueArray(map) {
        if (!map) {
            return undefined;
        }
        return Array.from(map, ([optionId, value]) => ({
            optionId,
            value: typeof value === "string" ? value : value.id
        }));
    }
    ChatSessionOptionsMap.toStrValueArray = toStrValueArray;
})(ChatSessionOptionsMap || (ChatSessionOptionsMap = {}));
function isSessionInProgressStatus(state) {
    return state === ChatSessionStatus.InProgress || state === ChatSessionStatus.NeedsInput;
}
function isIChatSessionFileChange2(obj) {
    const candidate = obj;
    return candidate && candidate.uri instanceof URI && typeof candidate.insertions === "number" && typeof candidate.deletions === "number";
}

export { ChatSessionOptionsMap, ChatSessionStatus, agentOptionId, isIChatSessionFileChange2, isSessionInProgressStatus, localChatSessionType };
