@t2000/engine 1.7.0 → 1.8.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/index.d.ts CHANGED
@@ -94,6 +94,19 @@ interface RecipeStep {
94
94
  on_error?: RecipeStepOnError;
95
95
  input_template?: Record<string, string>;
96
96
  cost_per_unit?: string;
97
+ /**
98
+ * [SPEC 7 P2.5 Layer 4] When true, this step is part of a multi-write
99
+ * Payment Stream bundle group. Steps with `bundle: true` MUST resolve
100
+ * to confirm-tier write tools that carry `bundleable: true` in
101
+ * `TOOL_FLAGS` (validated at recipe load time). The loader fails fast
102
+ * on auto-tier writes / read-only tools / non-bundleable confirm tools
103
+ * (`pay_api`, `save_contact`) inside a `bundle: true` group.
104
+ *
105
+ * The engine emits parallel `tool_use` blocks for `bundle: true`
106
+ * steps in the same turn; the permission gate (Layer 2) collapses
107
+ * them into a single bundled `pending_action`.
108
+ */
109
+ bundle?: boolean;
97
110
  }
98
111
  interface Recipe {
99
112
  name: string;
@@ -889,6 +902,27 @@ interface PendingActionModifiableField {
889
902
  /** Optional asset symbol (e.g. "USDC", "SUI", "vSUI") for amount fields. */
890
903
  asset?: string;
891
904
  }
905
+ /**
906
+ * [SPEC 7 v0.4 Layer 2] One step inside a multi-write Payment Stream
907
+ * `PendingAction`. Single-write actions never carry `steps[]`; the
908
+ * legacy `toolName`/`toolUseId`/`input`/`attemptId` fields cover them.
909
+ */
910
+ interface PendingActionStep {
911
+ toolName: string;
912
+ toolUseId: string;
913
+ /**
914
+ * Per-step UUID v4 stamped at emit time. Hosts write one
915
+ * `TurnMetrics` row per step keyed on this id; the resume route's
916
+ * `updateMany({ where: { attemptId } })` extends trivially to the
917
+ * per-step shape (loop `stepResults`, update each row).
918
+ */
919
+ attemptId: string;
920
+ input: unknown;
921
+ /** Per-step user-facing summary (rendered in the PermissionCard). */
922
+ description: string;
923
+ /** Optional modifiable fields for THIS step (rare in v1; sourced from `tool-modifiable-fields.ts`). */
924
+ modifiableFields?: PendingActionModifiableField[];
925
+ }
892
926
  /**
893
927
  * Serializable description of a write tool that needs user approval.
894
928
  * Stored in the session so the client can act on it in a separate request.
@@ -935,17 +969,88 @@ interface PendingAction {
935
969
  * matching the pair, which is exactly the false-resolution bug Item 3
936
970
  * exists to kill. Also survives session persistence so the resume call
937
971
  * can read it back from the rehydrated `PendingAction`.
972
+ *
973
+ * **Bundles:** when `steps !== undefined` (multi-write Payment Stream),
974
+ * the top-level `attemptId` mirrors `steps[0].attemptId` per SPEC 7
975
+ * § Layer 2 line 463 ("`steps[0]` mirrors the top-level
976
+ * toolName/toolUseId/input/attemptId for hosts that haven't been
977
+ * updated"). Pre-bundle hosts that key TurnMetrics rows on top-level
978
+ * `attemptId` collide cleanly with the bundle-aware host's step-0 row.
979
+ * Bundle-aware hosts iterate `steps[]` and write N TurnMetrics rows
980
+ * (one per step `attemptId`); the resume route's
981
+ * `updateMany({ where: { attemptId } })` keys still work because the
982
+ * route loops `stepResults` and updates each per-step row.
938
983
  */
939
984
  attemptId: string;
985
+ /**
986
+ * [SPEC 7 v0.4 Layer 2] When set, this `pending_action` represents a
987
+ * multi-write Payment Stream. Single-step bundles are NOT created — the
988
+ * engine emits the legacy single-write shape when N=1. Hosts that haven't
989
+ * been updated read `toolName`/`toolUseId`/`input` (which mirror
990
+ * `steps[0]`); newer hosts iterate `steps`.
991
+ *
992
+ * Bundleable tools (v1): `save_deposit`, `withdraw`, `borrow`,
993
+ * `repay_debt`, `send_transfer`, `swap_execute`, `claim_rewards`,
994
+ * `volo_stake`, `volo_unstake`. Non-bundleable: `pay_api`
995
+ * (HTTPS coupling), `save_contact` (Postgres only).
996
+ */
997
+ steps?: PendingActionStep[];
998
+ /**
999
+ * [SPEC 7 v0.3 Quote-Refresh] Milliseconds since the upstream read tools
1000
+ * that fed this bundle's composition completed. Engine stamps at emit
1001
+ * time using `Date.now() - min(tool_result.timestamp)` across the listed
1002
+ * `regenerateInput.toolUseIds`. Host renders as a "QUOTE Ns OLD" badge in
1003
+ * the PermissionCard header. Only set on bundled `pending_action`s.
1004
+ */
1005
+ quoteAge?: number;
1006
+ /**
1007
+ * [SPEC 7 v0.3 Quote-Refresh] True when the bundle was composed from
1008
+ * re-runnable read tools (`swap_quote`, `rates_info`, `balance_check`,
1009
+ * `portfolio_analysis`). False when amounts came from user-provided
1010
+ * inputs that don't depend on upstream quotes. Single-write
1011
+ * `pending_action`s set this to `false` (regenerate is N≥2 only).
1012
+ */
1013
+ canRegenerate?: boolean;
1014
+ /**
1015
+ * [SPEC 7 v0.3 Quote-Refresh] Engine-internal payload listing which
1016
+ * upstream read `tool_use` ids to re-fire when the user taps REGENERATE.
1017
+ * Host echoes this back via `POST /api/engine/regenerate`; engine re-runs
1018
+ * each tool with the same input (no LLM call), rebuilds the bundle, and
1019
+ * emits a fresh `pending_action` with new per-step `attemptId`s.
1020
+ */
1021
+ regenerateInput?: {
1022
+ toolUseIds: string[];
1023
+ };
940
1024
  }
