@t2000/engine 1.22.0 → 1.22.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @t2000/engine
2
2
 
3
- Agent engine for conversational finance — implements **Audric Intelligence** (the moat behind the Audric consumer product). Five systems work together: Agent Harness (34 tools — 23 read, 11 write), Reasoning Engine (14 guards across 3 priority tiers + 6 YAML skill recipes), Silent Profile, Chain Memory, and AdviceLog. Every action it triggers waits on Audric Passport's tap-to-confirm.
3
+ Agent engine for conversational finance — implements **Audric Intelligence** (the moat behind the Audric consumer product). Five systems work together: Agent Harness (35 tools — 24 read, 11 write), Reasoning Engine (14 guards across 3 priority tiers + 6 YAML skill recipes), Silent Profile, Chain Memory, and AdviceLog. Every action it triggers waits on Audric Passport's tap-to-confirm.
4
4
 
5
5
  QueryEngine orchestrates LLM conversations, financial tools, user confirmations, and MCP integrations into a single async-generator loop.
6
6
 
@@ -35,11 +35,11 @@ for await (const event of engine.submitMessage('What is my balance?')) {
35
35
 
36
36
  ## Audric Intelligence — the 5 systems
37
37
 
38
- > _Not a chatbot. A financial agent._ Five systems work together to **understand** the user's money, **reason** about decisions, **act** through 34 financial tools in one conversation, **remember** what they did on-chain, and **remember what it told them**. Every action still waits on Audric Passport's tap-to-confirm.
38
+ > _Not a chatbot. A financial agent._ Five systems work together to **understand** the user's money, **reason** about decisions, **act** through 35 financial tools in one conversation, **remember** what they did on-chain, and **remember what it told them**. Every action still waits on Audric Passport's tap-to-confirm.
39
39
 
40
40
  | System | One-line | Owns | Lives in |
41
41
  |---|---|---|---|
42
- | 🎛️ **Agent Harness** | 34 tools, one agent. | Tool registry, parallel reads, serial writes, permission gates, streaming dispatch | `engine.ts`, `tool.ts`, `orchestration.ts`, `tools/*` |
42
+ | 🎛️ **Agent Harness** | 35 tools, one agent. | Tool registry, parallel reads, serial writes, permission gates, streaming dispatch | `engine.ts`, `tool.ts`, `orchestration.ts`, `tools/*` |
43
43
  | ⚡ **Reasoning Engine** | Thinks before it acts. | Adaptive thinking effort, 14 guards (12 pre-exec + 2 post-exec), 6 YAML skill recipes, prompt caching, preflight validation | `classify-effort.ts`, `guards.ts`, `recipes/registry.ts`, `engine.ts` `cache_control` |
44
44
  | 🧠 **Silent Profile** | Knows your finances. | Daily on-chain orientation snapshot + Claude-inferred profile, injected as `<financial_context>` block at every boot | _Audric-side_: `UserFinancialContext` + `UserFinancialProfile` Prisma models + `buildFinancialContextBlock()` |
45
45
  | 🔗 **Chain Memory** | Remembers what you do on-chain. | 7 classifiers extract `ChainFact` rows from on-chain history, hydrated as silent context | _Audric-side_: 7 classifier crons + `ChainFact` Prisma model + `buildMemoryContext()` |
@@ -161,7 +161,10 @@ QueryEngine.submitMessage()
161
161
  > `defillama_sui_protocols`. Added 1 — `token_prices` (BlockVision-backed). `balance_check`
162
162
  > and `portfolio_analysis` rewired to BlockVision Indexer REST API for sub-500ms portfolio
163
163
  > fetches. `protocol_deep_dive` retains its DefiLlama dependency (narrow scope, no
164
- > equivalent on BlockVision). Net: 23 reads + 11 writes = 34 tools.
164
+ > equivalent on BlockVision). Net post-v1.4: 23 reads + 11 writes = 34 tools.
165
+ >
166
+ > **SPEC 10 SuiNS reverse-lookup (May 2026):** Added 1 read tool — `resolve_suins`.
167
+ > Net post-SPEC-10: **24 reads + 11 writes = 35 tools** (current).
165
168
 
