@blockrun/franklin 3.38.0 → 3.40.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/dist/tools/moa.js CHANGED
@@ -14,13 +14,13 @@ import { ModelClient } from '../agent/llm.js';
14
14
  // ─── Configuration ────────────────────────────────────────────────────────
15
15
  /** Reference models — diverse, cheap/free models for parallel queries. */
16
16
  const REFERENCE_MODELS = [
17
- 'nvidia/qwen3-next-80b-a3b-instruct', // Free, clean instruction-follower
18
- 'nvidia/mistral-nemotron', // Free, diverse family (maverick left the catalog 2026-07-14)
17
+ 'nvidia/nemotron-nano-9b-v2', // Free, serves itself on every path (qwen3-next EOL'd 2026-08-12)
18
+ 'nvidia/mistral-nemotron', // Free second voice (DEGRADED upstream; non-stream rides gateway fallback)
19
19
  'google/gemini-2.5-flash', // Fast, cheap
20
20
  'deepseek/deepseek-chat', // Cheap, good reasoning
21
21
  ];
22
22
  /** Aggregator model — free by default. Users explicitly pass `aggregator` to upgrade. */
23
- const AGGREGATOR_MODEL = 'nvidia/qwen3-next-80b-a3b-instruct';
23
+ const AGGREGATOR_MODEL = 'nvidia/nemotron-nano-9b-v2';
24
24
  /** Max tokens per reference response. */
25
25
  const REFERENCE_MAX_TOKENS = 4096;
26
26
  /** Max tokens for aggregator. */
@@ -14,8 +14,11 @@
14
14
  * Limitless+Opinion+Predict.Fun in one call
15
15
  * searchPolymarket $0.001 query Polymarket markets (event filter, sort)
16
16
  * searchKalshi $0.001 query Kalshi markets
17
- * crossPlatform $0.005 matching market pairs across Polymarket+Kalshi
18
- * (the arbitrage / consensus signal)
17
+ * crossPlatform SUNSET Predexon discontinued market matching
18
+ * 2026-07-20 (upstream 410; gateway de-registered
19
+ * it 2026-08-03). Kept as a zero-cost tombstone
20
+ * that steers callers to searchAll, whose
21
+ * canonical containers already span venues.
19
22
  * leaderboard $0.001 global Polymarket leaderboard — top wallets by P&L
20
23
  * walletProfile $0.005 full Polymarket wallet profile (single wallet)
21
24
  * or batch profiles (comma-separated wallets)
@@ -14,8 +14,11 @@
14
14
  * Limitless+Opinion+Predict.Fun in one call
15
15
  * searchPolymarket $0.001 query Polymarket markets (event filter, sort)
16
16
  * searchKalshi $0.001 query Kalshi markets
17
- * crossPlatform $0.005 matching market pairs across Polymarket+Kalshi
18
- * (the arbitrage / consensus signal)
17
+ * crossPlatform SUNSET Predexon discontinued market matching
18
+ * 2026-07-20 (upstream 410; gateway de-registered
19
+ * it 2026-08-03). Kept as a zero-cost tombstone
20
+ * that steers callers to searchAll, whose
21
+ * canonical containers already span venues.
19
22
  * leaderboard $0.001 global Polymarket leaderboard — top wallets by P&L
20
23
  * walletProfile $0.005 full Polymarket wallet profile (single wallet)
21
24
  * or batch profiles (comma-separated wallets)
@@ -48,7 +51,6 @@ const MAX_LIMIT = 50;
48
51
  // (success/latency) so panel health stays accurate.
