@blockrun/mcp 0.23.0 → 0.23.1
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.js +20 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -100,9 +100,10 @@ function getOrCreateWalletKey() {
|
|
|
100
100
|
const info = ensureEvmWallet();
|
|
101
101
|
return info.privateKey;
|
|
102
102
|
}
|
|
103
|
-
function buildSolanaClient() {
|
|
103
|
+
function buildSolanaClient(timeout) {
|
|
104
104
|
const privateKey = process.env.SOLANA_WALLET_KEY || loadSolanaWallet() || void 0;
|
|
105
|
-
|
|
105
|
+
const opts = { ...privateKey ? { privateKey } : {}, ...timeout ? { timeout } : {} };
|
|
106
|
+
return new SolanaLLMClient(Object.keys(opts).length ? opts : void 0);
|
|
106
107
|
}
|
|
107
108
|
function getClient() {
|
|
108
109
|
if (getChain() === "solana") {
|
|
@@ -117,6 +118,13 @@ function getClient() {
|
|
|
117
118
|
}
|
|
118
119
|
return _evmClient;
|
|
119
120
|
}
|
|
121
|
+
function buildClientWithTimeout(timeoutMs) {
|
|
122
|
+
if (getChain() === "solana") {
|
|
123
|
+
return buildSolanaClient(timeoutMs);
|
|
124
|
+
}
|
|
125
|
+
const privateKey = getOrCreateWalletKey();
|
|
126
|
+
return new LLMClient({ privateKey, timeout: timeoutMs });
|
|
127
|
+
}
|
|
120
128
|
function getAnthropicClient() {
|
|
121
129
|
if (!_anthropicClient) {
|
|
122
130
|
const privateKey = getOrCreateWalletKey();
|
|
@@ -2857,6 +2865,15 @@ import { z as z14 } from "zod";
|
|
|
2857
2865
|
function estimateModalCost(path5) {
|
|
2858
2866
|
return path5.includes("sandbox/create") ? 0.01 : 1e-3;
|
|
2859
2867
|
}
|
|
2868
|
+
var MODAL_DEFAULT_TIMEOUT_S = 300;
|
|
2869
|
+
var MODAL_MAX_TIMEOUT_S = 1800;
|
|
2870
|
+
var MODAL_SLACK_MS = 15e3;
|
|
2871
|
+
function modalTimeoutMs(body) {
|
|
2872
|
+
const raw = body && typeof body === "object" ? body.timeout : void 0;
|
|
2873
|
+
const requested = typeof raw === "number" && raw > 0 ? raw : MODAL_DEFAULT_TIMEOUT_S;
|
|
2874
|
+
const clamped = Math.min(Math.max(requested, MODAL_DEFAULT_TIMEOUT_S), MODAL_MAX_TIMEOUT_S);
|
|
2875
|
+
return clamped * 1e3 + MODAL_SLACK_MS;
|
|
2876
|
+
}
|
|
2860
2877
|
function registerModalTool(server, budget) {
|
|
2861
2878
|
server.registerTool(
|
|
2862
2879
|
"blockrun_modal",
|
|
@@ -2890,7 +2907,7 @@ Full action shapes + GPU type details in the \`modal\` skill.`,
|
|
|
2890
2907
|
isError: true
|
|
2891
2908
|
};
|
|
2892
2909
|
}
|
|
2893
|
-
const client =
|
|
2910
|
+
const client = buildClientWithTimeout(modalTimeoutMs(body));
|
|
2894
2911
|
const endpoint = `/v1/modal/${cleanPath}`;
|
|
2895
2912
|
const result = await client.requestWithPaymentRaw(endpoint, body ?? {});
|
|
2896
2913
|
recordSpending(budget, estimatedCost, agent_id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/mcp",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"mcpName": "io.github.BlockRunAI/blockrun-mcp",
|
|
5
5
|
"description": "BlockRun MCP Server - Give your AI agent web search, deep research, prediction markets, crypto data, X/Twitter intelligence. Paid via x402 micropayments.",
|
|
6
6
|
"type": "module",
|