@blockrun/clawrouter 0.12.26 → 0.12.27
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/cli.js +52 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/skills/clawrouter/SKILL.md +48 -0
- package/skills/imagegen/SKILL.md +80 -0
- package/skills/release/SKILL.md +182 -0
package/dist/index.js
CHANGED
|
@@ -5578,6 +5578,58 @@ function transformPaymentError(errorBody) {
|
|
|
5578
5578
|
}
|
|
5579
5579
|
}
|
|
5580
5580
|
}
|
|
5581
|
+
if (parsed.error === "Payment verification failed" && parsed.code === "PAYMENT_INVALID" && parsed.debug) {
|
|
5582
|
+
const debugLower = parsed.debug.toLowerCase();
|
|
5583
|
+
const wallet = parsed.payer || "unknown";
|
|
5584
|
+
const shortWallet = wallet.length > 12 ? `${wallet.slice(0, 6)}...${wallet.slice(-4)}` : wallet;
|
|
5585
|
+
if (debugLower.includes("insufficient")) {
|
|
5586
|
+
return JSON.stringify({
|
|
5587
|
+
error: {
|
|
5588
|
+
message: "Insufficient Solana USDC balance.",
|
|
5589
|
+
type: "insufficient_funds",
|
|
5590
|
+
wallet,
|
|
5591
|
+
help: `Fund wallet ${shortWallet} with USDC on Solana, or switch to Base: /wallet base`
|
|
5592
|
+
}
|
|
5593
|
+
});
|
|
5594
|
+
}
|
|
5595
|
+
if (debugLower.includes("transaction_simulation_failed") || debugLower.includes("simulation")) {
|
|
5596
|
+
console.error(`[ClawRouter] Solana transaction simulation failed: ${parsed.debug}`);
|
|
5597
|
+
return JSON.stringify({
|
|
5598
|
+
error: {
|
|
5599
|
+
message: "Solana payment simulation failed. Retrying with a different model.",
|
|
5600
|
+
type: "transaction_simulation_failed",
|
|
5601
|
+
help: "This is usually temporary. If it persists, try: /model free"
|
|
5602
|
+
}
|
|
5603
|
+
});
|
|
5604
|
+
}
|
|
5605
|
+
if (debugLower.includes("invalid signature") || debugLower.includes("invalid_signature")) {
|
|
5606
|
+
return JSON.stringify({
|
|
5607
|
+
error: {
|
|
5608
|
+
message: "Solana payment signature invalid.",
|
|
5609
|
+
type: "invalid_payload",
|
|
5610
|
+
help: "Try again. If this persists, reinstall ClawRouter: curl -fsSL https://blockrun.ai/ClawRouter-update | bash"
|
|
5611
|
+
}
|
|
5612
|
+
});
|
|
5613
|
+
}
|
|
5614
|
+
if (debugLower.includes("expired")) {
|
|
5615
|
+
return JSON.stringify({
|
|
5616
|
+
error: {
|
|
5617
|
+
message: "Solana payment expired. Retrying.",
|
|
5618
|
+
type: "expired",
|
|
5619
|
+
help: "This is usually temporary."
|
|
5620
|
+
}
|
|
5621
|
+
});
|
|
5622
|
+
}
|
|
5623
|
+
console.error(`[ClawRouter] Solana payment verification failed: ${parsed.debug} payer=${wallet}`);
|
|
5624
|
+
return JSON.stringify({
|
|
5625
|
+
error: {
|
|
5626
|
+
message: `Solana payment verification failed: ${parsed.debug}`,
|
|
5627
|
+
type: "payment_invalid",
|
|
5628
|
+
wallet,
|
|
5629
|
+
help: "Try again or switch to Base: /wallet base"
|
|
5630
|
+
}
|
|
5631
|
+
});
|
|
5632
|
+
}
|
|
5581
5633
|
if (parsed.error === "Settlement failed" || parsed.error === "Payment settlement failed" || parsed.details?.includes("Settlement failed") || parsed.details?.includes("transaction_simulation_failed")) {
|
|
5582
5634
|
const details = parsed.details || "";
|
|
5583
5635
|
const gasError = details.includes("unable to estimate gas");
|