49
52
  const PATH_PRICES = [
50
53
  { pattern: /\/v1\/pm\/markets\/search$/, usd: 0.005 },
51
- { pattern: /\/v1\/pm\/matching-markets/, usd: 0.005 },
52
54
  { pattern: /\/v1\/pm\/polymarket\/wallets\//, usd: 0.005 },
53
55
  { pattern: /\/v1\/pm\/polymarket\/wallet\//, usd: 0.005 },
54
56
  { pattern: /\/v1\/pm\/polymarket\/market\/[^/]+\/smart-money$/, usd: 0.005 },
@@ -321,7 +323,7 @@ async function execute(input, ctx) {
321
323
  const cappedLimit = Math.min(Math.max(1, limit ?? DEFAULT_LIMIT), MAX_LIMIT);
322
324
  if (!action) {
323
325
  return {
324
- output: 'Error: action is required (searchAll | searchPolymarket | searchKalshi | crossPlatform | leaderboard | walletProfile | walletPnl | walletPositions | smartActivity | smartMoney)',
326
+ output: 'Error: action is required (searchAll | searchPolymarket | searchKalshi | leaderboard | walletProfile | walletPnl | walletPositions | smartActivity | smartMoney)',
325
327
  isError: true,
326
328
  };
327
329
  }
@@ -883,46 +885,23 @@ async function execute(input, ctx) {
883
885
  return { output: frameUntrusted('Prediction-market data (untrusted)', lines.join('\n')) };
884
886
  }
885
887
  case 'crossPlatform': {
886
- const raw = await getWithPayment('/v1/pm/matching-markets/pairs', {
887
- limit: cappedLimit,
888
- }, ctx);
889
- const pairs = unwrapList(raw);
890
- if (pairs.length === 0) {
891
- return { output: 'No matched market pairs available right now.' };
892
- }
893
- const lines = [
894
- `## Cross-platform matched pairs — ${pairs.length}`,
895
- '_Polymarket ↔ Kalshi equivalent markets. Use these to compare implied probabilities across venues._',
896
- '',
897
- ];
898
- pairs.forEach((p, i) => {
899
- // Venues are nested UPPERCASE sub-objects in Predexon v2. pickString
900
- // walks the sub-object's name keys (title/slug/...), so passing the
901
- // whole `POLYMARKET` / `KALSHI` object resolves the title regardless
902
- // of which name-bearing key is populated. Flat legacy fields are
903
- // passed as fallbacks.
904
- const poly = p.POLYMARKET ?? undefined;
905
- const kalshi = p.KALSHI ?? undefined;
906
- const polyTitle = pickString(poly, p.polymarket_question) ?? '(untitled)';
907
- const kalshiTitle = pickString(kalshi, p.kalshi_title);
908
- const ticker = (kalshi && kalshi.market_ticker) || p.kalshi_ticker;
909
- const sim = p.similarity != null ? ` · similarity ${formatPct(p.similarity, 0)}` : '';
910
- lines.push(`${i + 1}. **Polymarket:** ${polyTitle}`);
911
- if (kalshi) {
912
- lines.push(` **Kalshi:** ${kalshiTitle ?? '(untitled)'}` +
913
- (ticker ? ` · ticker=\`${ticker}\`` : '') +
914
- sim);
915
- }
916
- else {
917
- lines.push(` _(no Kalshi match)_${sim}`);
918
- }
919
- });
920
- lines.push('', `_$0.005 paid via x402._`);
921
- return { output: frameUntrusted('Prediction-market data (untrusted)', lines.join('\n')) };
888
+ // Tombstone (no charge): Predexon sunset market matching 2026-07-20
889
+ // and the gateway de-registered /v1/pm/matching-markets{,/pairs} on
890
+ // 2026-08-03 — the upstream 410s. Old sessions / prompts may still
891
+ // ask for this action, so steer them instead of burning a paid call
892
+ // on a dead endpoint.
893
+ return {
894
+ output: 'crossPlatform was retired: Predexon discontinued cross-venue market ' +
895
+ 'matching on 2026-07-20 and the gateway removed the endpoint. To compare ' +
896
+ 'venues, use `searchAll` — its canonical market containers already span ' +
897
+ 'Polymarket+Kalshi+Limitless+Opinion+Predict.Fun — or run `searchPolymarket` ' +
898
+ 'and `searchKalshi` in parallel and compare implied probabilities.',
899
+ isError: true,
900
+ };
922
901
  }
923
902
  default:
924
903
  return {
925
- output: `Error: unknown action "${action}". Use: searchAll, searchPolymarket, searchKalshi, crossPlatform, leaderboard, walletProfile, walletPnl, walletPositions, smartActivity, smartMoney`,
904
+ output: `Error: unknown action "${action}". Use: searchAll, searchPolymarket, searchKalshi, leaderboard, walletProfile, walletPnl, walletPositions, smartActivity, smartMoney`,
926
905
  isError: true,
927
906
  };
928
907
  }
@@ -939,7 +918,6 @@ export const predictionMarketCapability = {
939
918
  '`searchAll` (search markets across Polymarket+Kalshi+Limitless+Opinion+Predict.Fun in one call — $0.005), ' +
940
919
  '`searchPolymarket` (Polymarket only, supports sort+status — $0.001), ' +
941
920
  '`searchKalshi` (Kalshi only, supports sort+status — $0.001), ' +
942
- '`crossPlatform` (matched market pairs across Polymarket+Kalshi for arbitrage / consensus — $0.005), ' +
943
921
  '`leaderboard` (global top wallets by P&L on Polymarket — $0.001), ' +
944
922
  '`walletProfile` (full Polymarket wallet profile — labels, scores, stats. Single address → /wallet/{addr}; comma-list → batch /wallets/profiles — $0.005), ' +
945
923
  '`walletPnl` (single Polymarket wallet P&L summary + time series — $0.005), ' +
@@ -962,7 +940,6 @@ export const predictionMarketCapability = {
962
940
  'searchAll',
963
941
  'searchPolymarket',
964
942
  'searchKalshi',
965
- 'crossPlatform',
966
943
  'leaderboard',
967
944
  'walletProfile',
968
945
  'walletPnl',
@@ -974,7 +951,7 @@ export const predictionMarketCapability = {
974
951
  },
975
952
  search: {
976
953
  type: 'string',
977
- description: 'Search query. Used by searchAll / searchPolymarket / searchKalshi / smartActivity. Optional for crossPlatform/leaderboard/walletProfile/walletPnl/walletPositions/smartMoney.',
954
+ description: 'Search query. Used by searchAll / searchPolymarket / searchKalshi / smartActivity. Optional for leaderboard/walletProfile/walletPnl/walletPositions/smartMoney.',
978
955
  },
979
956
  status: {
980
957
  type: 'string',
@@ -18,7 +18,7 @@ async function execute(input, ctx) {
18
18
  return { output: 'Error: prompt is required', isError: true };
19
19
  }
20
20
  // Resolve which model the sub-agent will actually run on
21
- const subModel = model || registeredParentModel || 'nvidia/qwen3-next-80b-a3b-instruct';
21
+ const subModel = model || registeredParentModel || 'nvidia/nemotron-nano-9b-v2';
22
22
  // Cost gate: if parent is free but sub-agent wants paid, ask user first.
23
23
  // Prevents silent charges when the agent decides to spawn a more capable sub-agent.
24
24
  if (isFreeModel(registeredParentModel) && !isFreeModel(subModel)) {
@@ -2,9 +2,10 @@
2
2
  * Video Generation capability — generate short MP4 videos via the BlockRun
3
3
  * /v1/videos/generations endpoint. Uses x402 payment (Base or Solana).
4
4
  *
5
- * Default model `xai/grok-imagine-video` returns an 8-second clip for ~$0.42.
6
- * Seedance 2.0 (bytedance/seedance-2.0 and -fast) runs longer — up to a few
7
- * minutes for a 10s clip.
5
+ * Default model `xai/grok-imagine-video` returns an 8-second clip for ~$0.42
6
+ * (480p at $0.05/s; the gateway added an official 720p tier at $0.07/s on
7
+ * 2026-08-12). Seedance (bytedance/seedance-2.0-mini through -2.5) runs
8
+ * longer — up to a few minutes for a 10s clip.
8
9
  *
9
10
  * Flow (async since blockrun@654cd35):
10
11
  * 1. POST /v1/videos/generations with signed x-payment header. The server
@@ -2,9 +2,10 @@
2
2
  * Video Generation capability — generate short MP4 videos via the BlockRun
3
3
  * /v1/videos/generations endpoint. Uses x402 payment (Base or Solana).
4
4
  *
5
- * Default model `xai/grok-imagine-video` returns an 8-second clip for ~$0.42.
6
- * Seedance 2.0 (bytedance/seedance-2.0 and -fast) runs longer — up to a few
7
- * minutes for a 10s clip.
5
+ * Default model `xai/grok-imagine-video` returns an 8-second clip for ~$0.42
6
+ * (480p at $0.05/s; the gateway added an official 720p tier at $0.07/s on
7
+ * 2026-08-12). Seedance (bytedance/seedance-2.0-mini through -2.5) runs
8
+ * longer — up to a few minutes for a 10s clip.
8
9
  *
9
10
  * Flow (async since blockrun@654cd35):
10
11
  * 1. POST /v1/videos/generations with signed x-payment header. The server
@@ -503,10 +504,13 @@ export function createVideoGenCapability(deps = {}) {
503
504
  output_path: { type: 'string', description: 'Where to save the MP4. Default: generated-<timestamp>.mp4 in working directory' },
504
505
  model: {
505
506
  type: 'string',
506
- description: 'Video model. Default: xai/grok-imagine-video. Known-valid models on the BlockRun gateway as of 2026-05: ' +
507
- 'xai/grok-imagine-video, bytedance/seedance-1.5-pro, bytedance/seedance-2.0, bytedance/seedance-2.0-fast. ' +
507
+ description: 'Video model. Default: xai/grok-imagine-video ($0.05/s). Known-valid models on the BlockRun gateway as of 2026-08: ' +
508
+ 'xai/grok-imagine-video, xai/grok-imagine-video-1.5 ($0.08/s), bytedance/seedance-1.5-pro ($0.070/s), bytedance/seedance-2.0-mini ($0.0797/s), ' +
509
+ 'bytedance/seedance-2.0-fast ($0.165/s), bytedance/seedance-2.0 ($0.227/s), bytedance/seedance-2.5 ($0.315/s), azure/sora-2 ($0.10/s). ' +
508
510
  'Pick from this list; the gateway rejects unknown names with HTTP 400 (no money charged on rejection). ' +
509
- 'Speak "Seedance Pro" → bytedance/seedance-2.0; speak "Seedance fast" → bytedance/seedance-2.0-fast.',
511
+ 'Speak "Seedance" → bytedance/seedance-2.5 (newest flagship); "Seedance Pro" → bytedance/seedance-2.0; ' +
512
+ '"Grok video" → xai/grok-imagine-video-1.5 (newer Grok clip model, $0.08/s vs $0.05/s); ' +
513
+ '"Seedance fast" → bytedance/seedance-2.0-fast; "Seedance mini" → bytedance/seedance-2.0-mini (cheapest).',
510
514
  },
511
515
  image_url: { type: 'string', description: 'Optional seed image (image-to-video). Accepts http(s) URL, data: URI, or local file path — local paths get inlined as base64 data URIs automatically.' },
512
516
  duration_seconds: { type: 'number', description: 'Duration billed for. Default depends on model (8s for grok-imagine-video).' },
@@ -41,7 +41,26 @@ export const MODEL_SHORTCUTS = {
41
41
  'gpt-5.6-sol': 'openai/gpt-5.6-sol',
42
42
  'gpt-5.6-terra': 'openai/gpt-5.6-terra',
43
43
  'gpt-5.6-luna': 'openai/gpt-5.6-luna',
44
+ // GPT-5.6 pro reasoning tier (gateway, 2026-08). Same base models with pro
45
+ // reasoning mode on: Sol Pro matches Sol at $5/$30, while Terra Pro ($1/$6)
46
+ // and Luna Pro ($0.1/$0.6) come in UNDER their own base tiers — so the pro
47
+ // ids are the better pick for anything reasoning-shaped. `gpt` stays pinned
48
+ // to Sol: bare aliases track the gateway's flagship, not the cheapest
49
+ // sibling.
50
+ 'gpt-5.6-sol-pro': 'openai/gpt-5.6-sol-pro',
51
+ 'sol-pro': 'openai/gpt-5.6-sol-pro',
52
+ 'gpt-5.6-terra-pro': 'openai/gpt-5.6-terra-pro',
53
+ 'terra-pro': 'openai/gpt-5.6-terra-pro',
54
+ 'gpt-5.6-luna-pro': 'openai/gpt-5.6-luna-pro',
55
+ 'luna-pro': 'openai/gpt-5.6-luna-pro',
44
56
  'gpt-5.5': 'openai/gpt-5.5',
57
+ 'gpt-5.5-pro': 'openai/gpt-5.5-pro',
58
+ // The rolling `chat-latest` alias — whatever ChatGPT currently serves as its
59
+ // default (GPT-5.5 Instant today), tuned for speed and concision. Priced
60
+ // like GPT-5.5 but capped at 128K context.
61
+ 'chat-latest': 'openai/chat-latest',
62
+ chatgpt: 'openai/chat-latest',
63
+ instant: 'openai/chat-latest',
45
64
  'gpt-5.4': 'openai/gpt-5.4',
46
65
  'gpt-5.4-pro': 'openai/gpt-5.4-pro',
47
66
  'gpt-5.4-mini': 'openai/gpt-5.4-mini',
@@ -50,19 +69,43 @@ export const MODEL_SHORTCUTS = {
50
69
  'gpt-5.2': 'openai/gpt-5.2',
51
70
  'gpt-5.2-pro': 'openai/gpt-5.2-pro',
52
71
  'gpt-4.1': 'openai/gpt-4.1',
72
+ 'gpt-4.1-mini': 'openai/gpt-4.1-mini',
73
+ 'gpt-4.1-nano': 'openai/gpt-4.1-nano',
74
+ '4o': 'openai/gpt-4o',
75
+ 'gpt-4o': 'openai/gpt-4o',
76
+ 'gpt-4o-mini': 'openai/gpt-4o-mini',
53
77
  codex: 'openai/gpt-5.3-codex',
54
78
  nano: 'openai/gpt-5-nano',
55
79
  mini: 'openai/gpt-5-mini',
56
80
  o3: 'openai/o3',
81
+ 'o3-mini': 'openai/o3-mini',
57
82
  o4: 'openai/o4-mini',
58
83
  'o4-mini': 'openai/o4-mini',
59
84
  o1: 'openai/o1',
60
85
  // Google
61
- gemini: 'google/gemini-2.5-pro',
86
+ // `gemini` follows the flagship Pro build (3.1 since 2026-08), matching the
87
+ // bare-alias-tracks-flagship rule `gpt`, `grok` and `glm` already use. 2.5
88
+ // Pro stays reachable as `gemini-2.5` — it is cheaper on input but a
89
+ // generation behind.
90
+ gemini: 'google/gemini-3.1-pro',
62
91
  'gemini-2.5': 'google/gemini-2.5-pro',
63
- flash: 'google/gemini-3.5-flash',
64
- 'gemini-flash': 'google/gemini-3.5-flash',
92
+ 'gemini-2.5-pro': 'google/gemini-2.5-pro',
93
+ // `flash` follows the newest Flash generation (3.6 since 2026-08). 3.5 stays
94
+ // reachable by its explicit id — it is dearer on output ($9 vs $7.5) with no
95
+ // capability edge, so nothing should be pinned to it deliberately.
96
+ flash: 'google/gemini-3.6-flash',
97
+ 'gemini-flash': 'google/gemini-3.6-flash',
98
+ 'gemini-3.6': 'google/gemini-3.6-flash',
99
+ 'gemini-3.6-flash': 'google/gemini-3.6-flash',
65
100
  'gemini-3.5-flash': 'google/gemini-3.5-flash',
101
+ 'gemini-2.5-flash': 'google/gemini-2.5-flash',
102
+ 'gemini-3-flash-preview': 'google/gemini-3-flash-preview',
103
+ // Flash Lite — thinking-mode Gemini for high-throughput work. `flash-lite`
104
+ // follows the newest (3.5); 3.1 is cheaper still and stays explicit.
105
+ 'flash-lite': 'google/gemini-3.5-flash-lite',
106
+ 'gemini-3.5-flash-lite': 'google/gemini-3.5-flash-lite',
107
+ 'gemini-3.1-flash-lite': 'google/gemini-3.1-flash-lite',
108
+ 'gemini-2.5-flash-lite': 'google/gemini-2.5-flash-lite',
66
109
  'gemini-3': 'google/gemini-3.1-pro',
67
110
  'gemini-3.1': 'google/gemini-3.1-pro',
68
111
  // xAI — grok-4.5 is the public flagship since 2026-07-14; `grok` follows it
@@ -89,46 +132,66 @@ export const MODEL_SHORTCUTS = {
89
132
  // The free nvidia/deepseek-v4-flash SKU was EOL'd by the gateway (410).
90
133
  // Point the deepseek-free aliases at the current free default so muscle
91
134
  // memory keeps working without handing back a dead id.
92
- 'deepseek-v4': 'nvidia/qwen3-next-80b-a3b-instruct',
93
- 'deepseek-v4-flash': 'nvidia/qwen3-next-80b-a3b-instruct',
94
- dsv4: 'nvidia/qwen3-next-80b-a3b-instruct',
95
- 'deepseek-v3.2': 'nvidia/qwen3-next-80b-a3b-instruct',
96
- 'deepseek-v3': 'nvidia/qwen3-next-80b-a3b-instruct',
97
- // Free (agent-tested BlockRun gateway free tier — refreshed 2026-07-11).
98
- // `free` follows the current free default (qwen3-next-instruct: cleanest
99
- // free instruction-follower). NOTE: every free alias resolves to a $0 nvidia
100
- // model — the free tier NEVER falls back to a paid model.
101
- free: 'nvidia/qwen3-next-80b-a3b-instruct',
102
- qwen: 'nvidia/qwen3-next-80b-a3b-instruct',
103
- qwen3: 'nvidia/qwen3-next-80b-a3b-instruct',
104
- 'qwen3-next': 'nvidia/qwen3-next-80b-a3b-instruct',
105
- 'qwen3.5': 'nvidia/qwen3.5-122b-a10b',
106
- glm4: 'nvidia/qwen3-next-80b-a3b-instruct',
107
- 'deepseek-free': 'nvidia/qwen3-next-80b-a3b-instruct',
108
- 'qwen-coder': 'nvidia/qwen3-next-80b-a3b-instruct',
109
- 'qwen-think': 'nvidia/qwen3-next-80b-a3b-instruct',
110
- 'gpt-oss': 'nvidia/qwen3-next-80b-a3b-instruct',
111
- 'gpt-oss-small': 'nvidia/qwen3-next-80b-a3b-instruct',
112
- 'mistral-small': 'nvidia/qwen3-next-80b-a3b-instruct',
135
+ 'deepseek-v4': 'nvidia/nemotron-nano-9b-v2',
136
+ 'deepseek-v4-flash': 'nvidia/nemotron-nano-9b-v2',
137
+ dsv4: 'nvidia/nemotron-nano-9b-v2',
138
+ 'deepseek-v3.2': 'nvidia/nemotron-nano-9b-v2',
139
+ 'deepseek-v3': 'nvidia/nemotron-nano-9b-v2',
140
+ // Free (agent-tested BlockRun gateway free tier — refreshed 2026-08-12 after
141
+ // qwen3-next-80b-a3b-instruct hit NVIDIA's EOL, 410). `free` follows the
142
+ // current free default (nemotron-nano-9b-v2: the one free model that
143
+ // verifiably serves itself on the streaming path — mistral-nemotron is
144
+ // DEGRADED upstream and 400s on stream). The qwen3-next / qwen3.5 aliases
145
+ // follow the retired-free-id pattern and resolve here too. NOTE: every free
146
+ // alias resolves to a $0 nvidia model — the free tier NEVER falls back to a
147
+ // paid model.
148
+ free: 'nvidia/nemotron-nano-9b-v2',
149
+ qwen: 'nvidia/nemotron-nano-9b-v2',
150
+ qwen3: 'nvidia/nemotron-nano-9b-v2',
151
+ 'qwen3-next': 'nvidia/nemotron-nano-9b-v2',
152
+ 'qwen3.5': 'nvidia/nemotron-nano-9b-v2',
153
+ glm4: 'nvidia/nemotron-nano-9b-v2',
154
+ 'deepseek-free': 'nvidia/nemotron-nano-9b-v2',
155
+ 'qwen-coder': 'nvidia/nemotron-nano-9b-v2',
156
+ 'qwen-think': 'nvidia/nemotron-nano-9b-v2',
157
+ 'gpt-oss': 'nvidia/nemotron-nano-9b-v2',
158
+ 'gpt-oss-small': 'nvidia/nemotron-nano-9b-v2',
159
+ 'mistral-small': 'nvidia/mistral-nemotron',
113
160
  'mistral-nemotron': 'nvidia/mistral-nemotron',
161
+ // Verified-self-serving free secondaries (2026-08-12): the nano line answers
162
+ // as itself on live probes, unlike the pooled 30B omni model.
163
+ 'nano-9b': 'nvidia/nemotron-nano-9b-v2',
164
+ 'nano-vl': 'nvidia/nemotron-nano-12b-v2-vl',
165
+ 'free-vision': 'nvidia/nemotron-nano-12b-v2-vl',
166
+ // Nemotron 3 Nano Omni started answering as ITSELF (re-probed 2026-08-19,
167
+ // stream and non-stream) — it was pooled behind gpt-oss-120b when it was
168
+ // last checked, which is why it had no alias until now. 31B/3.2B MoE,
169
+ // text + image + video + audio in, 256K context.
170
+ omni: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
171
+ 'free-omni': 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
172
+ 'nano-omni': 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
173
+ // Deliberately NOT aliased: nvidia/step-3.7-flash. It is in the catalog and
174
+ // billed at $0, but live probes (2026-08-19) come back served by
175
+ // nvidia/nemotron-3-super-120b — pointing users at it would promise a model
176
+ // they don't get. Same rule that retired the maverick and qwen3-next ids.
114
177
  // Maverick left the gateway catalog on/before 2026-07-14. The id still
115
178
  // answers, but only because the free pool silently substitutes another model
116
179
  // for it — so pointing users at it would be promising a model they don't get.
117
180
  // Follow the established retired-free-id pattern instead: resolve to the
118
181
  // current free default so muscle memory keeps working.
119
- llama: 'nvidia/qwen3-next-80b-a3b-instruct',
120
- 'llama-4': 'nvidia/qwen3-next-80b-a3b-instruct',
121
- 'llama-4-maverick': 'nvidia/qwen3-next-80b-a3b-instruct',
122
- maverick: 'nvidia/qwen3-next-80b-a3b-instruct',
182
+ llama: 'nvidia/nemotron-nano-9b-v2',
183
+ 'llama-4': 'nvidia/nemotron-nano-9b-v2',
184
+ 'llama-4-maverick': 'nvidia/nemotron-nano-9b-v2',
185
+ maverick: 'nvidia/nemotron-nano-9b-v2',
123
186
  // Backward-compatibility aliases for models the gateway retired or exposes
124
187
  // unreliably on /v1/messages. Map to agent-tested free models so shortcuts
125
188
  // keep working without silent paid fallback or empty tool-use turns.
126
189
  // Map to the closest current free model so old session records + user
127
190
  // muscle memory keep working.
128
- // `nemotron` now resolves to the real Mistral Nemotron (in-catalog, and one
129
- // of the few free ids that verifiably serves itself) rather than to Maverick.
191
+ // `nemotron` resolves to the real Mistral Nemotron (in-catalog; currently
192
+ // DEGRADED upstream, non-stream calls ride a disclosed gateway fallback).
130
193
  nemotron: 'nvidia/mistral-nemotron',
131
- devstral: 'nvidia/qwen3-next-80b-a3b-instruct',
194
+ devstral: 'nvidia/nemotron-nano-9b-v2',
132
195
  // Others
133
196
  minimax: 'minimax/minimax-m3',
134
197
  'm3': 'minimax/minimax-m3',
@@ -138,14 +201,38 @@ export const MODEL_SHORTCUTS = {
138
201
  'qwen-max': 'qwen/qwen3.7-max',
139
202
  'qwen3.7-max': 'qwen/qwen3.7-max',
140
203
  'qwen-3.7-max': 'qwen/qwen3.7-max',
204
+ // Plus and Flash round out the paid Qwen line — both 1M context with
205
+ // reasoning. Flash at $0.03/$0.13 is the cheapest paid model on the gateway.
206
+ 'qwen-plus': 'qwen/qwen3.7-plus',
207
+ 'qwen3.7-plus': 'qwen/qwen3.7-plus',
208
+ 'qwen-flash': 'qwen/qwen3.7-flash',
209
+ 'qwen3.7-flash': 'qwen/qwen3.7-flash',
210
+ // GLM-5.3 (2026-08) is Z.AI's flagship — same $1.4/$4.4 as 5.2 with 1M
211
+ // context and always-on reasoning — but it ships on the BASE gateway ONLY
212
+ // (sol.blockrun.ai lists 92 of Base's 93 models, and 5.3 is the one it's
213
+ // missing; verified 2026-08-20).
214
+ //
215
+ // So `glm` deliberately does NOT follow the flagship here. A bare alias is
216
+ // what people type from muscle memory, and it has to resolve on BOTH chains
217
+ // — pointing it at a Base-only id would hand every Solana user an HTTP 400
218
+ // on `/model glm`. 5.2 is on both, identically priced, one generation back.
219
+ // Promote this line the day 5.3 lands on Solana.
141
220
  glm: 'zai/glm-5.2',
142
221
  'glm-5': 'zai/glm-5',
222
+ 'glm-5.3': 'zai/glm-5.3',
143
223
  'glm-5.2': 'zai/glm-5.2',
144
224
  // GLM-5.1 demoted to a back-compat pin 2026-06 (flagship is 5.2) — still
145
225
  // routes for anyone who wants the 200K-context build explicitly.
146
226
  'glm-5.1': 'zai/glm-5.1',
147
227
  'glm-turbo': 'zai/glm-5-turbo',
148
228
  'glm5': 'zai/glm-5.2',
229
+ // Tencent + Xiaomi joined the gateway in 2026-08 — cheap reasoning at long
230
+ // context, below the frontier tier.
231
+ hy3: 'tencent/hy3',
232
+ tencent: 'tencent/hy3',
233
+ mimo: 'xiaomi/mimo-v2.5-pro',
234
+ 'mimo-v2.5-pro': 'xiaomi/mimo-v2.5-pro',
235
+ xiaomi: 'xiaomi/mimo-v2.5-pro',
149
236
  kimi: 'moonshot/kimi-k3',
150
237
  k3: 'moonshot/kimi-k3',
151
238
  // The K2.x line was retired by the gateway (2026-07, replaced by K3).
@@ -213,6 +300,8 @@ const PROVIDER_ORDER = [
213
300
  'minimax',
214
301
  'qwen',
215
302
  'deepseek',
303
+ 'tencent',
304
+ 'xiaomi',
216
305
  'nvidia',
217
306
  ];
218
307
  const PROVIDER_LABELS = {
@@ -225,6 +314,8 @@ const PROVIDER_LABELS = {
225
314
  minimax: 'MiniMax',
226
315
  qwen: 'Qwen / Alibaba',
227
316
  deepseek: 'DeepSeek',
317
+ tencent: 'Tencent / Hunyuan',
318
+ xiaomi: 'Xiaomi / MiMo',
228
319
  nvidia: 'Free / NVIDIA',
229
320
  };
230
321
  /**
@@ -267,8 +358,10 @@ export const PICKER_CATEGORIES = [
267
358
  { id: 'anthropic/claude-sonnet-5', shortcut: 'sonnet', label: 'Claude Sonnet 5', price: '$3/$15' },
268
359
  { id: 'qwen/qwen3.7-max', shortcut: 'qwen-max', label: 'Qwen3.7 Max', price: '$1.475/$4.425', highlight: true },
269
360
  { id: 'openai/gpt-5.6-sol', shortcut: 'gpt', label: 'GPT-5.6 Sol', price: '$5/$30', highlight: true },
270
- { id: 'google/gemini-3.1-pro', shortcut: 'gemini-3', label: 'Gemini 3.1 Pro', price: '$2/$12' },
271
- { id: 'google/gemini-2.5-pro', shortcut: 'gemini', label: 'Gemini 2.5 Pro', price: '$1.25/$10' },
361
+ // Gemini 2.5 Pro's row retired here the same way Opus 4.8's did: a
362
+ // superseded sibling listed directly under its successor is choice
363
+ // paralysis, not choice. `gemini-2.5` still resolves to it.
364
+ { id: 'google/gemini-3.1-pro', shortcut: 'gemini', label: 'Gemini 3.1 Pro', price: '$2/$12' },
272
365
  { id: 'xai/grok-4.5', shortcut: 'grok', label: 'Grok 4.5', price: '$2.5/$9' },
273
366
  // Kimi K3 (2026-07): 2.8T open MoE, 1M context, multimodal + reasoning.
274
367
  // Replaced the budget K2.7 line — now premium-priced ($3/$15).
@@ -285,10 +378,14 @@ export const PICKER_CATEGORIES = [
285
378
  // on hard tasks at <1/10 the price.
286
379
  { id: 'deepseek/deepseek-v4-pro', shortcut: 'deepseek-v4-pro', label: 'DeepSeek V4 Pro', price: '$0.435/$0.87', highlight: true },
287
380
  { id: 'deepseek/deepseek-reasoner', shortcut: 'r1', label: 'DeepSeek V4 Flash R.', price: '$0.2/$0.4' },
288
- { id: 'xai/grok-4-1-fast-reasoning', shortcut: 'grok-fast', label: 'Grok 4.1 Fast R.', price: '$0.2/$0.5' },
289
- // GLM-5.2: Z.AI's new flagship — 1M context, top open-source on
381
+ // Terra Pro took the row grok-4-1-fast-reasoning used to hold: the xAI
382
+ // fast family is hidden from /v1/models, so reconcilePicker dropped that
383
+ // row on every live render anyway (`grok-fast` still resolves). Terra
384
+ // Pro is GPT-5.6 Terra with pro reasoning on, at HALF Terra's price.
385
+ { id: 'openai/gpt-5.6-terra-pro', shortcut: 'terra-pro', label: 'GPT-5.6 Terra Pro', price: '$1/$6', highlight: true },
386
+ // GLM-5.3: Z.AI's flagship — 1M context, always-on reasoning, strong on
290
387
  // long-horizon coding. `glm`/`glm5` shortcuts pin it.
291
- { id: 'zai/glm-5.2', shortcut: 'glm', label: 'GLM-5.2', price: '$1.4/$4.4' },
388
+ { id: 'zai/glm-5.3', shortcut: 'glm-5.3', label: 'GLM-5.3', price: '$1.4/$4.4' },
292
389
  ],
293
390
  },
294
391
  {
@@ -296,13 +393,16 @@ export const PICKER_CATEGORIES = [
296
393
  models: [
297
394
  { id: 'anthropic/claude-haiku-4.5', shortcut: 'haiku', label: 'Claude Haiku 4.5', price: '$1/$5' },
298
395
  { id: 'openai/gpt-5-mini', shortcut: 'mini', label: 'GPT-5 Mini', price: '$0.25/$2' },
299
- { id: 'google/gemini-2.5-flash', shortcut: 'flash', label: 'Gemini 2.5 Flash', price: '$0.3/$2.5' },
396
+ // `flash` now follows Gemini 3.6; this row keeps the cheap 2.5 build and
397
+ // labels itself with the explicit shortcut so the two can't drift apart.
398
+ { id: 'google/gemini-2.5-flash', shortcut: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', price: '$0.3/$2.5' },
300
399
  // Re-aliased to V4 Flash Chat upstream — context 1M, price 30% lower.
301
- { id: 'deepseek/deepseek-chat', shortcut: 'deepseek', label: 'DeepSeek V4 Flash Chat', price: '$0.2/$0.4' },
302
- // GLM flat-rate promos fully ended 2026-06-06 — whole family per-token
303
- // now (glm-5 $0.60/$1.92; `glm` shortcut pins flagship glm-5.2, listed
304
- // in Reasoning above).
305
- { id: 'zai/glm-5', shortcut: 'glm-5', label: 'GLM-5', price: '$0.6/$1.92' },
400
+ { id: 'deepseek/deepseek-chat', shortcut: 'deepseek', label: 'DeepSeek V4 Flash Chat', price: '$0.14/$0.28' },
401
+ // Cheapest paid model on the gateway, and it still carries 1M context
402
+ // with reasoning — the budget slot GLM-5 used to hold (its flat-rate
403
+ // promo ended 2026-06-06 and it now lists at $1/$3.2, no longer a budget
404
+ // number; the `glm-5` shortcut stays live).
405
+ { id: 'qwen/qwen3.7-flash', shortcut: 'qwen-flash', label: 'Qwen3.7 Flash', price: '$0.03/$0.13', highlight: true },
306
406
  // Minimax M2.7 hidden to make room for V4 Pro in Reasoning + V4 Flash
307
407
  // (free) without exceeding the picker's 24-entry cap. Shortcut `minimax`
308
408
  // still resolves to it.
@@ -311,19 +411,24 @@ export const PICKER_CATEGORIES = [
311
411
  {
312
412
  category: '🆓 Free (no USDC needed)',
313
413
  models: [
314
- // Qwen3-Next 80B leads: it's what the `free` shortcut + free routing
315
- // profile resolve to. Mistral Nemotron is the diverse-family secondary,
316
- // promoted 2026-07-14 when nvidia/llama-4-maverick fell out of the
317
- // gateway catalog. Both are $0 — the free tier never falls back to paid.
414
+ // Nemotron Nano 9B leads: it's what the `free` shortcut + free routing
415
+ // profile resolve to, promoted 2026-08-12 when qwen3-next-80b-a3b-instruct
416
+ // hit NVIDIA's EOL (410). All rows are $0 — the free tier never falls
417
+ // back to paid.
318
418
  //
319
419
  // Caveat worth knowing before editing this list: the NVIDIA free pool
320
- // silently substitutes. Verified live 2026-07-14 — qwen3-next and
321
- // mistral-large-3-675b both came back served by
322
- // `nvidia/nemotron-3-super-120b-a12b-free`, so the free id you request
323
- // is not necessarily the one you get. mistral-nemotron was picked as the
324
- // secondary precisely because it does serve itself, consistently, and
325
- // answers without leaking reasoning prose.
326
- { id: 'nvidia/qwen3-next-80b-a3b-instruct', shortcut: 'free', label: 'Qwen3-Next 80B', price: 'FREE', highlight: true },
420
+ // silently substitutes or degrades, so every row here is re-probed
421
+ // before it ships. Re-probed 2026-08-19: the nano pair and the 30B omni
422
+ // model all answer as THEMSELVES on both the streaming and non-streaming
423
+ // paths (omni was pooled behind gpt-oss-120b in August and has since
424
+ // been fixed upstream — hence its new row). mistral-nemotron still
425
+ // comes back served by `nvidia/nemotron-3-super-120b`; it keeps its row
426
+ // and its `nemotron` alias but must never lead a chain. The catalog's
427
+ // fifth free id, nvidia/step-3.7-flash, is substituted the same way and
428
+ // is deliberately absent from both this list and MODEL_SHORTCUTS.
429
+ { id: 'nvidia/nemotron-nano-9b-v2', shortcut: 'free', label: 'Nemotron Nano 9B', price: 'FREE', highlight: true },
430
+ { id: 'nvidia/nemotron-nano-12b-v2-vl', shortcut: 'nano-vl', label: 'Nemotron Nano VL', price: 'FREE' },
431
+ { id: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning', shortcut: 'omni', label: 'Nemotron 3 Nano Omni', price: 'FREE' },
327
432
  { id: 'nvidia/mistral-nemotron', shortcut: 'nemotron', label: 'Mistral Nemotron', price: 'FREE' },
328
433
  ],
329
434
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/franklin",
3
- "version": "3.38.0",
3
+ "version": "3.40.0",
4
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": {
@@ -33,6 +33,7 @@
33
33
  "start": "node dist/index.js",
34
34
  "test": "npm run build && node --test --test-concurrency=4 --test-reporter=spec test/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",
35
35
  "test:e2e": "npm run build && node --test --test-reporter=spec test/e2e.mjs",
36
+ "e2e:polymarket:readonly": "npm run build && node scripts/polymarket-e2e-readonly.mjs",
36
37
  "test:free-models": "npm run build && node --test --test-reporter=spec test/free-model-matrix.mjs",
37
38
  "test:all": "npm run test && npm run test:e2e",
38
39
  "test:watch": "node --test --watch test/local.mjs test/skills.local.mjs test/exa.local.mjs test/audit-batch.local.mjs",
@@ -66,7 +67,8 @@
66
67
  "node": ">=20.19.0"
67
68
  },
68
69
  "dependencies": {
69
- "@blockrun/llm": "^3.5.2",
70
+ "@blockrun/llm": "^3.13.1",
71
+ "@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/6a790ebec60161825bbc8c4093fd221006b4e5fb",
70
72
  "@colbymchenry/codegraph": "^1.5.0",
71
73
  "@modelcontextprotocol/sdk": "^1.29.0",
72
74
  "@polymarket/builder-relayer-client": "^0.0.10",