crewai-agentkoin 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.
@@ -0,0 +1,13 @@
1
+ node_modules/
2
+ dist/
3
+ *.tsbuildinfo
4
+ .venv/
5
+ __pycache__/
6
+ *.pyc
7
+ .pytest_cache/
8
+ out/
9
+ .secrets/
10
+ *.key
11
+ *.pem
12
+ .env
13
+ .env.*
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 STOS Technologies LLC
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.
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.5
2
+ Name: crewai-agentkoin
3
+ Version: 0.1.0
4
+ Summary: AgentKoin (formerly AgentCoin) tools for CrewAI. Base Sepolia testnet only.
5
+ Project-URL: Homepage, https://github.com/stos-technologies/agentcoin
6
+ Project-URL: Repository, https://github.com/stos-technologies/agentcoin
7
+ Author: STOS Technologies LLC
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: agentkoin-core==0.1.0
12
+ Requires-Dist: crewai>=0.100
13
+ Requires-Dist: pydantic>=2
@@ -0,0 +1,72 @@
1
+ # crewai-agentcoin
2
+
3
+ CrewAI BaseTool subclasses with pydantic argument schemas.
4
+
5
+ Status: published to PyPI as `crewai-agentkoin`. Import package names are unchanged. Network: Base Sepolia (eip155:84532), test USDC only. Mainnet chain ids (1, 8453, 10, 137, 42161 and 15 others listed in `MAINNET_CHAIN_IDS`) are refused; the `allowMainnet` / `allow_mainnet` override exists in code, is off by default, and is unsupported.
6
+
7
+ ## Install
8
+
9
+ ```
10
+ pip install crewai-agentkoin
11
+ # or locally: uv pip install -e ./python/crewai-agentcoin
12
+ ```
13
+
14
+ ## Configure
15
+
16
+ ```
17
+ from crewai_agentcoin import agentcoin_tools
18
+ tools = agentcoin_tools()
19
+ agent = Agent(role="buyer", goal="...", backstory="...", tools=tools)
20
+ ```
21
+
22
+ ## Tools
23
+
24
+ | tool | writes or pays | what it returns |
25
+ |---|---|---|
26
+ | `find_service` | no | Searches the AgentCoin index of agent services (A2A, MCP, x402, ERC-8004) by text, protocol, max price, min delivery score, claimed status, network. |
27
+ | `route_task` | no | Returns ranked candidate sellers for a task and budget: quote, request template, delivery score, order modes (direct, escrow). |
28
+ | `place_order` | yes | Places an order for a listing and pays it from the configured wallet. |
29
+ | `get_order` | no | Returns an order's status, payment tx, escrow job state, deliverable hash, verdict and operator-signed delivery record. |
30
+ | `claim_listing` | yes | Seller side. |
31
+ | `verify` | no | serviceId: signed delivery score with local signature and evidence-root checks. |
32
+ | `refund` | yes | Escrow orders: checks the JobEscrow job state and sends the refund-path call that applies (cancel before acceptance, claimRefund after the deadline, timeoutRelease after a missed verdict, finalize after the challenge window). |
33
+
34
+ Wallet guards (core client, apply to every tool that pays):
35
+ - `maxPayment` / `max_payment`: per-order ceiling in USDC base units (6 decimals). Orders above it are refused before any signature.
36
+ - `allowedServiceIds` / `allowed_service_ids`: when set, `place_order` refuses any other listing.
37
+ - the 402 requirement must match the listing (network, asset, payTo, amount) or the payment is refused.
38
+ - the private key is read from the environment or passed in; it is never logged or returned by a tool.
39
+
40
+ Environment read by `fromEnv()` / `from_env()`:
41
+
42
+ | variable | default |
43
+ |---|---|
44
+ | `AGENTCOIN_PRIVATE_KEY` | unset: read-only tools only |
45
+ | `AGENTCOIN_URL` (legacy alias `AGENTCOIN_BASE_URL`) | `https://agentcoinhq.com` (`DEFAULT_AGENTCOIN_URL`; router v0.5, testnet) |
46
+ | `AGENTCOIN_CHAIN_ID` | `84532` |
47
+ | `AGENTCOIN_RPC_URL` | `https://sepolia.base.org` |
48
+ | `AGENTCOIN_MAX_PAYMENT` | `50000` (0.05 test USDC per order, base units) |
49
+ | `AGENTCOIN_ALLOWED_SERVICE_IDS` | unset (any listing) |
50
+ | `AGENTCOIN_ORIGIN` | unset (orders count as external). `agentcoin` marks AgentCoin's own test orders, which are excluded from seller scores. |
51
+
52
+ ## Tests
53
+
54
+ `pytest` in `python/` (mocked router via `agentcoin_core.testing.MockRouter` and `FakeChain`). 3 tests in this package.
55
+
56
+ ## Example
57
+
58
+ `examples/crewai_py.py` (escrow mode).
59
+
60
+ ## Telemetry
61
+
62
+ CrewAI sends OpenTelemetry spans to `telemetry.crewai.com` unless `CREWAI_DISABLE_TELEMETRY=true` or `OTEL_SDK_DISABLED=true` is set. The example and this package's tests set both.
63
+
64
+ Runs find -> order -> verify against the AgentCoin-operated notary listing (`svc_962928f654d2a8a1`, 0.01 test USDC). Without `AGENTCOIN_PRIVATE_KEY`, or with `AGENTCOIN_DRY_RUN=1`, it stops after the read-only find step. Results are written to `out/ (git-ignored)`.
65
+
66
+ ## License
67
+
68
+ MIT, Copyright (c) 2026 STOS Technologies LLC.
69
+
70
+ ## Source
71
+
72
+ https://github.com/stos-technologies/agentcoin
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "crewai-agentkoin"
3
+ version = "0.1.0"
4
+ description = "AgentKoin (formerly AgentCoin) tools for CrewAI. Base Sepolia testnet only."
5
+ requires-python = ">=3.10"
6
+ license = { text = "MIT" }
7
+ authors = [{ name = "STOS Technologies LLC" }]
8
+ dependencies = ["agentkoin-core==0.1.0", "crewai>=0.100", "pydantic>=2"]
9
+
10
+ [project.urls]
11
+ Homepage = "https://github.com/stos-technologies/agentcoin"
12
+ Repository = "https://github.com/stos-technologies/agentcoin"
13
+
14
+ [build-system]
15
+ requires = ["hatchling"]
16
+ build-backend = "hatchling.build"
17
+
18
+ [tool.hatch.build.targets.wheel]
19
+ packages = ["src/crewai_agentcoin"]
20
+
21
+ [tool.hatch.build.targets.sdist]
22
+ exclude = ["/tests", "/.gitignore"]
23
+
24
+ [tool.hatch.build.targets.sdist.force-include]
25
+ "LICENSE" = "LICENSE"
26
+
27
+ [tool.hatch.build.targets.wheel.force-include]
28
+ "LICENSE" = "LICENSE"
@@ -0,0 +1,28 @@
1
+ """AgentCoin tools for CrewAI. Base Sepolia testnet only."""
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ from agentcoin_core import TOOL_SPECS, as_client, run_tool_json
7
+ from agentcoin_core.schema import drop_none, pydantic_model
8
+ from crewai.tools import BaseTool
9
+
10
+
11
+ class AgentCoinTool(BaseTool):
12
+ """One AgentCoin tool. Result is a JSON string."""
13
+
14
+ client: Any = None
15
+ tool_name: str = ""
16
+
17
+ def _run(self, **kwargs) -> str:
18
+ return run_tool_json(self.client, self.tool_name, drop_none(kwargs))
19
+
20
+
21
+ def agentcoin_tools(client=None, *, include: list[str] | None = None, read_only: bool = False) -> list[AgentCoinTool]:
22
+ """Tools for `Agent(tools=...)`."""
23
+ c = as_client(client)
24
+ return [AgentCoinTool(name=s["name"], description=s["description"], args_schema=pydantic_model(s), client=c, tool_name=s["name"])
25
+ for s in TOOL_SPECS if (not include or s["name"] in include) and (not read_only or s["readOnly"])]
26
+
27
+
28
+ __all__ = ["AgentCoinTool", "agentcoin_tools"]