@t2000/engine 0.37.1 → 0.38.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/README.md +11 -12
- package/dist/index.d.ts +1 -47
- package/dist/index.js +6 -525
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ QueryEngine.submitMessage()
|
|
|
87
87
|
|
|
88
88
|
## Built-in Tools
|
|
89
89
|
|
|
90
|
-
### Read Tools (
|
|
90
|
+
### Read Tools (29 — parallel, auto-approved)
|
|
91
91
|
|
|
92
92
|
| Tool | Description |
|
|
93
93
|
|------|-------------|
|
|
@@ -96,7 +96,6 @@ QueryEngine.submitMessage()
|
|
|
96
96
|
| `health_check` | Health factor with risk assessment |
|
|
97
97
|
| `rates_info` | Current supply/borrow APYs |
|
|
98
98
|
| `transaction_history` | Recent transaction log |
|
|
99
|
-
| `allowance_status` | Agent budget allowance and permissions |
|
|
100
99
|
| `explain_tx` | Human-readable transaction explanation from digest |
|
|
101
100
|
| `web_search` | Web search via Brave Search API |
|
|
102
101
|
| `swap_quote` | Preview swap route, output amount, and price impact (no execution) |
|
|
@@ -117,20 +116,12 @@ QueryEngine.submitMessage()
|
|
|
117
116
|
| `create_invoice` | Create a formal invoice with due date and line items |
|
|
118
117
|
| `list_invoices` | List invoices with statuses |
|
|
119
118
|
| `cancel_invoice` | Cancel an unpaid invoice |
|
|
120
|
-
| `toggle_allowance` | Pause or resume agent autonomous spending |
|
|
121
|
-
| `update_daily_limit` | Change the daily USDC spending cap |
|
|
122
|
-
| `update_permissions` | Update which service categories the agent can act on |
|
|
123
119
|
| `spending_analytics` | Spending breakdown by service/category over time period |
|
|
124
120
|
| `yield_summary` | Yield earned + projections with sparkline data |
|
|
125
121
|
| `activity_summary` | Activity breakdown by action type |
|
|
126
|
-
| `create_schedule` | Create a recurring scheduled action (DCA) |
|
|
127
|
-
| `list_schedules` | List scheduled actions with trust stage |
|
|
128
|
-
| `cancel_schedule` | Cancel a scheduled action |
|
|
129
122
|
| `render_canvas` | Generate interactive HTML canvas visualizations |
|
|
130
|
-
| `pattern_status` | View behavioral pattern proposals and trust stage |
|
|
131
|
-
| `record_advice` | Record financial advice given for outcome tracking |
|
|
132
123
|
|
|
133
|
-
### Write Tools (
|
|
124
|
+
### Write Tools (11 — serial, confirmation required)
|
|
134
125
|
|
|
135
126
|
| Tool | Description |
|
|
136
127
|
|------|-------------|
|
|
@@ -145,7 +136,15 @@ QueryEngine.submitMessage()
|
|
|
145
136
|
| `volo_stake` | Stake SUI for vSUI (VOLO liquid staking) |
|
|
146
137
|
| `volo_unstake` | Unstake vSUI back to SUI |
|
|
147
138
|
| `save_contact` | Save a contact name + address for quick sends |
|
|
148
|
-
|
|
139
|
+
|
|
140
|
+
> Note: `record_advice` is an Audric-local tool registered in
|
|
141
|
+
> `audric/apps/web/lib/engine/advice-tool.ts`, not part of the engine package.
|
|
142
|
+
|
|
143
|
+
> **Simplification Day 7:** Removed 9 tools — `allowance_status`, `toggle_allowance`,
|
|
144
|
+
> `update_daily_limit`, `update_permissions` (allowance contract dormant under zkLogin),
|
|
145
|
+
> `create_schedule`, `list_schedules`, `cancel_schedule` (DCA can't execute without user
|
|
146
|
+
> online to sign), `pattern_status`, `pause_pattern` (pattern proposals removed; classifiers
|
|
147
|
+
> kept as pure functions).
|
|
149
148
|
|
|
150
149
|
## Audric 2.0 Engine Features
|
|
151
150
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1719,52 +1719,6 @@ declare const activitySummaryTool: Tool<{
|
|
|
1719
1719
|
period?: "month" | "year" | "all" | "week" | undefined;
|
|
1720
1720
|
}, ActivitySummary>;
|
|
1721
1721
|
|
|
1722
|
-
declare const patternStatusTool: Tool<{}, {
|
|
1723
|
-
patterns: {
|
|
1724
|
-
id: string;
|
|
1725
|
-
actionType: string;
|
|
1726
|
-
amount: number;
|
|
1727
|
-
asset: string;
|
|
1728
|
-
cronExpr: string;
|
|
1729
|
-
enabled: boolean;
|
|
1730
|
-
nextRunAt: string;
|
|
1731
|
-
source: string;
|
|
1732
|
-
stage: number;
|
|
1733
|
-
patternType: string | null;
|
|
1734
|
-
confidence: number | null;
|
|
1735
|
-
pausedAt: string | null;
|
|
1736
|
-
totalExecutions: number;
|
|
1737
|
-
totalAmountUsdc: number;
|
|
1738
|
-
confirmationsCompleted: number;
|
|
1739
|
-
confirmationsRequired: number;
|
|
1740
|
-
}[];
|
|
1741
|
-
userCreated: {
|
|
1742
|
-
id: string;
|
|
1743
|
-
actionType: string;
|
|
1744
|
-
amount: number;
|
|
1745
|
-
asset: string;
|
|
1746
|
-
cronExpr: string;
|
|
1747
|
-
enabled: boolean;
|
|
1748
|
-
nextRunAt: string;
|
|
1749
|
-
source: string;
|
|
1750
|
-
stage: number;
|
|
1751
|
-
patternType: string | null;
|
|
1752
|
-
confidence: number | null;
|
|
1753
|
-
pausedAt: string | null;
|
|
1754
|
-
totalExecutions: number;
|
|
1755
|
-
totalAmountUsdc: number;
|
|
1756
|
-
confirmationsCompleted: number;
|
|
1757
|
-
confirmationsRequired: number;
|
|
1758
|
-
}[];
|
|
1759
|
-
} | null>;
|
|
1760
|
-
declare const pausePatternTool: Tool<{
|
|
1761
|
-
action: "pause" | "resume" | "disable";
|
|
1762
|
-
patternId: string;
|
|
1763
|
-
}, {
|
|
1764
|
-
id: string;
|
|
1765
|
-
action: "pause" | "resume" | "disable";
|
|
1766
|
-
} | null>;
|
|
1767
|
-
|
|
1768
1722
|
declare const defillamaYieldPoolsTool: Tool<{
|
|
1769
1723
|
limit?: number | undefined;
|
|
1770
1724
|
chain?: string | undefined;
|
|
@@ -1880,4 +1834,4 @@ declare function clearPriceCache(): void;
|
|
|
1880
1834
|
|
|
1881
1835
|
declare const DEFAULT_SYSTEM_PROMPT = "You are a financial agent on Sui. You manage money and access paid APIs via MPP micropayments.\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- Lead with the result. After tool calls, state the outcome with real numbers. Done.\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## 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 broad market data (yields across protocols, token prices, TVL, protocol comparisons), use defillama_* tools.\n- To discover Sui protocols, use defillama_sui_protocols first, then defillama_protocol_info 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 only (critical)\n- save_deposit accepts ONLY USDC. No other token can be deposited into savings.\n- When asked \"how much can I save?\", report only the user's USDC wallet balance (saveableUsdc field from balance_check). Other tokens like GOLD, SUI, USDT are NOT saveable and NOT savings positions \u2014 they are just wallet holdings.\n- NEVER say a non-USDC token is \"in savings\" or \"earning APY in savings\" unless it appears in the savings_info positions list. Wallet holdings \u2260 savings.\n- If user wants to save non-USDC tokens, tell them to swap to USDC first. Do NOT auto-chain swap + deposit.\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\": defillama_token_prices \u2192 calculate amount \u2192 swap_execute.\n- \"Best yield on SUI\": compare rates_info (NAVI lending) + defillama_yield_pools (broader) + volo_stats.\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 is USDC only.\n- \"What protocols are on Sui?\": defillama_sui_protocols \u2192 defillama_protocol_info for details.\n\n## Safety\n- Never encourage risky financial behavior.\n- Warn when health factor < 1.5.\n- All amounts in USDC unless stated otherwise.";
|
|
1882
1836
|
|
|
1883
|
-
export { AnthropicProvider, type AnthropicProviderConfig, 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_PERMISSION_CONFIG, DEFAULT_SYSTEM_PROMPT, EarlyToolDispatcher, type EngineConfig, type EngineEvent, type GuardCheckResult, type GuardConfig, type GuardEvent, type GuardInjection, type GuardResult, type GuardRunnerState, type GuardTier, type GuardVerdict, type HealthFactorResult, type LLMProvider, type McpCallResult, McpClientManager, McpResponseCache, type McpServerConfig, type McpServerConnection, type McpToolAdapterConfig, type McpToolDescriptor, MemorySessionStore, type Message, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_SERVER_NAME, type NaviRawCoin, type NaviRawHealthFactor, type NaviRawPool, type NaviRawPosition, type NaviRawPositionsResponse, type NaviRawProtocolStats, type NaviRawRewardsResponse, type NaviReadOptions, NaviTools, type OutputConfig, PERMISSION_PRESETS, type PendingAction, type PendingReward, type PendingToolCall, type PermissionLevel, type PermissionOperation, type PermissionResponse, type PermissionRule, 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, type SavingsResult, type ServerPositionData, type SessionData, type SessionStore, type StateType, type StopReason, type SuiCoinBalance, type SystemBlock, type SystemPrompt, TOOL_FLAGS, type ThinkingConfig, type ThinkingEffort, type Tool, type ToolChoice, type ToolContext, type ToolDefinition, type ToolFlags, type ToolJsonSchema, type ToolResult, TxMutex, type UserFinancialProfile, type UserPermissionConfig, WRITE_TOOLS, type WalletCoin, activitySummaryTool, adaptAllMcpTools, adaptAllServerTools, adaptMcpTool, applyToolFlags, balanceCheckTool, borrowTool, budgetToolResult, buildCachedSystemPrompt, buildMcpTools, buildProactivenessInstructions, buildProfileContext, buildSelfEvaluationInstruction, buildStateContext, buildTool, claimRewardsTool, classifyEffort, clearPriceCache, compactMessages, createGuardRunnerState, defillamaChainTvlTool, defillamaPriceChangeTool, defillamaProtocolFeesTool, defillamaProtocolInfoTool, defillamaSuiProtocolsTool, defillamaTokenPricesTool, defillamaYieldPoolsTool, engineToSSE, estimateTokens, explainTxTool, extractConversationText, extractMcpText, fetchAvailableRewards, fetchBalance, fetchHealthFactor, fetchPositions, fetchProtocolStats, fetchRates, fetchSavings, fetchTokenPrices, fetchWalletCoins, findTool, getDefaultTools, getMcpManager, getToolFlags, getWalletAddress, guardArtifactPreview, guardStaleData, hasNaviMcp, healthCheckTool, loadRecipes, microcompact, mppServicesTool, parseMcpJson, parseRecipe, parseSSE,
|
|
1837
|
+
export { AnthropicProvider, type AnthropicProviderConfig, 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_PERMISSION_CONFIG, DEFAULT_SYSTEM_PROMPT, EarlyToolDispatcher, type EngineConfig, type EngineEvent, type GuardCheckResult, type GuardConfig, type GuardEvent, type GuardInjection, type GuardResult, type GuardRunnerState, type GuardTier, type GuardVerdict, type HealthFactorResult, type LLMProvider, type McpCallResult, McpClientManager, McpResponseCache, type McpServerConfig, type McpServerConnection, type McpToolAdapterConfig, type McpToolDescriptor, MemorySessionStore, type Message, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_SERVER_NAME, type NaviRawCoin, type NaviRawHealthFactor, type NaviRawPool, type NaviRawPosition, type NaviRawPositionsResponse, type NaviRawProtocolStats, type NaviRawRewardsResponse, type NaviReadOptions, NaviTools, type OutputConfig, PERMISSION_PRESETS, type PendingAction, type PendingReward, type PendingToolCall, type PermissionLevel, type PermissionOperation, type PermissionResponse, type PermissionRule, 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, type SavingsResult, type ServerPositionData, type SessionData, type SessionStore, type StateType, type StopReason, type SuiCoinBalance, type SystemBlock, type SystemPrompt, TOOL_FLAGS, type ThinkingConfig, type ThinkingEffort, type Tool, type ToolChoice, type ToolContext, type ToolDefinition, type ToolFlags, type ToolJsonSchema, type ToolResult, TxMutex, type UserFinancialProfile, type UserPermissionConfig, WRITE_TOOLS, type WalletCoin, activitySummaryTool, adaptAllMcpTools, adaptAllServerTools, adaptMcpTool, applyToolFlags, balanceCheckTool, borrowTool, budgetToolResult, buildCachedSystemPrompt, buildMcpTools, buildProactivenessInstructions, buildProfileContext, buildSelfEvaluationInstruction, buildStateContext, buildTool, claimRewardsTool, classifyEffort, clearPriceCache, compactMessages, createGuardRunnerState, defillamaChainTvlTool, defillamaPriceChangeTool, defillamaProtocolFeesTool, defillamaProtocolInfoTool, defillamaSuiProtocolsTool, defillamaTokenPricesTool, defillamaYieldPoolsTool, engineToSSE, estimateTokens, explainTxTool, extractConversationText, extractMcpText, fetchAvailableRewards, fetchBalance, fetchHealthFactor, fetchPositions, fetchProtocolStats, fetchRates, fetchSavings, fetchTokenPrices, fetchWalletCoins, findTool, getDefaultTools, getMcpManager, getToolFlags, getWalletAddress, guardArtifactPreview, guardStaleData, hasNaviMcp, healthCheckTool, loadRecipes, microcompact, mppServicesTool, parseMcpJson, parseRecipe, parseSSE, payApiTool, portfolioAnalysisTool, protocolDeepDiveTool, ratesInfoTool, registerEngineTools, renderCanvasTool, repayDebtTool, requireAgent, resolvePermissionTier, resolveUsdValue, runGuards, runTools, saveContactTool, saveDepositTool, savingsInfoTool, sendTransferTool, serializeSSE, spendingAnalyticsTool, swapExecuteTool, swapQuoteTool, toolNameToOperation, toolsToDefinitions, transactionHistoryTool, transformBalance, transformHealthFactor, transformPositions, transformRates, transformRewards, transformSavings, updateGuardStateAfterToolResult, validateHistory, voloStakeTool, voloStatsTool, voloUnstakeTool, webSearchTool, withdrawTool, yieldSummaryTool };
|