@t2000/engine 0.39.0 → 0.40.1
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 +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1832,6 +1832,6 @@ declare function fetchWalletCoins(address: string, rpcUrl?: string): Promise<Wal
|
|
|
1832
1832
|
declare function fetchTokenPrices(coinTypes: string[]): Promise<Record<string, number>>;
|
|
1833
1833
|
declare function clearPriceCache(): void;
|
|
1834
1834
|
|
|
1835
|
-
declare const DEFAULT_SYSTEM_PROMPT = "You are a financial agent on Sui. You
|
|
1835
|
+
declare const DEFAULT_SYSTEM_PROMPT = "You are Audric \u2014 a financial agent on Sui. You handle money (Audric Finance: save, send, swap, borrow, repay, withdraw) and call paid APIs via MPP micropayments (Audric Pay: 41 services, 90+ endpoints). A silent intelligence layer (financial profile, conversation memory, chain memory, AdviceLog) shapes your replies but never surfaces as a notification \u2014 you act only when the user asks. The creator marketplace (Audric Store) ships in Phase 5 \u2014 if a user asks about it, say \"coming soon.\"\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.";
|
|
1836
1836
|
|
|
1837
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 };
|
package/dist/index.js
CHANGED
|
@@ -2005,7 +2005,7 @@ var portfolioAnalysisTool = buildTool({
|
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
let weekChange;
|
|
2008
|
-
const apiUrl = context.env?.
|
|
2008
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2009
2009
|
if (apiUrl && address) {
|
|
2010
2010
|
try {
|
|
2011
2011
|
const histRes = await fetch(
|
|
@@ -2240,7 +2240,7 @@ var createPaymentLinkTool = buildTool({
|
|
|
2240
2240
|
},
|
|
2241
2241
|
isReadOnly: true,
|
|
2242
2242
|
async call(input, context) {
|
|
2243
|
-
const apiUrl = context.env?.
|
|
2243
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2244
2244
|
if (!apiUrl || !context.walletAddress) {
|
|
2245
2245
|
return { data: null, displayText: "Payment link creation is not available." };
|
|
2246
2246
|
}
|
|
@@ -2273,7 +2273,7 @@ var listPaymentLinksTool = buildTool({
|
|
|
2273
2273
|
jsonSchema: { type: "object", properties: {}, required: [] },
|
|
2274
2274
|
isReadOnly: true,
|
|
2275
2275
|
async call(_input, context) {
|
|
2276
|
-
const apiUrl = context.env?.
|
|
2276
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2277
2277
|
if (!apiUrl || !context.walletAddress) {
|
|
2278
2278
|
return { data: { links: [] }, displayText: "No payment links found." };
|
|
2279
2279
|
}
|
|
@@ -2325,7 +2325,7 @@ var createInvoiceTool = buildTool({
|
|
|
2325
2325
|
},
|
|
2326
2326
|
isReadOnly: true,
|
|
2327
2327
|
async call(input, context) {
|
|
2328
|
-
const apiUrl = context.env?.
|
|
2328
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2329
2329
|
if (!apiUrl || !context.walletAddress) {
|
|
2330
2330
|
return { data: null, displayText: "Invoice creation is not available." };
|
|
2331
2331
|
}
|
|
@@ -2366,7 +2366,7 @@ var cancelPaymentLinkTool = buildTool({
|
|
|
2366
2366
|
},
|
|
2367
2367
|
isReadOnly: true,
|
|
2368
2368
|
async call(input, context) {
|
|
2369
|
-
const apiUrl = context.env?.
|
|
2369
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2370
2370
|
if (!apiUrl || !context.walletAddress) {
|
|
2371
2371
|
return { data: null, displayText: "Payment link cancellation is not available." };
|
|
2372
2372
|
}
|
|
@@ -2406,7 +2406,7 @@ var cancelInvoiceTool = buildTool({
|
|
|
2406
2406
|
},
|
|
2407
2407
|
isReadOnly: true,
|
|
2408
2408
|
async call(input, context) {
|
|
2409
|
-
const apiUrl = context.env?.
|
|
2409
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2410
2410
|
if (!apiUrl || !context.walletAddress) {
|
|
2411
2411
|
return { data: null, displayText: "Invoice cancellation is not available." };
|
|
2412
2412
|
}
|
|
@@ -2438,7 +2438,7 @@ var listInvoicesTool = buildTool({
|
|
|
2438
2438
|
jsonSchema: { type: "object", properties: {}, required: [] },
|
|
2439
2439
|
isReadOnly: true,
|
|
2440
2440
|
async call(_input, context) {
|
|
2441
|
-
const apiUrl = context.env?.
|
|
2441
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2442
2442
|
if (!apiUrl || !context.walletAddress) {
|
|
2443
2443
|
return { data: { invoices: [] }, displayText: "No invoices found." };
|
|
2444
2444
|
}
|
|
@@ -2696,7 +2696,7 @@ var spendingAnalyticsTool = buildTool({
|
|
|
2696
2696
|
isReadOnly: true,
|
|
2697
2697
|
async call(input, context) {
|
|
2698
2698
|
const period = input.period ?? "month";
|
|
2699
|
-
const apiUrl = context.env?.
|
|
2699
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2700
2700
|
const address = context.walletAddress;
|
|
2701
2701
|
const empty = { period, totalSpent: 0, requestCount: 0, serviceCount: 0, byService: [] };
|
|
2702
2702
|
if (!apiUrl || !address) {
|
|
@@ -2732,7 +2732,7 @@ var yieldSummaryTool = buildTool({
|
|
|
2732
2732
|
jsonSchema: { type: "object", properties: {}, required: [] },
|
|
2733
2733
|
isReadOnly: true,
|
|
2734
2734
|
async call(_input, context) {
|
|
2735
|
-
const apiUrl = context.env?.
|
|
2735
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2736
2736
|
const address = context.walletAddress;
|
|
2737
2737
|
const empty = {
|
|
2738
2738
|
today: 0,
|
|
@@ -2782,7 +2782,7 @@ var activitySummaryTool = buildTool({
|
|
|
2782
2782
|
isReadOnly: true,
|
|
2783
2783
|
async call(input, context) {
|
|
2784
2784
|
const period = input.period ?? "month";
|
|
2785
|
-
const apiUrl = context.env?.
|
|
2785
|
+
const apiUrl = context.env?.AUDRIC_INTERNAL_API_URL;
|
|
2786
2786
|
const address = context.walletAddress;
|
|
2787
2787
|
const empty = {
|
|
2788
2788
|
period,
|
|
@@ -3150,7 +3150,7 @@ function getDefaultTools() {
|
|
|
3150
3150
|
}
|
|
3151
3151
|
|
|
3152
3152
|
// src/prompt.ts
|
|
3153
|
-
var DEFAULT_SYSTEM_PROMPT = `You are a financial agent on Sui. You
|
|
3153
|
+
var DEFAULT_SYSTEM_PROMPT = `You are Audric \u2014 a financial agent on Sui. You handle money (Audric Finance: save, send, swap, borrow, repay, withdraw) and call paid APIs via MPP micropayments (Audric Pay: 41 services, 90+ endpoints). A silent intelligence layer (financial profile, conversation memory, chain memory, AdviceLog) shapes your replies but never surfaces as a notification \u2014 you act only when the user asks. The creator marketplace (Audric Store) ships in Phase 5 \u2014 if a user asks about it, say "coming soon."
|
|
3154
3154
|
|
|
3155
3155
|
## Response rules
|
|
3156
3156
|
- 1-2 sentences max. No bullet lists unless asked. No preambles.
|