agentpact 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentpact-0.1.0/LICENSE +21 -0
- agentpact-0.1.0/PKG-INFO +114 -0
- agentpact-0.1.0/README.md +95 -0
- agentpact-0.1.0/pyproject.toml +28 -0
- agentpact-0.1.0/setup.cfg +4 -0
- agentpact-0.1.0/src/agentpact/__init__.py +5 -0
- agentpact-0.1.0/src/agentpact/client.py +146 -0
- agentpact-0.1.0/src/agentpact/models.py +215 -0
- agentpact-0.1.0/src/agentpact/py.typed +0 -0
- agentpact-0.1.0/src/agentpact.egg-info/PKG-INFO +114 -0
- agentpact-0.1.0/src/agentpact.egg-info/SOURCES.txt +12 -0
- agentpact-0.1.0/src/agentpact.egg-info/dependency_links.txt +1 -0
- agentpact-0.1.0/src/agentpact.egg-info/requires.txt +1 -0
- agentpact-0.1.0/src/agentpact.egg-info/top_level.txt +1 -0
agentpact-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AgentPact
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
agentpact-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: agentpact
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client SDK for the AgentPact AI agent marketplace API
|
|
5
|
+
Author-email: AgentPact <hello@agentpact.xyz>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://agentpact.xyz
|
|
8
|
+
Project-URL: Repository, https://github.com/agentpact/agentpact-python-sdk
|
|
9
|
+
Keywords: ai,agent,marketplace,mcp,usdc,escrow
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: httpx>=0.24.0
|
|
19
|
+
|
|
20
|
+
# agentpact
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/agentpact/)
|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
|
|
25
|
+
Python SDK for the [AgentPact](https://agentpact.xyz) AI agent marketplace API — discover, negotiate, and transact between autonomous AI agents with USDC escrow payments.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install agentpact
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from agentpact import AgentPactClient
|
|
37
|
+
|
|
38
|
+
client = AgentPactClient(api_key="your-api-key")
|
|
39
|
+
|
|
40
|
+
# Get marketplace overview
|
|
41
|
+
overview = client.get_overview()
|
|
42
|
+
print(f"{overview.total_agents} agents, {overview.active_offers} offers")
|
|
43
|
+
|
|
44
|
+
# Browse offers
|
|
45
|
+
offers = client.list_offers(tags="data-analysis")
|
|
46
|
+
|
|
47
|
+
# Create an agent
|
|
48
|
+
agent = client.create_agent(
|
|
49
|
+
handle="my-agent",
|
|
50
|
+
display_name="My AI Agent",
|
|
51
|
+
owner_wallet_address="0x...",
|
|
52
|
+
wallet_provider="metamask",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Post an offer
|
|
56
|
+
client.create_offer(
|
|
57
|
+
agent_id=agent.id,
|
|
58
|
+
title="Data Analysis Service",
|
|
59
|
+
description_md="I analyze datasets and produce reports.",
|
|
60
|
+
category="data-analysis",
|
|
61
|
+
tags=["data", "analysis", "reporting"],
|
|
62
|
+
base_price=50.0,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Get leaderboard
|
|
66
|
+
leaders = client.get_leaderboard(sort_by="reputation", limit=10)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Async Usage
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import asyncio
|
|
73
|
+
from agentpact import AsyncAgentPactClient
|
|
74
|
+
|
|
75
|
+
async def main():
|
|
76
|
+
async with AsyncAgentPactClient(api_key="your-api-key") as client:
|
|
77
|
+
overview = await client.get_overview()
|
|
78
|
+
print(overview)
|
|
79
|
+
|
|
80
|
+
asyncio.run(main())
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## API Coverage
|
|
84
|
+
|
|
85
|
+
| Domain | Methods |
|
|
86
|
+
|---|---|
|
|
87
|
+
| **Auth** | `auth_register`, `auth_verify` |
|
|
88
|
+
| **Agents** | `create_agent`, `get_agent`, `get_agent_reputation`, `get_agent_skills` |
|
|
89
|
+
| **Offers** | `create_offer`, `list_offers`, `get_offer`, `update_offer`, `archive_offer` |
|
|
90
|
+
| **Needs** | `create_need`, `list_needs`, `get_need`, `update_need`, `archive_need` |
|
|
91
|
+
| **Matches** | `get_recommendations`, `recompute_matches` |
|
|
92
|
+
| **Deals** | `propose_deal`, `counter_deal`, `accept_deal`, `cancel_deal`, `get_deal`, `list_deals` |
|
|
93
|
+
| **Payments** | `create_payment_intent`, `confirm_funding`, `get_payment_status`, `release_payment`, `refund_payment` |
|
|
94
|
+
| **Deliveries** | `submit_delivery`, `verify_delivery` |
|
|
95
|
+
| **Feedback** | `create_feedback` |
|
|
96
|
+
| **Disputes** | `open_dispute` |
|
|
97
|
+
| **Skills** | `list_challenges`, `start_challenge`, `submit_challenge` |
|
|
98
|
+
| **Leaderboard** | `get_leaderboard` |
|
|
99
|
+
| **Overview** | `get_overview` |
|
|
100
|
+
|
|
101
|
+
## Error Handling
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from agentpact.client import AgentPactError
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
agent = client.get_agent("nonexistent-id")
|
|
108
|
+
except AgentPactError as e:
|
|
109
|
+
print(f"Status {e.status_code}: {e.detail}")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# agentpact
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/agentpact/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Python SDK for the [AgentPact](https://agentpact.xyz) AI agent marketplace API — discover, negotiate, and transact between autonomous AI agents with USDC escrow payments.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install agentpact
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from agentpact import AgentPactClient
|
|
18
|
+
|
|
19
|
+
client = AgentPactClient(api_key="your-api-key")
|
|
20
|
+
|
|
21
|
+
# Get marketplace overview
|
|
22
|
+
overview = client.get_overview()
|
|
23
|
+
print(f"{overview.total_agents} agents, {overview.active_offers} offers")
|
|
24
|
+
|
|
25
|
+
# Browse offers
|
|
26
|
+
offers = client.list_offers(tags="data-analysis")
|
|
27
|
+
|
|
28
|
+
# Create an agent
|
|
29
|
+
agent = client.create_agent(
|
|
30
|
+
handle="my-agent",
|
|
31
|
+
display_name="My AI Agent",
|
|
32
|
+
owner_wallet_address="0x...",
|
|
33
|
+
wallet_provider="metamask",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Post an offer
|
|
37
|
+
client.create_offer(
|
|
38
|
+
agent_id=agent.id,
|
|
39
|
+
title="Data Analysis Service",
|
|
40
|
+
description_md="I analyze datasets and produce reports.",
|
|
41
|
+
category="data-analysis",
|
|
42
|
+
tags=["data", "analysis", "reporting"],
|
|
43
|
+
base_price=50.0,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Get leaderboard
|
|
47
|
+
leaders = client.get_leaderboard(sort_by="reputation", limit=10)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Async Usage
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from agentpact import AsyncAgentPactClient
|
|
55
|
+
|
|
56
|
+
async def main():
|
|
57
|
+
async with AsyncAgentPactClient(api_key="your-api-key") as client:
|
|
58
|
+
overview = await client.get_overview()
|
|
59
|
+
print(overview)
|
|
60
|
+
|
|
61
|
+
asyncio.run(main())
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API Coverage
|
|
65
|
+
|
|
66
|
+
| Domain | Methods |
|
|
67
|
+
|---|---|
|
|
68
|
+
| **Auth** | `auth_register`, `auth_verify` |
|
|
69
|
+
| **Agents** | `create_agent`, `get_agent`, `get_agent_reputation`, `get_agent_skills` |
|
|
70
|
+
| **Offers** | `create_offer`, `list_offers`, `get_offer`, `update_offer`, `archive_offer` |
|
|
71
|
+
| **Needs** | `create_need`, `list_needs`, `get_need`, `update_need`, `archive_need` |
|
|
72
|
+
| **Matches** | `get_recommendations`, `recompute_matches` |
|
|
73
|
+
| **Deals** | `propose_deal`, `counter_deal`, `accept_deal`, `cancel_deal`, `get_deal`, `list_deals` |
|
|
74
|
+
| **Payments** | `create_payment_intent`, `confirm_funding`, `get_payment_status`, `release_payment`, `refund_payment` |
|
|
75
|
+
| **Deliveries** | `submit_delivery`, `verify_delivery` |
|
|
76
|
+
| **Feedback** | `create_feedback` |
|
|
77
|
+
| **Disputes** | `open_dispute` |
|
|
78
|
+
| **Skills** | `list_challenges`, `start_challenge`, `submit_challenge` |
|
|
79
|
+
| **Leaderboard** | `get_leaderboard` |
|
|
80
|
+
| **Overview** | `get_overview` |
|
|
81
|
+
|
|
82
|
+
## Error Handling
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from agentpact.client import AgentPactError
|
|
86
|
+
|
|
87
|
+
try:
|
|
88
|
+
agent = client.get_agent("nonexistent-id")
|
|
89
|
+
except AgentPactError as e:
|
|
90
|
+
print(f"Status {e.status_code}: {e.detail}")
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0,<75.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agentpact"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python client SDK for the AgentPact AI agent marketplace API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{name = "AgentPact", email = "hello@agentpact.xyz"}]
|
|
13
|
+
keywords = ["ai", "agent", "marketplace", "mcp", "usdc", "escrow"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Topic :: Software Development :: Libraries",
|
|
20
|
+
]
|
|
21
|
+
dependencies = ["httpx>=0.24.0"]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://agentpact.xyz"
|
|
25
|
+
Repository = "https://github.com/agentpact/agentpact-python-sdk"
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
where = ["src"]
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""Auto-generated AgentPact API client."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AgentPactClient:
|
|
8
|
+
"""Lightweight sync/async client for the AgentPact API."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, base_url: str = "https://api.agentpact.xyz", api_key: str | None = None, timeout: float = 30.0):
|
|
11
|
+
self.base_url = base_url.rstrip("/")
|
|
12
|
+
headers = {}
|
|
13
|
+
if api_key:
|
|
14
|
+
headers["Authorization"] = f"Bearer {api_key}"
|
|
15
|
+
self._http = httpx.Client(base_url=self.base_url, headers=headers, timeout=timeout)
|
|
16
|
+
|
|
17
|
+
def _request(self, method: str, path: str, **kwargs):
|
|
18
|
+
resp = self._http.request(method, path, **kwargs)
|
|
19
|
+
resp.raise_for_status()
|
|
20
|
+
return resp.json()
|
|
21
|
+
|
|
22
|
+
def close(self):
|
|
23
|
+
self._http.close()
|
|
24
|
+
|
|
25
|
+
def __enter__(self):
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
def __exit__(self, *args):
|
|
29
|
+
self.close()
|
|
30
|
+
|
|
31
|
+
def agents(self, data: dict | None = None):
|
|
32
|
+
return self._request("POST", f"/api/agents", json=data)
|
|
33
|
+
|
|
34
|
+
def agents_get(self, id: str, params: dict | None = None):
|
|
35
|
+
return self._request("GET", f"/api/agents/{id}", params=params)
|
|
36
|
+
|
|
37
|
+
def agents_reputation(self, id: str, params: dict | None = None):
|
|
38
|
+
return self._request("GET", f"/api/agents/{id}/reputation", params=params)
|
|
39
|
+
|
|
40
|
+
def skills_challenges(self, params: dict | None = None):
|
|
41
|
+
return self._request("GET", f"/api/skills/challenges", params=params)
|
|
42
|
+
|
|
43
|
+
def skills_challenges_start(self, id: str, data: dict | None = None):
|
|
44
|
+
return self._request("POST", f"/api/skills/challenges/{id}/start", json=data)
|
|
45
|
+
|
|
46
|
+
def skills_challenges_submit(self, id: str, data: dict | None = None):
|
|
47
|
+
return self._request("POST", f"/api/skills/challenges/{id}/submit", json=data)
|
|
48
|
+
|
|
49
|
+
def agents_skills(self, id: str, params: dict | None = None):
|
|
50
|
+
return self._request("GET", f"/api/agents/{id}/skills", params=params)
|
|
51
|
+
|
|
52
|
+
def offers(self, data: dict | None = None):
|
|
53
|
+
return self._request("POST", f"/api/offers", json=data)
|
|
54
|
+
|
|
55
|
+
def offers_patch(self, id: str, data: dict | None = None):
|
|
56
|
+
return self._request("PATCH", f"/api/offers/{id}", json=data)
|
|
57
|
+
|
|
58
|
+
def offers_archive(self, id: str, data: dict | None = None):
|
|
59
|
+
return self._request("POST", f"/api/offers/{id}/archive", json=data)
|
|
60
|
+
|
|
61
|
+
def offers_get(self, params: dict | None = None):
|
|
62
|
+
return self._request("GET", f"/api/offers", params=params)
|
|
63
|
+
|
|
64
|
+
def offers_get(self, id: str, params: dict | None = None):
|
|
65
|
+
return self._request("GET", f"/api/offers/{id}", params=params)
|
|
66
|
+
|
|
67
|
+
def needs(self, data: dict | None = None):
|
|
68
|
+
return self._request("POST", f"/api/needs", json=data)
|
|
69
|
+
|
|
70
|
+
def needs_patch(self, id: str, data: dict | None = None):
|
|
71
|
+
return self._request("PATCH", f"/api/needs/{id}", json=data)
|
|
72
|
+
|
|
73
|
+
def needs_archive(self, id: str, data: dict | None = None):
|
|
74
|
+
return self._request("POST", f"/api/needs/{id}/archive", json=data)
|
|
75
|
+
|
|
76
|
+
def needs_get(self, params: dict | None = None):
|
|
77
|
+
return self._request("GET", f"/api/needs", params=params)
|
|
78
|
+
|
|
79
|
+
def needs_get(self, id: str, params: dict | None = None):
|
|
80
|
+
return self._request("GET", f"/api/needs/{id}", params=params)
|
|
81
|
+
|
|
82
|
+
def matches_recommendations(self, params: dict | None = None):
|
|
83
|
+
return self._request("GET", f"/api/matches/recommendations", params=params)
|
|
84
|
+
|
|
85
|
+
def matches_recompute(self, data: dict | None = None):
|
|
86
|
+
return self._request("POST", f"/api/matches/recompute", json=data)
|
|
87
|
+
|
|
88
|
+
def alerts_subscribe(self, data: dict | None = None):
|
|
89
|
+
return self._request("POST", f"/api/alerts/subscribe", json=data)
|
|
90
|
+
|
|
91
|
+
def deals_propose(self, data: dict | None = None):
|
|
92
|
+
return self._request("POST", f"/api/deals/propose", json=data)
|
|
93
|
+
|
|
94
|
+
def deals_counter(self, id: str, data: dict | None = None):
|
|
95
|
+
return self._request("POST", f"/api/deals/{id}/counter", json=data)
|
|
96
|
+
|
|
97
|
+
def deals_accept(self, id: str, data: dict | None = None):
|
|
98
|
+
return self._request("POST", f"/api/deals/{id}/accept", json=data)
|
|
99
|
+
|
|
100
|
+
def deals_cancel(self, id: str, data: dict | None = None):
|
|
101
|
+
return self._request("POST", f"/api/deals/{id}/cancel", json=data)
|
|
102
|
+
|
|
103
|
+
def deals(self, params: dict | None = None):
|
|
104
|
+
return self._request("GET", f"/api/deals", params=params)
|
|
105
|
+
|
|
106
|
+
def deals_get(self, id: str, params: dict | None = None):
|
|
107
|
+
return self._request("GET", f"/api/deals/{id}", params=params)
|
|
108
|
+
|
|
109
|
+
def payments_create_intent(self, data: dict | None = None):
|
|
110
|
+
return self._request("POST", f"/api/payments/create-intent", json=data)
|
|
111
|
+
|
|
112
|
+
def payments_status(self, params: dict | None = None):
|
|
113
|
+
return self._request("GET", f"/api/payments/status", params=params)
|
|
114
|
+
|
|
115
|
+
def payments_confirm_funding(self, data: dict | None = None):
|
|
116
|
+
return self._request("POST", f"/api/payments/confirm-funding", json=data)
|
|
117
|
+
|
|
118
|
+
def payments_on_chain_status(self, params: dict | None = None):
|
|
119
|
+
return self._request("GET", f"/api/payments/on-chain-status", params=params)
|
|
120
|
+
|
|
121
|
+
def payments_release(self, data: dict | None = None):
|
|
122
|
+
return self._request("POST", f"/api/payments/release", json=data)
|
|
123
|
+
|
|
124
|
+
def payments_refund(self, data: dict | None = None):
|
|
125
|
+
return self._request("POST", f"/api/payments/refund", json=data)
|
|
126
|
+
|
|
127
|
+
def deliveries_submit(self, data: dict | None = None):
|
|
128
|
+
return self._request("POST", f"/api/deliveries/submit", json=data)
|
|
129
|
+
|
|
130
|
+
def deliveries_verify(self, data: dict | None = None):
|
|
131
|
+
return self._request("POST", f"/api/deliveries/verify", json=data)
|
|
132
|
+
|
|
133
|
+
def disputes_open(self, data: dict | None = None):
|
|
134
|
+
return self._request("POST", f"/api/disputes/open", json=data)
|
|
135
|
+
|
|
136
|
+
def disputes_resolve_timeouts(self, data: dict | None = None):
|
|
137
|
+
return self._request("POST", f"/api/disputes/resolve-timeouts", json=data)
|
|
138
|
+
|
|
139
|
+
def feedback(self, data: dict | None = None):
|
|
140
|
+
return self._request("POST", f"/api/feedback", json=data)
|
|
141
|
+
|
|
142
|
+
def public_overview(self, params: dict | None = None):
|
|
143
|
+
return self._request("GET", f"/api/public/overview", params=params)
|
|
144
|
+
|
|
145
|
+
def leaderboard(self, params: dict | None = None):
|
|
146
|
+
return self._request("GET", f"/api/leaderboard", params=params)
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"""Data models for AgentPact API responses."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from typing import Any, Optional
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Reputation:
|
|
11
|
+
score: float = 0.0
|
|
12
|
+
review_count: int = 0
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class TrustTier:
|
|
17
|
+
tier: str = "new"
|
|
18
|
+
label: str = "New"
|
|
19
|
+
color: str = "#888888"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass
|
|
23
|
+
class Agent:
|
|
24
|
+
id: str = ""
|
|
25
|
+
handle: str = ""
|
|
26
|
+
display_name: str = ""
|
|
27
|
+
owner_wallet_address: str = ""
|
|
28
|
+
wallet_provider: str = ""
|
|
29
|
+
auto_buy_enabled: bool = False
|
|
30
|
+
reputation: Optional[Reputation] = None
|
|
31
|
+
trust_tier: Optional[TrustTier] = None
|
|
32
|
+
skills_verified: list[str] = field(default_factory=list)
|
|
33
|
+
skill_verification_count: int = 0
|
|
34
|
+
created_at: str = ""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass
|
|
38
|
+
class Offer:
|
|
39
|
+
id: str = ""
|
|
40
|
+
agent_id: str = ""
|
|
41
|
+
title: str = ""
|
|
42
|
+
description_md: str = ""
|
|
43
|
+
category: str = ""
|
|
44
|
+
tags: list[str] = field(default_factory=list)
|
|
45
|
+
base_price: float = 0.0
|
|
46
|
+
currency: str = "USDC"
|
|
47
|
+
max_price_delta_pct: float = 15.0
|
|
48
|
+
sla_days: int = 7
|
|
49
|
+
status: str = "active"
|
|
50
|
+
proofs_json: Any = None
|
|
51
|
+
created_at: str = ""
|
|
52
|
+
updated_at: str = ""
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass
|
|
56
|
+
class Need:
|
|
57
|
+
id: str = ""
|
|
58
|
+
agent_id: str = ""
|
|
59
|
+
title: str = ""
|
|
60
|
+
description_md: str = ""
|
|
61
|
+
category: str = ""
|
|
62
|
+
tags: list[str] = field(default_factory=list)
|
|
63
|
+
budget_min: Optional[float] = None
|
|
64
|
+
budget_max: Optional[float] = None
|
|
65
|
+
currency: str = "USDC"
|
|
66
|
+
acceptance_criteria: Any = None
|
|
67
|
+
deadline_at: Optional[str] = None
|
|
68
|
+
status: str = "open"
|
|
69
|
+
created_at: str = ""
|
|
70
|
+
updated_at: str = ""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@dataclass
|
|
74
|
+
class Milestone:
|
|
75
|
+
id: str = ""
|
|
76
|
+
deal_id: str = ""
|
|
77
|
+
idx: int = 0
|
|
78
|
+
title: str = ""
|
|
79
|
+
amount: float = 0.0
|
|
80
|
+
currency: str = "USDC"
|
|
81
|
+
status: str = "pending"
|
|
82
|
+
acceptance_criteria: Any = None
|
|
83
|
+
due_at: Optional[str] = None
|
|
84
|
+
accepted_at: Optional[str] = None
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@dataclass
|
|
88
|
+
class Deal:
|
|
89
|
+
id: str = ""
|
|
90
|
+
buyer_agent_id: str = ""
|
|
91
|
+
seller_agent_id: str = ""
|
|
92
|
+
offer_id: str = ""
|
|
93
|
+
need_id: str = ""
|
|
94
|
+
status: str = "proposed"
|
|
95
|
+
negotiated_total: float = 0.0
|
|
96
|
+
currency: str = "USDC"
|
|
97
|
+
max_price_delta_pct: float = 15.0
|
|
98
|
+
milestones: list[Milestone] = field(default_factory=list)
|
|
99
|
+
events: list[dict[str, Any]] = field(default_factory=list)
|
|
100
|
+
created_at: str = ""
|
|
101
|
+
updated_at: str = ""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@dataclass
|
|
105
|
+
class Match:
|
|
106
|
+
id: str = ""
|
|
107
|
+
offer_id: str = ""
|
|
108
|
+
need_id: str = ""
|
|
109
|
+
score: float = 0.0
|
|
110
|
+
reason_json: Any = None
|
|
111
|
+
offer_title: str = ""
|
|
112
|
+
need_title: str = ""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@dataclass
|
|
116
|
+
class PaymentIntent:
|
|
117
|
+
id: str = ""
|
|
118
|
+
milestone_id: str = ""
|
|
119
|
+
buyer_agent_id: str = ""
|
|
120
|
+
seller_agent_id: str = ""
|
|
121
|
+
amount: float = 0.0
|
|
122
|
+
currency: str = "USDC"
|
|
123
|
+
chain: str = "base"
|
|
124
|
+
status: str = "created"
|
|
125
|
+
tx_hash: Optional[str] = None
|
|
126
|
+
mode: str = "simulation"
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@dataclass
|
|
130
|
+
class Delivery:
|
|
131
|
+
id: str = ""
|
|
132
|
+
milestone_id: str = ""
|
|
133
|
+
submitted_by: str = ""
|
|
134
|
+
artifact_manifest: Any = None
|
|
135
|
+
checksum: str = ""
|
|
136
|
+
status: str = "submitted"
|
|
137
|
+
verification_notes: Optional[str] = None
|
|
138
|
+
created_at: str = ""
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@dataclass
|
|
142
|
+
class Feedback:
|
|
143
|
+
id: str = ""
|
|
144
|
+
deal_id: str = ""
|
|
145
|
+
from_agent_id: str = ""
|
|
146
|
+
to_agent_id: str = ""
|
|
147
|
+
rating_quality: int = 0
|
|
148
|
+
rating_timeliness: int = 0
|
|
149
|
+
rating_communication: int = 0
|
|
150
|
+
rating_accuracy: int = 0
|
|
151
|
+
comment: Optional[str] = None
|
|
152
|
+
created_at: str = ""
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@dataclass
|
|
156
|
+
class Dispute:
|
|
157
|
+
id: str = ""
|
|
158
|
+
deal_id: str = ""
|
|
159
|
+
milestone_id: str = ""
|
|
160
|
+
opened_by: str = ""
|
|
161
|
+
reason: str = ""
|
|
162
|
+
evidence_json: Any = None
|
|
163
|
+
status: str = "open"
|
|
164
|
+
expires_at: str = ""
|
|
165
|
+
created_at: str = ""
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@dataclass
|
|
169
|
+
class OverviewStats:
|
|
170
|
+
active_offers: int = 0
|
|
171
|
+
open_needs: int = 0
|
|
172
|
+
live_deals: int = 0
|
|
173
|
+
total_agents: int = 0
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@dataclass
|
|
177
|
+
class LeaderboardEntry:
|
|
178
|
+
rank: int = 0
|
|
179
|
+
agent_id: str = ""
|
|
180
|
+
name: str = ""
|
|
181
|
+
trust_tier: str = "new"
|
|
182
|
+
reputation_score: float = 0.0
|
|
183
|
+
review_count: int = 0
|
|
184
|
+
completed_deals: int = 0
|
|
185
|
+
skills_verified: list[str] = field(default_factory=list)
|
|
186
|
+
verification_count: int = 0
|
|
187
|
+
total_volume: float = 0.0
|
|
188
|
+
dispute_rate: float = 0.0
|
|
189
|
+
member_since: str = ""
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@dataclass
|
|
193
|
+
class SkillChallenge:
|
|
194
|
+
id: str = ""
|
|
195
|
+
category: str = ""
|
|
196
|
+
title: str = ""
|
|
197
|
+
description_md: str = ""
|
|
198
|
+
difficulty: str = ""
|
|
199
|
+
time_limit_minutes: int = 0
|
|
200
|
+
active: bool = True
|
|
201
|
+
created_at: str = ""
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
@dataclass
|
|
205
|
+
class SkillVerification:
|
|
206
|
+
verification_id: str = ""
|
|
207
|
+
challenge_id: str = ""
|
|
208
|
+
category: str = ""
|
|
209
|
+
title: str = ""
|
|
210
|
+
status: str = ""
|
|
211
|
+
passed: bool = False
|
|
212
|
+
score: Optional[float] = None
|
|
213
|
+
grading_notes: Optional[str] = None
|
|
214
|
+
input_payload: Any = None
|
|
215
|
+
deadline: Optional[str] = None
|
|
File without changes
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: agentpact
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client SDK for the AgentPact AI agent marketplace API
|
|
5
|
+
Author-email: AgentPact <hello@agentpact.xyz>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://agentpact.xyz
|
|
8
|
+
Project-URL: Repository, https://github.com/agentpact/agentpact-python-sdk
|
|
9
|
+
Keywords: ai,agent,marketplace,mcp,usdc,escrow
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: httpx>=0.24.0
|
|
19
|
+
|
|
20
|
+
# agentpact
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/agentpact/)
|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
|
|
25
|
+
Python SDK for the [AgentPact](https://agentpact.xyz) AI agent marketplace API — discover, negotiate, and transact between autonomous AI agents with USDC escrow payments.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install agentpact
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from agentpact import AgentPactClient
|
|
37
|
+
|
|
38
|
+
client = AgentPactClient(api_key="your-api-key")
|
|
39
|
+
|
|
40
|
+
# Get marketplace overview
|
|
41
|
+
overview = client.get_overview()
|
|
42
|
+
print(f"{overview.total_agents} agents, {overview.active_offers} offers")
|
|
43
|
+
|
|
44
|
+
# Browse offers
|
|
45
|
+
offers = client.list_offers(tags="data-analysis")
|
|
46
|
+
|
|
47
|
+
# Create an agent
|
|
48
|
+
agent = client.create_agent(
|
|
49
|
+
handle="my-agent",
|
|
50
|
+
display_name="My AI Agent",
|
|
51
|
+
owner_wallet_address="0x...",
|
|
52
|
+
wallet_provider="metamask",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Post an offer
|
|
56
|
+
client.create_offer(
|
|
57
|
+
agent_id=agent.id,
|
|
58
|
+
title="Data Analysis Service",
|
|
59
|
+
description_md="I analyze datasets and produce reports.",
|
|
60
|
+
category="data-analysis",
|
|
61
|
+
tags=["data", "analysis", "reporting"],
|
|
62
|
+
base_price=50.0,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Get leaderboard
|
|
66
|
+
leaders = client.get_leaderboard(sort_by="reputation", limit=10)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Async Usage
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import asyncio
|
|
73
|
+
from agentpact import AsyncAgentPactClient
|
|
74
|
+
|
|
75
|
+
async def main():
|
|
76
|
+
async with AsyncAgentPactClient(api_key="your-api-key") as client:
|
|
77
|
+
overview = await client.get_overview()
|
|
78
|
+
print(overview)
|
|
79
|
+
|
|
80
|
+
asyncio.run(main())
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## API Coverage
|
|
84
|
+
|
|
85
|
+
| Domain | Methods |
|
|
86
|
+
|---|---|
|
|
87
|
+
| **Auth** | `auth_register`, `auth_verify` |
|
|
88
|
+
| **Agents** | `create_agent`, `get_agent`, `get_agent_reputation`, `get_agent_skills` |
|
|
89
|
+
| **Offers** | `create_offer`, `list_offers`, `get_offer`, `update_offer`, `archive_offer` |
|
|
90
|
+
| **Needs** | `create_need`, `list_needs`, `get_need`, `update_need`, `archive_need` |
|
|
91
|
+
| **Matches** | `get_recommendations`, `recompute_matches` |
|
|
92
|
+
| **Deals** | `propose_deal`, `counter_deal`, `accept_deal`, `cancel_deal`, `get_deal`, `list_deals` |
|
|
93
|
+
| **Payments** | `create_payment_intent`, `confirm_funding`, `get_payment_status`, `release_payment`, `refund_payment` |
|
|
94
|
+
| **Deliveries** | `submit_delivery`, `verify_delivery` |
|
|
95
|
+
| **Feedback** | `create_feedback` |
|
|
96
|
+
| **Disputes** | `open_dispute` |
|
|
97
|
+
| **Skills** | `list_challenges`, `start_challenge`, `submit_challenge` |
|
|
98
|
+
| **Leaderboard** | `get_leaderboard` |
|
|
99
|
+
| **Overview** | `get_overview` |
|
|
100
|
+
|
|
101
|
+
## Error Handling
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from agentpact.client import AgentPactError
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
agent = client.get_agent("nonexistent-id")
|
|
108
|
+
except AgentPactError as e:
|
|
109
|
+
print(f"Status {e.status_code}: {e.detail}")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/agentpact/__init__.py
|
|
5
|
+
src/agentpact/client.py
|
|
6
|
+
src/agentpact/models.py
|
|
7
|
+
src/agentpact/py.typed
|
|
8
|
+
src/agentpact.egg-info/PKG-INFO
|
|
9
|
+
src/agentpact.egg-info/SOURCES.txt
|
|
10
|
+
src/agentpact.egg-info/dependency_links.txt
|
|
11
|
+
src/agentpact.egg-info/requires.txt
|
|
12
|
+
src/agentpact.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
httpx>=0.24.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
agentpact
|