import { parseSessionId, } from '../../modules/claude-invocation/entities/claudeSession/claudeSession.schema.js';
export class StubClaudeSessionGateway {
    dispatchCalls = [];
    stopCalls = [];
    removeCalls = [];
    listAgentsCallCount = 0;
    getSessionUsageCalls = [];
    dispatchResult = {
        status: 'dispatched',
        sessionId: parseSessionId('stub-session'),
    };
    daemonStatusValue = { reachable: true, reason: null };
    usageValue = { usesApiPool: false, raw: 'subscription pool' };
    scheduledAgentStatuses = [];
    sessionUsageResult = null;
    setDispatchResult(result) {
        this.dispatchResult = result;
    }
    setDaemonStatus(status) {
        this.daemonStatusValue = status;
    }
    setUsage(report) {
        this.usageValue = report;
    }
    setSessionUsage(value) {
        this.sessionUsageResult = value;
    }
    scheduleAgentCompletion(sessionIdValue, status, afterPollCount) {
        this.scheduledAgentStatuses.push({
            sessionId: parseSessionId(sessionIdValue),
            status,
            afterPollCount,
        });
    }
    async dispatch(input) {
        this.dispatchCalls.push(input);
        return this.dispatchResult;
    }
    async stop(sessionId) {
        this.stopCalls.push(sessionId);
        return { success: true, warning: null };
    }
    async remove(sessionId) {
        this.removeCalls.push(sessionId);
        return { success: true, warning: null };
    }
    async listAgents() {
        this.listAgentsCallCount += 1;
        return this.scheduledAgentStatuses
            .filter(entry => entry.afterPollCount <= this.listAgentsCallCount)
            .map(entry => ({ sessionId: entry.sessionId, status: entry.status }));
    }
    async daemonStatus() {
        return this.daemonStatusValue;
    }
    async usage() {
        return this.usageValue;
    }
    async getSessionUsage(sessionId, cwd) {
        this.getSessionUsageCalls.push({ sessionId, cwd });
        return this.sessionUsageResult;
    }
}
//# sourceMappingURL=claudeSession.stub.js.map