Skip to content

Commit ae8f344

Browse files
vvillait88claude
andcommitted
docs: drop "mirror of node-commerce" framing; describe modules standalone
python-commerce stands on its own as the Python flavor of the agent commerce SDK; it doesn't need to be sold as a derivative of the Node version. Scrubbed "mirror of @agent-score/commerce" / "Mirror of node-commerce's X" / "Mirrors :func:..." across CLAUDE.md, README, examples README, identity adapters, payment helpers, signer extraction, denial helpers, address normalization, and tests. Replaced with neutral standalone descriptions; kept implementation invariants (cross-language API parity, must produce identical normalization output) intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 560580b commit ae8f344

17 files changed

Lines changed: 36 additions & 46 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# agentscore-commerce
22

3-
Agent commerce SDK for Python. The full merchant-side toolkit: identity gating + payment helpers + 402 builders + discovery + Stripe multichain. One install, submodule imports per concern. Mirror of `@agent-score/commerce` (Node.js) — same surface area, idiomatic Python.
3+
Agent commerce SDK for Python. The full merchant-side toolkit: identity gating + payment helpers + 402 builders + discovery + Stripe multichain. One install, submodule imports per concern.
44

55
## Submodules
66

@@ -27,7 +27,7 @@ Single Python package, hatchling-built, published to PyPI as `agentscore-commerc
2727
| `agentscore_commerce/api/` | `AgentScore` re-export |
2828
| `tests/` | pytest, one file per surface |
2929

30-
Mirror of node-commerce's structure — every helper lifted from the node version's working production code.
30+
Every helper lifts from working production code (`agentscore/martin-estate`) — extract from real consumers, not speculation.
3131

3232
## Identity model
3333

@@ -71,7 +71,7 @@ uv run pytest tests/
7171
- **Never commit .env files or secrets**
7272
- **Use PRs** — never push directly to main
7373
- **Helpers are protocol translations + configurable opinions, not opinionated frameworks**
74-
- **Mirror node-commerce** — keep the surface area identical so vendors switching languages have the same mental model
74+
- **Cross-language API parity** — keep the surface area identical between the node and python flavors so vendors switching languages have the same mental model
7575

7676
## Releasing
7777

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![PyPI version](https://img.shields.io/pypi/v/agentscore-commerce.svg)](https://pypi.org/project/agentscore-commerce/)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
55

6-
The full merchant-side SDK for [AgentScore](https://agentscore.sh) in Python — agent commerce in one install. Identity middleware (FastAPI, Flask, Django, AIOHTTP, Sanic, ASGI), payment helpers, 402 challenge builders, MPP discovery, and Stripe multichain support. Mirror of [`@agent-score/commerce`](https://github.com/agentscore/node-commerce) — same surface, idiomatic Python.
6+
The full merchant-side SDK for [AgentScore](https://agentscore.sh) in Python — agent commerce in one install. Identity middleware (FastAPI, Flask, Django, AIOHTTP, Sanic, ASGI), payment helpers, 402 challenge builders, MPP discovery, and Stripe multichain support.
77

88
## Install
99

agentscore_commerce/identity/_denial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Universal denial helpers shared across every adapter — Python mirror of node-commerce/src/_denial.ts.
1+
"""Universal denial helpers shared across every adapter.
22
33
What lives here:
44
FIXABLE_DENIAL_REASONS / is_fixable_denial — classifier for compliance reasons that can

agentscore_commerce/identity/address.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
so DB lookups against `address_lower`-style columns work. Solana addresses are base58 and
55
case-sensitive — we MUST preserve the input verbatim, never lowercase.
66
7-
Mirrors `core/api/src/lib/address.ts` and `node-commerce/src/identity/address.ts` so all three layers
8-
normalize identically. Drift here silently breaks captured-wallet resolution and signer-match.
7+
Must produce identical output to the API and node SDK normalizers. Drift here
8+
silently breaks captured-wallet resolution and signer-match.
99
"""
1010

1111
from __future__ import annotations

agentscore_commerce/identity/aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_assess_data(request: web.Request) -> dict[str, Any] | None:
6868
"""Return the `/v1/assess` response the middleware stashed on the aiohttp request dict.
6969
7070
Returns ``None`` when identity was missing or the gate short-circuited with a
71-
denial. Mirrors :func:`agentscore_commerce.identity.fastapi.get_assess_data`.
71+
denial.
7272
"""
7373
return request.get(ASSESS_STATE_KEY)
7474

agentscore_commerce/identity/django.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def get_assess_data(request: HttpRequest) -> dict[str, Any] | None:
6464
"""Return the `/v1/assess` response the middleware stashed on the request.
6565
6666
Returns ``None`` when identity was missing or the gate short-circuited with a
67-
denial. Mirrors :func:`agentscore_commerce.identity.fastapi.get_assess_data`.
67+
denial.
6868
"""
6969
return getattr(request, ASSESS_STATE_KEY, None)
7070

agentscore_commerce/identity/flask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_assess_data() -> dict[str, Any] | None:
6767
"""Return the `/v1/assess` response the gate stashed on Flask's request-scoped ``g``.
6868
6969
Returns ``None`` outside a gated request, when identity was missing, or when the gate
70-
short-circuited with a denial. Mirrors :func:`agentscore_commerce.identity.fastapi.get_assess_data`.
70+
short-circuited with a denial.
7171
"""
7272
from flask import g
7373

agentscore_commerce/identity/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def get_assess_data(request: Request) -> dict[str, Any] | None:
7171
"""Return the `/v1/assess` response the middleware stashed on the request scope.
7272
7373
Returns ``None`` when identity was missing or the gate short-circuited with a
74-
denial. Mirrors :func:`agentscore_commerce.identity.fastapi.get_assess_data`.
74+
denial.
7575
"""
7676
state = request.scope.get("state") or {}
7777
return state.get(ASSESS_STATE_KEY)

agentscore_commerce/identity/sanic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_assess_data(request: Request) -> dict[str, Any] | None:
6868
"""Return the `/v1/assess` response the middleware stashed on ``request.ctx``.
6969
7070
Returns ``None`` when identity was missing or the gate short-circuited with a
71-
denial. Mirrors :func:`agentscore_commerce.identity.fastapi.get_assess_data`.
71+
denial.
7272
"""
7373
return getattr(request.ctx, ASSESS_STATE_ATTR, None)
7474

agentscore_commerce/payment/mppx_server.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""One-call MPP server setup wrapping the official `pympp` Python package.
22
3-
Mirror of node-commerce's `createMppxServer` factory. Wires Tempo charge,
4-
Tempo session (channel-based for variable-cost / streaming), and Stripe SPT
5-
methods from symbolic rail config — replaces the boilerplate of constructing
6-
each method by hand.
3+
Wires Tempo charge, Tempo session (channel-based for variable-cost /
4+
streaming), and Stripe SPT methods from symbolic rail config — replaces
5+
the boilerplate of constructing each method by hand.
76
87
Usage::
98
@@ -115,8 +114,8 @@ async def create_mppx_server(
115114
Returns a configured ``Mppx`` server instance. Raises ``ImportError`` with a
116115
guiding install command when ``pympp`` (or a per-rail extra) is missing.
117116
118-
Mirror of node-commerce's ``createMppxServer``. Async because Stripe SPT method
119-
construction may require an HTTP setup call to the Stripe API.
117+
Async because Stripe SPT method construction may require an HTTP setup call
118+
to the Stripe API.
120119
"""
121120
pympp = _import_optional("pympp.server")
122121
if pympp is None or not hasattr(pympp, "Mppx"):

0 commit comments

Comments
 (0)