@blockrun/franklin 3.43.0 → 3.44.0
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/README.md +95 -11
- package/dist/agent/intent-prefetch.js +4 -3
- package/dist/agent/llm.js +5 -0
- package/dist/agent/loop.js +7 -4
- package/dist/agent/secret-redact.js +11 -0
- package/dist/commands/balance.js +25 -1
- package/dist/commands/doctor.js +48 -2
- package/dist/commands/login.d.ts +14 -0
- package/dist/commands/login.js +97 -0
- package/dist/commands/models.js +3 -2
- package/dist/commands/plugin.js +3 -2
- package/dist/commands/predict.js +3 -2
- package/dist/commands/proxy.js +3 -2
- package/dist/commands/setup.js +15 -1
- package/dist/commands/slack.js +3 -2
- package/dist/commands/social.js +3 -2
- package/dist/commands/start.js +3 -2
- package/dist/commands/stats.js +18 -1
- package/dist/commands/telegram.js +3 -2
- package/dist/config.d.ts +5 -0
- package/dist/config.js +17 -0
- package/dist/gateway-models.js +9 -4
- package/dist/index.js +26 -3
- package/dist/onramp/client.js +3 -2
- package/dist/payments/auth-mode.d.ts +114 -0
- package/dist/payments/auth-mode.js +186 -0
- package/dist/payments/post-with-payment.d.ts +6 -0
- package/dist/payments/post-with-payment.js +40 -6
- package/dist/payments/price-catalog.d.ts +71 -0
- package/dist/payments/price-catalog.js +322 -0
- package/dist/phone/client.js +6 -2
- package/dist/pricing.js +3 -3
- package/dist/proxy/fallback.d.ts +1 -1
- package/dist/proxy/fallback.js +21 -2
- package/dist/proxy/server.js +38 -1
- package/dist/router/index.js +2 -1
- package/dist/serve/cloud-sync.d.ts +1 -0
- package/dist/serve/server.js +10 -3
- package/dist/stats/tracker.d.ts +15 -1
- package/dist/stats/tracker.js +14 -2
- package/dist/tools/blockrun.js +10 -3
- package/dist/tools/defillama.js +9 -3
- package/dist/tools/exa.js +22 -9
- package/dist/tools/imagegen.js +4 -2
- package/dist/tools/modal.js +4 -2
- package/dist/tools/musicgen.js +4 -2
- package/dist/tools/phone.js +4 -2
- package/dist/tools/prediction.js +15 -4
- package/dist/tools/realface.js +14 -8
- package/dist/tools/rpc.js +10 -3
- package/dist/tools/surf.js +12 -4
- package/dist/tools/videogen.js +4 -2
- package/dist/tools/voice.js +6 -4
- package/dist/tools/zerox-base.js +4 -2
- package/dist/tools/zerox-gasless.js +6 -4
- package/dist/trading/providers/blockrun/client.js +20 -7
- package/dist/ui/model-picker.js +1 -1
- package/package.json +8 -4
|
@@ -14,13 +14,25 @@
|
|
|
14
14
|
* together with the x402 signing wrapper.
|
|
15
15
|
*/
|
|
16
16
|
import { USER_AGENT, loadChain } from '../../../config.js';
|
|
17
|
+
import { gatewayHeaders, resolvePayMode } from '../../../payments/auth-mode.js';
|
|
17
18
|
import { recordFetch } from '../telemetry.js';
|
|
18
19
|
import { getOrCreateWallet, getOrCreateSolanaWallet, createPaymentPayload, createSolanaPaymentPayload, parsePaymentRequired, extractPaymentDetails, solanaKeyToBytes, SOLANA_NETWORK, } from '@blockrun/llm';
|
|
19
20
|
const TIMEOUT_MS = 10_000;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Absolute URL for a gateway path. Callers pass `/api/v1/...` because that is
|
|
23
|
+
* the shape the x402 hosts serve; the API-key host serves the same routes at
|
|
24
|
+
* `/v1/...`, so the `/api` segment is stripped in key mode.
|
|
25
|
+
*
|
|
26
|
+
* `loadChain()` dispatches on env / ~/.blockrun/payment-chain and is read every
|
|
27
|
+
* call so mid-session chain switches take effect without a restart. In key mode
|
|
28
|
+
* the chain is irrelevant — the credit balance is chainless.
|
|
29
|
+
*/
|
|
30
|
+
function gatewayUrl(path) {
|
|
31
|
+
const mode = resolvePayMode();
|
|
32
|
+
if (mode.kind === 'key')
|
|
33
|
+
return mode.apiBase + path.replace(/^\/api/, '');
|
|
34
|
+
const origin = loadChain() === 'solana' ? 'https://sol.blockrun.ai' : 'https://blockrun.ai';
|
|
35
|
+
return origin + path;
|
|
24
36
|
}
|
|
25
37
|
const cache = new Map();
|
|
26
38
|
export async function cached(key, ttlMs, fn) {
|
|
@@ -43,11 +55,11 @@ export function clearCache() {
|
|
|
43
55
|
export async function blockrunGet(path, opts = { endpoint: path }) {
|
|
44
56
|
const ctrl = new AbortController();
|
|
45
57
|
const timer = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
|
|
46
|
-
const url =
|
|
58
|
+
const url = gatewayUrl(path);
|
|
47
59
|
const startedAt = Date.now();
|
|
48
60
|
try {
|
|
49
61
|
const res = await fetch(url, {
|
|
50
|
-
headers: { 'User-Agent': USER_AGENT, Accept: 'application/json' },
|
|
62
|
+
headers: { ...gatewayHeaders(), 'User-Agent': USER_AGENT, Accept: 'application/json' },
|
|
51
63
|
signal: ctrl.signal,
|
|
52
64
|
});
|
|
53
65
|
const latencyMs = Date.now() - startedAt;
|
|
@@ -168,10 +180,11 @@ class PaymentSignError extends Error {
|
|
|
168
180
|
export async function blockrunGetPaid(path, opts) {
|
|
169
181
|
const ctrl = new AbortController();
|
|
170
182
|
const timer = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
|
|
171
|
-
const url =
|
|
183
|
+
const url = gatewayUrl(path);
|
|
172
184
|
const chain = loadChain();
|
|
173
185
|
const startedAt = Date.now();
|
|
174
186
|
const headers = {
|
|
187
|
+
...gatewayHeaders(),
|
|
175
188
|
'User-Agent': USER_AGENT,
|
|
176
189
|
Accept: 'application/json',
|
|
177
190
|
};
|
package/dist/ui/model-picker.js
CHANGED
|
@@ -366,7 +366,7 @@ export const PICKER_CATEGORIES = [
|
|
|
366
366
|
// superseded sibling listed directly under its successor is choice
|
|
367
367
|
// paralysis, not choice. `gemini-2.5` still resolves to it.
|
|
368
368
|
{ id: 'google/gemini-3.1-pro', shortcut: 'gemini', label: 'Gemini 3.1 Pro', price: '$2/$12' },
|
|
369
|
-
{ id: 'xai/grok-4.5', shortcut: 'grok', label: 'Grok 4.5', price: '$2
|
|
369
|
+
{ id: 'xai/grok-4.5', shortcut: 'grok', label: 'Grok 4.5', price: '$2/$6' },
|
|
370
370
|
// Kimi K3 (2026-07): 2.8T open MoE, 1M context, multimodal + reasoning.
|
|
371
371
|
// Replaced the budget K2.7 line — now premium-priced ($3/$15).
|
|
372
372
|
{ id: 'moonshot/kimi-k3', shortcut: 'kimi', label: 'Kimi K3', price: '$3/$15' },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/franklin",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Franklin Agent
|
|
3
|
+
"version": "3.44.0",
|
|
4
|
+
"description": "Franklin Agent — The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"desktop:package:win": "npm run dist:win --workspace @blockrun/franklin-desktop",
|
|
39
39
|
"dev": "tsc --watch",
|
|
40
40
|
"start": "node dist/index.js",
|
|
41
|
-
"test": "npm run build && node --test --test-concurrency=4 --test-reporter=spec test/local.mjs test/serve-security.local.mjs test/skills.local.mjs test/repair.mjs test/model-resolver.mjs test/exa.local.mjs test/audit-batch.local.mjs test/polymarket.local.mjs test/market.local.mjs test/hooks.local.mjs test/scheduler.local.mjs test/trade-plan.local.mjs test/goal.local.mjs test/memory.local.mjs test/agent-host.local.mjs test/reservation.local.mjs",
|
|
41
|
+
"test": "npm run build && node --test --test-concurrency=4 --test-reporter=spec test/local.mjs test/api-key.local.mjs test/serve-security.local.mjs test/skills.local.mjs test/repair.mjs test/model-resolver.mjs test/exa.local.mjs test/audit-batch.local.mjs test/polymarket.local.mjs test/market.local.mjs test/hooks.local.mjs test/scheduler.local.mjs test/trade-plan.local.mjs test/goal.local.mjs test/memory.local.mjs test/agent-host.local.mjs test/reservation.local.mjs",
|
|
42
42
|
"test:e2e": "npm run build && node --test --test-reporter=spec test/e2e.mjs",
|
|
43
43
|
"e2e:polymarket:readonly": "npm run build && node scripts/polymarket-e2e-readonly.mjs",
|
|
44
44
|
"test:free-models": "npm run build && node --test --test-reporter=spec test/free-model-matrix.mjs",
|
|
@@ -108,6 +108,10 @@
|
|
|
108
108
|
},
|
|
109
109
|
"overrides": {
|
|
110
110
|
"ws@>=8.0.0 <=8.20.1": "^8.21.1",
|
|
111
|
-
"@polymarket/builder-signing-sdk": "1.0.0"
|
|
111
|
+
"@polymarket/builder-signing-sdk": "1.0.0",
|
|
112
|
+
"@polymarket/builder-relayer-client": {
|
|
113
|
+
"axios": "^1.18.1"
|
|
114
|
+
},
|
|
115
|
+
"qs": "^6.16.0"
|
|
112
116
|
}
|
|
113
117
|
}
|