941
1025
  /**
942
1026
  * Response from the client when resolving a pending action.
943
1027
  * - `approved: false` → tool is declined, LLM is told "user declined"
944
1028
  * - `approved: true` with `executionResult` → engine uses the client-provided result
1029
+ * (single-write path)
1030
+ * - `approved: true` with `stepResults` → engine pushes one `tool_result`
1031
+ * block per step into the conversation (bundle path)
945
1032
  */
946
1033
  interface PermissionResponse {
947
1034
  approved: boolean;
1035
+ /** Single-write (legacy) execution result. Ignored when `stepResults` is set. */
948
1036
  executionResult?: unknown;
1037
+ /**
1038
+ * [SPEC 7 v0.4 Layer 2] Per-step results for a bundle resume. One entry
1039
+ * per step in the original `PendingAction.steps`, in the same order.
1040
+ * Each carries the step's `toolUseId` + `attemptId` so the host's resume
1041
+ * route can update the matching `TurnMetrics` row.
1042
+ *
1043
+ * **Atomic semantics:** PTB execution is atomic at the Sui layer. If the
1044
+ * host detects a bundle-level failure, it should populate every entry
1045
+ * with `isError: true` carrying the same error message (so the LLM
1046
+ * narrates the failure once, not N times).
1047
+ */
1048
+ stepResults?: Array<{
1049
+ toolUseId: string;
1050
+ attemptId: string;
1051
+ result: unknown;
1052
+ isError: boolean;
1053
+ }>;
949
1054
  }
950
1055
  type PermissionLevel = 'auto' | 'confirm' | 'explicit';
