chore: bump @agentcash/router to 1.18.0#1018
Merged
Merged
Conversation
Router 1.16+ made handlers framework-agnostic: the handler's request is a Web Request, not NextRequest, so request.nextUrl is undefined at runtime. Replace with new URL(request.url).pathname in the 5 paid routes that extract a path segment inside .handler() — same fix pattern as the the-stables fleet migration (Merit-Systems/the-stables#555). Plain Next.js handlers (proxy-image, resources/label, invite/redeem) still receive a real NextRequest and are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace the 5 duplicated inline new URL(request.url).pathname.split() expressions with extractPathSegment() in api/x402/_lib/utils.ts — same expression, one definition (mirrors mppscan's extractServiceId). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.18.0 adds beforeSettle 'skip' (conditional settlement) — additive only, and this app doesn't use settlement hooks. Pin-only change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Bumps
@agentcash/router1.10.1 → 1.18.0 (apps/scan) and fixes the one breaking change that bites us: since 1.16 the router is framework-agnostic, so therequestinside.handler()is a WebRequest—request.nextUrlisundefinedat runtime.1.17 → 1.18 is additive only (
beforeSettlemay return'skip'for conditional settlement); this app doesn't use settlement hooks.Changes
apps/scan/package.json: router pin 1.10.1 → 1.18.0request.nextUrl.pathnameinside.handler(); that's now a sharedextractPathSegment(request, n)helper inapi/x402/_lib/utils.tsusingnew URL(request.url).pathname(same expression, one definition — mirrors the fix pattern in Merit-Systems/the-stables#555):x402/merchants/{address}/transactions+/statsx402/wallets/{address}/transactions+/statsx402/origins/{id}/resourcesproxy-image,resources/label,invite/redeem) receive a realNextRequestfrom Next itself and are untouched.