ag402-core 0.1.1__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.
- ag402_core-0.1.1/.gitignore +61 -0
- ag402_core-0.1.1/PKG-INFO +33 -0
- ag402_core-0.1.1/README.md +3 -0
- ag402_core-0.1.1/ag402_core/__init__.py +17 -0
- ag402_core-0.1.1/ag402_core/cli.py +1676 -0
- ag402_core-0.1.1/ag402_core/config.py +185 -0
- ag402_core-0.1.1/ag402_core/env_manager.py +176 -0
- ag402_core-0.1.1/ag402_core/friendly_errors.py +129 -0
- ag402_core-0.1.1/ag402_core/gateway/__init__.py +5 -0
- ag402_core-0.1.1/ag402_core/gateway/auth.py +150 -0
- ag402_core-0.1.1/ag402_core/middleware/__init__.py +0 -0
- ag402_core-0.1.1/ag402_core/middleware/budget_guard.py +161 -0
- ag402_core-0.1.1/ag402_core/middleware/x402_middleware.py +352 -0
- ag402_core-0.1.1/ag402_core/monkey.py +400 -0
- ag402_core-0.1.1/ag402_core/payment/__init__.py +11 -0
- ag402_core-0.1.1/ag402_core/payment/base.py +70 -0
- ag402_core-0.1.1/ag402_core/payment/registry.py +100 -0
- ag402_core-0.1.1/ag402_core/payment/retry.py +84 -0
- ag402_core-0.1.1/ag402_core/payment/solana_adapter.py +504 -0
- ag402_core-0.1.1/ag402_core/proxy/__init__.py +5 -0
- ag402_core-0.1.1/ag402_core/proxy/forward_proxy.py +321 -0
- ag402_core-0.1.1/ag402_core/py.typed +0 -0
- ag402_core-0.1.1/ag402_core/runners/__init__.py +5 -0
- ag402_core-0.1.1/ag402_core/runners/base.py +128 -0
- ag402_core-0.1.1/ag402_core/security/__init__.py +20 -0
- ag402_core-0.1.1/ag402_core/security/challenge_validator.py +116 -0
- ag402_core-0.1.1/ag402_core/security/key_guard.py +100 -0
- ag402_core-0.1.1/ag402_core/security/rate_limiter.py +25 -0
- ag402_core-0.1.1/ag402_core/security/replay_guard.py +191 -0
- ag402_core-0.1.1/ag402_core/security/wallet_encryption.py +165 -0
- ag402_core-0.1.1/ag402_core/setup_wizard.py +363 -0
- ag402_core-0.1.1/ag402_core/terminal.py +41 -0
- ag402_core-0.1.1/ag402_core/wallet/__init__.py +0 -0
- ag402_core-0.1.1/ag402_core/wallet/agent_wallet.py +449 -0
- ag402_core-0.1.1/ag402_core/wallet/faucet.py +31 -0
- ag402_core-0.1.1/ag402_core/wallet/models.py +32 -0
- ag402_core-0.1.1/ag402_core/wallet/payment_order.py +302 -0
- ag402_core-0.1.1/pyproject.toml +52 -0
- ag402_core-0.1.1/tests/__init__.py +0 -0
- ag402_core-0.1.1/tests/conftest.py +83 -0
- ag402_core-0.1.1/tests/conftest_devnet.py +326 -0
- ag402_core-0.1.1/tests/conftest_localnet.py +200 -0
- ag402_core-0.1.1/tests/test_budget_enhanced.py +280 -0
- ag402_core-0.1.1/tests/test_cli_enhanced.py +688 -0
- ag402_core-0.1.1/tests/test_decimal_precision.py +75 -0
- ag402_core-0.1.1/tests/test_devnet_e2e.py +272 -0
- ag402_core-0.1.1/tests/test_devnet_solana.py +470 -0
- ag402_core-0.1.1/tests/test_env_manager.py +229 -0
- ag402_core-0.1.1/tests/test_gateway.py +47 -0
- ag402_core-0.1.1/tests/test_key_guard.py +182 -0
- ag402_core-0.1.1/tests/test_localnet_e2e.py +224 -0
- ag402_core-0.1.1/tests/test_localnet_solana.py +357 -0
- ag402_core-0.1.1/tests/test_middleware.py +271 -0
- ag402_core-0.1.1/tests/test_middleware_stateful.py +222 -0
- ag402_core-0.1.1/tests/test_monkey.py +130 -0
- ag402_core-0.1.1/tests/test_payment.py +156 -0
- ag402_core-0.1.1/tests/test_payment_order.py +272 -0
- ag402_core-0.1.1/tests/test_payment_verifier_amounts.py +111 -0
- ag402_core-0.1.1/tests/test_phase4.py +314 -0
- ag402_core-0.1.1/tests/test_rate_limiter.py +60 -0
- ag402_core-0.1.1/tests/test_registry.py +60 -0
- ag402_core-0.1.1/tests/test_replay_guard.py +103 -0
- ag402_core-0.1.1/tests/test_security.py +363 -0
- ag402_core-0.1.1/tests/test_solana_enhanced.py +115 -0
- ag402_core-0.1.1/tests/test_solana_resilience.py +659 -0
- ag402_core-0.1.1/tests/test_v1_p2_security_fixes.py +376 -0
- ag402_core-0.1.1/tests/test_v1_security_audit_fixes.py +503 -0
- ag402_core-0.1.1/tests/test_wallet.py +132 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.egg
|
|
10
|
+
.eggs/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
env/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.idea/
|
|
19
|
+
.vscode/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
*~
|
|
23
|
+
|
|
24
|
+
# Testing
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.coverage
|
|
27
|
+
htmlcov/
|
|
28
|
+
.tox/
|
|
29
|
+
test-ledger/
|
|
30
|
+
|
|
31
|
+
# Environment & secrets
|
|
32
|
+
.env
|
|
33
|
+
.env.local
|
|
34
|
+
*.pem
|
|
35
|
+
*.key
|
|
36
|
+
|
|
37
|
+
# SQLite databases (wallet data)
|
|
38
|
+
*.db
|
|
39
|
+
*.sqlite
|
|
40
|
+
*.sqlite3
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
Thumbs.db
|
|
45
|
+
|
|
46
|
+
# Distribution
|
|
47
|
+
*.tar.gz
|
|
48
|
+
*.whl
|
|
49
|
+
|
|
50
|
+
# Logs
|
|
51
|
+
*.log
|
|
52
|
+
|
|
53
|
+
# Claude internal
|
|
54
|
+
.claude/
|
|
55
|
+
|
|
56
|
+
# CodeBuddy internal
|
|
57
|
+
.codebuddy/
|
|
58
|
+
|
|
59
|
+
# Planning/draft documents (not part of source)
|
|
60
|
+
*.draft.md
|
|
61
|
+
开源发布行动计划.md
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ag402-core
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Payment engine for AI Agents — automatic HTTP 402 payment with Solana USDC
|
|
5
|
+
Project-URL: Homepage, https://github.com/AetherCore-Dev/ag402
|
|
6
|
+
Project-URL: Documentation, https://github.com/AetherCore-Dev/ag402#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/AetherCore-Dev/ag402
|
|
8
|
+
Project-URL: Issues, https://github.com/AetherCore-Dev/ag402/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md
|
|
10
|
+
Author: Ag402 Team
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
Keywords: ai-agent,payment,solana,usdc,x402
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: aiosqlite>=0.19.0
|
|
15
|
+
Requires-Dist: cryptography>=41.0.0
|
|
16
|
+
Requires-Dist: httpx>=0.27.0
|
|
17
|
+
Requires-Dist: open402>=0.1.0
|
|
18
|
+
Provides-Extra: crypto
|
|
19
|
+
Requires-Dist: base58>=2.1.0; extra == 'crypto'
|
|
20
|
+
Requires-Dist: solana>=0.34.0; extra == 'crypto'
|
|
21
|
+
Requires-Dist: solders>=0.21.0; extra == 'crypto'
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: httpx>=0.27.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-timeout>=2.2.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: ruff>=0.3.0; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# ag402-core
|
|
32
|
+
|
|
33
|
+
Payment engine for AI Agents — automatic HTTP 402 payment with Solana USDC.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""ag402-core: Payment engine for AI Agents.
|
|
2
|
+
|
|
3
|
+
Quick start::
|
|
4
|
+
|
|
5
|
+
import ag402_core
|
|
6
|
+
ag402_core.enable() # monkey-patch httpx/requests for auto x402 payment
|
|
7
|
+
|
|
8
|
+
# Or with context manager:
|
|
9
|
+
with ag402_core.enabled():
|
|
10
|
+
resp = httpx.get("https://paid-api.example.com/data")
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
__version__ = "0.1.0"
|
|
14
|
+
|
|
15
|
+
from ag402_core.monkey import disable, enable, enabled, is_enabled
|
|
16
|
+
|
|
17
|
+
__all__ = ["__version__", "enable", "disable", "enabled", "is_enabled"]
|