export function createClaudeSession(input) {
    return {
        sessionId: input.sessionId,
        jobId: input.jobId,
        jobType: input.jobType,
        localPath: input.localPath,
        mergeRequestId: input.mergeRequestId,
        dispatchedAt: input.dispatchedAt,
        status: 'dispatched',
        failureReason: null,
    };
}
export function markCompleted(session) {
    return { ...session, status: 'completed', failureReason: null };
}
export function markFailed(session, reason) {
    return { ...session, status: 'failed', failureReason: reason };
}
export function markTimedOut(session) {
    return { ...session, status: 'timed-out', failureReason: 'timeout' };
}
export function markCleaned(session) {
    return { ...session, status: 'cleaned' };
}
export function isExpired(session, now, timeoutMs) {
    const elapsed = now.getTime() - session.dispatchedAt.getTime();
    return elapsed >= timeoutMs;
}
//# sourceMappingURL=claudeSession.js.map