x402-proxy 0.10.4 → 0.10.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/CHANGELOG.md +9 -1
- package/dist/bin/cli.js +15 -11
- package/dist/index.js +5 -3
- package/dist/openclaw/plugin.js +7 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.10.5] - 2026-04-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- `--debug` flag now works with inference proxy - route.ts debug check was captured at import time (before `cli.ts` sets the env var), so `dbg()` never fired; now evaluates lazily per call
|
|
14
|
+
- `--debug` on `claude` command now shows proxy logs (sets `quiet: false`)
|
|
15
|
+
- MPP `X-Payer-Address` header injection preserves headers as plain objects instead of converting to `Headers` instance, avoiding mppx headers-spreading bug that silently drops `Content-Type` on SSE requests
|
|
16
|
+
|
|
10
17
|
## [0.10.4] - 2026-04-01
|
|
11
18
|
|
|
12
19
|
### Fixed
|
|
@@ -367,7 +374,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
367
374
|
- `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
|
|
368
375
|
- Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
|
|
369
376
|
|
|
370
|
-
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.
|
|
377
|
+
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.5...HEAD
|
|
378
|
+
[0.10.5]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.4...v0.10.5
|
|
371
379
|
[0.10.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.3...v0.10.4
|
|
372
380
|
[0.10.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.2...v0.10.3
|
|
373
381
|
[0.10.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.1...v0.10.2
|
package/dist/bin/cli.js
CHANGED
|
@@ -216,11 +216,13 @@ async function createMppProxyHandler(opts) {
|
|
|
216
216
|
});
|
|
217
217
|
const payerAddress = account.address;
|
|
218
218
|
function injectPayerHeader(init) {
|
|
219
|
-
const
|
|
220
|
-
headers.set("X-Payer-Address", payerAddress);
|
|
219
|
+
const existing = init?.headers instanceof Headers ? Object.fromEntries(init.headers.entries()) : init?.headers ?? {};
|
|
221
220
|
return {
|
|
222
221
|
...init,
|
|
223
|
-
headers
|
|
222
|
+
headers: {
|
|
223
|
+
...existing,
|
|
224
|
+
"X-Payer-Address": payerAddress
|
|
225
|
+
}
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
228
|
let session;
|
|
@@ -323,9 +325,8 @@ function addressForNetwork(evmAddress, solanaAddress, network) {
|
|
|
323
325
|
}
|
|
324
326
|
//#endregion
|
|
325
327
|
//#region src/openclaw/route.ts
|
|
326
|
-
const debug = process.env.X402_PROXY_DEBUG === "1";
|
|
327
328
|
function dbg(msg) {
|
|
328
|
-
if (
|
|
329
|
+
if (process.env.X402_PROXY_DEBUG === "1") process.stderr.write(`[x402-proxy] ${msg}\n`);
|
|
329
330
|
}
|
|
330
331
|
function createInferenceProxyRouteHandler(opts) {
|
|
331
332
|
const { providers, getX402Proxy, getMppHandler, getWalletAddress, getWalletAddressForNetwork, historyPath, allModels, logger } = opts;
|
|
@@ -849,6 +850,7 @@ function createRequestHandler(routeHandler) {
|
|
|
849
850
|
};
|
|
850
851
|
}
|
|
851
852
|
async function startServeServer(options = {}) {
|
|
853
|
+
if (options.debug) options.quiet = false;
|
|
852
854
|
const config = loadConfig();
|
|
853
855
|
const wallet = await resolveWalletForServe(options);
|
|
854
856
|
const resolvedProtocol = resolveProtocol(options.protocol ?? config?.preferredProtocol);
|
|
@@ -1069,6 +1071,7 @@ Examples:
|
|
|
1069
1071
|
}
|
|
1070
1072
|
},
|
|
1071
1073
|
async func(flags, ...rawClaudeArgs) {
|
|
1074
|
+
const debug = process.env.X402_PROXY_DEBUG === "1";
|
|
1072
1075
|
const started = await startServeServer({
|
|
1073
1076
|
upstreamUrl: flags.upstream ?? "https://surf.cascade.fyi/api/v1/inference",
|
|
1074
1077
|
port: Number(flags.port),
|
|
@@ -1076,7 +1079,8 @@ Examples:
|
|
|
1076
1079
|
network: flags.network,
|
|
1077
1080
|
evmKey: flags.evmKey,
|
|
1078
1081
|
solanaKey: flags.solanaKey,
|
|
1079
|
-
quiet:
|
|
1082
|
+
quiet: !debug,
|
|
1083
|
+
debug
|
|
1080
1084
|
});
|
|
1081
1085
|
const child = spawn("claude", normalizeClaudeArgs(rawClaudeArgs), {
|
|
1082
1086
|
stdio: "inherit",
|
|
@@ -1836,7 +1840,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
1836
1840
|
}
|
|
1837
1841
|
const remoteClient = new Client({
|
|
1838
1842
|
name: "x402-proxy",
|
|
1839
|
-
version: "0.10.
|
|
1843
|
+
version: "0.10.5"
|
|
1840
1844
|
});
|
|
1841
1845
|
const x402Mcp = new x402MCPClient(remoteClient, x402PaymentClient, {
|
|
1842
1846
|
autoPayment: true,
|
|
@@ -1874,7 +1878,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
1874
1878
|
}
|
|
1875
1879
|
const localServer = new Server({
|
|
1876
1880
|
name: "x402-proxy",
|
|
1877
|
-
version: "0.10.
|
|
1881
|
+
version: "0.10.5"
|
|
1878
1882
|
}, { capabilities: {
|
|
1879
1883
|
tools: tools.length > 0 ? {} : void 0,
|
|
1880
1884
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -1969,7 +1973,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
1969
1973
|
}));
|
|
1970
1974
|
const remoteClient = new Client({
|
|
1971
1975
|
name: "x402-proxy",
|
|
1972
|
-
version: "0.10.
|
|
1976
|
+
version: "0.10.5"
|
|
1973
1977
|
});
|
|
1974
1978
|
await connectTransport(remoteClient);
|
|
1975
1979
|
const mppClient = McpClient.wrap(remoteClient, { methods: wrappedMethods });
|
|
@@ -1984,7 +1988,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
1984
1988
|
}
|
|
1985
1989
|
const localServer = new Server({
|
|
1986
1990
|
name: "x402-proxy",
|
|
1987
|
-
version: "0.10.
|
|
1991
|
+
version: "0.10.5"
|
|
1988
1992
|
}, { capabilities: {
|
|
1989
1993
|
tools: tools.length > 0 ? {} : void 0,
|
|
1990
1994
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -2383,7 +2387,7 @@ const app = buildApplication(buildRouteMap({
|
|
|
2383
2387
|
docs: { brief: "curl for x402 paid APIs" }
|
|
2384
2388
|
}), {
|
|
2385
2389
|
name: "x402-proxy",
|
|
2386
|
-
versionInfo: { currentVersion: "0.10.
|
|
2390
|
+
versionInfo: { currentVersion: "0.10.5" },
|
|
2387
2391
|
scanner: { caseStyle: "allow-kebab-for-camel" }
|
|
2388
2392
|
});
|
|
2389
2393
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -82,11 +82,13 @@ async function createMppProxyHandler(opts) {
|
|
|
82
82
|
});
|
|
83
83
|
const payerAddress = account.address;
|
|
84
84
|
function injectPayerHeader(init) {
|
|
85
|
-
const
|
|
86
|
-
headers.set("X-Payer-Address", payerAddress);
|
|
85
|
+
const existing = init?.headers instanceof Headers ? Object.fromEntries(init.headers.entries()) : init?.headers ?? {};
|
|
87
86
|
return {
|
|
88
87
|
...init,
|
|
89
|
-
headers
|
|
88
|
+
headers: {
|
|
89
|
+
...existing,
|
|
90
|
+
"X-Payer-Address": payerAddress
|
|
91
|
+
}
|
|
90
92
|
};
|
|
91
93
|
}
|
|
92
94
|
let session;
|
package/dist/openclaw/plugin.js
CHANGED
|
@@ -87,11 +87,13 @@ async function createMppProxyHandler(opts) {
|
|
|
87
87
|
});
|
|
88
88
|
const payerAddress = account.address;
|
|
89
89
|
function injectPayerHeader(init) {
|
|
90
|
-
const
|
|
91
|
-
headers.set("X-Payer-Address", payerAddress);
|
|
90
|
+
const existing = init?.headers instanceof Headers ? Object.fromEntries(init.headers.entries()) : init?.headers ?? {};
|
|
92
91
|
return {
|
|
93
92
|
...init,
|
|
94
|
-
headers
|
|
93
|
+
headers: {
|
|
94
|
+
...existing,
|
|
95
|
+
"X-Payer-Address": payerAddress
|
|
96
|
+
}
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
99
|
let session;
|
|
@@ -1151,7 +1153,7 @@ function createWalletCommand(ctx) {
|
|
|
1151
1153
|
if (parts[0]?.toLowerCase() === "send") return { text: "Use `/x_send <amount|all> <address>` for transfers." };
|
|
1152
1154
|
try {
|
|
1153
1155
|
const snap = await getWalletSnapshot(ctx.rpcUrl, solanaWallet, evmWallet, ctx.historyPath);
|
|
1154
|
-
const lines = [`x402-proxy v0.10.
|
|
1156
|
+
const lines = [`x402-proxy v0.10.5`];
|
|
1155
1157
|
const defaultModel = ctx.allModels[0];
|
|
1156
1158
|
if (defaultModel) lines.push("", `**Model** - ${defaultModel.name} (${defaultModel.provider})`);
|
|
1157
1159
|
lines.push("", `**Protocol** - ${ctx.getDefaultRequestProtocol()}`);
|
|
@@ -1367,9 +1369,8 @@ function resolveMppSessionBudget(value, fallback = "0.5") {
|
|
|
1367
1369
|
}
|
|
1368
1370
|
//#endregion
|
|
1369
1371
|
//#region src/openclaw/route.ts
|
|
1370
|
-
const debug = process.env.X402_PROXY_DEBUG === "1";
|
|
1371
1372
|
function dbg(msg) {
|
|
1372
|
-
if (
|
|
1373
|
+
if (process.env.X402_PROXY_DEBUG === "1") process.stderr.write(`[x402-proxy] ${msg}\n`);
|
|
1373
1374
|
}
|
|
1374
1375
|
function createInferenceProxyRouteHandler(opts) {
|
|
1375
1376
|
const { providers, getX402Proxy, getMppHandler, getWalletAddress, getWalletAddressForNetwork, historyPath, allModels, logger } = opts;
|
package/package.json
CHANGED