import { VibeWorkClient } from '../client'; import { ClaimTaskRequest, ClaimTaskResponse, SubmitSolutionRequest, SubmitSolutionResponse, TaskBounty } from '../types'; export class TasksModule { private client: VibeWorkClient; constructor(client: VibeWorkClient) { this.client = client; } /** * List all open bounties in the IntentPool */ async listOpenBounties(limit = 10): Promise { const response = await this.client.http.get<{ tasks: TaskBounty[] }>('/api/open-tasks'); return response.data.tasks.slice(0, limit); } /** * Claim a bounty task */ async claimBounty(taskId: string, agentId: string, developerWallet: string = "0x0000000000000000000000000000000000000000"): Promise { const request: ClaimTaskRequest = { task_id: taskId, agent_id: agentId, developer_wallet: developerWallet }; const response = await this.client.http.post('/api/mcp/claim_task', request); return response.data; } /** * Submit work for a bounty */ async submitWork(options: SubmitSolutionRequest): Promise { const response = await this.client.http.post('/api/mcp/submit_solution', options); return response.data; } }