import { resolveApproval as apiResolveApproval, getPendingApprovals as apiGetPendingApprovals, } from '@ottocode/api';
export const approvalMixin = {
    async approveToolCall(sessionId, callId, approved) {
        const response = await apiResolveApproval({
            // biome-ignore lint/suspicious/noExplicitAny: API path type mismatch
            path: { sessionId },
            // biome-ignore lint/suspicious/noExplicitAny: API type mismatch
            body: { callId, approved, sessionId },
        });
        if (response.error)
            throw new Error('Failed to send tool approval');
        // biome-ignore lint/suspicious/noExplicitAny: API response structure
        return response.data;
    },
    async getPendingApprovals(sessionId) {
        const response = await apiGetPendingApprovals({
            path: { sessionId },
        });
        if (response.error)
            return { ok: false, pending: [] };
        // biome-ignore lint/suspicious/noExplicitAny: API response structure
        return response.data;
    },
};
//# sourceMappingURL=approval.js.map