Repository navigation
Add sell-api skill, sell-oneshot skill eval, and radius-cli sell check - #60
Conversation
- plugins/radius/skills/sell-api: a top-level seller skill (detect the framework, install, configure radius-sdk, run locally, verify with `radius-cli sell check`, hand off deployment), with references for frameworks, protocols, networks and facilitators, settlement, and the gotchas the seller eval records. The x402 skill keeps the buyer side and the protocol and points sellers to sell-api; the manual seller illustration (x402-server.md) is removed and the seller scenario fixtures move to sell-api. Plugin 0.0.5 -> 0.1.0. - plugins/radius/evals/sell-oneshot: the SELL-ONESHOT task as a Claude plugin eval case (skill-fired + behavior graders). It names no framework or repo path; sell.mjs reads it from there, scaffolds a package.json listing one framework, and also runs `radius-cli sell check` as a grader step. - radius-cli `sell check <url>`: audits a seller's unpaid 402 (x402 offers decoded with @x402/core as the SDK does, MPP challenges, facilitator /supported, SDK buyer selection), with --price, --facilitator, --probe-head and --pay --threshold (testnet unless --network mainnet). Checklist or --json, exit 0/1/2. Unit tests use the real SDK seller and a mock facilitator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
|
CI: The This PR doesn't modify Fix: bring #57 into the base branch, by merging or rebasing Generated by Claude Code |
(cherry picked from commit e6d5c11) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
🦋 Changeset detectedLatest commit: c7fb137 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…Worker proxy, selective gating) SELL-NEXT-MW runs radiusPayments in Next 15 edge middleware, SELL-ASTRO-MW in Astro 4.15 and 5.18 SSR middleware, SELL-WORKER-PROXY in a Worker (workerd via wrangler dev) in front of an origin, and SELL-SELECTIVE a humans-free, agents-pay wrapper. Next and Astro are installed on demand into a cache directory and the cases report SKIP when that is not possible; the runner gains a SKIP status. Known gaps are XFAIL: paid missing pages, localhost resource.url, prerendered pages, build-time 402 corruption, and CDN headers passing through paid responses. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
…igin gates in sell-api Replace the untested @x402/next row with the radiusPayments middleware pattern for Next 15 and 16, add Astro middleware (with the prerender guard), a Cloudflare Worker in front of an origin and Fastly Compute, and a publishers reference (agents versus humans, CDN caching, paywalls, off-domain assets, discovery, paid 404s). Add gotchas for Astro prerender build corruption, paid 404, localhost resource.url, CDN header pass-through and Fastly AbortSignal, broaden the skill description, and add a skill scenario. Claims are limited to what the seller evals or hand runs verified; untested items are marked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
Review: sell-api skill +
|
…check Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
- Shape-check every accepts entry; a non-object offer is a FAIL for that offer, not a crash. - MPP mirror check reuses the validated offers (object/missing accepts no longer throws). - Read an x402 challenge from the 402 JSON body when there is no PAYMENT-REQUIRED header, as the SDK buyer's readChallenge does (v1, and an off-spec v2 body with a warning). - Compare --price amounts as BigInt (also for MPP); MPP mirror matches v1 offers (maxAmountRequired, network aliases). - Bad -H, unreadable -d @file, unknown --network/--networks and invalid --threshold exit 2. - --pay: the paid request gets a longer timeout budget, and a failure after the payment was sent says the payment may have settled. - sell-next fixture: check AI_AGENT_UA (and signature-agent) before the Mozilla/ human test. - Tests for each; README, docs and changeset updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
|
Addressed azf20's review in 11c7e10. The branch now includes the #48 fixes (2ded934) through merge 8472cf6, which also brings Each crash and behaviour was reproduced first with the built CLI against a local server sending crafted 402s, and now has a unit test that fails on the old code. Fixed:
Skipped:
Generated by Claude Code |
…check Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq # Conflicts: # plugins/radius/.claude-plugin/plugin.json
The merge-base changed after approval.
Requested by Eriks Reks · Slack thread
Before: Seller guidance was one section inside the
x402skill. It was Hono-only, and it shipped with a long hand-rolled protocol illustration. The one-shot seller eval's prompt lived inevaluations/and pointed the agent straight at the SDK README and the x402 skill. Nothing could check a seller's 402 before deploy short of decoding the header by hand.After: A top-level
sell-apiskill covers selling an API. It detects the framework (Hono, web-standard/Next route handlers, Express, Next middleware marked untested), installs and configuresradius-sdk, runs locally, verifies withradius-cli sell check, and hands off deployment. It has one reference per topic: frameworks, protocols, networks/facilitators, settlement, and gotchas. The gotchas are taken from the seller eval's XFAILs and observations, each with a mitigation. Thex402skill is now the buyer side plus the protocol. The SELL-ONESHOT prompt is now a plugin eval case. The agent has to findsell-apion its own, and the deterministic grader is stillpnpm eval:payments:sell -- --case SELL-ONESHOT. The newradius-cli sell check <url>audits an unpaid 402 and exits non-zero when a check fails.How:
sell checkdecodesPAYMENT-REQUIREDwith@x402/core/http(the same decoder radius-sdk uses; it is now a CLI dependency, pinned to the SDK's 2.27.0). It parses MPP with the SDK'sparseMppChallenges, reads/supportedthroughRadiusFacilitatorClient, and askscreateRadiusFetch(with a throwaway key that declines before signing) whether a radius-sdk buyer would pay. For each offer it checks the network, the asset and EIP-712 domain, the amount (against--price, which names the decimals a wrong amount implies),payTo,resource.url,maxTimeoutSeconds, and facilitator support. Options:--probe-head, and--pay --threshold(testnet unless--network mainnetis passed explicitly). Unit tests use the real SDK seller and a mock facilitator. SELL-ONESHOT now scaffolds apackage.jsonthat lists only one framework, reads the prompt fromplugins/radius/evals/sell-oneshot/prompt.md, and runssell checkas an extra grader step. Plugin bumped 0.0.5 → 0.1.0. CLI changeset is minor. No SDK runtime changes.Verified locally:
pnpm build,pnpm typecheckandpnpm testpass (SDK 218, CLI 46 tests).eval:paymentspasses 20/20 andeval:payments:agentpasses 36/36.eval:payments:sellgives 6 pass, 2 XFAIL, 0 fail, the same as before.validate_plugin.py --base-ref,claude plugin validate --strict(plugin and marketplace), and docs prettier, eslint and validate also pass. SELL-ONESHOT was also run once with a real Claude Code integrator (--plugin-dir plugins/radius, the README example), and it passed on Express and Hono. The paid plugin-eval workflow was not run.Release order: the skill tells users to run
radius-cli sell check(radius-cli 0.5.0) and gives a curl fallback. Publish the CLI before releasing this plugin version.Stacked on #48: the base is
feat/agent-payments-evaluation.🤖 Generated with Claude Code
https://claude.ai/code/session_01MTVVAF1bbGhWkfLjATWseq
Generated by Claude Code