Repository navigation
feat(cli): doctor --seller <url> to validate a remote x402 seller - #110
Merged
Merged
Conversation
Co-Authored-By: Grok 4.7 <noreply@x.ai>
npm run build and npm run lint syntax-check the CLI. This package ships as one JavaScript file and has no tsc or eslint config. Co-Authored-By: Grok 4.7 <noreply@x.ai>
Browsers ignore Access-Control-Expose-Headers on the preflight. The doctor User-Agent now takes its version from package.json, and the node --check scripts are gone so they are not mistaken for a linter. Co-Authored-By: Grok 4.7 <noreply@x.ai>
This was referenced Oct 11, 2026
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.
Closes #105
nirium doctor --seller <url>valida un vendedor x402 remoto sin pagar. Pide la URL y exige 402 con unPAYMENT-REQUIREDdecodificable. Revisa quenetwork,asset,amountypayToexistan y estén bien formados, y queresource.urlseahttps://. Manda un preflight CORS con un origen al azar y comprueba que no responde 500, que el 402 exponePAYMENT-REQUIREDyPAYMENT-RESPONSE(el navegador ignoraAccess-Control-Expose-Headersdel preflight), y quePAYMENT-SIGNATUREestá permitido. Cada check se imprime pass/fail.--jsonqueda para CI y el exit code es distinto de cero si alguno falla.El probe es un
GETmás unOPTIONS. No envíaPAYMENT-SIGNATUREni lee el.env. ElUser-Agentesnirium-doctor/<version>leído depackages/cli/package.json. El #103 no está enmain, así que los tests del fixture viven aquí.Rebaseado sobre
maindespués de #108 (payya no acepta el secreto como argumento).Este paquete no tiene ESLint ni un script
lint.npm testes el único script nuevo y correnode --testcontra el fixture. El workflow de upstream (sdk-test.yml) no cubrepackages/cli/**. Estos tests se pueden sumar ahí, o dejarlo para #107.Cómo se probó
npm testenpackages/cli: 11/11 contra un servidor en127.0.0.1, sin red. Incluye el caso en que el preflight expone los headers y el 402 no:cors-exposefalla.https://x402.holatia.app/v1/quote. Pasaron challenge,stellar:pubnet, asset, amount, payTo,resource.url, preflight 204 yPAYMENT-SIGNATURE. Fallócors-expose: el 402 no envíaAccess-Control-Expose-Headers. Exit code 1.Disclosure: implemented with AI assistance (Cursor) under my direction and reviewed by hand.