import { ToolPermissionContext } from '../constraint/permission.js';
import { BudgetTracker } from '../constraint/budget.js';
export class Session {
    sessionId;
    messages;
    context;
    turnCount;
    permissionContext;
    budget;
    constructor(sessionId, messages = [], context = {}, turnCount = 0, permissionContext = ToolPermissionContext.fromIterables(), budget = new BudgetTracker()) {
        this.sessionId = sessionId;
        this.messages = messages;
        this.context = context;
        this.turnCount = turnCount;
        this.permissionContext = permissionContext;
        this.budget = budget;
    }
    addMessage(msg) {
        this.messages.push(msg);
        this.turnCount++;
    }
    get history() {
        return [...this.messages];
    }
    clear() {
        this.messages = [];
        this.turnCount = 0;
    }
    setContext(key, value) {
        this.context[key] = value;
    }
    getContext(key) {
        return this.context[key];
    }
}
