Repository navigation
feat(tools-registry): add agent402-check402 - #25858
Open
agent402-dev wants to merge 1 commit into
Open
agent402-dev wants to merge 1 commit into
agent402-dev wants to merge 1 commit into
Conversation
Contributor
|
@agent402-dev is attempting to run Vercel CI for a fork pull request of the Vercel Team on Vercel. A member of the Team first needs to approve it. |
Contributor
|
@agent402-dev is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Agents that call x402 paid APIs decide whether to pay from the HTTP 402 answer. The registry already lists x402 toolkits that pay; this adds a tool that only checks a paid endpoint before an agent pays it.
Summary
Adds one entry,
agent402-check402, tocontent/tools-registry/registry.ts(appended at the end, like recent entries). The tool (check402Toolfrom@agent402-dev/ai-sdk-tools) sends one request without a payment header and reports what the buyer's agent will hit in the 402 answer: payment format, network and asset, price, payTo and resource URL, plus the USDC amount asked. It never signs or pays, and needs no API key or wallet.aiandzodare in the install commands because they are peer dependencies.End-to-End Verification
In a clean temporary project with the published
@agent402-dev/ai-sdk-tools@0.1.0,ai@7.1.1andzod:tsc --noEmit --strict,nodenext).check402Tool({ allowLocal: true })ran insidegenerateTextwithMockLanguageModelV4emitting the tool call (so no provider key), against a local endpoint whose 402 has a Solanaexactoption withoutextra.feePayer: 2 steps, tool resultfixes: 1(fee_payer),signedOrPaid: false.httpURL is refused ("Only https URLs are checked.").Limits: this run used a local endpoint only. An earlier run with
ai@7.1.0against a public x402 endpoint returnedfixes: 0with nothing signed or paid.Checklist
pnpm changesetin the project root)Docs: the package README (linked as
docsUrl). No changeset, since only the registry content changes.