teleton 0.2.5 → 0.3.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.
@@ -30,7 +30,7 @@ import {
30
30
  initializeMemory,
31
31
  migrateFromMainDb,
32
32
  openModuleDb
33
- } from "./chunk-DR6WM6B5.js";
33
+ } from "./chunk-QQW6KE7Q.js";
34
34
  import {
35
35
  COINGECKO_API_URL,
36
36
  ELEVENLABS_TTS_URL,
@@ -65,7 +65,7 @@ import {
65
65
  TELEGRAM_CONNECTION_RETRIES,
66
66
  TELEGRAM_FLOOD_SLEEP_THRESHOLD,
67
67
  TELEGRAM_MAX_MESSAGE_LENGTH
68
- } from "./chunk-2X4PCE7V.js";
68
+ } from "./chunk-UYF4TT44.js";
69
69
  import {
70
70
  ALLOWED_EXTENSIONS,
71
71
  MAX_FILE_SIZES,
@@ -1524,7 +1524,7 @@ var PROVIDER_REGISTRY = {
1524
1524
  keyHint: "sk-or-v1-...",
1525
1525
  consoleUrl: "https://openrouter.ai/keys",
1526
1526
  defaultModel: "anthropic/claude-opus-4.5",
1527
- utilityModel: "google/gemini-2.0-flash-001:free",
1527
+ utilityModel: "google/gemini-2.5-flash-lite",
1528
1528
  toolLimit: 128,
1529
1529
  piAiProvider: "openrouter"
1530
1530
  }
@@ -2149,6 +2149,9 @@ function getProviderModel(provider, modelId) {
2149
2149
  const meta = getProviderMetadata(provider);
2150
2150
  try {
2151
2151
  const model = getModel(meta.piAiProvider, modelId);
2152
+ if (!model) {
2153
+ throw new Error(`getModel returned undefined for ${provider}/${modelId}`);
2154
+ }
2152
2155
  modelCache.set(cacheKey, model);
2153
2156
  return model;
2154
2157
  } catch (e) {
@@ -2160,6 +2163,11 @@ function getProviderModel(provider, modelId) {
2160
2163
  if (fallbackCached) return fallbackCached;
2161
2164
  try {
2162
2165
  const model = getModel(meta.piAiProvider, meta.defaultModel);
2166
+ if (!model) {
2167
+ throw new Error(
2168
+ `Fallback model ${meta.defaultModel} also returned undefined for ${provider}`
2169
+ );
2170
+ }
2163
2171
  modelCache.set(fallbackKey, model);
2164
2172
  return model;
2165
2173
  } catch {
@@ -3633,6 +3641,11 @@ ${statsContext}`;
3633
3641
  */
3634
3642
  clearHistory(chatId) {
3635
3643
  const db3 = getDatabase().getDb();
3644
+ db3.prepare(
3645
+ `DELETE FROM tg_messages_vec WHERE id IN (
3646
+ SELECT id FROM tg_messages WHERE chat_id = ?
3647
+ )`
3648
+ ).run(chatId);
3636
3649
  db3.prepare(`DELETE FROM tg_messages WHERE chat_id = ?`).run(chatId);
3637
3650
  resetSession(chatId);
3638
3651
  console.log(`\u{1F5D1}\uFE0F Cleared history for chat ${chatId}`);
@@ -4591,7 +4604,7 @@ var MessageHandler = class {
4591
4604
  reason: "Already processed"
4592
4605
  };
4593
4606
  }
4594
- if (message.isGroup && message.isBot) {
4607
+ if (message.isBot) {
4595
4608
  return {
4596
4609
  message,
4597
4610
  isAdmin,
@@ -15593,6 +15606,223 @@ var tonMyTransactionsExecutor = async (params, context) => {
15593
15606
  }
15594
15607
  };
15595
15608
 
15609
+ // src/agent/tools/ton/chart.ts
15610
+ import { Type as Type78 } from "@sinclair/typebox";
15611
+ var tonChartTool = {
15612
+ name: "ton_chart",
15613
+ description: "Get price history chart for TON or any jetton. Returns price points over a time period with stats (min, max, change %). Use token param for jettons (master contract address).",
15614
+ parameters: Type78.Object({
15615
+ token: Type78.Optional(
15616
+ Type78.String({
15617
+ description: 'Token identifier: "ton" for TON, or a jetton master contract address. Defaults to "ton".'
15618
+ })
15619
+ ),
15620
+ period: Type78.Optional(
15621
+ Type78.String({
15622
+ description: 'Time period: "1h", "24h", "7d", "30d", "90d", "1y". Defaults to "7d".'
15623
+ })
15624
+ )
15625
+ }),
15626
+ category: "data-bearing"
15627
+ };
15628
+ var PERIOD_CONFIG = {
15629
+ "1h": { seconds: 3600, points: 60 },
15630
+ "24h": { seconds: 86400, points: 96 },
15631
+ "7d": { seconds: 604800, points: 168 },
15632
+ "30d": { seconds: 2592e3, points: 120 },
15633
+ "90d": { seconds: 7776e3, points: 180 },
15634
+ "1y": { seconds: 31536e3, points: 200 }
15635
+ };
15636
+ var tonChartExecutor = async (params, context) => {
15637
+ try {
15638
+ const token = params.token || "ton";
15639
+ const period = params.period || "7d";
15640
+ const config = PERIOD_CONFIG[period];
15641
+ if (!config) {
15642
+ return {
15643
+ success: false,
15644
+ error: `Invalid period "${period}". Use one of: ${Object.keys(PERIOD_CONFIG).join(", ")}`
15645
+ };
15646
+ }
15647
+ const endDate = Math.floor(Date.now() / 1e3);
15648
+ const startDate = endDate - config.seconds;
15649
+ const url = `/rates/chart?token=${encodeURIComponent(token)}&currency=usd&start_date=${startDate}&end_date=${endDate}&points_count=${config.points}`;
15650
+ const res = await tonapiFetch(url);
15651
+ if (!res.ok) {
15652
+ const text = await res.text().catch(() => "");
15653
+ return {
15654
+ success: false,
15655
+ error: `TonAPI returned ${res.status}: ${text || res.statusText}`
15656
+ };
15657
+ }
15658
+ const data = await res.json();
15659
+ if (!Array.isArray(data.points) || data.points.length === 0) {
15660
+ return {
15661
+ success: false,
15662
+ error: `No price data available for token "${token}" over period "${period}".`
15663
+ };
15664
+ }
15665
+ const rawPoints = data.points;
15666
+ const sorted = [...rawPoints].sort((a, b) => a[0] - b[0]);
15667
+ const points = sorted.map(([ts, price]) => ({
15668
+ timestamp: ts,
15669
+ date: new Date(ts * 1e3).toISOString(),
15670
+ price
15671
+ }));
15672
+ const prices = points.map((p2) => p2.price);
15673
+ const startPrice = prices[0];
15674
+ const currentPrice = prices[prices.length - 1];
15675
+ const minPrice = Math.min(...prices);
15676
+ const maxPrice = Math.max(...prices);
15677
+ const changeAbsolute = currentPrice - startPrice;
15678
+ const changePercent = startPrice !== 0 ? changeAbsolute / startPrice * 100 : 0;
15679
+ const minIdx = prices.indexOf(minPrice);
15680
+ const maxIdx = prices.indexOf(maxPrice);
15681
+ const stats = {
15682
+ currentPrice,
15683
+ startPrice,
15684
+ minPrice,
15685
+ maxPrice,
15686
+ changePercent: Math.round(changePercent * 100) / 100,
15687
+ changeAbsolute: Math.round(changeAbsolute * 1e6) / 1e6,
15688
+ high: { price: maxPrice, date: points[maxIdx].date },
15689
+ low: { price: minPrice, date: points[minIdx].date }
15690
+ };
15691
+ const direction = changePercent >= 0 ? "+" : "";
15692
+ const tokenLabel = token === "ton" ? "TON" : token;
15693
+ const message = `${tokenLabel} price over ${period}: $${currentPrice.toFixed(4)} (${direction}${stats.changePercent}%). Low: $${minPrice.toFixed(4)}, High: $${maxPrice.toFixed(4)}. ${points.length} data points.`;
15694
+ return {
15695
+ success: true,
15696
+ data: {
15697
+ token: tokenLabel,
15698
+ period,
15699
+ points,
15700
+ stats,
15701
+ message
15702
+ }
15703
+ };
15704
+ } catch (error) {
15705
+ console.error("Error in ton_chart:", error);
15706
+ return {
15707
+ success: false,
15708
+ error: error instanceof Error ? error.message : String(error)
15709
+ };
15710
+ }
15711
+ };
15712
+
15713
+ // src/agent/tools/ton/nft-list.ts
15714
+ import { Type as Type79 } from "@sinclair/typebox";
15715
+ var nftListTool = {
15716
+ name: "nft_list",
15717
+ description: "List NFTs owned by a TON wallet. Defaults to the agent's own wallet. Can filter by collection address.",
15718
+ parameters: Type79.Object({
15719
+ address: Type79.Optional(
15720
+ Type79.String({
15721
+ description: "TON wallet address to query. Defaults to the agent's wallet."
15722
+ })
15723
+ ),
15724
+ collection: Type79.Optional(
15725
+ Type79.String({
15726
+ description: "Filter by collection contract address."
15727
+ })
15728
+ ),
15729
+ limit: Type79.Optional(
15730
+ Type79.Number({
15731
+ description: "Max NFTs to return (1-100). Defaults to 50.",
15732
+ minimum: 1,
15733
+ maximum: 100
15734
+ })
15735
+ )
15736
+ }),
15737
+ category: "data-bearing"
15738
+ };
15739
+ var nftListExecutor = async (params, context) => {
15740
+ try {
15741
+ const address4 = params.address || getWalletAddress();
15742
+ if (!address4) {
15743
+ return {
15744
+ success: false,
15745
+ error: "No address provided and agent wallet is not initialized."
15746
+ };
15747
+ }
15748
+ const limit = params.limit || 50;
15749
+ const queryParts = [`limit=${limit}`, "indirect_ownership=true"];
15750
+ if (params.collection) {
15751
+ queryParts.push(`collection=${encodeURIComponent(params.collection)}`);
15752
+ }
15753
+ const url = `/accounts/${encodeURIComponent(address4)}/nfts?${queryParts.join("&")}`;
15754
+ const res = await tonapiFetch(url);
15755
+ if (!res.ok) {
15756
+ const text = await res.text().catch(() => "");
15757
+ return {
15758
+ success: false,
15759
+ error: `TonAPI returned ${res.status}: ${text || res.statusText}`
15760
+ };
15761
+ }
15762
+ const data = await res.json();
15763
+ if (!Array.isArray(data.nft_items)) {
15764
+ return {
15765
+ success: false,
15766
+ error: "Invalid API response: missing nft_items array"
15767
+ };
15768
+ }
15769
+ const rawItems = data.nft_items;
15770
+ const filtered = rawItems.filter((item) => item.trust !== "blacklist");
15771
+ const nfts = filtered.map((item) => {
15772
+ const meta = item.metadata || {};
15773
+ const coll = item.collection || {};
15774
+ const sale = item.sale;
15775
+ const previews = item.previews || [];
15776
+ const preview = previews.length > 1 && previews[1].url || previews.length > 0 && previews[0].url || null;
15777
+ let salePrice = null;
15778
+ if (sale?.price?.value) {
15779
+ const raw = Number(sale.price.value);
15780
+ if (!isNaN(raw) && raw > 0) {
15781
+ const amount = raw / 1e9;
15782
+ const currency = sale.price.token_name || "TON";
15783
+ salePrice = `${amount} ${currency}`;
15784
+ }
15785
+ }
15786
+ return {
15787
+ address: item.address,
15788
+ name: meta.name || "Unnamed NFT",
15789
+ description: (meta.description || "").slice(0, 100),
15790
+ collection: coll.name || null,
15791
+ collectionAddress: coll.address || null,
15792
+ preview,
15793
+ onSale: !!sale,
15794
+ salePrice,
15795
+ marketplace: sale?.marketplace || null,
15796
+ dns: item.dns || null,
15797
+ trust: item.trust || "none",
15798
+ explorer: `https://tonviewer.com/${item.address}`
15799
+ };
15800
+ });
15801
+ const hasMore = rawItems.length >= limit;
15802
+ const summary = `Found ${nfts.length} NFT(s) for ${address4}${params.collection ? ` in collection ${params.collection}` : ""}${hasMore ? ` (limit ${limit} reached, there may be more)` : ""}.`;
15803
+ const onSaleCount = nfts.filter((n2) => n2.onSale).length;
15804
+ const collections = [...new Set(nfts.map((n2) => n2.collection).filter(Boolean))];
15805
+ const message = `${summary}${onSaleCount > 0 ? ` ${onSaleCount} on sale.` : ""} Collections: ${collections.length > 0 ? collections.join(", ") : "none"}.`;
15806
+ return {
15807
+ success: true,
15808
+ data: {
15809
+ address: address4,
15810
+ totalNfts: nfts.length,
15811
+ hasMore,
15812
+ nfts,
15813
+ message,
15814
+ summary
15815
+ }
15816
+ };
15817
+ } catch (error) {
15818
+ console.error("Error in nft_list:", error);
15819
+ return {
15820
+ success: false,
15821
+ error: error instanceof Error ? error.message : String(error)
15822
+ };
15823
+ }
15824
+ };
15825
+
15596
15826
  // src/agent/tools/ton/index.ts