166
169
  ## Recent Upgrades — Spec 1 (Correctness) + Spec 2 (Intelligence)
167
170
 
package/dist/index.d.ts CHANGED
@@ -4203,7 +4203,7 @@ declare function fetchAudricHistory(address: string, opts: {
4203
4203
  limit?: number;
4204
4204
  }, env?: Record<string, string>, signal?: AbortSignal): Promise<AudricHistoryRecord[] | null>;
4205
4205
 
4206
- declare const DEFAULT_SYSTEM_PROMPT = "You are Audric \u2014 a financial agent on Sui. Audric is exactly five products: Audric Passport (the trust layer \u2014 Google sign-in, non-custodial wallet, tap-to-confirm consent, sponsored gas \u2014 wraps every other product), Audric Intelligence (you \u2014 the 5-system brain: Agent Harness with 34 tools, Reasoning Engine with 14 guards and 6 skill recipes, Silent Profile, Chain Memory, AdviceLog), Audric Finance (manage money on Sui \u2014 Save via NAVI lending at 3-8% APY USDC, Credit via NAVI borrowing with health factor, Swap via Cetus aggregator across 20+ DEXs at 0.1% fee, Charts for yield/health/portfolio viz), Audric Pay (move money \u2014 send USDC, receive via payment links / invoices / QR; free, global, instant on Sui), and Audric Store (creator marketplace, ships Phase 5 \u2014 say \"coming soon\" if asked). Save, swap, borrow, repay, withdraw, charts \u2192 Audric Finance. Send, receive, payment-link, invoice, QR \u2192 Audric Pay. Your silent context (profile, memory, chain facts, advice log) shapes your replies but never surfaces as a notification \u2014 you act only when the user asks, and every write waits on their tap-to-confirm via Passport. You can also call 41 paid APIs (music, image, research, translation, weather, fulfilment) via MPP micropayments using the pay_api tool \u2014 this is an internal capability, not a promoted product, so only mention it when the user asks for something that needs it.\n\n## Response rules\n- 1-2 sentences max. No bullet lists unless asked. No preambles.\n- Never say \"Would you like me to...\", \"Sure!\", \"Great question!\", \"Absolutely!\" \u2014 just do it or say you can't.\n- Present amounts as $1,234.56 and rates as X.XX% APY.\n- Show top 3 results unless asked for more. Summarize totals in one line.\n\n## Caption rules (after tool calls)\n- **When a canvas was rendered (`render_canvas` was called, or any tool that auto-renders a card like balance_check / portfolio_analysis / savings_info / health_check / transaction_history): the canvas IS the answer.** Your chat message must NOT restate wallet, savings, debt, holdings, or net-worth numbers \u2014 they are already on screen. Add at most ONE sentence of context, advice, or next step (e.g. \"Your USDC is idle \u2014 consider depositing for ~4.5% APY\"), or say nothing.\n- **When NO canvas was rendered:** lead with the result and quote the actual numbers from the tool. One sentence.\n- **NEVER describe a position as \"no\", \"none\", \"minimal\", \"zero\", or \"inactive\" if the tool result contains a positive value for that field.** The tool result is the source of truth \u2014 never your interior summary. If the canvas shows $100 in savings, you cannot say \"no active savings\" in the caption.\n- **NEVER claim \"no DeFi positions\" when the tool result says the DeFi slice is UNAVAILABLE.** When `balance_check` displayText contains \"DeFi positions: UNAVAILABLE\" or \"DeFi data source unreachable\", the slice is unknown \u2014 say \"DeFi data is currently unavailable\" or omit the mention. Only claim \"no DeFi positions\" when the displayText explicitly omits any DeFi line (i.e. the fetch succeeded with $0 across every covered protocol).\n\n## Execution rule\nOnly offer to execute actions you have tools for. If you retrieved a quote, data, or information but have no tool to act on it, give the user the result and tell them where to execute manually \u2014 in one sentence. Never say \"Would you like me to proceed?\" unless you have a tool that can actually proceed.\n\n## Before acting\n- ALWAYS call a read tool first before any write tool \u2014 balance_check before save/send/borrow, savings_info before withdraw.\n- Show real numbers from tools \u2014 never fabricate rates, amounts, or balances.\n- When user says \"all\" or an imprecise amount, call the read tool first to get the exact number.\n\n## Tool usage\n- Use tools proactively \u2014 don't refuse requests you can handle.\n- For real-world questions (weather, search, news, prices), use pay_api. Tell the user the cost first.\n- For NAVI lending APYs, use rates_info; for VOLO liquid staking stats, use volo_stats; for spot token prices, use token_prices.\n- For protocol-level due diligence (TVL, fees, audits, safety) on Sui DeFi protocols, use protocol_deep_dive with the slug.\n- Run multiple read-only tools in parallel when you need several data points.\n- If a tool errors, say what went wrong and what to try instead. One sentence.\n\n## Savings = USDC or USDsui (critical)\n- save_deposit and borrow accept ONLY USDC or USDsui. No other token can be deposited or borrowed.\n- USDC is the canonical default. USDsui is permitted because it has a productive NAVI pool (often a higher APY than USDC). All other holdings (GOLD, SUI, USDT, USDe, ETH, NAVX, WAL) are NOT saveable.\n- When asked \"how much can I save?\":\n - Report saveableUsdc from balance_check (the user's USDC wallet balance \u2014 canonical saveable).\n - If the user also holds USDsui in their wallet, report that separately as \"USDsui (saveable): X.XX\". Do NOT roll the two together \u2014 the LLM must keep the per-asset distinction so the user can pick.\n- When the user says \"save 10 USDC\" \u2192 call save_deposit with asset=\"USDC\". When they say \"save 10 USDsui\" \u2192 call with asset=\"USDsui\". Never silently substitute.\n- When the user says \"save 10\" (no asset) \u2192 call balance_check first and ask which stable they want, OR pick whichever they hold more of with a one-line explanation.\n- \"Best stable to save right now?\" \u2192 call rates_info to compare USDC vs USDsui APY on NAVI; let the user pick.\n- NEVER say a non-saveable token (GOLD, SUI, USDT, etc.) is \"in savings\" or \"earning APY in savings\". Wallet holdings \u2260 savings positions, even for stables we don't accept.\n- If user wants to save a non-saveable token, tell them to swap to USDC or USDsui first. Do NOT auto-chain swap + deposit.\n- Repay symmetry: a USDsui debt MUST be repaid with USDsui (and USDC debt with USDC). When calling repay_debt, pass asset=\"USDsui\" if the borrow is USDsui. If the user asks \"repay my debt\" and savings_info shows borrows in BOTH stables, list both and ask which to repay first. If the user holds the wrong stable, tell them to swap manually \u2014 do NOT auto-chain swap + repay.\n\n## Fees (critical \u2014 never deny having fees)\n- **Swap:** 0.1% Audric overlay fee on the output amount, taken by the aggregator and sent to the Audric treasury. The Cetus DEX fee (typically 0.01\u20130.25%) is separate and goes to the DEX. Both are shown on the swap card. Never say Audric takes no cut on swaps \u2014 it does.\n- **Save (deposit):** 0.1% Audric fee on the deposit amount, taken atomically in the same transaction.\n- **Borrow:** 0.05% Audric fee on the borrow amount, taken atomically in the same transaction.\n- **Withdraw / Repay / Send / Receive:** No Audric fee. Gas is sponsored (free to the user).\n- When a user asks about fees, quote the above. Do NOT say \"I don't take a cut\", \"fees are zero\", \"all your value stays with you\", or \"I'm here to execute, not extract\" \u2014 those are incorrect for swap, save, and borrow.\n\n## Multi-step flows\n- \"How much X for Y?\": swap_quote first, then swap_execute if user confirms.\n- \"Swap then save\": swap_execute \u2192 balance_check \u2192 save_deposit. Confirm each step.\n- \"Buy $X of token\": token_prices \u2192 calculate amount \u2192 swap_execute.\n- \"Best yield on SUI\": compare rates_info (NAVI lending) + volo_stats (vSUI liquid staking).\n- withdraw supports legacy positions: USDC, USDe, USDsui, SUI. Pass asset param to withdraw a specific token.\n- \"Deposit SUI to earn yield\": volo_stake for SUI liquid staking. save_deposit only accepts USDC or USDsui.\n- \"Is protocol X safe?\" / \"Tell me about NAVI\": protocol_deep_dive with the slug.\n- \"Full account report\" / \"account summary\" / \"give me everything\" / \"complete overview\": triggers the `account_report` recipe \u2014 when the recipe block appears, follow EVERY step including all six tool calls. Each step renders a distinct rich card; skipping a step means a missing card.\n\n## Safety\n- Never encourage risky financial behavior.\n- Warn when health factor < 1.5.\n- All amounts in USDC unless stated otherwise.\n\n## Proactive insights (only when there's a clear opportunity)\n- When you spot a financial insight worth surfacing \u2014 idle balance worth saving, health factor approaching the warning band, APY drift on a known position, progress against a saved goal \u2014 emit a `<proactive type=\"...\" subjectKey=\"...\">BODY</proactive>` block. ALWAYS use the wrapper \u2014 plain-text proactive prose without the wrapper renders as regular text and skips the engine's per-session cooldown (the same nudge will then re-fire every turn).\n- Two valid placements \u2014 pick whichever fits the turn:\n - **No user question** (or the question is unrelated to the insight): wrap your ENTIRE response in the `<proactive>` block.\n - **You're answering a user question AND have a related insight to add**: answer the question normally, then APPEND the `<proactive>` block at the end, separated by a line break. The \"after the answer\" form is also taught in detail under \u00A7 Proactive Awareness \u2014 same syntax, both placements valid.\n- The host renders the wrapped block with a distinct \"\u2726 ADDED BY AUDRIC\" lockup so the user knows this is your suggestion, not an answer.\n- Allowed types (closed list \u2014 anything else is dropped): `idle_balance` (cash sitting idle that could earn yield), `hf_warning` (debt position approaching liquidation), `apy_drift` (rate change on a position they hold), `goal_progress` (update on a saved goal).\n- `subjectKey` is a stable identifier for the SPECIFIC subject \u2014 examples: `USDC` or `USDsui` for an idle-balance insight on either NAVI-saveable stable, `1.45` for a HF warning at that level, `save-500-by-may` for goal progress. Same (type, subjectKey) won't fire twice in one session \u2014 pick the same key for the same subject so the engine cooldown works.\n- Cap: at most ONE proactive block per turn.\n- Skip proactive blocks when nothing notable changed since the last turn, when the user is mid-flow on something else, or when you'd just be restating the financial-context block. Quality over quantity \u2014 a block ignored is worse than no block.";
4206
+ declare const DEFAULT_SYSTEM_PROMPT: string;
4207
4207
 
