@t2000/engine 1.8.0 → 1.10.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 +128 -1
- package/dist/index.js +184 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1535,6 +1535,14 @@ declare class QueryEngine {
|
|
|
1535
1535
|
private runPostWriteRefresh;
|
|
1536
1536
|
interrupt(): void;
|
|
1537
1537
|
getMessages(): readonly Message[];
|
|
1538
|
+
/**
|
|
1539
|
+
* [SPEC 7 P2.4b] Read-only access to the engine's tool registry.
|
|
1540
|
+
* Exposed so out-of-band utilities like `regenerateBundle` can call
|
|
1541
|
+
* `composeBundleFromToolResults({ tools: engine.getTools(), ... })`
|
|
1542
|
+
* without forcing the host to hand-thread the tool array. Mirrors
|
|
1543
|
+
* `getMessages()` access pattern.
|
|
1544
|
+
*/
|
|
1545
|
+
getTools(): readonly Tool[];
|
|
1538
1546
|
getMatchedRecipe(): Recipe | null;
|
|
1539
1547
|
getContextBudget(): ContextBudget;
|
|
1540
1548
|
reset(): void;
|
|
@@ -1632,6 +1640,125 @@ declare function bundleShortestTtl(toolUseIds: string[], toolNamesById: Record<s
|
|
|
1632
1640
|
/** The set of read tools whose results re-fire on REGENERATE. */
|
|
1633
1641
|
declare const REGENERATABLE_READ_TOOLS: ReadonlySet<string>;
|
|
1634
1642
|
|
|
1643
|
+
/**
|
|
1644
|
+
* SPEC 7 v0.3 Quote-Refresh ReviewCard — engine-side bundle regeneration.
|
|
1645
|
+
*
|
|
1646
|
+
* When a user takes 30–60s to read a multi-step Payment Stream
|
|
1647
|
+
* `pending_action`, the upstream read results that fed bundle composition
|
|
1648
|
+
* (Cetus quotes, NAVI APYs, wallet balances) drift. Today the user has to
|
|
1649
|
+
* either approve with stale data (Sui dry-run is the safety gate, but the
|
|
1650
|
+
* UX is "did this just lie to me?") or cancel and re-prompt the LLM
|
|
1651
|
+
* (loses the narrative thread). The Quote-Refresh ReviewCard adds a
|
|
1652
|
+
* third option: an explicit REGENERATE button that re-fires the
|
|
1653
|
+
* upstream reads (no LLM call), rebuilds the bundle in place, and
|
|
1654
|
+
* yields a fresh `pending_action` with new per-step `attemptId`s.
|
|
1655
|
+
*
|
|
1656
|
+
* **What this function does NOT do.**
|
|
1657
|
+
* - Run the LLM. Regenerate is "re-evaluate the same intent against
|
|
1658
|
+
* fresh state" — the writes' tool names + inputs stay identical;
|
|
1659
|
+
* only the upstream read TIMESTAMPS change (and any downstream
|
|
1660
|
+
* derivations the host made off them).
|
|
1661
|
+
* - Run the bundle on-chain. The host still presents the new
|
|
1662
|
+
* PermissionCard for confirmation; user can approve, regenerate
|
|
1663
|
+
* again, or deny.
|
|
1664
|
+
* - Mutate `TurnMetrics` rows. The host route owns analytics — see
|
|
1665
|
+
* `audric/apps/web/app/api/engine/regenerate/route.ts`.
|
|
1666
|
+
*
|
|
1667
|
+
* **Spec 1 / Spec 2 invariants preserved.**
|
|
1668
|
+
* - Each regeneration produces its own per-step `attemptId` (UUID v4),
|
|
1669
|
+
* so the host can write a fresh `TurnMetrics` row keyed on it.
|
|
1670
|
+
* - The original `pending_action`'s `attemptId` stays valid for the
|
|
1671
|
+
* host's `pendingActionOutcome = 'regenerated'` update — no
|
|
1672
|
+
* accidental over-write of the original row.
|
|
1673
|
+
*
|
|
1674
|
+
* **Why synchronous (no SSE).** The chat stream that originally
|
|
1675
|
+
* yielded the bundled `pending_action` has already closed by the time
|
|
1676
|
+
* the user taps Regenerate (`useEngine.ts` flips `isStreaming: false`
|
|
1677
|
+
* on `pending_action`). Reopening a stream for a sub-second round-trip
|
|
1678
|
+
* would be heavier than the host needs. Instead, the host endpoint
|
|
1679
|
+
* calls this function synchronously and returns
|
|
1680
|
+
* `{ success, newPendingAction, timelineEvents[] }` in the response
|
|
1681
|
+
* body — host renders `timelineEvents[]` as a "↻ Regenerated · Ns"
|
|
1682
|
+
* group above the new card.
|
|
1683
|
+
*/
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* One event in the `timelineEvents[]` array returned to the host.
|
|
1687
|
+
* Mirrors the engine's normal SSE event shapes for `tool_start` and
|
|
1688
|
+
* `tool_result` so the host can push them onto its timeline as if they
|
|
1689
|
+
* had streamed live.
|
|
1690
|
+
*/
|
|
1691
|
+
type RegenerateTimelineEvent = {
|
|
1692
|
+
type: 'tool_start';
|
|
1693
|
+
toolName: string;
|
|
1694
|
+
toolUseId: string;
|
|
1695
|
+
input: unknown;
|
|
1696
|
+
} | {
|
|
1697
|
+
type: 'tool_result';
|
|
1698
|
+
toolName: string;
|
|
1699
|
+
toolUseId: string;
|
|
1700
|
+
result: unknown;
|
|
1701
|
+
isError: boolean;
|
|
1702
|
+
durationMs: number;
|
|
1703
|
+
};
|
|
1704
|
+
interface RegenerateSuccess {
|
|
1705
|
+
success: true;
|
|
1706
|
+
/**
|
|
1707
|
+
* Fresh `pending_action` with new per-step `attemptId`s. The host
|
|
1708
|
+
* swaps this in for the original `PermissionCard` payload; the
|
|
1709
|
+
* existing PermissionCard renderer requires no changes — it sees a
|
|
1710
|
+
* fresh action with a fresh `quoteAge` of ~0ms.
|
|
1711
|
+
*/
|
|
1712
|
+
newPendingAction: PendingAction;
|
|
1713
|
+
/**
|
|
1714
|
+
* Re-fired upstream read events the host renders as a
|
|
1715
|
+
* "↻ Regenerated · Ns" group above the new card. Order: every
|
|
1716
|
+
* `tool_start` for one read is paired with its `tool_result`; reads
|
|
1717
|
+
* are processed serially (so durations sum cleanly for the group
|
|
1718
|
+
* label).
|
|
1719
|
+
*/
|
|
1720
|
+
timelineEvents: RegenerateTimelineEvent[];
|
|
1721
|
+
}
|
|
1722
|
+
interface RegenerateFailure {
|
|
1723
|
+
success: false;
|
|
1724
|
+
reason: 'pending_action_not_found' | 'cannot_regenerate' | 'engine_error';
|
|
1725
|
+
message: string;
|
|
1726
|
+
}
|
|
1727
|
+
type RegenerateResult = RegenerateSuccess | RegenerateFailure;
|
|
1728
|
+
/**
|
|
1729
|
+
* Re-fire the upstream reads that fed a bundled pending_action and
|
|
1730
|
+
* compose a fresh bundle. The engine MUST be created with the same
|
|
1731
|
+
* tool registry + ToolContext as the chat turn that produced the
|
|
1732
|
+
* original action. The host typically reaches this by calling
|
|
1733
|
+
* `createEngine({ address, session })` on the same session that
|
|
1734
|
+
* persisted the pending_action.
|
|
1735
|
+
*
|
|
1736
|
+
* **Side effect.** On success, this mutates the engine's message
|
|
1737
|
+
* history by appending one synthetic assistant message (carrying the
|
|
1738
|
+
* regenerated `tool_use` blocks) and one user message (carrying the
|
|
1739
|
+
* fresh `tool_result` blocks). This is so the LLM sees the fresh
|
|
1740
|
+
* data when the user approves the new bundle and the engine resumes.
|
|
1741
|
+
* The host should persist `engine.getMessages()` back to its session
|
|
1742
|
+
* store after a successful regenerate.
|
|
1743
|
+
*
|
|
1744
|
+
* **Failure modes.**
|
|
1745
|
+
* - `pending_action_not_found` — the action isn't a bundle (no
|
|
1746
|
+
* `steps`, or fewer than 2 steps). Single-write actions can't be
|
|
1747
|
+
* regenerated by design.
|
|
1748
|
+
* - `cannot_regenerate` — the action's `canRegenerate` flag is
|
|
1749
|
+
* false, OR no contributing read tool_use_ids could be located in
|
|
1750
|
+
* session history.
|
|
1751
|
+
* - `engine_error` — a tool re-execution threw, OR bundle
|
|
1752
|
+
* composition rejected (defensive — should not happen if the
|
|
1753
|
+
* original bundle was valid).
|
|
1754
|
+
*
|
|
1755
|
+
* Errors in tool re-execution short-circuit the whole regenerate
|
|
1756
|
+
* (bundle composition would inherit a broken read result). The host
|
|
1757
|
+
* surfaces this as a toast: "Could not regenerate. The original card
|
|
1758
|
+
* is still valid."
|
|
1759
|
+
*/
|
|
1760
|
+
declare function regenerateBundle(engine: QueryEngine, action: PendingAction): Promise<RegenerateResult>;
|
|
1761
|
+
|
|
1635
1762
|
interface BuildToolOptions<TInput, TOutput> {
|
|
1636
1763
|
name: string;
|
|
1637
1764
|
description: string;
|
|
@@ -3521,4 +3648,4 @@ declare function getTelemetrySink(): TelemetrySink;
|
|
|
3521
3648
|
/** Restore the default noop sink. Used by test teardowns. */
|
|
3522
3649
|
declare function resetTelemetrySink(): void;
|
|
3523
3650
|
|
|
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 };
|
|
3651
|
+
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, type RegenerateFailure, type RegenerateResult, type RegenerateSuccess, type RegenerateTimelineEvent, 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, regenerateBundle, 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 };
|
package/dist/index.js
CHANGED
|
@@ -3056,7 +3056,7 @@ var transactionHistoryTool = buildTool({
|
|
|
3056
3056
|
var SAVE_ASSETS = ["USDC", "USDsui"];
|
|
3057
3057
|
var saveDepositTool = buildTool({
|
|
3058
3058
|
name: "save_deposit",
|
|
3059
|
-
description: 'Deposit USDC or USDsui into NAVI savings to earn yield. ONLY these two stables are accepted. If the user asks to save/deposit any other token (GOLD, SUI, USDT, USDe, ETH, etc.), do NOT call this tool and do NOT automatically swap their tokens and deposit. Instead, tell the user that only USDC and USDsui deposits are supported and ask if they would like to swap first. Let the user decide \u2014 never auto-chain swap + deposit. When the user says "save 10 USDC" pass asset="USDC". When they say "save 10 USDsui" pass asset="USDsui". When they say "save 10" with no asset, ALWAYS call balance_check first and ask which stable they want to deposit (or default to whichever they hold more of, with a one-line note). Never silently substitute USDsui for USDC or vice versa.',
|
|
3059
|
+
description: 'Deposit USDC or USDsui into NAVI savings to earn yield. ONLY these two stables are accepted. If the user asks to save/deposit any other token (GOLD, SUI, USDT, USDe, ETH, etc.), do NOT call this tool and do NOT automatically swap their tokens and deposit. Instead, tell the user that only USDC and USDsui deposits are supported and ask if they would like to swap first. Let the user decide \u2014 never auto-chain swap + deposit. When the user says "save 10 USDC" pass asset="USDC". When they say "save 10 USDsui" pass asset="USDsui". When they say "save 10" with no asset, ALWAYS call balance_check first and ask which stable they want to deposit (or default to whichever they hold more of, with a one-line note). Never silently substitute USDsui for USDC or vice versa. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "swap to USDC and save"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3060
3060
|
inputSchema: z.object({
|
|
3061
3061
|
amount: z.number().positive(),
|
|
3062
3062
|
asset: z.enum(SAVE_ASSETS).optional().describe('"USDC" or "USDsui". Defaults to USDC when omitted.')
|
|
@@ -3109,7 +3109,7 @@ var saveDepositTool = buildTool({
|
|
|
3109
3109
|
});
|
|
3110
3110
|
var withdrawTool = buildTool({
|
|
3111
3111
|
name: "withdraw",
|
|
3112
|
-
description:
|
|
3112
|
+
description: 'Withdraw from NAVI lending back to wallet. Defaults to USDC; also withdraws USDsui (the second active saveable stable). Legacy positions in other assets (USDe, SUI) can still be withdrawn if the user has them \u2014 but only USDC and USDsui are eligible to be re-deposited via save_deposit. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "withdraw and send to Mom"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3113
3113
|
inputSchema: z.object({
|
|
3114
3114
|
amount: z.number().positive(),
|
|
3115
3115
|
asset: z.string().optional().describe("Asset to withdraw (default: USDC). Active: USDsui. Legacy positions: USDe, SUI.")
|
|
@@ -3152,7 +3152,7 @@ var withdrawTool = buildTool({
|
|
|
3152
3152
|
var ASSET_LIST = ALL_NAVI_ASSETS.map((a) => String(a)).join(", ");
|
|
3153
3153
|
var sendTransferTool = buildTool({
|
|
3154
3154
|
name: "send_transfer",
|
|
3155
|
-
description: `Send ANY supported token (${ASSET_LIST}) to another Sui address or contact name. Validates the address, checks balance, and executes the on-chain transfer. MUST set the \`asset\` field to the token symbol you want to send (case-insensitive). If \`asset\` is omitted, USDC is assumed \u2014 only do this when the user explicitly asks for USDC. When the user asks to send a token by name (SUI, USDT, etc.) or to send the proceeds of a just-completed swap, you MUST pass \`asset\` matching that token. Returns tx hash, gas cost, and updated balance.`,
|
|
3155
|
+
description: `Send ANY supported token (${ASSET_LIST}) to another Sui address or contact name. Validates the address, checks balance, and executes the on-chain transfer. MUST set the \`asset\` field to the token symbol you want to send (case-insensitive). If \`asset\` is omitted, USDC is assumed \u2014 only do this when the user explicitly asks for USDC. When the user asks to send a token by name (SUI, USDT, etc.) or to send the proceeds of a just-completed swap, you MUST pass \`asset\` matching that token. Returns tx hash, gas cost, and updated balance. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "swap to USDC and send to Mom", "withdraw and send"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.`,
|
|
3156
3156
|
inputSchema: z.object({
|
|
3157
3157
|
to: z.string().min(1),
|
|
3158
3158
|
amount: z.number().positive(),
|
|
@@ -3229,7 +3229,7 @@ var sendTransferTool = buildTool({
|
|
|
3229
3229
|
var BORROW_ASSETS = ["USDC", "USDsui"];
|
|
3230
3230
|
var borrowTool = buildTool({
|
|
3231
3231
|
name: "borrow",
|
|
3232
|
-
description: 'Borrow USDC or USDsui against savings collateral. ONLY these two stables are supported. Requires existing savings deposits as collateral. Checks max safe borrow and health factor. Returns tx hash, fee, asset borrowed, and post-borrow health factor. When the user says "borrow 10 USDC" pass asset="USDC". When they say "borrow 10 USDsui" pass asset="USDsui". When they say "borrow 10" with no asset, default to USDC unless the user has only USDsui collateral.',
|
|
3232
|
+
description: 'Borrow USDC or USDsui against savings collateral. ONLY these two stables are supported. Requires existing savings deposits as collateral. Checks max safe borrow and health factor. Returns tx hash, fee, asset borrowed, and post-borrow health factor. When the user says "borrow 10 USDC" pass asset="USDC". When they say "borrow 10 USDsui" pass asset="USDsui". When they say "borrow 10" with no asset, default to USDC unless the user has only USDsui collateral. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "borrow $50 and send to Mom"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3233
3233
|
inputSchema: z.object({
|
|
3234
3234
|
amount: z.number().positive(),
|
|
3235
3235
|
asset: z.enum(BORROW_ASSETS).optional().describe('"USDC" or "USDsui". Defaults to USDC when omitted.')
|
|
@@ -3283,7 +3283,7 @@ var borrowTool = buildTool({
|
|
|
3283
3283
|
var REPAY_ASSETS = ["USDC", "USDsui"];
|
|
3284
3284
|
var repayDebtTool = buildTool({
|
|
3285
3285
|
name: "repay_debt",
|
|
3286
|
-
description: 'Repay outstanding USDC or USDsui debt. Always call balance_check first to know the debt amount + which asset is owed (savings_info shows per-asset borrow positions). Pass asset="USDC" or asset="USDsui" to target a specific debt. When omitted, repays the highest-APY borrow first. Important: a USDsui debt MUST be repaid with USDsui (and USDC debt with USDC) \u2014 the SDK fetches the correct coin type for the targeted asset, but the user must hold enough of that stable in their wallet. If the user has only the wrong stable, do NOT auto-swap \u2014 tell them to swap manually first. Returns tx hash, amount repaid, asset, and remaining debt.',
|
|
3286
|
+
description: 'Repay outstanding USDC or USDsui debt. Always call balance_check first to know the debt amount + which asset is owed (savings_info shows per-asset borrow positions). Pass asset="USDC" or asset="USDsui" to target a specific debt. When omitted, repays the highest-APY borrow first. Important: a USDsui debt MUST be repaid with USDsui (and USDC debt with USDC) \u2014 the SDK fetches the correct coin type for the targeted asset, but the user must hold enough of that stable in their wallet. If the user has only the wrong stable, do NOT auto-swap \u2014 tell them to swap manually first. Returns tx hash, amount repaid, asset, and remaining debt. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "repay debt then withdraw the rest"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3287
3287
|
inputSchema: z.object({
|
|
3288
3288
|
amount: z.number().positive(),
|
|
3289
3289
|
asset: z.enum(REPAY_ASSETS).optional().describe('"USDC" or "USDsui". When omitted, repays the highest-APY borrow first.')
|
|
@@ -3340,7 +3340,7 @@ function formatAmount(amount) {
|
|
|
3340
3340
|
}
|
|
3341
3341
|
var claimRewardsTool = buildTool({
|
|
3342
3342
|
name: "claim_rewards",
|
|
3343
|
-
description: 'Claim all pending protocol rewards across lending adapters. Returns the claimed reward breakdown (per-asset symbol + amount), total USD value (best effort \u2014 may be 0 when oracle prices are unavailable), and the on-chain tx hash. When the rewards list is empty the response will explicitly say "no pending rewards"; when it is non-empty narrate the per-symbol amounts even if totalValueUsd is 0 (the on-chain credit still happened).',
|
|
3343
|
+
description: 'Claim all pending protocol rewards across lending adapters. Returns the claimed reward breakdown (per-asset symbol + amount), total USD value (best effort \u2014 may be 0 when oracle prices are unavailable), and the on-chain tx hash. When the rewards list is empty the response will explicitly say "no pending rewards"; when it is non-empty narrate the per-symbol amounts even if totalValueUsd is 0 (the on-chain credit still happened). Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "claim rewards and stake them"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3344
3344
|
inputSchema: z.object({}),
|
|
3345
3345
|
jsonSchema: { type: "object", properties: {}, required: [] },
|
|
3346
3346
|
isReadOnly: false,
|
|
@@ -3600,7 +3600,7 @@ var mppServicesTool = buildTool({
|
|
|
3600
3600
|
});
|
|
3601
3601
|
var swapExecuteTool = buildTool({
|
|
3602
3602
|
name: "swap_execute",
|
|
3603
|
-
description:
|
|
3603
|
+
description: 'Swap tokens on Sui via Cetus Aggregator (20+ DEXs). Supports any token pair with liquidity. Use user-friendly names (SUI, USDC, CETUS, DEEP, etc.) or full coin types. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "swap to USDC and save", "swap and send to Mom"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3604
3604
|
inputSchema: z.object({
|
|
3605
3605
|
from: z.string().describe('Source token (e.g. "SUI", "USDC", or full coin type)'),
|
|
3606
3606
|
to: z.string().describe('Target token (e.g. "USDC", "CETUS", or full coin type)'),
|
|
@@ -3689,7 +3689,7 @@ var swapQuoteTool = buildTool({
|
|
|
3689
3689
|
});
|
|
3690
3690
|
var voloStakeTool = buildTool({
|
|
3691
3691
|
name: "volo_stake",
|
|
3692
|
-
description:
|
|
3692
|
+
description: 'Stake SUI for vSUI via VOLO liquid staking. Earn ~3-5% APY. Rewards compound automatically via exchange rate \u2014 no claiming needed. Minimum 1 SUI. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "swap USDC to SUI and stake"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3693
3693
|
inputSchema: z.object({
|
|
3694
3694
|
amount: z.number().min(1).describe("Amount of SUI to stake (minimum 1)")
|
|
3695
3695
|
}),
|
|
@@ -3720,7 +3720,7 @@ var voloStakeTool = buildTool({
|
|
|
3720
3720
|
});
|
|
3721
3721
|
var voloUnstakeTool = buildTool({
|
|
3722
3722
|
name: "volo_unstake",
|
|
3723
|
-
description: 'Unstake vSUI back to SUI. Returns SUI including accumulated yield. Use amount in vSUI units or "all" to unstake entire position.',
|
|
3723
|
+
description: 'Unstake vSUI back to SUI. Returns SUI including accumulated yield. Use amount in vSUI units or "all" to unstake entire position. Payment Stream: bundleable \u2014 when paired with another bundleable write in the same request (e.g. "unstake vSUI and send to Mom"), emit all calls in the same assistant turn so the engine collapses them into one atomic PTB the user signs once.',
|
|
3724
3724
|
inputSchema: z.object({
|
|
3725
3725
|
amount: z.union([z.number().positive(), z.literal("all")]).describe('Amount of vSUI to unstake, or "all"')
|
|
3726
3726
|
}),
|
|
@@ -7160,6 +7160,16 @@ var QueryEngine = class {
|
|
|
7160
7160
|
getMessages() {
|
|
7161
7161
|
return this.messages;
|
|
7162
7162
|
}
|
|
7163
|
+
/**
|
|
7164
|
+
* [SPEC 7 P2.4b] Read-only access to the engine's tool registry.
|
|
7165
|
+
* Exposed so out-of-band utilities like `regenerateBundle` can call
|
|
7166
|
+
* `composeBundleFromToolResults({ tools: engine.getTools(), ... })`
|
|
7167
|
+
* without forcing the host to hand-thread the tool array. Mirrors
|
|
7168
|
+
* `getMessages()` access pattern.
|
|
7169
|
+
*/
|
|
7170
|
+
getTools() {
|
|
7171
|
+
return this.tools;
|
|
7172
|
+
}
|
|
7163
7173
|
getMatchedRecipe() {
|
|
7164
7174
|
return this.matchedRecipe;
|
|
7165
7175
|
}
|
|
@@ -8022,6 +8032,158 @@ function harnessShapeForEffort(effort) {
|
|
|
8022
8032
|
return "max";
|
|
8023
8033
|
}
|
|
8024
8034
|
}
|
|
8035
|
+
async function regenerateBundle(engine, action) {
|
|
8036
|
+
if (!action.steps || action.steps.length < 2) {
|
|
8037
|
+
return {
|
|
8038
|
+
success: false,
|
|
8039
|
+
reason: "pending_action_not_found",
|
|
8040
|
+
message: "Action is not a multi-step bundle"
|
|
8041
|
+
};
|
|
8042
|
+
}
|
|
8043
|
+
if (action.canRegenerate !== true) {
|
|
8044
|
+
return {
|
|
8045
|
+
success: false,
|
|
8046
|
+
reason: "cannot_regenerate",
|
|
8047
|
+
message: "Bundle has canRegenerate=false (no upstream reads contributed)"
|
|
8048
|
+
};
|
|
8049
|
+
}
|
|
8050
|
+
const regenIds = action.regenerateInput?.toolUseIds ?? [];
|
|
8051
|
+
if (regenIds.length === 0) {
|
|
8052
|
+
return {
|
|
8053
|
+
success: false,
|
|
8054
|
+
reason: "cannot_regenerate",
|
|
8055
|
+
message: "Bundle has no regenerateInput.toolUseIds"
|
|
8056
|
+
};
|
|
8057
|
+
}
|
|
8058
|
+
const messages = engine.getMessages();
|
|
8059
|
+
const tools = [...engine.getTools()];
|
|
8060
|
+
const originalReads = [];
|
|
8061
|
+
for (const id of regenIds) {
|
|
8062
|
+
let found = null;
|
|
8063
|
+
outer: for (const msg of messages) {
|
|
8064
|
+
if (msg.role !== "assistant") continue;
|
|
8065
|
+
for (const block of msg.content) {
|
|
8066
|
+
if (block.type === "tool_use" && block.id === id) {
|
|
8067
|
+
found = {
|
|
8068
|
+
name: block.name,
|
|
8069
|
+
input: block.input
|
|
8070
|
+
};
|
|
8071
|
+
break outer;
|
|
8072
|
+
}
|
|
8073
|
+
}
|
|
8074
|
+
}
|
|
8075
|
+
if (!found) {
|
|
8076
|
+
return {
|
|
8077
|
+
success: false,
|
|
8078
|
+
reason: "engine_error",
|
|
8079
|
+
message: `Original tool_use ${id} not found in session history`
|
|
8080
|
+
};
|
|
8081
|
+
}
|
|
8082
|
+
if (!REGENERATABLE_READ_TOOLS.has(found.name)) {
|
|
8083
|
+
continue;
|
|
8084
|
+
}
|
|
8085
|
+
originalReads.push({ toolName: found.name, input: found.input });
|
|
8086
|
+
}
|
|
8087
|
+
if (originalReads.length === 0) {
|
|
8088
|
+
return {
|
|
8089
|
+
success: false,
|
|
8090
|
+
reason: "cannot_regenerate",
|
|
8091
|
+
message: "No regeneratable read tool_use blocks found in session history"
|
|
8092
|
+
};
|
|
8093
|
+
}
|
|
8094
|
+
const timelineEvents = [];
|
|
8095
|
+
const newReads = [];
|
|
8096
|
+
for (const r of originalReads) {
|
|
8097
|
+
const newToolUseId = `regen_${randomUUID().replace(/-/g, "").slice(0, 16)}`;
|
|
8098
|
+
timelineEvents.push({
|
|
8099
|
+
type: "tool_start",
|
|
8100
|
+
toolName: r.toolName,
|
|
8101
|
+
toolUseId: newToolUseId,
|
|
8102
|
+
input: r.input
|
|
8103
|
+
});
|
|
8104
|
+
const t0 = Date.now();
|
|
8105
|
+
let outcome;
|
|
8106
|
+
try {
|
|
8107
|
+
outcome = await engine.invokeReadTool(r.toolName, r.input);
|
|
8108
|
+
} catch (err) {
|
|
8109
|
+
outcome = {
|
|
8110
|
+
data: { error: err instanceof Error ? err.message : String(err) },
|
|
8111
|
+
isError: true
|
|
8112
|
+
};
|
|
8113
|
+
}
|
|
8114
|
+
const durationMs = Date.now() - t0;
|
|
8115
|
+
timelineEvents.push({
|
|
8116
|
+
type: "tool_result",
|
|
8117
|
+
toolName: r.toolName,
|
|
8118
|
+
toolUseId: newToolUseId,
|
|
8119
|
+
result: outcome.data,
|
|
8120
|
+
isError: outcome.isError,
|
|
8121
|
+
durationMs
|
|
8122
|
+
});
|
|
8123
|
+
if (outcome.isError) {
|
|
8124
|
+
return {
|
|
8125
|
+
success: false,
|
|
8126
|
+
reason: "engine_error",
|
|
8127
|
+
message: `Re-execution of ${r.toolName} failed`
|
|
8128
|
+
};
|
|
8129
|
+
}
|
|
8130
|
+
newReads.push({
|
|
8131
|
+
toolUseId: newToolUseId,
|
|
8132
|
+
toolName: r.toolName,
|
|
8133
|
+
input: r.input,
|
|
8134
|
+
result: outcome.data,
|
|
8135
|
+
isError: false,
|
|
8136
|
+
timestamp: t0
|
|
8137
|
+
});
|
|
8138
|
+
}
|
|
8139
|
+
const synthAssistantBlocks = newReads.map((r) => ({
|
|
8140
|
+
type: "tool_use",
|
|
8141
|
+
id: r.toolUseId,
|
|
8142
|
+
name: r.toolName,
|
|
8143
|
+
input: r.input
|
|
8144
|
+
}));
|
|
8145
|
+
const synthUserBlocks = newReads.map((r) => ({
|
|
8146
|
+
type: "tool_result",
|
|
8147
|
+
toolUseId: r.toolUseId,
|
|
8148
|
+
content: typeof r.result === "string" ? r.result : JSON.stringify(r.result),
|
|
8149
|
+
isError: r.isError
|
|
8150
|
+
}));
|
|
8151
|
+
const synthMessages = [
|
|
8152
|
+
{ role: "assistant", content: synthAssistantBlocks },
|
|
8153
|
+
{ role: "user", content: synthUserBlocks }
|
|
8154
|
+
];
|
|
8155
|
+
engine.loadMessages([...messages, ...synthMessages]);
|
|
8156
|
+
const pendingWrites = action.steps.map((step) => ({
|
|
8157
|
+
id: step.toolUseId,
|
|
8158
|
+
name: step.toolName,
|
|
8159
|
+
input: step.input
|
|
8160
|
+
}));
|
|
8161
|
+
const readResults = newReads.map((r) => ({
|
|
8162
|
+
toolUseId: r.toolUseId,
|
|
8163
|
+
toolName: r.toolName,
|
|
8164
|
+
timestamp: r.timestamp
|
|
8165
|
+
}));
|
|
8166
|
+
const assistantContent = action.assistantContent ?? [];
|
|
8167
|
+
const completedResults = action.completedResults ?? [];
|
|
8168
|
+
let newPendingAction;
|
|
8169
|
+
try {
|
|
8170
|
+
newPendingAction = composeBundleFromToolResults({
|
|
8171
|
+
pendingWrites,
|
|
8172
|
+
tools,
|
|
8173
|
+
readResults,
|
|
8174
|
+
assistantContent,
|
|
8175
|
+
completedResults,
|
|
8176
|
+
turnIndex: action.turnIndex
|
|
8177
|
+
});
|
|
8178
|
+
} catch (err) {
|
|
8179
|
+
return {
|
|
8180
|
+
success: false,
|
|
8181
|
+
reason: "engine_error",
|
|
8182
|
+
message: err instanceof Error ? err.message : "Bundle rebuild failed"
|
|
8183
|
+
};
|
|
8184
|
+
}
|
|
8185
|
+
return { success: true, newPendingAction, timelineEvents };
|
|
8186
|
+
}
|
|
8025
8187
|
|
|
8026
8188
|
// src/streaming.ts
|
|
8027
8189
|
function serializeSSE(event) {
|
|
@@ -8216,6 +8378,10 @@ var RecipeRegistry = class {
|
|
|
8216
8378
|
recipe.description,
|
|
8217
8379
|
"Follow these steps:"
|
|
8218
8380
|
];
|
|
8381
|
+
const bundleSteps = recipe.steps.filter((s) => s.bundle === true);
|
|
8382
|
+
const bundleStepNames = new Set(bundleSteps.map((s) => s.name));
|
|
8383
|
+
const showBundleHeader = bundleStepNames.size >= 2;
|
|
8384
|
+
let openedBundleHeader = false;
|
|
8219
8385
|
for (let i = 0; i < recipe.steps.length; i++) {
|
|
8220
8386
|
const step = recipe.steps[i];
|
|
8221
8387
|
const num = i + 1;
|
|
@@ -8223,7 +8389,14 @@ var RecipeRegistry = class {
|
|
|
8223
8389
|
const serviceNote = step.service ? ` (${step.service})` : "";
|
|
8224
8390
|
const costNote = step.cost ? ` \u2014 ${step.cost}` : "";
|
|
8225
8391
|
const gateNote = step.gate && step.gate !== "none" ? ` [GATE: ${step.gate}]` : "";
|
|
8226
|
-
|
|
8392
|
+
if (showBundleHeader && step.bundle === true && !openedBundleHeader) {
|
|
8393
|
+
lines.push(
|
|
8394
|
+
"PAYMENT STREAM \u2014 emit ALL the following bundleable writes as parallel `tool_use` blocks IN THE SAME ASSISTANT TURN. The engine collapses them into ONE atomic PTB the user signs once. Do NOT execute step-by-step across turns:"
|
|
8395
|
+
);
|
|
8396
|
+
openedBundleHeader = true;
|
|
8397
|
+
}
|
|
8398
|
+
const bundleTag = showBundleHeader && step.bundle === true ? " [PAYMENT STREAM]" : "";
|
|
8399
|
+
let line = `${num}. ${step.name}${toolNote}${serviceNote}${costNote}${gateNote}${bundleTag}`;
|
|
8227
8400
|
if (step.gate_prompt) {
|
|
8228
8401
|
line += ` \u2014 "${step.gate_prompt}"`;
|
|
8229
8402
|
}
|
|
@@ -9123,6 +9296,6 @@ function sanitizeAnthropicMessages(messages) {
|
|
|
9123
9296
|
return merged;
|
|
9124
9297
|
}
|
|
9125
9298
|
|
|
9126
|
-
export { AnthropicProvider, BalanceTracker, CANVAS_TEMPLATES, ContextBudget, CostTracker, DEFAULT_GUARD_CONFIG, DEFAULT_LEASE_SEC, DEFAULT_PERMISSION_CONFIG, DEFAULT_POLL_BUDGET_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SYSTEM_PROMPT, DEFAULT_TOOL_TTL_MS, EFFORT_THINKING_BUDGET_CAPS, EarlyToolDispatcher, InMemoryDefiCacheStore, InMemoryFetchLock, InMemoryNaviCacheStore, InMemoryWalletCacheStore, InvalidAddressError, McpClientManager, McpResponseCache, MemorySessionStore, NAVI_ADDR_TTL_SEC, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_RATES_TTL_SEC, NAVI_SERVER_NAME, NaviTools, PERMISSION_PRESETS, QueryEngine, READ_TOOLS, REGENERATABLE_READ_TOOLS, RecipeRegistry, RetryTracker, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SuinsNotRegisteredError, SuinsRpcError, TOOL_FLAGS, TOOL_MODIFIABLE_FIELDS, TOOL_TTL_MS, TxMutex, WRITE_TOOLS, _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 };
|
|
9299
|
+
export { AnthropicProvider, BalanceTracker, CANVAS_TEMPLATES, ContextBudget, CostTracker, DEFAULT_GUARD_CONFIG, DEFAULT_LEASE_SEC, DEFAULT_PERMISSION_CONFIG, DEFAULT_POLL_BUDGET_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SYSTEM_PROMPT, DEFAULT_TOOL_TTL_MS, EFFORT_THINKING_BUDGET_CAPS, EarlyToolDispatcher, InMemoryDefiCacheStore, InMemoryFetchLock, InMemoryNaviCacheStore, InMemoryWalletCacheStore, InvalidAddressError, McpClientManager, McpResponseCache, MemorySessionStore, NAVI_ADDR_TTL_SEC, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_RATES_TTL_SEC, NAVI_SERVER_NAME, NaviTools, PERMISSION_PRESETS, QueryEngine, READ_TOOLS, REGENERATABLE_READ_TOOLS, RecipeRegistry, RetryTracker, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SuinsNotRegisteredError, SuinsRpcError, TOOL_FLAGS, TOOL_MODIFIABLE_FIELDS, TOOL_TTL_MS, TxMutex, WRITE_TOOLS, _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, regenerateBundle, 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 };
|
|
9127
9300
|
//# sourceMappingURL=index.js.map
|
|
9128
9301
|
//# sourceMappingURL=index.js.map
|