Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
SuperfluidActionProvider,
superfluid_action_provider,
)
from .taskmarket.taskmarket_action_provider import (
TaskmarketActionProvider,
taskmarket_action_provider,
)
from .twitter.twitter_action_provider import TwitterActionProvider, twitter_action_provider
from .wallet.wallet_action_provider import WalletActionProvider, wallet_action_provider
from .weth.weth_action_provider import WethActionProvider, weth_action_provider
Expand All @@ -57,6 +61,7 @@
"PythActionProvider",
"SshActionProvider",
"SuperfluidActionProvider",
"TaskmarketActionProvider",
"TwitterActionProvider",
"WalletActionProvider",
"WethActionProvider",
Expand All @@ -78,6 +83,7 @@
"pyth_action_provider",
"ssh_action_provider",
"superfluid_action_provider",
"taskmarket_action_provider",
"twitter_action_provider",
"wallet_action_provider",
"weth_action_provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Taskmarket Action Provider

This directory contains the **TaskmarketActionProvider** implementation, which provides actions for interacting with [Taskmarket](https://taskmarket.dev) bounties and tasks on Base Mainnet.

## Directory Structure

```
taskmarket/
├── taskmarket_action_provider.py # Main provider with Taskmarket functionality
├── schemas.py # Taskmarket action schemas
├── __init__.py # Main exports
└── README.md # This file

# From python/coinbase-agentkit/
tests/action_providers/taskmarket/
├── conftest.py # Test configuration (if needed)
└── test_taskmarket_action_provider.py # Test file for Taskmarket provider
```

## Actions

- `create_taskmarket_task`: Create a new Taskmarket bounty task
- Requires description, reward, and duration
- Optionally accepts deliverables summary, max spend cap, and tags
- Escrows reward in USDC on Base Mainnet

- `get_taskmarket_task`: Retrieve the current status of a Taskmarket task
- Returns status, reward, expiry, submission count, and pending actions

- `list_taskmarket_submissions`: Retrieve submissions for a Taskmarket task
- Returns submission IDs, worker addresses, file URLs, timestamps, and rejection status
- Never silently accepts or rejects work

## Network Support

The Taskmarket provider supports Base Mainnet (chain 8453).

## Setup

1. Install the Taskmarket CLI:
```bash
npm install -g @lucid-agents/taskmarket
taskmarket init
```

2. Fund the agent wallet with USDC on Base Mainnet for task creation.

## Usage

```python
from coinbase_agentkit import AgentKit
from coinbase_agentkit.action_providers import taskmarket_action_provider

agent_kit = AgentKit(
wallet_provider=wallet_provider,
action_providers=[taskmarket_action_provider()],
)

# Create a task
result = agent_kit.get_actions()[0].invoke({
"description": "Build a Taskmarket integration PR",
"reward": "5",
"duration_hours": 48,
"deliverables": "Working PR with tests",
"max_spend": "10",
})
```

## Notes

- Task creation requires the Taskmarket CLI to be installed and initialized.
- The CLI must be run in an environment where the agent wallet is registered.
- Network and spending checks are enforced at the CLI level.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Taskmarket action provider package."""

from .schemas import (
CreateTaskmarketTaskSchema,
GetTaskmarketTaskSchema,
ListTaskmarketSubmissionsSchema,
)
from .taskmarket_action_provider import TaskmarketActionProvider, taskmarket_action_provider

__all__ = [
"CreateTaskmarketTaskSchema",
"GetTaskmarketTaskSchema",
"ListTaskmarketSubmissionsSchema",
"TaskmarketActionProvider",
"taskmarket_action_provider",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"""Schemas for Taskmarket action provider."""

from decimal import Decimal
from typing import Any

from pydantic import BaseModel, Field, field_validator


class CreateTaskmarketTaskSchema(BaseModel):
"""Input schema for creating a Taskmarket task."""

description: str = Field(
...,
description="The full task description including deliverables and acceptance criteria",
)
reward: str = Field(
...,
description="Reward amount in USDC whole units (e.g. '5' for 5 USDC)",
)
duration_hours: int = Field(
...,
description="Task duration in hours from creation",
)
deliverables: str = Field(
default="",
description="Summary of expected deliverables for the requester workflow",
)
max_spend: str = Field(
default="0",
description="Maximum total spend cap in USDC whole units (e.g. '10' for 10 USDC)",
)
tags: str = Field(
default="",
description="Comma-separated tags for the task",
)

@field_validator("reward")
@classmethod
def validate_reward(cls, v: str) -> str:
"""Validate reward is a positive decimal."""
try:
d = Decimal(v)
if d <= 0:
raise ValueError("Reward must be positive")
except Exception as e:
raise ValueError(f"Reward must be a positive number: {e}")
return v

@field_validator("duration_hours")
@classmethod
def validate_duration(cls, v: int) -> int:
"""Validate duration is positive."""
if v <= 0:
raise ValueError("Duration must be positive")
return v


class GetTaskmarketTaskSchema(BaseModel):
"""Input schema for getting a Taskmarket task."""

task_id: str = Field(
...,
description="The Taskmarket task ID to retrieve",
)


class ListTaskmarketSubmissionsSchema(BaseModel):
"""Input schema for listing Taskmarket task submissions."""

task_id: str = Field(
...,
description="The Taskmarket task ID to list submissions for",
)
Loading
Loading