@blockrun/franklin 3.15.73 → 3.15.74

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.
@@ -336,7 +336,7 @@ Your training data is frozen in the past. Live-world questions MUST be answered
336
336
 
337
337
  If you find yourself about to emit one of these, stop and call the tool instead. If you don't know which ticker the user means, call ExaSearch or AskUser — never deflect.
338
338
 
339
- **Prediction markets (PredictionMarket).** When the user asks about real-world odds — elections, "will X happen by year-end", "Polymarket on Y", "Kalshi market for Z", "what are the odds of recession" — use **PredictionMarket** instead of guessing. Eight actions, route by intent:
339
+ **Prediction markets (PredictionMarket).** When the user asks about real-world odds — elections, "will X happen by year-end", "Polymarket on Y", "Kalshi market for Z", "what are the odds of recession" — use **PredictionMarket** instead of guessing. Ten actions, route by intent:
340
340
  - "is there a market on X anywhere?" / unknown which platform → \`searchAll\` (\$0.005) — single call across Polymarket+Kalshi+Limitless+Opinion+Predict.Fun.
341
341
  - "what are the odds on Polymarket / Kalshi specifically" → \`searchPolymarket\` (\$0.001) and \`searchKalshi\` (\$0.001) **in parallel**; comparing implied probability across the two venues is the high-value answer.
342
342
  - "where do Polymarket and Kalshi disagree / arbitrage" → \`crossPlatform\` (\$0.005) returns pre-matched pairs.
@@ -102,7 +102,7 @@ async function getWithPayment(path, query, ctx) {
102
102
  const errText = await response.text().catch(() => '');
103
103
  // Surface failed paid calls in the Markets-tab health summary.
104
104
  recordFetch({ provider: 'blockrun', endpoint: path, ok: false, latencyMs: Date.now() - startedAt });
105
- throw new Error(`PredictionMarket ${path} failed (${response.status}): ${errText.slice(0, 200)}`);
105
+ throw new Error(`PredictionMarket ${path} failed (${response.status}): ${errText.slice(0, 600)}`);
106
106
  }
107
107
  recordFetch({
108
108
  provider: 'blockrun',
@@ -230,7 +230,7 @@ function parseWalletsInput(value) {
230
230
  .filter(Boolean);
231
231
  }
232
232
  async function execute(input, ctx) {
233
- const { action, search, status, sort, limit, conditionId, wallets } = input;
233
+ const { action, search, status, sort, limit, conditionId, wallets, granularity } = input;
234
234
  const cappedLimit = Math.min(Math.max(1, limit ?? DEFAULT_LIMIT), MAX_LIMIT);
235
235
  if (!action) {
236
236
  return {
@@ -244,8 +244,12 @@ async function execute(input, ctx) {
244
244
  // One $0.005 call across 5 platforms — Polymarket, Kalshi, Limitless,
245
245
  // Opinion, Predict.Fun. The right entry point for "is there a market
246
246
  // on X anywhere?" — beats firing per-platform searches in parallel.
247
+ // Predexon expects `q` for the search term — verified 2026-05-06 from
248
+ // a live 422: {"detail":[{"type":"missing","loc":["query","q"]}]}.
249
+ // Public input field stays `search` for ergonomic consistency with
250
+ // searchPolymarket / searchKalshi; rename on the wire.
247
251
  const raw = await getWithPayment('/v1/pm/markets/search', {
248
- search,
252
+ q: search,
249
253
  status,
250
254
  sort,
251
255
  limit: cappedLimit,
@@ -431,7 +435,10 @@ async function execute(input, ctx) {
431
435
  };
432
436
  }
433
437
  const wallet = parsedWallets[0];
434
- const raw = await getWithPayment(`/v1/pm/polymarket/wallet/pnl/${encodeURIComponent(wallet)}`, {}, ctx);
438
+ // Predexon requires `granularity` from the enum {day, week, month,
439
+ // year, all} — verified 2026-05-06 in two live 422 turns. Default
440
+ // `day`; agent can override via input field for longer aggregations.
441
+ const raw = await getWithPayment(`/v1/pm/polymarket/wallet/pnl/${encodeURIComponent(wallet)}`, { granularity: granularity ?? 'day' }, ctx);
435
442
  if (!raw || typeof raw !== 'object') {
436
443
  return { output: `No P&L data returned for ${wallet}` };
437
444
  }
@@ -756,6 +763,11 @@ export const predictionMarketCapability = {
756
763
  type: 'string',
757
764
  description: 'For smartMoney: Polymarket condition_id from searchPolymarket or smartActivity.',
758
765
  },
766
+ granularity: {
767
+ type: 'string',
768
+ enum: ['day', 'week', 'month', 'year', 'all'],
769
+ description: 'For walletPnl: time bucket for the P&L series. Default day.',
770
+ },
759
771
  },
760
772
  required: ['action'],
761
773
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/franklin",
3
- "version": "3.15.73",
3
+ "version": "3.15.74",
4
4
  "description": "Franklin — 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": {