15597
15827
  var tools16 = [
15598
15828
  { tool: tonSendTool, executor: tonSendExecutor, scope: "dm-only" },
@@ -15600,16 +15830,18 @@ var tools16 = [
15600
15830
  { tool: tonGetBalanceTool, executor: tonGetBalanceExecutor },
15601
15831
  { tool: tonPriceTool, executor: tonPriceExecutor },
15602
15832
  { tool: tonGetTransactionsTool, executor: tonGetTransactionsExecutor },
15603
- { tool: tonMyTransactionsTool, executor: tonMyTransactionsExecutor }
15833
+ { tool: tonMyTransactionsTool, executor: tonMyTransactionsExecutor },
15834
+ { tool: tonChartTool, executor: tonChartExecutor },
15835
+ { tool: nftListTool, executor: nftListExecutor }
15604
15836
  ];
15605
15837
 
15606
15838
  // src/agent/tools/dns/check.ts
15607
- import { Type as Type78 } from "@sinclair/typebox";
15839
+ import { Type as Type80 } from "@sinclair/typebox";
15608
15840
  var dnsCheckTool = {
15609
15841
  name: "dns_check",
15610
15842
  description: "Check if a .ton domain is available, in auction, or already owned. Returns status with relevant details (price estimates, current bids, owner info).",
15611
- parameters: Type78.Object({
15612
- domain: Type78.String({
15843
+ parameters: Type80.Object({
15844
+ domain: Type80.String({
15613
15845
  description: "Domain name to check (with or without .ton extension)"
15614
15846
  })
15615
15847
  })
@@ -15723,13 +15955,13 @@ var dnsCheckExecutor = async (params, context) => {
15723
15955
  };
15724
15956
 
15725
15957
  // src/agent/tools/dns/auctions.ts
15726
- import { Type as Type79 } from "@sinclair/typebox";
15958
+ import { Type as Type81 } from "@sinclair/typebox";
15727
15959
  var dnsAuctionsTool = {
15728
15960
  name: "dns_auctions",
15729
15961
  description: "List all active .ton domain auctions. Returns domains currently in auction with current bid prices, number of bids, and end times.",
15730
- parameters: Type79.Object({
15731
- limit: Type79.Optional(
15732
- Type79.Number({
15962
+ parameters: Type81.Object({
15963
+ limit: Type81.Optional(
15964
+ Type81.Number({
15733
15965
  description: "Maximum number of auctions to return (default: 20, max: 100)",
15734
15966
  minimum: 1,
15735
15967
  maximum: 100
@@ -15794,12 +16026,12 @@ ${summary}`
15794
16026
  };
15795
16027
 
15796
16028
  // src/agent/tools/dns/resolve.ts
15797
- import { Type as Type80 } from "@sinclair/typebox";
16029
+ import { Type as Type82 } from "@sinclair/typebox";
15798
16030
  var dnsResolveTool = {
15799
16031
  name: "dns_resolve",
15800
16032
  description: "Resolve a .ton domain to its associated wallet address. Only works for domains that are already owned (not available or in auction).",
15801
- parameters: Type80.Object({
15802
- domain: Type80.String({
16033
+ parameters: Type82.Object({
16034
+ domain: Type82.String({
15803
16035
  description: "Domain name to resolve (with or without .ton extension)"
15804
16036
  })
15805
16037
  })
@@ -15855,7 +16087,7 @@ var dnsResolveExecutor = async (params, context) => {
15855
16087
  };
15856
16088
 
15857
16089
  // src/agent/tools/dns/start-auction.ts
15858
- import { Type as Type81 } from "@sinclair/typebox";
16090
+ import { Type as Type83 } from "@sinclair/typebox";
15859
16091
  import { mnemonicToPrivateKey as mnemonicToPrivateKey4 } from "@ton/crypto";
15860
16092
  import { WalletContractV5R1 as WalletContractV5R14, TonClient as TonClient7, toNano as toNano3, internal as internal3, beginCell } from "@ton/ton";
15861
16093
  import { Address as Address6, SendMode as SendMode3 } from "@ton/core";
@@ -15863,11 +16095,11 @@ var DNS_COLLECTION = "EQC3dNlesgVD8YbAazcauIrXBPfiVhMMr5YYk2in0Mtsz0Bz";
15863
16095
  var dnsStartAuctionTool = {
15864
16096
  name: "dns_start_auction",
15865
16097
  description: "Start an auction for an unminted .ton domain. Sends TON to the DNS collection contract to mint a new domain NFT. Domain must be 4-126 characters, available (not minted), and amount must meet minimum price.",
15866
- parameters: Type81.Object({
15867
- domain: Type81.String({
16098
+ parameters: Type83.Object({
16099
+ domain: Type83.String({
15868
16100
  description: "Domain name to mint (without .ton extension, 4-126 chars)"
15869
16101
  }),
15870
- amount: Type81.Number({
16102
+ amount: Type83.Number({
15871
16103
  description: "Bid amount in TON (must meet minimum: ~100 TON for 4 chars, ~1 TON for 11+ chars)",
15872
16104
  minimum: 1
15873
16105
  })
@@ -15942,18 +16174,18 @@ var dnsStartAuctionExecutor = async (params, context) => {
15942
16174
  };
15943
16175
 
15944
16176
  // src/agent/tools/dns/bid.ts
15945
- import { Type as Type82 } from "@sinclair/typebox";
16177
+ import { Type as Type84 } from "@sinclair/typebox";
15946
16178
  import { mnemonicToPrivateKey as mnemonicToPrivateKey5 } from "@ton/crypto";
15947
16179
  import { WalletContractV5R1 as WalletContractV5R15, TonClient as TonClient8, toNano as toNano4, internal as internal4 } from "@ton/ton";
15948
16180
  import { Address as Address7, SendMode as SendMode4 } from "@ton/core";
15949
16181
  var dnsBidTool = {
15950
16182
  name: "dns_bid",
15951
16183
  description: "Place a bid on an existing .ton domain auction. Bid must be at least 5% higher than current bid. The domain must already be in auction (use dns_check first to verify status and get current bid).",
15952
- parameters: Type82.Object({
15953
- domain: Type82.String({
16184
+ parameters: Type84.Object({
16185
+ domain: Type84.String({
15954
16186
  description: "Domain name (with or without .ton extension)"
15955
16187
  }),
15956
- amount: Type82.Number({
16188
+ amount: Type84.Number({
15957
16189
  description: "Bid amount in TON (must be >= 105% of current bid)",
15958
16190
  minimum: 1
15959
16191
  })
@@ -16059,7 +16291,7 @@ var dnsBidExecutor = async (params, context) => {
16059
16291
  };
16060
16292
 
16061
16293
  // src/agent/tools/dns/link.ts
16062
- import { Type as Type83 } from "@sinclair/typebox";
16294
+ import { Type as Type85 } from "@sinclair/typebox";
16063
16295
  import { mnemonicToPrivateKey as mnemonicToPrivateKey6 } from "@ton/crypto";
16064
16296
  import { WalletContractV5R1 as WalletContractV5R16, TonClient as TonClient9, toNano as toNano5, internal as internal5, beginCell as beginCell2 } from "@ton/ton";
16065
16297
  import { Address as Address8, SendMode as SendMode5 } from "@ton/core";
@@ -16071,12 +16303,12 @@ var WALLET_RECORD_KEY = BigInt(
16071
16303
  var dnsLinkTool = {
16072
16304
  name: "dns_link",
16073
16305
  description: "Link a wallet address to a .ton domain you own. This sets the wallet record so the domain resolves to the specified address. If no wallet_address is provided, links to your own wallet.",
16074
- parameters: Type83.Object({
16075
- domain: Type83.String({
16306
+ parameters: Type85.Object({
16307
+ domain: Type85.String({
16076
16308
  description: "Domain name (with or without .ton extension)"
16077
16309
  }),
16078
- wallet_address: Type83.Optional(
16079
- Type83.String({
16310
+ wallet_address: Type85.Optional(
16311
+ Type85.String({
16080
16312
  description: "Wallet address to link (defaults to your wallet if not specified)"
16081
16313
  })
16082
16314
  )
@@ -16186,7 +16418,7 @@ var dnsLinkExecutor = async (params, context) => {
16186
16418
  };
16187
16419
 
16188
16420
  // src/agent/tools/dns/unlink.ts
16189
- import { Type as Type84 } from "@sinclair/typebox";
16421
+ import { Type as Type86 } from "@sinclair/typebox";
16190
16422
  import { mnemonicToPrivateKey as mnemonicToPrivateKey7 } from "@ton/crypto";
16191
16423
  import { WalletContractV5R1 as WalletContractV5R17, TonClient as TonClient10, toNano as toNano6, internal as internal6, beginCell as beginCell3 } from "@ton/ton";
16192
16424
  import { Address as Address9, SendMode as SendMode6 } from "@ton/core";
@@ -16197,8 +16429,8 @@ var WALLET_RECORD_KEY2 = BigInt(
16197
16429
  var dnsUnlinkTool = {
16198
16430
  name: "dns_unlink",
16199
16431
  description: "Remove the wallet link from a .ton domain you own. This deletes the wallet record so the domain no longer resolves to any address.",
16200
- parameters: Type84.Object({
16201
- domain: Type84.String({
16432
+ parameters: Type86.Object({
16433
+ domain: Type86.String({
16202
16434
  description: "Domain name (with or without .ton extension)"
16203
16435
  })
16204
16436
  })
@@ -16307,11 +16539,11 @@ var tools17 = [
16307
16539
  ];
16308
16540
 
16309
16541
  // src/agent/tools/jetton/balances.ts
16310
- import { Type as Type85 } from "@sinclair/typebox";
16542
+ import { Type as Type87 } from "@sinclair/typebox";
16311
16543
  var jettonBalancesTool = {
16312
16544
  name: "jetton_balances",
16313
16545
  description: "Get all Jetton (token) balances owned by the agent. Returns a list of all tokens with their balances, names, symbols, and verification status. Useful to check what tokens you currently hold.",
16314
- parameters: Type85.Object({}),
16546
+ parameters: Type87.Object({}),
16315
16547
  category: "data-bearing"
16316
16548
  };
16317
16549
  var jettonBalancesExecutor = async (params, context) => {
@@ -16412,7 +16644,7 @@ var jettonBalancesExecutor = async (params, context) => {
16412
16644
  };
16413
16645
 
16414
16646
  // src/agent/tools/jetton/swap.ts
16415
- import { Type as Type86 } from "@sinclair/typebox";
16647
+ import { Type as Type88 } from "@sinclair/typebox";
16416
16648
  import { mnemonicToPrivateKey as mnemonicToPrivateKey8 } from "@ton/crypto";
16417
16649
  import { WalletContractV5R1 as WalletContractV5R18, TonClient as TonClient11, toNano as toNano19, internal as internal7 } from "@ton/ton";
16418
16650
  import { SendMode as SendMode7 } from "@ton/core";
@@ -19741,19 +19973,19 @@ var NATIVE_TON_ADDRESS = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c";
19741
19973
  var jettonSwapTool = {
19742
19974
  name: "jetton_swap",
19743
19975
  description: "Swap tokens on STON.fi DEX. Supports TON\u2194Jetton and Jetton\u2194Jetton swaps. Use 'ton' as from_asset to buy jettons with TON, or provide jetton master address. Amount is in human-readable units (will be converted based on decimals). Example: swap 10 TON for USDT, or swap USDT for SCALE.",
19744
- parameters: Type86.Object({
19745
- from_asset: Type86.String({
19976
+ parameters: Type88.Object({
19977
+ from_asset: Type88.String({
19746
19978
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
19747
19979
  }),
19748
- to_asset: Type86.String({
19980
+ to_asset: Type88.String({
19749
19981
  description: "Destination jetton master address (EQ... format)"
19750
19982
  }),
19751
- amount: Type86.Number({
19983
+ amount: Type88.Number({
19752
19984
  description: "Amount to swap in human-readable units (e.g., 10 for 10 TON or 10 tokens)",
19753
19985
  minimum: 1e-3
19754
19986
  }),
19755
- slippage: Type86.Optional(
19756
- Type86.Number({
19987
+ slippage: Type88.Optional(
19988
+ Type88.Number({
19757
19989
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
19758
19990
  minimum: 1e-3,
19759
19991
  maximum: 0.5
@@ -19871,7 +20103,7 @@ var jettonSwapExecutor = async (params, context) => {
19871
20103
  };
19872
20104
 
19873
20105
  // src/agent/tools/jetton/send.ts
19874
- import { Type as Type87 } from "@sinclair/typebox";
20106
+ import { Type as Type89 } from "@sinclair/typebox";
19875
20107
  import { mnemonicToPrivateKey as mnemonicToPrivateKey9 } from "@ton/crypto";
19876
20108
  import { WalletContractV5R1 as WalletContractV5R19, TonClient as TonClient12, toNano as toNano20, internal as internal8 } from "@ton/ton";
19877
20109
  import { Address as Address13, SendMode as SendMode8, beginCell as beginCell15 } from "@ton/core";
@@ -19879,19 +20111,19 @@ var JETTON_TRANSFER_OP = 260734629;
19879
20111
  var jettonSendTool = {
19880
20112
  name: "jetton_send",
19881
20113
  description: "Send Jettons (tokens) to another address. Requires the jetton master address, recipient address, and amount. Amount is in human-readable units (e.g., 10 for 10 USDT). Use jetton_balances first to see what tokens you own and their addresses.",
19882
- parameters: Type87.Object({
19883
- jetton_address: Type87.String({
20114
+ parameters: Type89.Object({
20115
+ jetton_address: Type89.String({
19884
20116
  description: "Jetton master contract address (EQ... or 0:... format)"
19885
20117
  }),
19886
- to: Type87.String({
20118
+ to: Type89.String({
19887
20119
  description: "Recipient TON address (EQ... or UQ... format)"
19888
20120
  }),
19889
- amount: Type87.Number({
20121
+ amount: Type89.Number({
19890
20122
  description: "Amount to send in human-readable units (e.g., 10 for 10 tokens)",
19891
20123
  minimum: 0
19892
20124
  }),
19893
- comment: Type87.Optional(
19894
- Type87.String({
20125
+ comment: Type89.Optional(
20126
+ Type89.String({
19895
20127
  description: "Optional comment/memo to include with the transfer"
19896
20128
  })
19897
20129
  )
@@ -19995,12 +20227,12 @@ var jettonSendExecutor = async (params, context) => {
19995
20227
  };
19996
20228
 
19997
20229
  // src/agent/tools/jetton/info.ts
19998
- import { Type as Type88 } from "@sinclair/typebox";
20230
+ import { Type as Type90 } from "@sinclair/typebox";
19999
20231
  var jettonInfoTool = {
20000
20232
  name: "jetton_info",
20001
20233
  description: "Get detailed information about a Jetton (token) by its master contract address. Returns name, symbol, decimals, total supply, holders count, and verification status. Useful to research a token before buying or sending.",
20002
- parameters: Type88.Object({
20003
- jetton_address: Type88.String({
20234
+ parameters: Type90.Object({
20235
+ jetton_address: Type90.String({
20004
20236
  description: "Jetton master contract address (EQ... or 0:... format)"
20005
20237
  })
20006
20238
  })
@@ -20090,12 +20322,12 @@ function formatLargeNumber(num) {
20090
20322
  }
20091
20323
 
20092
20324
  // src/agent/tools/jetton/price.ts
20093
- import { Type as Type89 } from "@sinclair/typebox";
20325
+ import { Type as Type91 } from "@sinclair/typebox";
20094
20326
  var jettonPriceTool = {
20095
20327
  name: "jetton_price",
20096
20328
  description: "Get the current price of a Jetton (token) in USD and TON, along with 24h, 7d, and 30d price changes. Useful to check token value before swapping or to monitor investments.",
20097
- parameters: Type89.Object({
20098
- jetton_address: Type89.String({
20329
+ parameters: Type91.Object({
20330
+ jetton_address: Type91.String({
20099
20331
  description: "Jetton master contract address (EQ... or 0:... format)"
20100
20332
  })
20101
20333
  })
@@ -20188,17 +20420,17 @@ var jettonPriceExecutor = async (params, context) => {
20188
20420
  };
20189
20421
 
20190
20422
  // src/agent/tools/jetton/search.ts
20191
- import { Type as Type90 } from "@sinclair/typebox";
20423
+ import { Type as Type92 } from "@sinclair/typebox";
20192
20424
  var jettonSearchTool = {
20193
20425
  name: "jetton_search",
20194
20426
  description: "Search for Jettons (tokens) by name or symbol. Returns a list of matching tokens with their addresses, useful for finding a token's address before swapping or checking prices. Search is case-insensitive.",
20195
- parameters: Type90.Object({
20196
- query: Type90.String({
20427
+ parameters: Type92.Object({
20428
+ query: Type92.String({
20197
20429
  description: "Search query - token name or symbol (e.g., 'usdt', 'scale', 'not')",
20198
20430
  minLength: 1
20199
20431
  }),
20200
- limit: Type90.Optional(
20201
- Type90.Number({
20432
+ limit: Type92.Optional(
20433
+ Type92.Number({
20202
20434
  description: "Maximum number of results to return (default: 10, max: 50)",
20203
20435
  minimum: 1,
20204
20436
  maximum: 50
@@ -20307,25 +20539,25 @@ var jettonSearchExecutor = async (params, context) => {
20307
20539
  };
20308
20540
 
20309
20541
  // src/agent/tools/jetton/quote.ts
20310
- import { Type as Type91 } from "@sinclair/typebox";
20542
+ import { Type as Type93 } from "@sinclair/typebox";
20311
20543
  import { toNano as toNano21 } from "@ton/ton";
20312
20544
  var NATIVE_TON_ADDRESS2 = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c";
20313
20545
  var jettonQuoteTool = {
20314
20546
  name: "jetton_quote",
20315
20547
  description: "Get a price quote for a token swap WITHOUT executing it. Shows expected output, minimum output, price impact, and fees. Use this to preview a swap before committing. Use 'ton' as from_asset for TON, or jetton master address.",
20316
- parameters: Type91.Object({
20317
- from_asset: Type91.String({
20548
+ parameters: Type93.Object({
20549
+ from_asset: Type93.String({
20318
20550
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
20319
20551
  }),
20320
- to_asset: Type91.String({
20552
+ to_asset: Type93.String({
20321
20553
  description: "Destination jetton master address (EQ... format)"
20322
20554
  }),
20323
- amount: Type91.Number({
20555
+ amount: Type93.Number({
20324
20556
  description: "Amount to swap in human-readable units",
20325
20557
  minimum: 1e-3
20326
20558
  }),
20327
- slippage: Type91.Optional(
20328
- Type91.Number({
20559
+ slippage: Type93.Optional(
20560
+ Type93.Number({
20329
20561
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
20330
20562
  minimum: 1e-3,
20331
20563
  maximum: 0.5
@@ -20411,16 +20643,16 @@ var jettonQuoteExecutor = async (params, context) => {
20411
20643
  };
20412
20644
 
20413
20645
  // src/agent/tools/jetton/holders.ts
20414
- import { Type as Type92 } from "@sinclair/typebox";
20646
+ import { Type as Type94 } from "@sinclair/typebox";
20415
20647
  var jettonHoldersTool = {
20416
20648
  name: "jetton_holders",
20417
20649
  description: "Get the top holders of a Jetton (token). Shows wallet addresses and their balances. Useful to analyze token distribution and identify whale wallets.",
20418
- parameters: Type92.Object({
20419
- jetton_address: Type92.String({
20650
+ parameters: Type94.Object({
20651
+ jetton_address: Type94.String({
20420
20652
  description: "Jetton master contract address (EQ... or 0:... format)"
20421
20653
  }),
20422
- limit: Type92.Optional(
20423
- Type92.Number({
20654
+ limit: Type94.Optional(
20655
+ Type94.Number({
20424
20656
  description: "Number of top holders to return (default: 10, max: 100)",
20425
20657
  minimum: 1,
20426
20658
  maximum: 100
@@ -20505,12 +20737,12 @@ var jettonHoldersExecutor = async (params, context) => {
20505
20737
  };
20506
20738
 
20507
20739
  // src/agent/tools/jetton/history.ts
20508
- import { Type as Type93 } from "@sinclair/typebox";
20740
+ import { Type as Type95 } from "@sinclair/typebox";
20509
20741
  var jettonHistoryTool = {
20510
20742
  name: "jetton_history",
20511
20743
  description: "Get price history and performance data for a Jetton. Shows price changes over 24h, 7d, 30d periods, along with volume and market data. Useful for analyzing token trends.",
20512
- parameters: Type93.Object({
20513
- jetton_address: Type93.String({
20744
+ parameters: Type95.Object({
20745
+ jetton_address: Type95.String({
20514
20746
  description: "Jetton master contract address (EQ... format)"
20515
20747
  })
20516
20748
  })
@@ -20630,13 +20862,13 @@ var jettonHistoryExecutor = async (params, context) => {
20630
20862
  };
20631
20863
 
20632
20864
  // src/agent/tools/jetton/trending.ts
20633
- import { Type as Type94 } from "@sinclair/typebox";
20865
+ import { Type as Type96 } from "@sinclair/typebox";
20634
20866
  var jettonTrendingTool = {
20635
20867
  name: "jetton_trending",
20636
20868
  description: "Get trending/popular Jettons on the TON blockchain. Shows tokens ranked by trading volume and liquidity. Useful for discovering popular tokens.",
20637
- parameters: Type94.Object({
20638
- limit: Type94.Optional(
20639
- Type94.Number({
20869
+ parameters: Type96.Object({
20870
+ limit: Type96.Optional(
20871
+ Type96.Number({
20640
20872
  description: "Number of trending tokens to return (default: 10, max: 50)",
20641
20873
  minimum: 1,
20642
20874
  maximum: 50
@@ -20703,18 +20935,18 @@ var jettonTrendingExecutor = async (params, context) => {
20703
20935
  };
20704
20936
 
20705
20937
  // src/agent/tools/jetton/pools.ts
20706
- import { Type as Type95 } from "@sinclair/typebox";
20938
+ import { Type as Type97 } from "@sinclair/typebox";
20707
20939
  var jettonPoolsTool = {
20708
20940
  name: "jetton_pools",
20709
20941
  description: "Get liquidity pools for a Jetton or list top pools by volume. Shows pool addresses, liquidity, volume, APY, and trading pairs. Useful for finding where to trade a token or analyzing DeFi opportunities.",
20710
- parameters: Type95.Object({
20711
- jetton_address: Type95.Optional(
20712
- Type95.String({
20942
+ parameters: Type97.Object({
20943
+ jetton_address: Type97.Optional(
20944
+ Type97.String({
20713
20945
  description: "Jetton address to filter pools (optional - if not provided, returns top pools)"
20714
20946
  })
20715
20947
  ),
20716
- limit: Type95.Optional(
20717
- Type95.Number({
20948
+ limit: Type97.Optional(
20949
+ Type97.Number({
20718
20950
  description: "Number of pools to return (default: 10, max: 50)",
20719
20951
  minimum: 1,
20720
20952
  maximum: 50
@@ -20830,7 +21062,7 @@ var tools18 = [
20830
21062
  ];
20831
21063
 
20832
21064
  // src/agent/tools/dedust/quote.ts
20833
- import { Type as Type96 } from "@sinclair/typebox";
21065
+ import { Type as Type98 } from "@sinclair/typebox";
20834
21066
  import { TonClient as TonClient13, toNano as toNano22, fromNano as fromNano5 } from "@ton/ton";
20835
21067
  import { Address as Address14 } from "@ton/core";
20836
21068
  import { Factory, Asset, PoolType, ReadinessStatus } from "@dedust/sdk";
@@ -20854,24 +21086,24 @@ var NATIVE_TON_ADDRESS3 = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c";
20854
21086
  var dedustQuoteTool = {
20855
21087
  name: "dedust_quote",
20856
21088
  description: "Get a price quote for a token swap on DeDust DEX WITHOUT executing it. Shows expected output, minimum output, and pool info. Use 'ton' as from_asset for TON, or jetton master address. Pool types: 'volatile' (default) or 'stable' (for stablecoins).",
20857
- parameters: Type96.Object({
20858
- from_asset: Type96.String({
21089
+ parameters: Type98.Object({
21090
+ from_asset: Type98.String({
20859
21091
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
20860
21092
  }),
20861
- to_asset: Type96.String({
21093
+ to_asset: Type98.String({
20862
21094
  description: "Destination asset: 'ton' for TON, or jetton master address (EQ... format)"
20863
21095
  }),
20864
- amount: Type96.Number({
21096
+ amount: Type98.Number({
20865
21097
  description: "Amount to swap in human-readable units",
20866
21098
  minimum: 1e-3
20867
21099
  }),
20868
- pool_type: Type96.Optional(
20869
- Type96.Union([Type96.Literal("volatile"), Type96.Literal("stable")], {
21100
+ pool_type: Type98.Optional(
21101
+ Type98.Union([Type98.Literal("volatile"), Type98.Literal("stable")], {
20870
21102
  description: "Pool type: 'volatile' (default) or 'stable' for stablecoin pairs"
20871
21103
  })
20872
21104
  ),
20873
- slippage: Type96.Optional(
20874
- Type96.Number({
21105
+ slippage: Type98.Optional(
21106
+ Type98.Number({
20875
21107
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
20876
21108
  minimum: 1e-3,
20877
21109
  maximum: 0.5
@@ -20986,7 +21218,7 @@ var dedustQuoteExecutor = async (params, context) => {
20986
21218
  };
20987
21219
 
20988
21220
  // src/agent/tools/dedust/swap.ts
20989
- import { Type as Type97 } from "@sinclair/typebox";
21221
+ import { Type as Type99 } from "@sinclair/typebox";
20990
21222
  import { mnemonicToPrivateKey as mnemonicToPrivateKey10 } from "@ton/crypto";
20991
21223
  import { WalletContractV5R1 as WalletContractV5R110, TonClient as TonClient14, toNano as toNano23, fromNano as fromNano6 } from "@ton/ton";
20992
21224
  import { Address as Address15 } from "@ton/core";
@@ -20994,24 +21226,24 @@ import { Factory as Factory2, Asset as Asset2, PoolType as PoolType2, ReadinessS
20994
21226
  var dedustSwapTool = {
20995
21227
  name: "dedust_swap",
20996
21228
  description: "Execute a token swap on DeDust DEX. Supports TON->Jetton and Jetton->TON/Jetton swaps. Use 'ton' as from_asset or to_asset for TON. Pool types: 'volatile' (default) or 'stable' (for stablecoins like USDT/USDC). Use dedust_quote first to preview the swap.",
20997
- parameters: Type97.Object({
20998
- from_asset: Type97.String({
21229
+ parameters: Type99.Object({
21230
+ from_asset: Type99.String({
20999
21231
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
21000
21232
  }),
21001
- to_asset: Type97.String({
21233
+ to_asset: Type99.String({
21002
21234
  description: "Destination asset: 'ton' for TON, or jetton master address (EQ... format)"
21003
21235
  }),
21004
- amount: Type97.Number({
21236
+ amount: Type99.Number({
21005
21237
  description: "Amount to swap in human-readable units (e.g., 10 for 10 TON or 10 tokens)",
21006
21238
  minimum: 1e-3
21007
21239
  }),
21008
- pool_type: Type97.Optional(
21009
- Type97.Union([Type97.Literal("volatile"), Type97.Literal("stable")], {
21240
+ pool_type: Type99.Optional(
21241
+ Type99.Union([Type99.Literal("volatile"), Type99.Literal("stable")], {
21010
21242
  description: "Pool type: 'volatile' (default) or 'stable' for stablecoin pairs"
21011
21243
  })
21012
21244
  ),
21013
- slippage: Type97.Optional(
21014
- Type97.Number({
21245
+ slippage: Type99.Optional(
21246
+ Type99.Number({
21015
21247
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
21016
21248
  minimum: 1e-3,
21017
21249
  maximum: 0.5
@@ -21157,23 +21389,23 @@ var dedustSwapExecutor = async (params, context) => {
21157
21389
  };
21158
21390
 
21159
21391
  // src/agent/tools/dedust/pools.ts
21160
- import { Type as Type98 } from "@sinclair/typebox";
21392
+ import { Type as Type100 } from "@sinclair/typebox";
21161
21393
  var dedustPoolsTool = {
21162
21394
  name: "dedust_pools",
21163
21395
  description: "List liquidity pools on DeDust DEX. Can filter by jetton address or pool type. Shows reserves, fees, and trading volume.",
21164
- parameters: Type98.Object({
21165
- jetton_address: Type98.Optional(
21166
- Type98.String({
21396
+ parameters: Type100.Object({
21397
+ jetton_address: Type100.Optional(
21398
+ Type100.String({
21167
21399
  description: "Filter by jetton master address (EQ... format) to find pools containing this token"
21168
21400
  })
21169
21401
  ),
21170
- pool_type: Type98.Optional(
21171
- Type98.Union([Type98.Literal("volatile"), Type98.Literal("stable")], {
21402
+ pool_type: Type100.Optional(
21403
+ Type100.Union([Type100.Literal("volatile"), Type100.Literal("stable")], {
21172
21404
  description: "Filter by pool type: 'volatile' or 'stable'"
21173
21405
  })
21174
21406
  ),
21175
- limit: Type98.Optional(
21176
- Type98.Number({
21407
+ limit: Type100.Optional(
21408
+ Type100.Number({
21177
21409
  description: "Maximum number of pools to return (default: 20)",
21178
21410
  minimum: 1,
21179
21411
  maximum: 100
@@ -21289,26 +21521,26 @@ var tools19 = [
21289
21521
  ];
21290
21522
 
21291
21523
  // src/agent/tools/dex/smart-quote.ts
21292
- import { Type as Type99 } from "@sinclair/typebox";
21524
+ import { Type as Type101 } from "@sinclair/typebox";
21293
21525
  import { TonClient as TonClient15, toNano as toNano24, fromNano as fromNano7 } from "@ton/ton";
21294
21526
  import { Address as Address16 } from "@ton/core";
21295
21527
  import { Factory as Factory3, Asset as Asset3, PoolType as PoolType3, ReadinessStatus as ReadinessStatus3 } from "@dedust/sdk";
21296
21528
  var dexQuoteTool = {
21297
21529
  name: "dex_quote",
21298
21530
  description: "Smart router that compares quotes from STON.fi and DeDust DEX to find the best price. Returns comparison table with expected outputs, fees, and recommends the best DEX for your swap. Use 'ton' for TON or jetton master address.",
21299
- parameters: Type99.Object({
21300
- from_asset: Type99.String({
21531
+ parameters: Type101.Object({
21532
+ from_asset: Type101.String({
21301
21533
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
21302
21534
  }),
21303
- to_asset: Type99.String({
21535
+ to_asset: Type101.String({
21304
21536
  description: "Destination asset: 'ton' for TON, or jetton master address (EQ... format)"
21305
21537
  }),
21306
- amount: Type99.Number({
21538
+ amount: Type101.Number({
21307
21539
  description: "Amount to swap in human-readable units",
21308
21540
  minimum: 1e-3
21309
21541
  }),
21310
- slippage: Type99.Optional(
21311
- Type99.Number({
21542
+ slippage: Type101.Optional(
21543
+ Type101.Number({
21312
21544
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
21313
21545
  minimum: 1e-3,
21314
21546
  maximum: 0.5
@@ -21546,7 +21778,7 @@ Use dex_swap to execute on the best DEX, or jetton_swap/dedust_swap for specific
21546
21778
  };
21547
21779
 
21548
21780
  // src/agent/tools/dex/smart-swap.ts
21549
- import { Type as Type100 } from "@sinclair/typebox";
21781
+ import { Type as Type102 } from "@sinclair/typebox";
21550
21782
  import { mnemonicToPrivateKey as mnemonicToPrivateKey11 } from "@ton/crypto";
21551
21783
  import { WalletContractV5R1 as WalletContractV5R111, TonClient as TonClient16, toNano as toNano25, fromNano as fromNano8 } from "@ton/ton";
21552
21784
  import { Address as Address17, SendMode as SendMode9, internal as internal9 } from "@ton/core";
@@ -21554,26 +21786,26 @@ import { Factory as Factory4, Asset as Asset4, PoolType as PoolType4, ReadinessS
21554
21786
  var dexSwapTool = {
21555
21787
  name: "dex_swap",
21556
21788
  description: "Smart router that executes swap on the best DEX (STON.fi or DeDust). Automatically compares prices and routes to the DEX with better output. Use preferred_dex to force a specific DEX. Use 'ton' for TON or jetton master address.",
21557
- parameters: Type100.Object({
21558
- from_asset: Type100.String({
21789
+ parameters: Type102.Object({
21790
+ from_asset: Type102.String({
21559
21791
  description: "Source asset: 'ton' for TON, or jetton master address (EQ... format)"
21560
21792
  }),
21561
- to_asset: Type100.String({
21793
+ to_asset: Type102.String({
21562
21794
  description: "Destination asset: 'ton' for TON, or jetton master address (EQ... format)"
21563
21795
  }),
21564
- amount: Type100.Number({
21796
+ amount: Type102.Number({
21565
21797
  description: "Amount to swap in human-readable units",
21566
21798
  minimum: 1e-3
21567
21799
  }),
21568
- slippage: Type100.Optional(
21569
- Type100.Number({
21800
+ slippage: Type102.Optional(
21801
+ Type102.Number({
21570
21802
  description: "Slippage tolerance (0.01 = 1%, default: 0.01)",
21571
21803
  minimum: 1e-3,
21572
21804
  maximum: 0.5
21573
21805
  })
21574
21806
  ),
21575
- preferred_dex: Type100.Optional(
21576
- Type100.Union([Type100.Literal("stonfi"), Type100.Literal("dedust"), Type100.Literal("auto")], {
21807
+ preferred_dex: Type102.Optional(
21808
+ Type102.Union([Type102.Literal("stonfi"), Type102.Literal("dedust"), Type102.Literal("auto")], {
21577
21809
  description: "Preferred DEX: 'auto' (default, best price), 'stonfi', or 'dedust'"
21578
21810
  })
21579
21811
  )
@@ -21890,7 +22122,7 @@ var tools20 = [
21890
22122
  ];
21891
22123
 
21892
22124
  // src/agent/tools/journal/log.ts
21893
- import { Type as Type101 } from "@sinclair/typebox";
22125
+ import { Type as Type103 } from "@sinclair/typebox";
21894
22126
  var journalLogTool = {
21895
22127
  name: "journal_log",
21896
22128
  description: `Log a business operation to the trading journal.
@@ -21908,44 +22140,44 @@ Examples:
21908
22140
  - gift: "Sold Deluxe Heart at 120% floor - buyer was eager"
21909
22141
  - middleman: "Escrow for 150 TON gift trade - 3% fee"
21910
22142
  - kol: "Posted project review in channel - 75 TON fee"`,
21911
- parameters: Type101.Object({
21912
- type: Type101.Union(
21913
- [Type101.Literal("trade"), Type101.Literal("gift"), Type101.Literal("middleman"), Type101.Literal("kol")],
22143
+ parameters: Type103.Object({
22144
+ type: Type103.Union(
22145
+ [Type103.Literal("trade"), Type103.Literal("gift"), Type103.Literal("middleman"), Type103.Literal("kol")],
21914
22146
  { description: "Type of operation" }
21915
22147
  ),
21916
- action: Type101.String({
22148
+ action: Type103.String({
21917
22149
  description: "Brief action description (e.g., 'buy', 'sell', 'swap', 'escrow', 'post')"
21918
22150
  }),
21919
- asset_from: Type101.Optional(
21920
- Type101.String({ description: "Asset sent/sold (e.g., 'TON', 'USDT', 'Deluxe Heart')" })
22151
+ asset_from: Type103.Optional(
22152
+ Type103.String({ description: "Asset sent/sold (e.g., 'TON', 'USDT', 'Deluxe Heart')" })
21921
22153
  ),
21922
- asset_to: Type101.Optional(Type101.String({ description: "Asset received/bought" })),
21923
- amount_from: Type101.Optional(Type101.Number({ description: "Amount sent/sold" })),
21924
- amount_to: Type101.Optional(Type101.Number({ description: "Amount received/bought" })),
21925
- price_ton: Type101.Optional(Type101.Number({ description: "Price in TON (for gifts, services)" })),
21926
- counterparty: Type101.Optional(
21927
- Type101.String({ description: "Username or ID of the other party (if applicable)" })
22154
+ asset_to: Type103.Optional(Type103.String({ description: "Asset received/bought" })),
22155
+ amount_from: Type103.Optional(Type103.Number({ description: "Amount sent/sold" })),
22156
+ amount_to: Type103.Optional(Type103.Number({ description: "Amount received/bought" })),
22157
+ price_ton: Type103.Optional(Type103.Number({ description: "Price in TON (for gifts, services)" })),
22158
+ counterparty: Type103.Optional(
22159
+ Type103.String({ description: "Username or ID of the other party (if applicable)" })
21928
22160
  ),
21929
- platform: Type101.Optional(
21930
- Type101.String({ description: "Platform used (e.g., 'STON.fi', 'Telegram', 'DeDust')" })
22161
+ platform: Type103.Optional(
22162
+ Type103.String({ description: "Platform used (e.g., 'STON.fi', 'Telegram', 'DeDust')" })
21931
22163
  ),
21932
- reasoning: Type101.String({
22164
+ reasoning: Type103.String({
21933
22165
  description: "WHY you took this action - explain your decision-making (this is CRITICAL for learning and auditing)"
21934
22166
  }),
21935
- outcome: Type101.Optional(
21936
- Type101.Union(
22167
+ outcome: Type103.Optional(
22168
+ Type103.Union(
21937
22169
  [
21938
- Type101.Literal("pending"),
21939
- Type101.Literal("profit"),
21940
- Type101.Literal("loss"),
21941
- Type101.Literal("neutral"),
21942
- Type101.Literal("cancelled")
22170
+ Type103.Literal("pending"),
22171
+ Type103.Literal("profit"),
22172
+ Type103.Literal("loss"),
22173
+ Type103.Literal("neutral"),
22174
+ Type103.Literal("cancelled")
21943
22175
  ],
21944
22176
  { description: "Outcome status (default: 'pending')" }
21945
22177
  )
21946
22178
  ),
21947
- tx_hash: Type101.Optional(
21948
- Type101.String({ description: "Blockchain transaction hash (if applicable)" })
22179
+ tx_hash: Type103.Optional(
22180
+ Type103.String({ description: "Blockchain transaction hash (if applicable)" })
21949
22181
  )
21950
22182
  })
21951
22183
  };
@@ -22005,7 +22237,7 @@ var journalLogExecutor = async (params, context) => {
22005
22237
  };
22006
22238
 
22007
22239
  // src/agent/tools/journal/query.ts
22008
- import { Type as Type102 } from "@sinclair/typebox";
22240
+ import { Type as Type104 } from "@sinclair/typebox";
22009
22241
  var journalQueryTool = {
22010
22242
  name: "journal_query",
22011
22243
  description: `Query the trading journal to analyze past operations.
@@ -22021,38 +22253,38 @@ Examples:
22021
22253
  - "What gifts did I sell this week?"
22022
22254
  - "Show all profitable TON trades"
22023
22255
  - "What's my win rate on crypto trades?"`,
22024
- parameters: Type102.Object({
22025
- type: Type102.Optional(
22026
- Type102.Union(
22256
+ parameters: Type104.Object({
22257
+ type: Type104.Optional(
22258
+ Type104.Union(
22027
22259
  [
22028
- Type102.Literal("trade"),
22029
- Type102.Literal("gift"),
22030
- Type102.Literal("middleman"),
22031
- Type102.Literal("kol")
22260
+ Type104.Literal("trade"),
22261
+ Type104.Literal("gift"),
22262
+ Type104.Literal("middleman"),
22263
+ Type104.Literal("kol")
22032
22264
  ],
22033
22265
  { description: "Filter by operation type" }
22034
22266
  )
22035
22267
  ),
22036
- asset: Type102.Optional(
22037
- Type102.String({ description: "Filter by asset (e.g., 'TON', 'USDT', 'Deluxe Heart')" })
22268
+ asset: Type104.Optional(
22269
+ Type104.String({ description: "Filter by asset (e.g., 'TON', 'USDT', 'Deluxe Heart')" })
22038
22270
  ),
22039
- outcome: Type102.Optional(
22040
- Type102.Union(
22271
+ outcome: Type104.Optional(
22272
+ Type104.Union(
22041
22273
  [
22042
- Type102.Literal("pending"),
22043
- Type102.Literal("profit"),
22044
- Type102.Literal("loss"),
22045
- Type102.Literal("neutral"),
22046
- Type102.Literal("cancelled")
22274
+ Type104.Literal("pending"),
22275
+ Type104.Literal("profit"),
22276
+ Type104.Literal("loss"),
22277
+ Type104.Literal("neutral"),
22278
+ Type104.Literal("cancelled")
22047
22279
  ],
22048
22280
  { description: "Filter by outcome status" }
22049
22281
  )
22050
22282
  ),
22051
- days: Type102.Optional(
22052
- Type102.Number({ description: "Limit to last N days (e.g., 7 for last week)", minimum: 1 })
22283
+ days: Type104.Optional(
22284
+ Type104.Number({ description: "Limit to last N days (e.g., 7 for last week)", minimum: 1 })
22053
22285
  ),
22054
- limit: Type102.Optional(
22055
- Type102.Number({ description: "Max number of results (default: 20)", minimum: 1 })
22286
+ limit: Type104.Optional(
22287
+ Type104.Number({ description: "Max number of results (default: 20)", minimum: 1 })
22056
22288
  )
22057
22289
  })
22058
22290
  };
@@ -22140,7 +22372,7 @@ var journalQueryExecutor = async (params) => {
22140
22372
  };
22141
22373
 
22142
22374
  // src/agent/tools/journal/update.ts
22143
- import { Type as Type103 } from "@sinclair/typebox";
22375
+ import { Type as Type105 } from "@sinclair/typebox";
22144
22376
  var journalUpdateTool = {
22145
22377
  name: "journal_update",
22146
22378
  description: `Update a journal entry with outcome and P&L.
@@ -22159,25 +22391,25 @@ Examples:
22159
22391
  - "Close trade #42 - sold at profit"
22160
22392
  - "Mark gift sale #38 as complete"
22161
22393
  - "Update escrow #55 with tx hash"`,
22162
- parameters: Type103.Object({
22163
- id: Type103.Number({ description: "Journal entry ID to update" }),
22164
- outcome: Type103.Optional(
22165
- Type103.Union(
22394
+ parameters: Type105.Object({
22395
+ id: Type105.Number({ description: "Journal entry ID to update" }),
22396
+ outcome: Type105.Optional(
22397
+ Type105.Union(
22166
22398
  [
22167
- Type103.Literal("pending"),
22168
- Type103.Literal("profit"),
22169
- Type103.Literal("loss"),
22170
- Type103.Literal("neutral"),
22171
- Type103.Literal("cancelled")
22399
+ Type105.Literal("pending"),
22400
+ Type105.Literal("profit"),
22401
+ Type105.Literal("loss"),
22402
+ Type105.Literal("neutral"),
22403
+ Type105.Literal("cancelled")
22172
22404
  ],
22173
22405
  { description: "Update outcome status" }
22174
22406
  )
22175
22407
  ),
22176
- pnl_ton: Type103.Optional(
22177
- Type103.Number({ description: "Profit/loss in TON (positive = profit, negative = loss)" })
22408
+ pnl_ton: Type105.Optional(
22409
+ Type105.Number({ description: "Profit/loss in TON (positive = profit, negative = loss)" })
22178
22410
  ),
22179
- pnl_pct: Type103.Optional(Type103.Number({ description: "Profit/loss percentage" })),
22180
- tx_hash: Type103.Optional(Type103.String({ description: "Add or update transaction hash" }))
22411
+ pnl_pct: Type105.Optional(Type105.Number({ description: "Profit/loss percentage" })),
22412
+ tx_hash: Type105.Optional(Type105.String({ description: "Add or update transaction hash" }))
22181
22413
  })
22182
22414
  };
22183
22415
  var journalUpdateExecutor = async (params) => {
@@ -22246,7 +22478,7 @@ var tools21 = [
22246
22478
  ];
22247
22479
 
22248
22480
  // src/agent/tools/workspace/list.ts
22249
- import { Type as Type104 } from "@sinclair/typebox";
22481
+ import { Type as Type106 } from "@sinclair/typebox";
22250
22482
  import { readdirSync as readdirSync3, lstatSync as lstatSync2 } from "fs";
22251
22483
  import { join as join11 } from "path";
22252
22484
  var workspaceListTool = {
@@ -22261,19 +22493,19 @@ Your workspace is at ~/.teleton/workspace/ and contains:
22261
22493
  - temp/ (temporary files)
22262
22494
 
22263
22495
  You can ONLY access files within this workspace. Files outside (config.yaml, wallet.json, etc.) are protected.`,
22264
- parameters: Type104.Object({
22265
- path: Type104.Optional(
22266
- Type104.String({
22496
+ parameters: Type106.Object({
22497
+ path: Type106.Optional(
22498
+ Type106.String({
22267
22499
  description: "Subdirectory to list (relative to workspace root). Leave empty for root."
22268
22500
  })
22269
22501
  ),
22270
- recursive: Type104.Optional(
22271
- Type104.Boolean({
22502
+ recursive: Type106.Optional(
22503
+ Type106.Boolean({
22272
22504
  description: "List files recursively (default: false)"
22273
22505
  })
22274
22506
  ),
22275
- filter: Type104.Optional(
22276
- Type104.String({
22507
+ filter: Type106.Optional(
22508
+ Type106.String({
22277
22509
  description: "Filter by type: 'all' (default), 'files', or 'directories'",
22278
22510
  enum: ["all", "files", "directories"]
22279
22511
  })
@@ -22345,7 +22577,7 @@ var workspaceListExecutor = async (params, _context) => {
22345
22577
  };
22346
22578
 
22347
22579
  // src/agent/tools/workspace/read.ts
22348
- import { Type as Type105 } from "@sinclair/typebox";
22580
+ import { Type as Type107 } from "@sinclair/typebox";
22349
22581
  import { readFileSync as readFileSync13, lstatSync as lstatSync3 } from "fs";
22350
22582
  var workspaceReadTool = {
22351
22583
  name: "workspace_read",
@@ -22361,18 +22593,18 @@ Examples:
22361
22593
  - Read your memory: path="MEMORY.md"
22362
22594
  - Read today's log: path="memory/2024-01-15.md"
22363
22595
  - Read downloaded image info: path="downloads/image.jpg" (will return metadata only)`,
22364
- parameters: Type105.Object({
22365
- path: Type105.String({
22596
+ parameters: Type107.Object({
22597
+ path: Type107.String({
22366
22598
  description: "Path to file (relative to workspace root)"
22367
22599
  }),
22368
- encoding: Type105.Optional(
22369
- Type105.String({
22600
+ encoding: Type107.Optional(
22601
+ Type107.String({
22370
22602
  description: "File encoding: 'utf-8' (default) or 'base64'",
22371
22603
  enum: ["utf-8", "base64"]
22372
22604
  })
22373
22605
  ),
22374
- maxSize: Type105.Optional(
22375
- Type105.Number({
22606
+ maxSize: Type107.Optional(
22607
+ Type107.Number({
22376
22608
  description: "Max file size to read in bytes (default: 1MB)"
22377
22609
  })
22378
22610
  )
@@ -22447,7 +22679,7 @@ var workspaceReadExecutor = async (params, _context) => {
22447
22679
  };
22448
22680
 
22449
22681
  // src/agent/tools/workspace/write.ts
22450
- import { Type as Type106 } from "@sinclair/typebox";
22682
+ import { Type as Type108 } from "@sinclair/typebox";
22451
22683
  import { writeFileSync as writeFileSync9, appendFileSync as appendFileSync3, mkdirSync as mkdirSync9, existsSync as existsSync13 } from "fs";
22452
22684
  import { dirname as dirname6 } from "path";
22453
22685
  var workspaceWriteTool = {
@@ -22464,26 +22696,26 @@ You CANNOT write to protected locations like config.yaml, wallet.json, etc.
22464
22696
  Examples:
22465
22697
  - Save a note: path="memory/note.md", content="..."
22466
22698
  - Prepare upload: path="uploads/message.txt", content="..."`,
22467
- parameters: Type106.Object({
22468
- path: Type106.String({
22699
+ parameters: Type108.Object({
22700
+ path: Type108.String({
22469
22701
  description: "Path to file (relative to workspace root)"
22470
22702
  }),
22471
- content: Type106.String({
22703
+ content: Type108.String({
22472
22704
  description: "Content to write"
22473
22705
  }),
22474
- encoding: Type106.Optional(
22475
- Type106.String({
22706
+ encoding: Type108.Optional(
22707
+ Type108.String({
22476
22708
  description: "Content encoding: 'utf-8' (default) or 'base64'",
22477
22709
  enum: ["utf-8", "base64"]
22478
22710
  })
22479
22711
  ),
22480
- append: Type106.Optional(
22481
- Type106.Boolean({
22712
+ append: Type108.Optional(
22713
+ Type108.Boolean({
22482
22714
  description: "Append to file instead of overwriting (default: false)"
22483
22715
  })
22484
22716
  ),
22485
- createDirs: Type106.Optional(
22486
- Type106.Boolean({
22717
+ createDirs: Type108.Optional(
22718
+ Type108.Boolean({
22487
22719
  description: "Create parent directories if they don't exist (default: true)"
22488
22720
  })
22489
22721
  )
@@ -22540,7 +22772,7 @@ var workspaceWriteExecutor = async (params, _context) => {
22540
22772
  };
22541
22773
 
22542
22774
  // src/agent/tools/workspace/delete.ts
22543
- import { Type as Type107 } from "@sinclair/typebox";
22775
+ import { Type as Type109 } from "@sinclair/typebox";
22544
22776
  import { unlinkSync as unlinkSync3, rmdirSync, readdirSync as readdirSync4, rmSync } from "fs";
22545
22777
  var PROTECTED_WORKSPACE_FILES = [
22546
22778
  "SOUL.md",
@@ -22562,12 +22794,12 @@ You CAN delete:
22562
22794
  - Custom files you've created
22563
22795
 
22564
22796
  Use recursive=true to delete non-empty directories.`,
22565
- parameters: Type107.Object({
22566
- path: Type107.String({
22797
+ parameters: Type109.Object({
22798
+ path: Type109.String({
22567
22799
  description: "Path to file or directory to delete"
22568
22800
  }),
22569
- recursive: Type107.Optional(
22570
- Type107.Boolean({
22801
+ recursive: Type109.Optional(
22802
+ Type109.Boolean({
22571
22803
  description: "Delete directory recursively (default: false)"
22572
22804
  })
22573
22805
  )
@@ -22622,7 +22854,7 @@ var workspaceDeleteExecutor = async (params, _context) => {
22622
22854
  };
22623
22855
 
22624
22856
  // src/agent/tools/workspace/info.ts
22625
- import { Type as Type108 } from "@sinclair/typebox";
22857
+ import { Type as Type110 } from "@sinclair/typebox";
22626
22858
  import { lstatSync as lstatSync4, readdirSync as readdirSync5, existsSync as existsSync14 } from "fs";
22627
22859
  import { join as join12 } from "path";
22628
22860
  var MEMES_DIR = WORKSPACE_PATHS.MEMES_DIR;
@@ -22635,9 +22867,9 @@ Returns:
22635
22867
  - Directory structure
22636
22868
  - File counts and sizes
22637
22869
  - Usage limits`,
22638
- parameters: Type108.Object({
22639
- detailed: Type108.Optional(
22640
- Type108.Boolean({
22870
+ parameters: Type110.Object({
22871
+ detailed: Type110.Optional(
22872
+ Type110.Boolean({
22641
22873
  description: "Include detailed file listing (default: false)"
22642
22874
  })
22643
22875
  )
@@ -22736,7 +22968,7 @@ var workspaceInfoExecutor = async (params, _context) => {
22736
22968
  };
22737
22969
 
22738
22970
  // src/agent/tools/workspace/rename.ts
22739
- import { Type as Type109 } from "@sinclair/typebox";
22971
+ import { Type as Type111 } from "@sinclair/typebox";
22740
22972
  import { renameSync, existsSync as existsSync15 } from "fs";
22741
22973
  import { dirname as dirname7 } from "path";
22742
22974
  import { mkdirSync as mkdirSync10 } from "fs";
@@ -22755,15 +22987,15 @@ Examples:
22755
22987
  - Organize: from="downloads/doc.pdf", to="downloads/contracts/2026/lease.pdf"
22756
22988
 
22757
22989
  CANNOT move/rename files outside workspace or to protected locations.`,
22758
- parameters: Type109.Object({
22759
- from: Type109.String({
22990
+ parameters: Type111.Object({
22991
+ from: Type111.String({
22760
22992
  description: "Current path of the file (relative to workspace)"
22761
22993
  }),
22762
- to: Type109.String({
22994
+ to: Type111.String({
22763
22995
  description: "New path for the file (relative to workspace)"
22764
22996
  }),
22765
- overwrite: Type109.Optional(
22766
- Type109.Boolean({
22997
+ overwrite: Type111.Optional(
22998
+ Type111.Boolean({
22767
22999
  description: "Overwrite if destination exists (default: false)"
22768
23000
  })
22769
23001
  )
@@ -22963,7 +23195,7 @@ function getCasinoDb() {
22963
23195
  }
22964
23196
 
22965
23197
  // src/agent/tools/casino/balance.ts
22966
- import { Type as Type110 } from "@sinclair/typebox";
23198
+ import { Type as Type112 } from "@sinclair/typebox";
22967
23199
  var casinoBalanceTool = {
22968
23200
  name: "casino_balance",
22969
23201
  description: `Check Teleton Casino bankroll status and betting limits.
@@ -22980,7 +23212,7 @@ Teleton Casino needs sufficient balance to cover potential payouts (up to 5x the
22980
23212
 
22981
23213
  IMPORTANT: When a player wants to bet, tell them to send TON to Teleton Casino address with their username as memo.
22982
23214
  Example: "Send 2 TON to EQxxx with memo: john_doe"`,
22983
- parameters: Type110.Object({})
23215
+ parameters: Type112.Object({})
22984
23216
  };
22985
23217
  var casinoBalanceExecutor = async (params, context) => {
22986
23218
  try {
@@ -23046,7 +23278,7 @@ var casinoBalanceExecutor = async (params, context) => {
23046
23278
  };
23047
23279
 
23048
23280
  // src/agent/tools/casino/spin.ts
23049
- import { Type as Type111 } from "@sinclair/typebox";
23281
+ import { Type as Type113 } from "@sinclair/typebox";
23050
23282
 
23051
23283
  // src/casino/game-engine.ts
23052
23284
  import { Api as Api57 } from "telegram";
@@ -23424,19 +23656,19 @@ Process:
23424
23656
  6. AUTO-PAYOUT if player wins
23425
23657
 
23426
23658
  Tell the user: "Send X TON to [casino_address] with memo: your_username"`,
23427
- parameters: Type111.Object({
23428
- chat_id: Type111.String({
23659
+ parameters: Type113.Object({
23660
+ chat_id: Type113.String({
23429
23661
  description: "Telegram chat ID where to send the spin"
23430
23662
  }),
23431
- bet_amount: Type111.Number({
23663
+ bet_amount: Type113.Number({
23432
23664
  description: "Bet amount in TON",
23433
23665
  minimum: 0.1
23434
23666
  }),
23435
- player_username: Type111.String({
23667
+ player_username: Type113.String({
23436
23668
  description: "Player's Telegram username (without @)"
23437
23669
  }),
23438
- reply_to: Type111.Optional(
23439
- Type111.Number({
23670
+ reply_to: Type113.Optional(
23671
+ Type113.Number({
23440
23672
  description: "Message ID to reply to"
23441
23673
  })
23442
23674
  )
@@ -23460,7 +23692,7 @@ var casinoSpinExecutor = async (params, context) => {
23460
23692
  };
23461
23693
 
23462
23694
  // src/agent/tools/casino/dice.ts
23463
- import { Type as Type112 } from "@sinclair/typebox";
23695
+ import { Type as Type114 } from "@sinclair/typebox";
23464
23696
  var casinoDiceTool = {
23465
23697
  name: "casino_dice",
23466
23698
  description: `Execute a Teleton Casino dice roll with full security checks.
@@ -23480,19 +23712,19 @@ Same security as slot:
23480
23712
  6. AUTO-PAYOUT if player wins
23481
23713
 
23482
23714
  Tell the user: "Send X TON to [casino_address] with memo: your_username"`,
23483
- parameters: Type112.Object({
23484
- chat_id: Type112.String({
23715
+ parameters: Type114.Object({
23716
+ chat_id: Type114.String({
23485
23717
  description: "Telegram chat ID where to send the dice"
23486
23718
  }),
23487
- bet_amount: Type112.Number({
23719
+ bet_amount: Type114.Number({
23488
23720
  description: "Bet amount in TON",
23489
23721
  minimum: 0.1
23490
23722
  }),
23491
- player_username: Type112.String({
23723
+ player_username: Type114.String({
23492
23724
  description: "Player's Telegram username (without @)"
23493
23725
  }),
23494
- reply_to: Type112.Optional(
23495
- Type112.Number({
23726
+ reply_to: Type114.Optional(
23727
+ Type114.Number({
23496
23728
  description: "Message ID to reply to"
23497
23729
  })
23498
23730
  )
@@ -23516,7 +23748,7 @@ var casinoDiceExecutor = async (params, context) => {
23516
23748
  };
23517
23749
 
23518
23750
  // src/agent/tools/casino/leaderboard.ts
23519
- import { Type as Type113 } from "@sinclair/typebox";
23751
+ import { Type as Type115 } from "@sinclair/typebox";
23520
23752
  var casinoLeaderboardTool = {
23521
23753
  name: "casino_leaderboard",
23522
23754
  description: `Show Teleton Casino leaderboard with top players.
@@ -23531,16 +23763,16 @@ Shows:
23531
23763
  - Total amount wagered
23532
23764
  - Total wins/losses
23533
23765
  - Win rate percentage`,
23534
- parameters: Type113.Object({
23535
- limit: Type113.Optional(
23536
- Type113.Number({
23766
+ parameters: Type115.Object({
23767
+ limit: Type115.Optional(
23768
+ Type115.Number({
23537
23769
  description: "Number of players to show (default: 10)",
23538
23770
  minimum: 1,
23539
23771
  maximum: 50
23540
23772
  })
23541
23773
  ),
23542
- type: Type113.Optional(
23543
- Type113.String({
23774
+ type: Type115.Optional(
23775
+ Type115.String({
23544
23776
  description: "Leaderboard type: winners, losers, or wagered",
23545
23777
  enum: ["winners", "losers", "wagered"]
23546
23778
  })
@@ -23645,7 +23877,7 @@ ${formattedPlayers}`
23645
23877
  };
23646
23878
 
23647
23879
  // src/agent/tools/casino/my-stats.ts
23648
- import { Type as Type114 } from "@sinclair/typebox";
23880
+ import { Type as Type116 } from "@sinclair/typebox";
23649
23881
  var casinoMyStatsTool = {
23650
23882
  name: "casino_my_stats",
23651
23883
  description: `Show the current player's personal Teleton Casino statistics.
@@ -23658,7 +23890,7 @@ Returns:
23658
23890
  - Net profit/loss
23659
23891
  - Win rate percentage
23660
23892
  - Last bet timestamp`,
23661
- parameters: Type114.Object({})
23893
+ parameters: Type116.Object({})
23662
23894
  };
23663
23895
  var casinoMyStatsExecutor = async (params, context) => {
23664
23896
  try {
@@ -23787,7 +24019,7 @@ var MarketScraperService = class {
23787
24019
  this.isScrapingInProgress = true;
23788
24020
  console.log("\u{1F504} Starting full market scrape...");
23789
24021
  try {
23790
- const { runScraper } = await import("./scraper-2O6Z3ZHT.js");
24022
+ const { runScraper } = await import("./scraper-KXRBQMVQ.js");
23791
24023
  const result = await runScraper({
23792
24024
  workers: 4,
23793
24025
  limit: 0
@@ -24241,16 +24473,15 @@ var TonnetApp = class {
24241
24473
  autoReconnect: true,
24242
24474
  floodSleepThreshold: TELEGRAM_FLOOD_SLEEP_THRESHOLD
24243
24475
  });
24244
- const VECTOR_DIMENSIONS = 512;
24476
+ const VECTOR_DIMENSIONS = 384;
24245
24477
  const memory = initializeMemory({
24246
24478
  database: {
24247
24479
  path: join16(TELETON_ROOT, "memory.db"),
24248
- enableVectorSearch: false,
24480
+ enableVectorSearch: true,
24249
24481
  vectorDimensions: VECTOR_DIMENSIONS
24250
24482
  },
24251
24483
  embeddings: {
24252
- provider: "none",
24253
- apiKey: "",
24484
+ provider: "local",
24254
24485
  model: ""
24255
24486
  },
24256
24487
  workspaceDir: join16(TELETON_ROOT)
@@ -24316,19 +24547,18 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24316
24547
  `\u26A0\uFE0F Tool count (${this.toolCount}) exceeds ${providerMeta.displayName} limit (${providerMeta.toolLimit})`
24317
24548
  );
24318
24549
  }
24319
- const { migrateSessionsToDb } = await import("./migrate-6BQZVOBN.js");
24550
+ const { migrateSessionsToDb } = await import("./migrate-7OG67FXP.js");
24320
24551
  migrateSessionsToDb();
24321
24552
  const { cleanupOldTranscripts } = await import("./transcript-DF2Y6CFY.js");
24322
24553
  cleanupOldTranscripts(30);
24323
24554
  const memory = initializeMemory({
24324
24555
  database: {
24325
24556
  path: join16(TELETON_ROOT, "memory.db"),
24326
- enableVectorSearch: false,
24327
- vectorDimensions: 512
24557
+ enableVectorSearch: true,
24558
+ vectorDimensions: 384
24328
24559
  },
24329
24560
  embeddings: {
24330
- provider: "none",
24331
- apiKey: "",
24561
+ provider: "local",
24332
24562
  model: ""
24333
24563
  },
24334
24564
  workspaceDir: join16(TELETON_ROOT)
@@ -24466,8 +24696,8 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24466
24696
  }
24467
24697
  const taskId = match[1];
24468
24698
  const { getTaskStore } = await import("./tasks-M3QDPTGY.js");
24469
- const { executeScheduledTask } = await import("./task-executor-4SVB72GR.js");
24470
- const { getDatabase: getDatabase2 } = await import("./memory-PDEJIPK6.js");
24699
+ const { executeScheduledTask } = await import("./task-executor-AUTT3VAL.js");
24700
+ const { getDatabase: getDatabase2 } = await import("./memory-ZXDAJBL6.js");
24471
24701
  const db3 = getDatabase2().getDb();
24472
24702
  const taskStore = getTaskStore(db3);
24473
24703
  const task = taskStore.getTask(taskId);
@@ -24533,7 +24763,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24533
24763
  taskStore.completeTask(taskId, response.content);
24534
24764
  console.log(`\u2705 Executed scheduled task ${taskId}: ${task.description}`);
24535
24765
  if (!this.dependencyResolver) {
24536
- const { TaskDependencyResolver } = await import("./task-dependency-resolver-WNYOTWWM.js");
24766
+ const { TaskDependencyResolver } = await import("./task-dependency-resolver-S45DFI5C.js");
24537
24767
  this.dependencyResolver = new TaskDependencyResolver(taskStore, this.bridge);
24538
24768
  }
24539
24769
  await this.dependencyResolver.onTaskComplete(taskId);
@@ -24541,8 +24771,8 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24541
24771
  console.error("Error handling scheduled task:", error);
24542
24772
  try {
24543
24773
  const { getTaskStore } = await import("./tasks-M3QDPTGY.js");
24544
- const { TaskDependencyResolver } = await import("./task-dependency-resolver-WNYOTWWM.js");
24545
- const { getDatabase: getDatabase2 } = await import("./memory-PDEJIPK6.js");
24774
+ const { TaskDependencyResolver } = await import("./task-dependency-resolver-S45DFI5C.js");
24775
+ const { getDatabase: getDatabase2 } = await import("./memory-ZXDAJBL6.js");
24546
24776
  const db3 = getDatabase2().getDb();
24547
24777
  const taskStore = getTaskStore(db3);
24548
24778
  const match = message.text.match(/^\[TASK:([^\]]+)\]/);