Skip to content

Commit c18b174

Browse files
ci(skills): reject deprecated @sei-js/x402 packages in samples
check-skills.mjs now fails when a code block installs or imports an @sei-js/x402 package, so a regeneration that copies sei-skill's v1 x402 samples can't pass. Prose that names the packages as deprecated still passes. Adding one to the install line locally fails the check. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4eabc00 commit c18b174

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎scripts/check-skills.mjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@ for (const dir of dirs) {
3737
}
3838

3939
// Agents copy these samples verbatim, so catch the regressions that can double-sign a
40-
// validator, leave it without a signer, or report a reverted payment as sent.
40+
// validator, leave it without a signer, report a reverted payment as sent, or build on
41+
// the deprecated x402 v1 packages.
4142
for (const [, code] of source.matchAll(/```[^\n]*\n([\s\S]*?)```/g)) {
4243
if (code.includes('unsafe-reset-all') && !/\bset -[a-z]*e/.test(code)) {
4344
failures.push(`${path}: a script that runs unsafe-reset-all must fail closed (set -euo pipefail)`);
4445
}
4546
if (/^\[priv-validator\]/m.test(code) && /^\s*(key-type|server-address)\s*=/m.test(code)) {
4647
failures.push(`${path}: [priv-validator] has no key-type or server-address; seid listens on laddr and the remote signer dials in`);
4748
}
49+
if (code.includes('@sei-js/x402')) {
50+
failures.push(`${path}: a sample uses a deprecated @sei-js/x402 package; use the upstream @x402 v2 packages (see ai/x402.mdx)`);
51+
}
4852
const waits = (code.match(/waitForTransactionReceipt\(/gi) || []).length;
4953
const statusChecks = (code.match(/\.status\b/g) || []).length;
5054
if (waits > statusChecks) {

0 commit comments

Comments
 (0)