@agentcash/router 0.4.3 → 0.4.5
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/dist/index.cjs +9 -2
- package/dist/index.js +9 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -144,11 +144,17 @@ function firePluginHook(plugin, method, ...args) {
|
|
|
144
144
|
try {
|
|
145
145
|
const result = fn.apply(plugin, args);
|
|
146
146
|
if (result && typeof result.catch === "function") {
|
|
147
|
-
result.catch(() => {
|
|
147
|
+
result.catch((error) => {
|
|
148
|
+
console.error(
|
|
149
|
+
`[router] ERROR ${method}: ${error instanceof Error ? error.message : String(error)}`
|
|
150
|
+
);
|
|
148
151
|
});
|
|
149
152
|
}
|
|
150
153
|
return result;
|
|
151
|
-
} catch {
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error(
|
|
156
|
+
`[router] ERROR ${method}: ${error instanceof Error ? error.message : String(error)}`
|
|
157
|
+
);
|
|
152
158
|
return void 0;
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -717,6 +723,7 @@ function createRequestHandler(routeEntry, handler, deps) {
|
|
|
717
723
|
message: `Settlement failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
718
724
|
route: routeEntry.key
|
|
719
725
|
});
|
|
726
|
+
return fail(500, "Settlement failed", meta, pluginCtx);
|
|
720
727
|
}
|
|
721
728
|
}
|
|
722
729
|
finalize(response, rawResult, meta, pluginCtx);
|
package/dist/index.js
CHANGED
|
@@ -110,11 +110,17 @@ function firePluginHook(plugin, method, ...args) {
|
|
|
110
110
|
try {
|
|
111
111
|
const result = fn.apply(plugin, args);
|
|
112
112
|
if (result && typeof result.catch === "function") {
|
|
113
|
-
result.catch(() => {
|
|
113
|
+
result.catch((error) => {
|
|
114
|
+
console.error(
|
|
115
|
+
`[router] ERROR ${method}: ${error instanceof Error ? error.message : String(error)}`
|
|
116
|
+
);
|
|
114
117
|
});
|
|
115
118
|
}
|
|
116
119
|
return result;
|
|
117
|
-
} catch {
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error(
|
|
122
|
+
`[router] ERROR ${method}: ${error instanceof Error ? error.message : String(error)}`
|
|
123
|
+
);
|
|
118
124
|
return void 0;
|
|
119
125
|
}
|
|
120
126
|
}
|
|
@@ -683,6 +689,7 @@ function createRequestHandler(routeEntry, handler, deps) {
|
|
|
683
689
|
message: `Settlement failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
684
690
|
route: routeEntry.key
|
|
685
691
|
});
|
|
692
|
+
return fail(500, "Settlement failed", meta, pluginCtx);
|
|
686
693
|
}
|
|
687
694
|
}
|
|
688
695
|
finalize(response, rawResult, meta, pluginCtx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentcash/router",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Unified route builder for Next.js App Router APIs with x402, MPP, SIWX, and API key auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@x402/core": "^2.3.0",
|
|
29
29
|
"@x402/evm": "^2.3.0",
|
|
30
30
|
"@x402/extensions": "^2.3.0",
|
|
31
|
-
"mppx": "^0.
|
|
31
|
+
"mppx": "^0.2.0",
|
|
32
32
|
"next": ">=15.0.0",
|
|
33
33
|
"zod": "^4.0.0",
|
|
34
34
|
"zod-openapi": "^5.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@x402/evm": "^2.3.0",
|
|
48
48
|
"@x402/extensions": "^2.3.0",
|
|
49
49
|
"eslint": "^10.0.0",
|
|
50
|
-
"mppx": "^0.
|
|
50
|
+
"mppx": "^0.2.0",
|
|
51
51
|
"next": "^15.0.0",
|
|
52
52
|
"prettier": "^3.8.1",
|
|
53
53
|
"react": "^19.0.0",
|