wolverine-ai 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolverine-ai",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -66,10 +66,10 @@ async function x402Plugin(fastify, opts) {
|
|
|
66
66
|
console.log(` 💰 x402: payments to ${_payTo.slice(0, 6)}...${_payTo.slice(-4)} on ${_network}`);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// ── Route-level x402 hook ──
|
|
70
|
-
fastify.addHook("
|
|
71
|
-
// Check if this route has x402 config
|
|
72
|
-
const routeConfig = request.routeOptions?.config?.x402 || request.context?.config?.x402;
|
|
69
|
+
// ── Route-level x402 hook (preHandler so body is parsed for variable pricing) ──
|
|
70
|
+
fastify.addHook("preHandler", async (request, reply) => {
|
|
71
|
+
// Check if this route has x402 config (Fastify v4: context.config, v5: routeOptions.config)
|
|
72
|
+
const routeConfig = request.routeOptions?.config?.x402 || request.routeConfig?.x402 || request.context?.config?.x402;
|
|
73
73
|
if (!routeConfig) return; // Not an x402 route
|
|
74
74
|
if (!_payTo) {
|
|
75
75
|
reply.code(500).send({ error: "x402 not configured — no wallet address" });
|