951
1056
  interface ToolResult<T = unknown> {
@@ -1046,6 +1151,24 @@ interface ToolFlags {
1046
1151
  producesArtifact?: boolean;
1047
1152
  costAware?: boolean;
1048
1153
  maxRetries?: number;
1154
+ /**
1155
+ * [SPEC 7 v0.4 Layer 2] Opt-in: this write tool can participate in a
1156
+ * multi-write Payment Stream. When the LLM emits ≥2 `tool_use` blocks
1157
+ * in a single assistant turn AND every block resolves to a `confirm`-tier
1158
+ * write tool with `bundleable: true`, the engine collapses them into one
1159
+ * `pending_action` with `steps[]` instead of yielding N times. Default
1160
+ * `false` — silently opt-out. v1 set: `save_deposit`, `withdraw`,
1161
+ * `borrow`, `repay_debt`, `send_transfer`, `swap_execute`,
1162
+ * `claim_rewards`, `volo_stake`, `volo_unstake`.
1163
+ *
1164
+ * **Permanently non-bundleable:**
1165
+ * - `pay_api` — recipient/amount/currency aren't known at LLM intent
1166
+ * time (gateway 402 challenge resolves them at route time, after a
1167
+ * network round-trip the engine has no knowledge of). PTB cannot be
1168
+ * composed at compose time.
1169
+ * - `save_contact` — Postgres-only, no on-chain effect.
1170
+ */
1171
+ bundleable?: boolean;
1049
1172
  }
1050
1173
  type PreflightResult = {
1051
1174
  valid: true;
@@ -1466,6 +1589,49 @@ declare class QueryEngine {
1466
1589
  */
1467
1590
  declare function validateHistory(messages: Message[]): Message[];
1468
1591
 
1592
+ /**
1593
+ * SPEC 7 v0.3 Quote-Refresh ReviewCard — per-tool result freshness budgets.
1594
+ *
1595
+ * When a Payment Stream `pending_action` is composed at T=0 from upstream
1596
+ * read results, the user may take 30–60s to read + tap APPROVE. By that
1597
+ * time some upstream results have drifted (Cetus quotes refresh in
1598
+ * ~30s; NAVI APYs change slower). The host renders a "QUOTE Ns OLD"
1599
+ * badge and pulses the REGENERATE button when `quoteAge >
1600
+ * bundleShortestTtl(...)` so the user is nudged toward a fresh
1601
+ * composition. The TTL is a UX hint — it does NOT gate correctness.
1602
+ * The actual safety net is Sui's on-chain dry-run + `minOut` reverts.
1603
+ *
1604
+ * **Why per-tool, not per-bundle.** A bundle that depends on `swap_quote`
1605
+ * (30s drift) AND `rates_info` (90s drift) inherits the SHORTEST member
1606
+ * TTL — that's the freshness ceiling we can promise. Mixing in a
1607
+ * stable-floor read like `balance_check` (120s) doesn't loosen the
1608
+ * ceiling; the user still cares about the 30s quote going stale.
1609
+ *
1610
+ * **Where this lives.** Engine emits `quoteAge` + `regenerateInput` on
1611
+ * the bundled `pending_action`; the host imports `bundleShortestTtl` to
1612
+ * decide when the regenerate button auto-pulses. Adding a new
1613
+ * re-runnable read tool: append it to `TOOL_TTL_MS` here AND ensure the
1614
+ * bundle composer's contributing-reads detector picks it up.
1615
+ */
1616
+ declare const TOOL_TTL_MS: Record<string, number>;
1617
+ /** Default TTL for read tools not in `TOOL_TTL_MS` (60s — conservative). */
1618
+ declare const DEFAULT_TOOL_TTL_MS = 60000;
1619
+ /**
1620
+ * Resolve the shortest TTL among a set of tool_use_ids. Hosts call this
1621
+ * to decide when the regenerate button should auto-pulse.
1622
+ *
1623
+ * @param toolUseIds — the set of upstream read `tool_use` ids that fed
1624
+ * the bundle composition (what the engine stamps into
1625
+ * `PendingAction.regenerateInput.toolUseIds`).
1626
+ * @param toolNamesById — `tool_use_id` → `toolName` map, built by the
1627
+ * host from the same turn's tool_use blocks.
1628
+ * @returns The smallest TTL in milliseconds. Empty input returns
1629
+ * `DEFAULT_TOOL_TTL_MS`.
1630
+ */
1631
+ declare function bundleShortestTtl(toolUseIds: string[], toolNamesById: Record<string, string>): number;
1632
+ /** The set of read tools whose results re-fire on REGENERATE. */
1633
+ declare const REGENERATABLE_READ_TOOLS: ReadonlySet<string>;
1634
+
1469
1635
  interface BuildToolOptions<TInput, TOutput> {
1470
1636
  name: string;
1471
1637
  description: string;
@@ -1614,6 +1780,11 @@ declare class MemorySessionStore implements SessionStore {
1614
1780
  * producesArtifact — returns images, documents, generated content
1615
1781
  * costAware — has a monetary cost the user should know about
1616
1782
  * maxRetries — max calls with same input (default: unlimited for reads, 1 for writes)
1783
+ * bundleable — [SPEC 7 Layer 2] can participate in a multi-write Payment Stream
1784
+ * PTB. Set on every confirm-tier write whose on-chain effect is
1785
+ * fully expressible at compose time. Excluded: `pay_api` (recipient/
1786
+ * amount/currency unknown until gateway 402 challenge resolves at
1787
+ * route time) and `save_contact` (Postgres-only, no on-chain effect).
1617
1788
  */
1618
1789
  declare const TOOL_FLAGS: Record<string, ToolFlags>;
1619
1790
  /**
@@ -1625,6 +1796,18 @@ declare function applyToolFlags<T extends Tool>(tools: T[]): T[];
1625
1796
  * Get flags for a tool by name. Returns empty flags if not registered.
1626
1797
  */
1627
1798
  declare function getToolFlags(name: string): ToolFlags;
1799
+ /**
1800
+ * [SPEC 7 P2.5 Layer 4] True if this tool is in the v1 bundleable set.
1801
+ *
1802
+ * Used by the recipe loader's `bundle: true` validation — recipes that
1803
+ * declare `bundle: true` on a step MUST point to a tool that returns
1804
+ * `true` here. The set is the 9 confirm-tier write tools whose on-chain
1805
+ * effect is fully expressible at compose time:
1806
+ *
1807
+ * save_deposit, withdraw, borrow, repay_debt, send_transfer,
1808
+ * swap_execute, claim_rewards, volo_stake, volo_unstake.
1809
+ */
1810
+ declare function isBundleableTool(name: string): boolean;
1628
1811
 
1629
1812
  /**
1630
1813
  * Routes each turn to the appropriate thinking effort level based on
@@ -3338,4 +3521,4 @@ declare function getTelemetrySink(): TelemetrySink;
3338
3521
  /** Restore the default noop sink. Used by test teardowns. */
3339
3522
  declare function resetTelemetrySink(): void;
3340
3523
 
3341
- export { type AddressPortfolio, AnthropicProvider, type AnthropicProviderConfig, type AudricHistoryRecord, type AudricPortfolioResult, type AwaitOrFetchOpts, type BalancePrices, type BalanceResult, BalanceTracker, type BuildToolOptions, CANVAS_TEMPLATES, type CanvasTemplate, type ChatParams, type CompactOptions, type ContentBlock, ContextBudget, type ContextBudgetConfig, type ConversationState, type ConversationStateStore, type CostSnapshot, CostTracker, type CostTrackerConfig, DEFAULT_GUARD_CONFIG, DEFAULT_LEASE_SEC, DEFAULT_PERMISSION_CONFIG, DEFAULT_POLL_BUDGET_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SYSTEM_PROMPT, type DefiCacheEntry, type DefiCacheStore, type DefiProtocol, type DefiSummary, EFFORT_THINKING_BUDGET_CAPS, EarlyToolDispatcher, type EngineConfig, type EngineEvent, type EvalSummaryParseResult, type EvaluationItem, type EvaluationStatus, type FetchLock, type GuardCheckResult, type GuardConfig, type GuardEvent, type GuardInjection, type GuardResult, type GuardRunnerState, type GuardTier, type GuardVerdict, type HarnessShape, type HealthFactorResult, InMemoryDefiCacheStore, InMemoryFetchLock, InMemoryNaviCacheStore, InMemoryWalletCacheStore, InvalidAddressError, type LLMProvider, type McpCallResult, McpClientManager, McpResponseCache, type McpServerConfig, type McpServerConnection, type McpToolAdapterConfig, type McpToolDescriptor, MemorySessionStore, type Message, NAVI_ADDR_TTL_SEC, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_RATES_TTL_SEC, NAVI_SERVER_NAME, type NaviCacheEntry, type NaviCacheStore, type NaviRawCoin, type NaviRawHealthFactor, type NaviRawPool, type NaviRawPosition, type NaviRawPositionsResponse, type NaviRawProtocolStats, type NaviRawRewardsResponse, type NaviReadOptions, NaviTools, type NormalizedAddress, type OutputConfig, PERMISSION_PRESETS, type PendingAction, type PendingActionModifiableField, type PendingReward, type PendingToolCall, type PermissionLevel, type PermissionOperation, type PermissionResponse, type PermissionRule, type PortfolioCoin, type PositionEntry, type PreflightResult, type ProtocolStats, type ProviderEvent, QueryEngine, READ_TOOLS, type RatesResult, type Recipe, type RecipePrerequisite, RecipeRegistry, type RecipeStep, type RecipeStepOnError, RetryTracker, type SSEEvent, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, type SavingsResult, type ServerPositionData, type SessionData, type SessionStore, type StateType, type StopReason, type SuiCoinBalance, SuinsNotRegisteredError, SuinsRpcError, type SystemBlock, type SystemPrompt, TOOL_FLAGS, TOOL_MODIFIABLE_FIELDS, type TelemetrySink, type TelemetryTags, type ThinkingConfig, type ThinkingEffort, type TodoItem$1 as TodoItem, type Tool, type ToolChoice, type ToolContext, type ToolDefinition, type ToolFlags, type ToolJsonSchema, type ToolResult, TxMutex, type UpdateTodoInput, type TodoItem as UpdateTodoItem, type UserFinancialProfile, type UserPermissionConfig, WRITE_TOOLS, type WalletCacheEntry, type WalletCacheStore, type WalletCoin, _resetNaviCircuitBreaker, activitySummaryTool, adaptAllMcpTools, adaptAllServerTools, adaptMcpTool, applyToolFlags, awaitOrFetch, balanceCheckTool, borrowTool, budgetToolResult, buildCachedSystemPrompt, buildMcpTools, buildProactivenessInstructions, buildProfileContext, buildSelfEvaluationInstruction, buildStateContext, buildTool, claimRewardsTool, clampThinkingForEffort, classifyEffort, clearPortfolioCache, clearPortfolioCacheFor, clearPriceMapCache, compactMessages, createGuardRunnerState, engineToSSE, estimateTokens, explainTxTool, extractConversationText, extractMcpText, fetchAddressDefiPortfolio, fetchAddressPortfolio, fetchAudricHistory, fetchAudricPortfolio, fetchAvailableRewards, fetchBalance, fetchHealthFactor, fetchPositions, fetchProtocolStats, fetchRates, fetchSavings, fetchTokenPrices, fetchWalletCoins, findTool, getAudricApiBase, getDefaultTools, getDefiCacheStore, getFetchLock, getMcpManager, getModifiableFields, getNaviCacheStore, getTelemetrySink, getToolFlags, getWalletAddress, getWalletCacheStore, guardArtifactPreview, guardStaleData, harnessShapeForEffort, hasNaviMcp, healthCheckTool, loadRecipes, looksLikeSuiNs, microcompact, mppServicesTool, naviKey, normalizeAddressInput, parseEvalSummary, parseMcpJson, parseRecipe, parseSSE, payApiTool, portfolioAnalysisTool, protocolDeepDiveTool, ratesInfoTool, registerEngineTools, renderCanvasTool, repayDebtTool, requireAgent, resetDefiCacheStore, resetFetchLock, resetNaviCacheStore, resetTelemetrySink, resetWalletCacheStore, resolveAddressToSuinsViaRpc, resolvePermissionTier, resolveSuinsTool, resolveSuinsViaRpc, resolveUsdValue, runGuards, runTools, saveContactTool, saveDepositTool, savingsInfoTool, sendTransferTool, serializeSSE, setDefiCacheStore, setFetchLock, setNaviCacheStore, setTelemetrySink, setWalletCacheStore, spendingAnalyticsTool, swapExecuteTool, swapQuoteTool, tokenPricesTool, toolNameToOperation, toolsToDefinitions, transactionHistoryTool, transformBalance, transformHealthFactor, transformPositions, transformRates, transformRewards, transformSavings, updateGuardStateAfterToolResult, updateTodoTool, validateHistory, voloStakeTool, voloStatsTool, voloUnstakeTool, webSearchTool, withdrawTool, yieldSummaryTool };
3524
+ export { type AddressPortfolio, AnthropicProvider, type AnthropicProviderConfig, type AudricHistoryRecord, type AudricPortfolioResult, type AwaitOrFetchOpts, type BalancePrices, type BalanceResult, BalanceTracker, type BuildToolOptions, CANVAS_TEMPLATES, type CanvasTemplate, type ChatParams, type CompactOptions, type ContentBlock, ContextBudget, type ContextBudgetConfig, type ConversationState, type ConversationStateStore, type CostSnapshot, CostTracker, type CostTrackerConfig, DEFAULT_GUARD_CONFIG, DEFAULT_LEASE_SEC, DEFAULT_PERMISSION_CONFIG, DEFAULT_POLL_BUDGET_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SYSTEM_PROMPT, DEFAULT_TOOL_TTL_MS, type DefiCacheEntry, type DefiCacheStore, type DefiProtocol, type DefiSummary, EFFORT_THINKING_BUDGET_CAPS, EarlyToolDispatcher, type EngineConfig, type EngineEvent, type EvalSummaryParseResult, type EvaluationItem, type EvaluationStatus, type FetchLock, type GuardCheckResult, type GuardConfig, type GuardEvent, type GuardInjection, type GuardResult, type GuardRunnerState, type GuardTier, type GuardVerdict, type HarnessShape, type HealthFactorResult, InMemoryDefiCacheStore, InMemoryFetchLock, InMemoryNaviCacheStore, InMemoryWalletCacheStore, InvalidAddressError, type LLMProvider, type McpCallResult, McpClientManager, McpResponseCache, type McpServerConfig, type McpServerConnection, type McpToolAdapterConfig, type McpToolDescriptor, MemorySessionStore, type Message, NAVI_ADDR_TTL_SEC, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_RATES_TTL_SEC, NAVI_SERVER_NAME, type NaviCacheEntry, type NaviCacheStore, type NaviRawCoin, type NaviRawHealthFactor, type NaviRawPool, type NaviRawPosition, type NaviRawPositionsResponse, type NaviRawProtocolStats, type NaviRawRewardsResponse, type NaviReadOptions, NaviTools, type NormalizedAddress, type OutputConfig, PERMISSION_PRESETS, type PendingAction, type PendingActionModifiableField, type PendingActionStep, type PendingReward, type PendingToolCall, type PermissionLevel, type PermissionOperation, type PermissionResponse, type PermissionRule, type PortfolioCoin, type PositionEntry, type PreflightResult, type ProtocolStats, type ProviderEvent, QueryEngine, READ_TOOLS, REGENERATABLE_READ_TOOLS, type RatesResult, type Recipe, type RecipePrerequisite, RecipeRegistry, type RecipeStep, type RecipeStepOnError, RetryTracker, type SSEEvent, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, type SavingsResult, type ServerPositionData, type SessionData, type SessionStore, type StateType, type StopReason, type SuiCoinBalance, SuinsNotRegisteredError, SuinsRpcError, type SystemBlock, type SystemPrompt, TOOL_FLAGS, TOOL_MODIFIABLE_FIELDS, TOOL_TTL_MS, type TelemetrySink, type TelemetryTags, type ThinkingConfig, type ThinkingEffort, type TodoItem$1 as TodoItem, type Tool, type ToolChoice, type ToolContext, type ToolDefinition, type ToolFlags, type ToolJsonSchema, type ToolResult, TxMutex, type UpdateTodoInput, type TodoItem as UpdateTodoItem, type UserFinancialProfile, type UserPermissionConfig, WRITE_TOOLS, type WalletCacheEntry, type WalletCacheStore, type WalletCoin, _resetNaviCircuitBreaker, activitySummaryTool, adaptAllMcpTools, adaptAllServerTools, adaptMcpTool, applyToolFlags, awaitOrFetch, balanceCheckTool, borrowTool, budgetToolResult, buildCachedSystemPrompt, buildMcpTools, buildProactivenessInstructions, buildProfileContext, buildSelfEvaluationInstruction, buildStateContext, buildTool, bundleShortestTtl, claimRewardsTool, clampThinkingForEffort, classifyEffort, clearPortfolioCache, clearPortfolioCacheFor, clearPriceMapCache, compactMessages, createGuardRunnerState, engineToSSE, estimateTokens, explainTxTool, extractConversationText, extractMcpText, fetchAddressDefiPortfolio, fetchAddressPortfolio, fetchAudricHistory, fetchAudricPortfolio, fetchAvailableRewards, fetchBalance, fetchHealthFactor, fetchPositions, fetchProtocolStats, fetchRates, fetchSavings, fetchTokenPrices, fetchWalletCoins, findTool, getAudricApiBase, getDefaultTools, getDefiCacheStore, getFetchLock, getMcpManager, getModifiableFields, getNaviCacheStore, getTelemetrySink, getToolFlags, getWalletAddress, getWalletCacheStore, guardArtifactPreview, guardStaleData, harnessShapeForEffort, hasNaviMcp, healthCheckTool, isBundleableTool, loadRecipes, looksLikeSuiNs, microcompact, mppServicesTool, naviKey, normalizeAddressInput, parseEvalSummary, parseMcpJson, parseRecipe, parseSSE, payApiTool, portfolioAnalysisTool, protocolDeepDiveTool, ratesInfoTool, registerEngineTools, renderCanvasTool, repayDebtTool, requireAgent, resetDefiCacheStore, resetFetchLock, resetNaviCacheStore, resetTelemetrySink, resetWalletCacheStore, resolveAddressToSuinsViaRpc, resolvePermissionTier, resolveSuinsTool, resolveSuinsViaRpc, resolveUsdValue, runGuards, runTools, saveContactTool, saveDepositTool, savingsInfoTool, sendTransferTool, serializeSSE, setDefiCacheStore, setFetchLock, setNaviCacheStore, setTelemetrySink, setWalletCacheStore, spendingAnalyticsTool, swapExecuteTool, swapQuoteTool, tokenPricesTool, toolNameToOperation, toolsToDefinitions, transactionHistoryTool, transformBalance, transformHealthFactor, transformPositions, transformRates, transformRewards, transformSavings, updateGuardStateAfterToolResult, updateTodoTool, validateHistory, voloStakeTool, voloStatsTool, voloUnstakeTool, webSearchTool, withdrawTool, yieldSummaryTool };