4208
4208
  /** Cache entry shape. `cachedAt` is the wall-clock ms at write time. */
4209
4209
  interface NaviCacheEntry {
package/dist/index.js CHANGED
@@ -252,7 +252,7 @@ function isBundleableTool(name) {
252
252
  return TOOL_FLAGS[name]?.bundleable === true;
253
253
  }
254
254
 
255
- // src/navi-config.ts
255
+ // src/navi/config.ts
256
256
  var NAVI_SERVER_NAME = "navi";
257
257
  var NAVI_MCP_URL = "https://open-api.naviprotocol.io/api/mcp";
258
258
  var NAVI_MCP_CONFIG = {
@@ -521,7 +521,7 @@ async function fetchWalletCoins(address, rpcUrl) {
521
521
  });
522
522
  }
523
523
 
524
- // src/defi-cache.ts
524
+ // src/cache/defi.ts
525
525
  var InMemoryDefiCacheStore = class {
526
526
  store = /* @__PURE__ */ new Map();
527
527
  async get(address) {
@@ -557,7 +557,7 @@ function resetDefiCacheStore() {
557
557
  activeStore = new InMemoryDefiCacheStore();
558
558
  }
559
559
 
560
- // src/wallet-cache.ts
560
+ // src/cache/wallet.ts
561
561
  var InMemoryWalletCacheStore = class {
562
562
  store = /* @__PURE__ */ new Map();
563
563
  async get(address) {
@@ -1115,6 +1115,28 @@ var DEFI_PROTOCOLS = [
1115
1115
  "suistake",
1116
1116
  "walrus"
1117
1117
  ];
1118
+ var DEFI_PROTOCOL_CONCURRENCY = 3;
1119
+ async function mapWithConcurrency(items, fn, concurrency) {
1120
+ if (items.length === 0) return [];
1121
+ const results = new Array(items.length);
1122
+ let nextIdx = 0;
1123
+ async function worker() {
1124
+ while (true) {
1125
+ const myIdx = nextIdx;
1126
+ nextIdx += 1;
1127
+ if (myIdx >= items.length) return;
1128
+ try {
1129
+ const value = await fn(items[myIdx], myIdx);
1130
+ results[myIdx] = { status: "fulfilled", value };
1131
+ } catch (reason) {
1132
+ results[myIdx] = { status: "rejected", reason };
1133
+ }
1134
+ }
1135
+ }
1136
+ const workerCount = Math.max(1, Math.min(concurrency, items.length));
1137
+ await Promise.all(Array.from({ length: workerCount }, () => worker()));
1138
+ return results;
1139
+ }
1118
1140
  var SUI_TYPE_FULL = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
1119
1141
  var USDC_TYPE_FULL = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
1120
1142
  var BLUE_TYPE_FULL = "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE";
@@ -1189,8 +1211,10 @@ async function fetchAddressDefiPortfolio(address, apiKey, priceHints = {}, opts
1189
1211
  }
1190
1212
  const stickyBasis = recheck ?? cachedEntry;
1191
1213
  const fanoutAt = Date.now();
1192
- const settled = await Promise.allSettled(
1193
- DEFI_PROTOCOLS.map((p) => fetchOneDefiProtocol(address, p, apiKey, opts.retryStats))
1214
+ const settled = await mapWithConcurrency(
1215
+ DEFI_PROTOCOLS,
1216
+ (p) => fetchOneDefiProtocol(address, p, apiKey, opts.retryStats),
1217
+ DEFI_PROTOCOL_CONCURRENCY
1194
1218
  );
1195
1219
  const seen = /* @__PURE__ */ new Set();
1196
1220
  for (const s of settled) {
@@ -1668,7 +1692,7 @@ async function fetchAudricHistory(address, opts, env, signal) {
1668
1692
  }
1669
1693
  }
1670
1694
 
1671
- // src/sui-address.ts
1695
+ // src/sui/address.ts
1672
1696
  var SUI_MAINNET_URL2 = "https://fullnode.mainnet.sui.io:443";
1673
1697
  var SUI_ADDRESS_REGEX = /^0x[a-fA-F0-9]{1,64}$/i;
1674
1698
  var SUI_ADDRESS_STRICT_REGEX = /^0x[a-fA-F0-9]{64}$/i;
@@ -2113,7 +2137,7 @@ var balanceCheckTool = buildTool({
2113
2137
  }
2114
2138
  });
2115
2139
 
2116
- // src/navi-cache.ts
2140
+ // src/navi/cache.ts
2117
2141
  var InMemoryNaviCacheStore = class {
2118
2142
  store = /* @__PURE__ */ new Map();
2119
2143
  async get(key) {
@@ -2156,7 +2180,7 @@ var naviKey = {
2156
2180
  health: (address) => `navi:health:${address.toLowerCase()}`
2157
2181
  };
2158
2182
 
2159
- // src/navi-reads.ts
2183
+ // src/navi/reads.ts
2160
2184
  function sn(opts) {
2161
2185
  return opts?.serverName ?? NAVI_SERVER_NAME;
2162
2186
  }
@@ -5501,8 +5525,11 @@ function getModifiableFields(toolName) {
5501
5525
  return TOOL_MODIFIABLE_FIELDS[toolName];
5502
5526
  }
5503
5527
 
5504
- // src/prompt.ts
5505
- var DEFAULT_SYSTEM_PROMPT = `You are Audric \u2014 a financial agent on Sui. Audric is exactly five products: Audric Passport (the trust layer \u2014 Google sign-in, non-custodial wallet, tap-to-confirm consent, sponsored gas \u2014 wraps every other product), Audric Intelligence (you \u2014 the 5-system brain: Agent Harness with 34 tools, Reasoning Engine with 14 guards and 6 skill recipes, Silent Profile, Chain Memory, AdviceLog), Audric Finance (manage money on Sui \u2014 Save via NAVI lending at 3-8% APY USDC, Credit via NAVI borrowing with health factor, Swap via Cetus aggregator across 20+ DEXs at 0.1% fee, Charts for yield/health/portfolio viz), Audric Pay (move money \u2014 send USDC, receive via payment links / invoices / QR; free, global, instant on Sui), and Audric Store (creator marketplace, ships Phase 5 \u2014 say "coming soon" if asked). Save, swap, borrow, repay, withdraw, charts \u2192 Audric Finance. Send, receive, payment-link, invoice, QR \u2192 Audric Pay. Your silent context (profile, memory, chain facts, advice log) shapes your replies but never surfaces as a notification \u2014 you act only when the user asks, and every write waits on their tap-to-confirm via Passport. You can also call 41 paid APIs (music, image, research, translation, weather, fulfilment) via MPP micropayments using the pay_api tool \u2014 this is an internal capability, not a promoted product, so only mention it when the user asks for something that needs it.
5528
+ // src/prompt/index.ts
5529
+ var READ_COUNT = READ_TOOLS.length;
5530
+ var WRITE_COUNT = WRITE_TOOLS.length;
5531
+ var TOTAL_COUNT = READ_COUNT + WRITE_COUNT;
5532
+ var DEFAULT_SYSTEM_PROMPT = `You are Audric \u2014 a financial agent on Sui. Audric is exactly five products: Audric Passport (the trust layer \u2014 Google sign-in, non-custodial wallet, tap-to-confirm consent, sponsored gas \u2014 wraps every other product), Audric Intelligence (you \u2014 the 5-system brain: Agent Harness with ${TOTAL_COUNT} tools, Reasoning Engine with 14 guards and 6 skill recipes, Silent Profile, Chain Memory, AdviceLog), Audric Finance (manage money on Sui \u2014 Save via NAVI lending at 3-8% APY USDC, Credit via NAVI borrowing with health factor, Swap via Cetus aggregator across 20+ DEXs at 0.1% fee, Charts for yield/health/portfolio viz), Audric Pay (move money \u2014 send USDC, receive via payment links / invoices / QR; free, global, instant on Sui), and Audric Store (creator marketplace, ships Phase 5 \u2014 say "coming soon" if asked). Save, swap, borrow, repay, withdraw, charts \u2192 Audric Finance. Send, receive, payment-link, invoice, QR \u2192 Audric Pay. Your silent context (profile, memory, chain facts, advice log) shapes your replies but never surfaces as a notification \u2014 you act only when the user asks, and every write waits on their tap-to-confirm via Passport. You can also call 40+ paid APIs (music, image, research, translation, weather, fulfilment) via MPP micropayments using the pay_api tool \u2014 this is an internal capability, not a promoted product, so only mention it when the user asks for something that needs it.
5506
5533
 
5507
5534
  ## Response rules
5508
5535
  - 1-2 sentences max. No bullet lists unless asked. No preambles.
@@ -6739,7 +6766,7 @@ function safeNum(v) {
6739
6766
  return isNaN(n) ? 0 : n;
6740
6767
  }
6741
6768
 
6742
- // src/turn-read-cache.ts
6769
+ // src/cache/turn-read.ts
6743
6770
  var TurnReadCache = class {
6744
6771
  store = /* @__PURE__ */ new Map();
6745
6772
  /**
@@ -9171,7 +9198,7 @@ function parseEvalSummary(thinkingText) {
9171
9198
  };
9172
9199
  }
9173
9200
 
9174
- // src/prompt-cache.ts
9201
+ // src/prompt/cache.ts
9175
9202
  function buildCachedSystemPrompt(staticParts, dynamicPart) {
9176
9203
  const blocks = staticParts.map((text, i) => ({
9177
9204
  type: "text",
@@ -9222,10 +9249,9 @@ After completing the user's request, consider whether ONE additional piece of fi
9222
9249
  context is worth mentioning. ${brevityGuidance}
9223
9250
 
9224
9251
  \u2713 Mention if:
9225
- - Their savings goal is materially off-track (>20% behind pace)
9226
9252
  - Yield rate changed significantly since last session (>0.5%)
9227
9253
  - They have idle USDC or USDsui >$50 sitting for >48h (both are NAVI-saveable as of v0.51.0)
9228
- - An action they just took interacts with an active goal or debt position
9254
+ - An action they just took interacts with their debt position (e.g. health factor moved)
9229
9255
  - A pattern would materially benefit from their attention
9230
9256
 
9231
9257
  \u2717 Do NOT mention if:
@@ -9236,10 +9262,10 @@ context is worth mentioning. ${brevityGuidance}
9236
9262
 
9237
9263
  ${styleGuidance}
9238
9264
  Format: One sentence maximum, AFTER your main response, separated by a line break, WRAPPED in a \`<proactive type="..." subjectKey="...">BODY</proactive>\` block. The host renders the wrapped block with the "\u2726 ADDED BY AUDRIC" lockup styling \u2014 without the wrapper the host shows only plain text and the engine's per-session cooldown won't deduplicate future repeats (so the same nudge re-fires every turn).
9239
- Allowed types (closed list \u2014 anything else is dropped by the host): \`idle_balance\` (cash sitting idle that could earn yield), \`hf_warning\` (debt approaching liquidation), \`apy_drift\` (rate change on a position they hold), \`goal_progress\` (update on a saved goal).
9240
- \`subjectKey\` is a stable identifier for the SPECIFIC subject (e.g. "USDC" or "USDsui" for an idle-stable insight, "1.45" for HF at that level, "tokyo-trip" for a saved goal). Same (type, subjectKey) won't fire twice in one session \u2014 pick the same key for the same subject so cooldown works.
9241
- Example (post-answer suffix form): \`<proactive type="goal_progress" subjectKey="tokyo-trip">Your Tokyo goal is $80 behind pace.</proactive>\`
9242
- Frame as observation, not advice: "Your Tokyo goal is $80 behind pace." \u2014 not "You should deposit more."`;
9265
+ Allowed types (closed list \u2014 anything else is dropped by the host): \`idle_balance\` (cash sitting idle that could earn yield), \`hf_warning\` (debt approaching liquidation), \`apy_drift\` (rate change on a position they hold), \`goal_progress\` (update on an aspirational target the user mentioned in chat \u2014 e.g. "I want to save $500 by May").
9266
+ \`subjectKey\` is a stable identifier for the SPECIFIC subject (e.g. "USDC" or "USDsui" for an idle-stable insight, "1.45" for HF at that level, "save-500-by-may" for a chat-mentioned target). Same (type, subjectKey) won't fire twice in one session \u2014 pick the same key for the same subject so cooldown works.
9267
+ Example (post-answer suffix form): \`<proactive type="idle_balance" subjectKey="USDC">You have $120 USDC idle that could earn ~5% APY in NAVI.</proactive>\`
9268
+ Frame as observation, not advice: "You have $120 USDC idle." \u2014 not "You should deposit more."`;
9243
9269
  }
9244
9270
  function buildSelfEvaluationInstruction() {
9245
9271
  return `Self-evaluation (apply silently before composing your response):
@@ -9316,7 +9342,7 @@ function buildStateContext(state) {
9316
9342
  }
9317
9343
  }
9318
9344
 
9319
- // src/mcp.ts
9345
+ // src/mcp/index.ts
9320
9346
  function buildMcpTools(context, tools) {
9321
9347
  const engineTools = tools ?? getDefaultTools();
9322
9348
  return engineTools.map((tool) => ({