import { api } from './http';
import type { Agent } from './agents';

export interface MarketplaceAgent extends Agent {
  ownerName?: string;
  fork_count: number;
  skillCount: number;
  kbCount: number;
}

export const MarketplaceAPI = {
  list: () => api.get<MarketplaceAgent[]>('/agents/_/marketplace').then((r) => r.data),
  detail: (id: string) => api.get(`/agents/_/marketplace/${id}`).then((r) => r.data),
  fork: (id: string) => api.post(`/agents/_/marketplace/${id}/fork`).then((r) => r.data)
};

