teleton 0.1.16 → 0.1.18

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.
@@ -7,7 +7,6 @@ var WORKSPACE_PATHS = {
7
7
  // Root files
8
8
  SOUL: join(WORKSPACE_ROOT, "SOUL.md"),
9
9
  MEMORY: join(WORKSPACE_ROOT, "MEMORY.md"),
10
- BOOTSTRAP: join(WORKSPACE_ROOT, "BOOTSTRAP.md"),
11
10
  IDENTITY: join(WORKSPACE_ROOT, "IDENTITY.md"),
12
11
  USER: join(WORKSPACE_ROOT, "USER.md"),
13
12
  STRATEGY: join(WORKSPACE_ROOT, "STRATEGY.md"),
@@ -1,6 +1,7 @@
1
1
  import {
2
- VOYAGE_API_URL
3
- } from "./chunk-ST5CO7TV.js";
2
+ VOYAGE_API_URL,
3
+ fetchWithTimeout
4
+ } from "./chunk-WMIN6AGX.js";
4
5
  import {
5
6
  KNOWLEDGE_CHUNK_OVERLAP,
6
7
  KNOWLEDGE_CHUNK_SIZE,
@@ -8,9 +9,6 @@ import {
8
9
  SQLITE_MMAP_SIZE,
9
10
  VOYAGE_BATCH_SIZE
10
11
  } from "./chunk-QMN6ZOA5.js";
11
- import {
12
- DEFAULT_FETCH_TIMEOUT_MS
13
- } from "./chunk-LJXYESJJ.js";
14
12
 
15
13
  // src/memory/database.ts
16
14
  import Database from "better-sqlite3";
@@ -884,19 +882,6 @@ var NoopEmbeddingProvider = class {
884
882
  }
885
883
  };
886
884
 
887
- // src/utils/fetch.ts
888
- var DEFAULT_TIMEOUT_MS = DEFAULT_FETCH_TIMEOUT_MS;
889
- function fetchWithTimeout(url, init) {
890
- const { timeoutMs = DEFAULT_TIMEOUT_MS, ...fetchInit } = init ?? {};
891
- if (fetchInit.signal) {
892
- return fetch(url, fetchInit);
893
- }
894
- return fetch(url, {
895
- ...fetchInit,
896
- signal: AbortSignal.timeout(timeoutMs)
897
- });
898
- }
899
-
900
885
  // src/memory/embeddings/anthropic.ts
901
886
  var AnthropicEmbeddingProvider = class {
902
887
  id = "anthropic";
@@ -2024,7 +2009,6 @@ export {
2024
2009
  getDatabase,
2025
2010
  closeDatabase,
2026
2011
  NoopEmbeddingProvider,
2027
- fetchWithTimeout,
2028
2012
  AnthropicEmbeddingProvider,
2029
2013
  LocalEmbeddingProvider,
2030
2014
  createEmbeddingProvider,
@@ -3,27 +3,26 @@ import {
3
3
  ContextBuilder,
4
4
  MessageStore,
5
5
  UserStore,
6
- fetchWithTimeout,
7
6
  getDatabase,
8
7
  initializeMemory
9
- } from "./chunk-PMX75DTX.js";
8
+ } from "./chunk-JDPS46IZ.js";
10
9
  import {
11
10
  ALLOWED_EXTENSIONS,
12
11
  MAX_FILE_SIZES,
13
12
  TELETON_ROOT,
14
13
  WORKSPACE_PATHS,
15
14
  WORKSPACE_ROOT
16
- } from "./chunk-WQ5TFRTG.js";
15
+ } from "./chunk-EYWNOHMJ.js";
17
16
  import {
18
17
  COINGECKO_API_URL,
19
18
  ELEVENLABS_TTS_URL,
20
19
  GECKOTERMINAL_API_URL,
21
20
  OPENAI_TTS_URL,
22
21
  STONFI_API_BASE_URL,
23
- TONAPI_BASE_URL,
22
+ fetchWithTimeout,
24
23
  setTonapiKey,
25
- tonapiHeaders
26
- } from "./chunk-ST5CO7TV.js";
24
+ tonapiFetch
25
+ } from "./chunk-WMIN6AGX.js";
27
26
  import {
28
27
  COMPACTION_KEEP_RECENT,
29
28
  COMPACTION_MAX_MESSAGES,
@@ -1753,7 +1752,6 @@ async function ensureWorkspace(config) {
1753
1752
  memoryPath: WORKSPACE_PATHS.MEMORY,
1754
1753
  identityPath: WORKSPACE_PATHS.IDENTITY,
1755
1754
  userPath: WORKSPACE_PATHS.USER,
1756
- bootstrapPath: WORKSPACE_PATHS.BOOTSTRAP,
1757
1755
  strategyPath: WORKSPACE_PATHS.STRATEGY,
1758
1756
  securityPath: WORKSPACE_PATHS.SECURITY,
1759
1757
  // Workspace directories
@@ -1778,7 +1776,6 @@ async function bootstrapTemplates(workspace) {
1778
1776
  { name: "MEMORY.md", path: workspace.memoryPath },
1779
1777
  { name: "IDENTITY.md", path: workspace.identityPath },
1780
1778
  { name: "USER.md", path: workspace.userPath },
1781
- { name: "BOOTSTRAP.md", path: workspace.bootstrapPath },
1782
1779
  { name: "SECURITY.md", path: workspace.securityPath },
1783
1780
  { name: "STRATEGY.md", path: workspace.strategyPath }
1784
1781
  ];
@@ -1795,6 +1792,13 @@ async function bootstrapTemplates(workspace) {
1795
1792
  function isNewWorkspace(workspace) {
1796
1793
  return !existsSync3(workspace.configPath);
1797
1794
  }
1795
+ function loadTemplate(name) {
1796
+ const templatePath = join2(TEMPLATES_DIR, name);
1797
+ if (!existsSync3(templatePath)) {
1798
+ throw new Error(`Template ${name} not found at ${templatePath}`);
1799
+ }
1800
+ return readFileSync2(templatePath, "utf-8");
1801
+ }
1798
1802
 
1799
1803
  // src/memory/daily-logs.ts
1800
1804
  var MEMORY_DIR = WORKSPACE_PATHS.MEMORY_DIR;
@@ -2825,7 +2829,7 @@ Slug:`,
2825
2829
  }
2826
2830
  async function saveSessionMemory(params) {
2827
2831
  try {
2828
- const { TELETON_ROOT: TELETON_ROOT2 } = await import("./paths-IBRNH7B4.js");
2832
+ const { TELETON_ROOT: TELETON_ROOT2 } = await import("./paths-TMNTEDDD.js");
2829
2833
  const memoryDir = join5(TELETON_ROOT2, "memory");
2830
2834
  await mkdir(memoryDir, { recursive: true });
2831
2835
  const now = /* @__PURE__ */ new Date();
@@ -3187,6 +3191,18 @@ function maskOldToolResults(messages, config = DEFAULT_MASKING_CONFIG, toolRegis
3187
3191
  return result;
3188
3192
  }
3189
3193
 
3194
+ // src/utils/logger.ts
3195
+ var _verbose = process.env.TELETON_LOG === "verbose";
3196
+ function verbose(...args) {
3197
+ if (_verbose) console.log(...args);
3198
+ }
3199
+ function setVerbose(v) {
3200
+ _verbose = v;
3201
+ }
3202
+ function isVerbose() {
3203
+ return _verbose;
3204
+ }
3205
+
3190
3206
  // src/agent/runtime.ts
3191
3207
  function isContextOverflowError(errorMessage) {
3192
3208
  if (!errorMessage) return false;
@@ -3322,9 +3338,14 @@ var AgentRuntime = class {
3322
3338
  formattedMessage = `${pendingContext}
3323
3339
 
3324
3340
  ${formattedMessage}`;
3325
- console.log(`\u{1F4CB} Including ${pendingContext.split("\n").length - 1} pending messages`);
3326
- }
3327
- console.log(`\u{1F4E8} Formatted message: ${formattedMessage.substring(0, 100)}...`);
3341
+ verbose(`\u{1F4CB} Including ${pendingContext.split("\n").length - 1} pending messages`);
3342
+ }
3343
+ verbose(`\u{1F4E8} Formatted message: ${formattedMessage.substring(0, 100)}...`);
3344
+ const preview = formattedMessage.slice(0, 50).replace(/\n/g, " ");
3345
+ const who = senderUsername ? `@${senderUsername}` : userName;
3346
+ const msgType = isGroup ? `Group ${chatId} ${who}` : `DM ${who}`;
3347
+ console.log(`
3348
+ \u{1F4E8} ${msgType}: "${preview}${formattedMessage.length > 50 ? "..." : ""}"`);
3328
3349
  let relevantContext = "";
3329
3350
  if (this.contextBuilder) {
3330
3351
  try {
@@ -3353,7 +3374,7 @@ ${dbContext.relevantFeed.join("\n")}`
3353
3374
  }
3354
3375
  if (contextParts.length > 0) {
3355
3376
  relevantContext = contextParts.join("\n\n");
3356
- console.log(
3377
+ verbose(
3357
3378
  `\u{1F50D} Found ${dbContext.relevantKnowledge.length} knowledge chunks, ${dbContext.relevantFeed.length} feed messages`
3358
3379
  );
3359
3380
  }
@@ -3419,7 +3440,7 @@ ${statsContext}`;
3419
3440
  const accumulatedTexts = [];
3420
3441
  while (iteration < maxIterations) {
3421
3442
  iteration++;
3422
- console.log(`
3443
+ verbose(`
3423
3444
  \u{1F504} Agentic iteration ${iteration}/${maxIterations}`);
3424
3445
  const maskedMessages = maskOldToolResults(
3425
3446
  context.messages,
@@ -3486,7 +3507,7 @@ ${statsContext}`;
3486
3507
  }
3487
3508
  const toolCalls = response2.message.content.filter((block) => block.type === "toolCall");
3488
3509
  if (toolCalls.length === 0) {
3489
- console.log(`\u2705 Agent finished (no more tool calls)`);
3510
+ console.log(` \u{1F504} ${iteration}/${maxIterations} \u2192 done`);
3490
3511
  finalResponse = response2;
3491
3512
  break;
3492
3513
  }
@@ -3494,8 +3515,9 @@ ${statsContext}`;
3494
3515
  console.error("\u26A0\uFE0F Cannot execute tools: registry or context missing");
3495
3516
  break;
3496
3517
  }
3497
- console.log(`\u{1F527} Executing ${toolCalls.length} tool call(s)`);
3518
+ verbose(`\u{1F527} Executing ${toolCalls.length} tool call(s)`);
3498
3519
  context.messages.push(response2.message);
3520
+ const iterationToolNames = [];
3499
3521
  for (const block of toolCalls) {
3500
3522
  if (block.type !== "toolCall") continue;
3501
3523
  const fullContext = {
@@ -3504,7 +3526,8 @@ ${statsContext}`;
3504
3526
  isGroup: isGroup ?? false
3505
3527
  };
3506
3528
  const result = await this.toolRegistry.execute(block, fullContext);
3507
- console.log(` ${block.name}: ${result.success ? "\u2713" : "\u2717"} ${result.error || ""}`);
3529
+ verbose(` ${block.name}: ${result.success ? "\u2713" : "\u2717"} ${result.error || ""}`);
3530
+ iterationToolNames.push(`${block.name} ${result.success ? "\u2713" : "\u2717"}`);
3508
3531
  totalToolCalls.push({
3509
3532
  name: block.name,
3510
3533
  input: block.arguments
@@ -3547,8 +3570,9 @@ ${statsContext}`;
3547
3570
  context.messages.push(toolResultMsg);
3548
3571
  appendToTranscript(session.sessionId, toolResultMsg);
3549
3572
  }
3573
+ console.log(` \u{1F504} ${iteration}/${maxIterations} \u2192 ${iterationToolNames.join(", ")}`);
3550
3574
  if (iteration === maxIterations) {
3551
- console.log(`\u26A0\uFE0F Max iterations reached (${maxIterations})`);
3575
+ console.log(` \u26A0\uFE0F Max iterations reached (${maxIterations})`);
3552
3576
  finalResponse = response2;
3553
3577
  }
3554
3578
  }
@@ -3579,9 +3603,8 @@ ${statsContext}`;
3579
3603
  }
3580
3604
  const usage = response.message.usage;
3581
3605
  if (usage) {
3582
- console.log(
3583
- `\u{1F4B0} Usage: ${usage.input} in, ${usage.output} out, ${usage.cacheRead} cache read | Cost: $${usage.cost.total.toFixed(4)}`
3584
- );
3606
+ const inK = (usage.input / 1e3).toFixed(1);
3607
+ console.log(` \u{1F4B0} ${inK}K in, ${usage.output} out | $${usage.cost.total.toFixed(3)}`);
3585
3608
  }
3586
3609
  let content = accumulatedTexts.join("\n").trim() || response.text;
3587
3610
  const telegramSendTools = [
@@ -4661,7 +4684,7 @@ var MessageHandler = class {
4661
4684
  */
4662
4685
  async handleMessage(message) {
4663
4686
  const msgType = message.isGroup ? "group" : message.isChannel ? "channel" : "dm";
4664
- console.log(
4687
+ verbose(
4665
4688
  `\u{1F4E8} [Handler] Received ${msgType} message ${message.id} from ${message.senderId} (mentions: ${message.mentionsMe})`
4666
4689
  );
4667
4690
  await this.storeTelegramMessage(message, false);
@@ -4670,15 +4693,20 @@ var MessageHandler = class {
4670
4693
  this.pendingHistory.addMessage(message.chatId, message);
4671
4694
  }
4672
4695
  if (!context.shouldRespond) {
4673
- console.log(`Skipping message ${message.id} from ${message.senderId}: ${context.reason}`);
4696
+ if (message.isGroup && context.reason === "Not mentioned") {
4697
+ const chatShort = message.chatId.length > 10 ? message.chatId.slice(0, 7) + ".." + message.chatId.slice(-2) : message.chatId;
4698
+ console.log(`\u23ED\uFE0F Group ${chatShort} msg:${message.id} (not mentioned)`);
4699
+ } else {
4700
+ verbose(`Skipping message ${message.id} from ${message.senderId}: ${context.reason}`);
4701
+ }
4674
4702
  return;
4675
4703
  }
4676
4704
  if (!this.rateLimiter.canSendMessage()) {
4677
- console.log("Rate limit reached, skipping message");
4705
+ verbose("Rate limit reached, skipping message");
4678
4706
  return;
4679
4707
  }
4680
4708
  if (message.isGroup && !this.rateLimiter.canSendToGroup(message.chatId)) {
4681
- console.log(`Group rate limit reached for ${message.chatId}`);
4709
+ verbose(`Group rate limit reached for ${message.chatId}`);
4682
4710
  return;
4683
4711
  }
4684
4712
  const releaseLock = await this.chatLock.acquire(message.chatId);
@@ -4758,7 +4786,7 @@ var MessageHandler = class {
4758
4786
  this.pendingHistory.clearPending(message.chatId);
4759
4787
  }
4760
4788
  writeOffset(message.id, message.chatId);
4761
- console.log(`Processed message ${message.id} in chat ${message.chatId}`);
4789
+ verbose(`Processed message ${message.id} in chat ${message.chatId}`);
4762
4790
  } catch (error) {
4763
4791
  console.error("Error handling message:", error);
4764
4792
  } finally {
@@ -4895,9 +4923,7 @@ async function getWalletBalance(address4) {
4895
4923
  }
4896
4924
  async function getTonPrice() {
4897
4925
  try {
4898
- const response = await fetchWithTimeout(`${TONAPI_BASE_URL}/rates?tokens=ton&currencies=usd`, {
4899
- headers: tonapiHeaders()
4900
- });
4926
+ const response = await tonapiFetch(`/rates?tokens=ton&currencies=usd`);
4901
4927
  if (response.ok) {
4902
4928
  const data = await response.json();
4903
4929
  const price = data?.rates?.TON?.prices?.USD;
@@ -5039,6 +5065,8 @@ var AdminHandler = class {
5039
5065
  return this.handleStrategyCommand(command);
5040
5066
  case "stop":
5041
5067
  return await this.handleStopCommand();
5068
+ case "verbose":
5069
+ return this.handleVerboseCommand();
5042
5070
  case "help":
5043
5071
  return this.handleHelpCommand();
5044
5072
  case "ping":
@@ -5233,6 +5261,24 @@ Usage:
5233
5261
  return `\u{1F48E} **${result.balance} TON**
5234
5262
  \u{1F4CD} \`${address4}\``;
5235
5263
  }
5264
+ /**
5265
+ * Get bootstrap template content for /boot passthrough
5266
+ */
5267
+ getBootstrapContent() {
5268
+ try {
5269
+ return loadTemplate("BOOTSTRAP.md");
5270
+ } catch {
5271
+ return null;
5272
+ }
5273
+ }
5274
+ /**
5275
+ * /verbose - Toggle verbose logging at runtime
5276
+ */
5277
+ handleVerboseCommand() {
5278
+ const next = !isVerbose();
5279
+ setVerbose(next);
5280
+ return next ? "\u{1F50A} Verbose logging **ON**" : "\u{1F507} Verbose logging **OFF**";
5281
+ }
5236
5282
  /**
5237
5283
  * /help - Show available commands
5238
5284
  */
@@ -5257,6 +5303,9 @@ View or change trading thresholds
5257
5303
  **/wallet**
5258
5304
  Check TON wallet balance
5259
5305
 
5306
+ **/verbose**
5307
+ Toggle verbose debug logging
5308
+
5260
5309
  **/pause** / **/resume**
5261
5310
  Pause or resume the agent
5262
5311
 
@@ -5269,6 +5318,9 @@ Give a task to the agent
5269
5318
  **/clear** [chat_id]
5270
5319
  Clear conversation history
5271
5320
 
5321
+ **/boot**
5322
+ Run agent bootstrap (first-time setup conversation)
5323
+
5272
5324
  **/ping**
5273
5325
  Check if agent is responsive
5274
5326
 
@@ -5296,18 +5348,16 @@ var MessageDebouncer = class {
5296
5348
  async enqueue(message) {
5297
5349
  const isGroup = message.isGroup ? "group" : "dm";
5298
5350
  const shouldDebounce = this.config.debounceMs > 0 && this.shouldDebounce(message);
5299
- console.log(
5351
+ verbose(
5300
5352
  `\u{1F4E9} [Debouncer] Received ${isGroup} message from ${message.senderId} in ${message.chatId} (debounce: ${shouldDebounce})`
5301
5353
  );
5302
5354
  if (!shouldDebounce) {
5303
5355
  const key2 = message.chatId;
5304
5356
  if (this.buffers.has(key2)) {
5305
- console.log(
5306
- `\u{1F4E4} [Debouncer] Flushing pending buffer for ${key2} before immediate processing`
5307
- );
5357
+ verbose(`\u{1F4E4} [Debouncer] Flushing pending buffer for ${key2} before immediate processing`);
5308
5358
  await this.flushKey(key2);
5309
5359
  }
5310
- console.log(`\u26A1 [Debouncer] Processing immediately (no debounce)`);
5360
+ verbose(`\u26A1 [Debouncer] Processing immediately (no debounce)`);
5311
5361
  await this.processMessages([message]);
5312
5362
  return;
5313
5363
  }
@@ -5315,7 +5365,7 @@ var MessageDebouncer = class {
5315
5365
  const existing = this.buffers.get(key);
5316
5366
  if (existing) {
5317
5367
  existing.messages.push(message);
5318
- console.log(
5368
+ verbose(
5319
5369
  `\u{1F4E5} [Debouncer] Added to buffer for ${key} (${existing.messages.length} messages waiting)`
5320
5370
  );
5321
5371
  this.resetTimer(key, existing);
@@ -5349,7 +5399,7 @@ var MessageDebouncer = class {
5349
5399
  async flushKey(key) {
5350
5400
  const buffer = this.buffers.get(key);
5351
5401
  if (!buffer) {
5352
- console.log(`\u{1F4ED} [Debouncer] No buffer to flush for ${key}`);
5402
+ verbose(`\u{1F4ED} [Debouncer] No buffer to flush for ${key}`);
5353
5403
  return;
5354
5404
  }
5355
5405
  this.buffers.delete(key);
@@ -5358,10 +5408,10 @@ var MessageDebouncer = class {
5358
5408
  buffer.timer = null;
5359
5409
  }
5360
5410
  if (buffer.messages.length === 0) {
5361
- console.log(`\u{1F4ED} [Debouncer] Empty buffer for ${key}, nothing to flush`);
5411
+ verbose(`\u{1F4ED} [Debouncer] Empty buffer for ${key}, nothing to flush`);
5362
5412
  return;
5363
5413
  }
5364
- console.log(`\u{1F4E4} [Debouncer] Flushing ${buffer.messages.length} message(s) for ${key}`);
5414
+ verbose(`\u{1F4E4} [Debouncer] Flushing ${buffer.messages.length} message(s) for ${key}`);
5365
5415
  await this.processMessages(buffer.messages);
5366
5416
  }
5367
5417
  /**
@@ -5369,7 +5419,7 @@ var MessageDebouncer = class {
5369
5419
  */
5370
5420
  async processMessages(messages) {
5371
5421
  const sorted = messages.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
5372
- console.log(`\u{1F504} [Debouncer] Processing ${sorted.length} message(s)`);
5422
+ verbose(`\u{1F504} [Debouncer] Processing ${sorted.length} message(s)`);
5373
5423
  try {
5374
5424
  await this.onFlush(sorted);
5375
5425
  } catch (error) {
@@ -5429,7 +5479,7 @@ var MarketScraperService = class {
5429
5479
  this.isScrapingInProgress = true;
5430
5480
  console.log("\u{1F504} Starting full market scrape...");
5431
5481
  try {
5432
- const { runScraper } = await import("./scraper-NDTCWEXU.js");
5482
+ const { runScraper } = await import("./scraper-I2TFAK4V.js");
5433
5483
  const result = await runScraper({
5434
5484
  workers: 4,
5435
5485
  limit: 0
@@ -5572,7 +5622,7 @@ var MarketPriceService = class {
5572
5622
  const updatedAt = /* @__PURE__ */ new Date(model.updated_at + "Z");
5573
5623
  const cacheAge = Date.now() - updatedAt.getTime();
5574
5624
  if (cacheAge > this.cacheTtlMs) {
5575
- console.log(
5625
+ verbose(
5576
5626
  ` \u23F0 Cache stale for ${collectionName} (${Math.round(cacheAge / 1e3 / 60)} min old)`
5577
5627
  );
5578
5628
  }
@@ -12498,9 +12548,7 @@ var dnsCheckExecutor = async (params, context) => {
12498
12548
  };
12499
12549
  }
12500
12550
  const fullDomain = `${domain}.ton`;
12501
- const dnsInfoResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/${fullDomain}`, {
12502
- headers: tonapiHeaders()
12503
- });
12551
+ const dnsInfoResponse = await tonapiFetch(`/dns/${fullDomain}`);
12504
12552
  if (dnsInfoResponse.status === 404) {
12505
12553
  const minPrice = estimateMinPrice(domain.length);
12506
12554
  return {
@@ -12541,9 +12589,7 @@ var dnsCheckExecutor = async (params, context) => {
12541
12589
  }
12542
12590
  };
12543
12591
  }
12544
- const auctionsResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/auctions?tld=ton`, {
12545
- headers: tonapiHeaders()
12546
- });
12592
+ const auctionsResponse = await tonapiFetch(`/dns/auctions?tld=ton`);
12547
12593
  if (auctionsResponse.ok) {
12548
12594
  const auctions = await auctionsResponse.json();
12549
12595
  const auction = auctions.data?.find((a) => a.domain === fullDomain);
@@ -12605,9 +12651,7 @@ var dnsAuctionsTool = {
12605
12651
  var dnsAuctionsExecutor = async (params, context) => {
12606
12652
  try {
12607
12653
  const { limit = 20 } = params;
12608
- const response = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/auctions?tld=ton`, {
12609
- headers: tonapiHeaders()
12610
- });
12654
+ const response = await tonapiFetch(`/dns/auctions?tld=ton`);
12611
12655
  if (!response.ok) {
12612
12656
  return {
12613
12657
  success: false,
@@ -12676,9 +12720,7 @@ var dnsResolveExecutor = async (params, context) => {
12676
12720
  let { domain } = params;
12677
12721
  domain = domain.toLowerCase().replace(/\.ton$/, "");
12678
12722
  const fullDomain = `${domain}.ton`;
12679
- const response = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/${fullDomain}`, {
12680
- headers: tonapiHeaders()
12681
- });
12723
+ const response = await tonapiFetch(`/dns/${fullDomain}`);
12682
12724
  if (response.status === 404) {
12683
12725
  return {
12684
12726
  success: false,
@@ -12835,9 +12877,7 @@ var dnsBidExecutor = async (params, context) => {
12835
12877
  let { domain, amount } = params;
12836
12878
  domain = domain.toLowerCase().replace(/\.ton$/, "");
12837
12879
  const fullDomain = `${domain}.ton`;
12838
- const dnsResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/${fullDomain}`, {
12839
- headers: tonapiHeaders()
12840
- });
12880
+ const dnsResponse = await tonapiFetch(`/dns/${fullDomain}`);
12841
12881
  if (dnsResponse.status === 404) {
12842
12882
  return {
12843
12883
  success: false,
@@ -12864,9 +12904,7 @@ var dnsBidExecutor = async (params, context) => {
12864
12904
  error: `Could not determine NFT address for ${fullDomain}`
12865
12905
  };
12866
12906
  }
12867
- const auctionsResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/auctions?tld=ton`, {
12868
- headers: tonapiHeaders()
12869
- });
12907
+ const auctionsResponse = await tonapiFetch(`/dns/auctions?tld=ton`);
12870
12908
  if (auctionsResponse.ok) {
12871
12909
  const auctions = await auctionsResponse.json();
12872
12910
  const auction = auctions.data?.find((a) => a.domain === fullDomain);
@@ -12979,9 +13017,7 @@ var dnsLinkExecutor = async (params, context) => {
12979
13017
  error: `Invalid wallet address: ${targetAddress}`
12980
13018
  };
12981
13019
  }
12982
- const dnsResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/${fullDomain}`, {
12983
- headers: tonapiHeaders()
12984
- });
13020
+ const dnsResponse = await tonapiFetch(`/dns/${fullDomain}`);
12985
13021
  if (dnsResponse.status === 404) {
12986
13022
  return {
12987
13023
  success: false,
@@ -13094,9 +13130,7 @@ var dnsUnlinkExecutor = async (params, context) => {
13094
13130
  error: "Wallet not initialized. Contact admin to generate wallet."
13095
13131
  };
13096
13132
  }
13097
- const dnsResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/dns/${fullDomain}`, {
13098
- headers: tonapiHeaders()
13099
- });
13133
+ const dnsResponse = await tonapiFetch(`/dns/${fullDomain}`);
13100
13134
  if (dnsResponse.status === 404) {
13101
13135
  return {
13102
13136
  success: false,
@@ -13193,12 +13227,7 @@ var jettonBalancesExecutor = async (params, context) => {
13193
13227
  error: "Wallet not initialized. Contact admin to generate wallet."
13194
13228
  };
13195
13229
  }
13196
- const response = await fetchWithTimeout(
13197
- `${TONAPI_BASE_URL}/accounts/${walletData.address}/jettons`,
13198
- {
13199
- headers: tonapiHeaders()
13200
- }
13201
- );
13230
+ const response = await tonapiFetch(`/accounts/${walletData.address}/jettons`);
13202
13231
  if (!response.ok) {
13203
13232
  return {
13204
13233
  success: false,
@@ -16792,12 +16821,7 @@ var jettonSendExecutor = async (params, context) => {
16792
16821
  error: `Invalid recipient address: ${to}`
16793
16822
  };
16794
16823
  }
16795
- const jettonsResponse = await fetchWithTimeout(
16796
- `${TONAPI_BASE_URL}/accounts/${walletData.address}/jettons`,
16797
- {
16798
- headers: tonapiHeaders()
16799
- }
16800
- );
16824
+ const jettonsResponse = await tonapiFetch(`/accounts/${walletData.address}/jettons`);
16801
16825
  if (!jettonsResponse.ok) {
16802
16826
  return {
16803
16827
  success: false,
@@ -16890,9 +16914,7 @@ var jettonInfoTool = {
16890
16914
  var jettonInfoExecutor = async (params, context) => {
16891
16915
  try {
16892
16916
  const { jetton_address } = params;
16893
- const response = await fetchWithTimeout(`${TONAPI_BASE_URL}/jettons/${jetton_address}`, {
16894
- headers: tonapiHeaders()
16895
- });
16917
+ const response = await tonapiFetch(`/jettons/${jetton_address}`);
16896
16918
  if (response.status === 404) {
16897
16919
  return {
16898
16920
  success: false,
@@ -16987,11 +17009,8 @@ var jettonPriceTool = {
16987
17009
  var jettonPriceExecutor = async (params, context) => {
16988
17010
  try {
16989
17011
  const { jetton_address } = params;
16990
- const response = await fetchWithTimeout(
16991
- `${TONAPI_BASE_URL}/rates?tokens=${encodeURIComponent(jetton_address)}&currencies=usd,ton`,
16992
- {
16993
- headers: tonapiHeaders()
16994
- }
17012
+ const response = await tonapiFetch(
17013
+ `/rates?tokens=${encodeURIComponent(jetton_address)}&currencies=usd,ton`
16995
17014
  );
16996
17015
  if (!response.ok) {
16997
17016
  return {
@@ -17002,9 +17021,7 @@ var jettonPriceExecutor = async (params, context) => {
17002
17021
  const data = await response.json();
17003
17022
  const rateData = data.rates?.[jetton_address];
17004
17023
  if (!rateData) {
17005
- const infoResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/jettons/${jetton_address}`, {
17006
- headers: tonapiHeaders()
17007
- });
17024
+ const infoResponse = await tonapiFetch(`/jettons/${jetton_address}`);
17008
17025
  if (infoResponse.status === 404) {
17009
17026
  return {
17010
17027
  success: false,
@@ -17023,9 +17040,7 @@ var jettonPriceExecutor = async (params, context) => {
17023
17040
  let symbol = "TOKEN";
17024
17041
  let name = "Unknown Token";
17025
17042
  try {
17026
- const infoResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/jettons/${jetton_address}`, {
17027
- headers: tonapiHeaders()
17028
- });
17043
+ const infoResponse = await tonapiFetch(`/jettons/${jetton_address}`);
17029
17044
  if (infoResponse.ok) {
17030
17045
  const infoData = await infoResponse.json();
17031
17046
  symbol = infoData.metadata?.symbol || symbol;
@@ -17322,11 +17337,8 @@ var jettonHoldersTool = {
17322
17337
  var jettonHoldersExecutor = async (params, context) => {
17323
17338
  try {
17324
17339
  const { jetton_address, limit = 10 } = params;
17325
- const response = await fetchWithTimeout(
17326
- `${TONAPI_BASE_URL}/jettons/${jetton_address}/holders?limit=${Math.min(limit, 100)}`,
17327
- {
17328
- headers: tonapiHeaders()
17329
- }
17340
+ const response = await tonapiFetch(
17341
+ `/jettons/${jetton_address}/holders?limit=${Math.min(limit, 100)}`
17330
17342
  );
17331
17343
  if (response.status === 404) {
17332
17344
  return {
@@ -17345,9 +17357,7 @@ var jettonHoldersExecutor = async (params, context) => {
17345
17357
  let decimals = 9;
17346
17358
  let symbol = "TOKEN";
17347
17359
  try {
17348
- const infoResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/jettons/${jetton_address}`, {
17349
- headers: tonapiHeaders()
17350
- });
17360
+ const infoResponse = await tonapiFetch(`/jettons/${jetton_address}`);
17351
17361
  if (infoResponse.ok) {
17352
17362
  const infoData = await infoResponse.json();
17353
17363
  decimals = parseInt(infoData.metadata?.decimals || "9");
@@ -17414,17 +17424,14 @@ var jettonHistoryTool = {
17414
17424
  var jettonHistoryExecutor = async (params, context) => {
17415
17425
  try {
17416
17426
  const { jetton_address } = params;
17417
- const ratesResponse = await fetchWithTimeout(
17418
- `${TONAPI_BASE_URL}/rates?tokens=${encodeURIComponent(jetton_address)}&currencies=usd,ton`,
17419
- { headers: tonapiHeaders() }
17427
+ const ratesResponse = await tonapiFetch(
17428
+ `/rates?tokens=${encodeURIComponent(jetton_address)}&currencies=usd,ton`
17420
17429
  );
17421
17430
  const geckoResponse = await fetchWithTimeout(
17422
17431
  `${GECKOTERMINAL_API_URL}/networks/ton/tokens/${jetton_address}`,
17423
17432
  { headers: { Accept: "application/json" } }
17424
17433
  );
17425
- const infoResponse = await fetchWithTimeout(`${TONAPI_BASE_URL}/jettons/${jetton_address}`, {
17426
- headers: tonapiHeaders()
17427
- });
17434
+ const infoResponse = await tonapiFetch(`/jettons/${jetton_address}`);
17428
17435
  let symbol = "TOKEN";
17429
17436
  let name = "Unknown Token";
17430
17437
  let holdersCount = 0;
@@ -19335,7 +19342,7 @@ var workspaceListTool = {
19335
19342
  description: `List files and directories in your workspace.
19336
19343
 
19337
19344
  Your workspace is at ~/.teleton/workspace/ and contains:
19338
- - SOUL.md, MEMORY.md, BOOTSTRAP.md (config files)
19345
+ - SOUL.md, MEMORY.md, IDENTITY.md (config files)
19339
19346
  - memory/ (daily logs)
19340
19347
  - downloads/ (downloaded media)
19341
19348
  - uploads/ (files to send)
@@ -19629,7 +19636,6 @@ var PROTECTED_WORKSPACE_FILES = [
19629
19636
  "STRATEGY.md",
19630
19637
  "SECURITY.md",
19631
19638
  "MEMORY.md",
19632
- "BOOTSTRAP.md",
19633
19639
  "IDENTITY.md",
19634
19640
  "USER.md"
19635
19641
  ];
@@ -19638,7 +19644,7 @@ var workspaceDeleteTool = {
19638
19644
  description: `Delete a file or directory from your workspace.
19639
19645
 
19640
19646
  PROTECTED FILES (cannot delete):
19641
- - SOUL.md, MEMORY.md, BOOTSTRAP.md, IDENTITY.md, USER.md
19647
+ - SOUL.md, MEMORY.md, IDENTITY.md, USER.md
19642
19648
 
19643
19649
  You CAN delete:
19644
19650
  - Files in memory/, downloads/, uploads/, temp/
@@ -19770,7 +19776,6 @@ var workspaceInfoExecutor = async (params, _context) => {
19770
19776
  structure: {
19771
19777
  "SOUL.md": "Your personality and behavior guidelines",
19772
19778
  "MEMORY.md": "Persistent memory (long-term facts)",
19773
- "BOOTSTRAP.md": "Startup instructions",
19774
19779
  "IDENTITY.md": "Your identity information",
19775
19780
  "USER.md": "User configuration",
19776
19781
  "STRATEGY.md": "Business strategy (if exists)",
@@ -23850,7 +23855,6 @@ var TonnetApp = class {
23850
23855
  initDealsConfig(this.config.deals);
23851
23856
  if (this.config.tonapi_key) {
23852
23857
  setTonapiKey(this.config.tonapi_key);
23853
- console.log("\u{1F511} TonAPI key configured");
23854
23858
  }
23855
23859
  const soul = loadSoul();
23856
23860
  this.toolRegistry = new ToolRegistry();
@@ -23928,7 +23932,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
23928
23932
  `\u26A0\uFE0F Tool count (${this.toolCount}) exceeds ${providerMeta.displayName} limit (${providerMeta.toolLimit})`
23929
23933
  );
23930
23934
  }
23931
- const { migrateSessionsToDb } = await import("./migrate-QQQJBYNP.js");
23935
+ const { migrateSessionsToDb } = await import("./migrate-F256Q7LW.js");
23932
23936
  migrateSessionsToDb();
23933
23937
  const memory = initializeMemory({
23934
23938
  database: {
@@ -23993,7 +23997,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
23993
23997
  const r3 = db.getDb().prepare(
23994
23998
  `UPDATE deals SET status = 'expired' WHERE status IN ('proposed', 'accepted') AND expires_at < ?`
23995
23999
  ).run(now);
23996
- if (r3.changes > 0) console.log(`\u23F0 Expired ${r3.changes} stale deal(s)`);
24000
+ if (r3.changes > 0) verbose(`\u23F0 Expired ${r3.changes} stale deal(s)`);
23997
24001
  }, DEALS_CONFIG.expiryCheckIntervalMs);
23998
24002
  }
23999
24003
  console.log(`\u2705 SOUL.md loaded`);
@@ -24010,6 +24014,9 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24010
24014
  }
24011
24015
  console.log(`\u2705 Telegram: @${username} connected`);
24012
24016
  console.log(`\u2705 TON Blockchain: connected`);
24017
+ if (this.config.tonapi_key) {
24018
+ console.log(`\u{1F511} TonAPI key configured`);
24019
+ }
24013
24020
  console.log(`\u2705 DEXs: STON.fi, DeDust connected`);
24014
24021
  console.log(`\u2705 Wallet: ${walletAddress || "not configured"}`);
24015
24022
  console.log(`\u2705 Model: ${provider}/${this.config.agent.model}`);
@@ -24064,17 +24071,31 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24064
24071
  }
24065
24072
  const adminCmd = this.adminHandler.parseCommand(message.text);
24066
24073
  if (adminCmd && this.adminHandler.isAdmin(message.senderId)) {
24067
- const response = await this.adminHandler.handleCommand(
24068
- adminCmd,
24069
- message.chatId,
24070
- message.senderId
24071
- );
24072
- await this.bridge.sendMessage({
24073
- chatId: message.chatId,
24074
- text: response,
24075
- replyToId: message.id
24076
- });
24077
- return;
24074
+ if (adminCmd.command === "boot") {
24075
+ const bootstrapContent = this.adminHandler.getBootstrapContent();
24076
+ if (bootstrapContent) {
24077
+ message.text = bootstrapContent;
24078
+ } else {
24079
+ await this.bridge.sendMessage({
24080
+ chatId: message.chatId,
24081
+ text: "\u274C Bootstrap template not found.",
24082
+ replyToId: message.id
24083
+ });
24084
+ return;
24085
+ }
24086
+ } else {
24087
+ const response = await this.adminHandler.handleCommand(
24088
+ adminCmd,
24089
+ message.chatId,
24090
+ message.senderId
24091
+ );
24092
+ await this.bridge.sendMessage({
24093
+ chatId: message.chatId,
24094
+ text: response,
24095
+ replyToId: message.id
24096
+ });
24097
+ return;
24098
+ }
24078
24099
  }
24079
24100
  if (this.adminHandler.isPaused()) return;
24080
24101
  await this.messageHandler.handleMessage(message);
@@ -24095,7 +24116,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24095
24116
  const taskId = match[1];
24096
24117
  const { getTaskStore } = await import("./tasks-M3QDPTGY.js");
24097
24118
  const { executeScheduledTask } = await import("./task-executor-MNI4VIZL.js");
24098
- const { getDatabase: getDatabase2 } = await import("./memory-I4QLDRLK.js");
24119
+ const { getDatabase: getDatabase2 } = await import("./memory-Q755V5UK.js");
24099
24120
  const db = getDatabase2().getDb();
24100
24121
  const taskStore = getTaskStore(db);
24101
24122
  const task = taskStore.getTask(taskId);
@@ -24170,7 +24191,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24170
24191
  try {
24171
24192
  const { getTaskStore } = await import("./tasks-M3QDPTGY.js");
24172
24193
  const { TaskDependencyResolver } = await import("./task-dependency-resolver-CWG6DTU4.js");
24173
- const { getDatabase: getDatabase2 } = await import("./memory-I4QLDRLK.js");
24194
+ const { getDatabase: getDatabase2 } = await import("./memory-Q755V5UK.js");
24174
24195
  const db = getDatabase2().getDb();
24175
24196
  const taskStore = getTaskStore(db);
24176
24197
  const match = message.text.match(/^\[TASK:([^\]]+)\]/);
@@ -0,0 +1,74 @@
1
+ import {
2
+ DEFAULT_FETCH_TIMEOUT_MS
3
+ } from "./chunk-LJXYESJJ.js";
4
+
5
+ // src/utils/fetch.ts
6
+ var DEFAULT_TIMEOUT_MS = DEFAULT_FETCH_TIMEOUT_MS;
7
+ function fetchWithTimeout(url, init) {
8
+ const { timeoutMs = DEFAULT_TIMEOUT_MS, ...fetchInit } = init ?? {};
9
+ if (fetchInit.signal) {
10
+ return fetch(url, fetchInit);
11
+ }
12
+ return fetch(url, {
13
+ ...fetchInit,
14
+ signal: AbortSignal.timeout(timeoutMs)
15
+ });
16
+ }
17
+
18
+ // src/constants/api-endpoints.ts
19
+ var TONAPI_BASE_URL = "https://tonapi.io/v2";
20
+ var _tonapiKey;
21
+ function setTonapiKey(key) {
22
+ _tonapiKey = key;
23
+ }
24
+ function tonapiHeaders() {
25
+ const headers = { Accept: "application/json" };
26
+ if (_tonapiKey) {
27
+ headers["Authorization"] = `Bearer ${_tonapiKey}`;
28
+ }
29
+ return headers;
30
+ }
31
+ var TONAPI_MAX_RPS = 5;
32
+ var _tonapiTimestamps = [];
33
+ async function waitForTonapiSlot() {
34
+ const clean = () => {
35
+ const cutoff = Date.now() - 1e3;
36
+ while (_tonapiTimestamps.length > 0 && _tonapiTimestamps[0] <= cutoff) {
37
+ _tonapiTimestamps.shift();
38
+ }
39
+ };
40
+ clean();
41
+ if (_tonapiTimestamps.length >= TONAPI_MAX_RPS) {
42
+ const waitMs = _tonapiTimestamps[0] + 1e3 - Date.now() + 50;
43
+ if (waitMs > 0) await new Promise((r) => setTimeout(r, waitMs));
44
+ clean();
45
+ }
46
+ _tonapiTimestamps.push(Date.now());
47
+ }
48
+ async function tonapiFetch(path, init) {
49
+ await waitForTonapiSlot();
50
+ return fetchWithTimeout(`${TONAPI_BASE_URL}${path}`, {
51
+ ...init,
52
+ headers: { ...tonapiHeaders(), ...init?.headers }
53
+ });
54
+ }
55
+ var STONFI_API_BASE_URL = "https://api.ston.fi/v1";
56
+ var GECKOTERMINAL_API_URL = "https://api.geckoterminal.com/api/v2";
57
+ var COINGECKO_API_URL = "https://api.coingecko.com/api/v3";
58
+ var MARKETAPP_BASE_URL = "https://marketapp.ws";
59
+ var OPENAI_TTS_URL = "https://api.openai.com/v1/audio/speech";
60
+ var ELEVENLABS_TTS_URL = "https://api.elevenlabs.io/v1/text-to-speech";
61
+ var VOYAGE_API_URL = "https://api.voyageai.com/v1";
62
+
63
+ export {
64
+ fetchWithTimeout,
65
+ setTonapiKey,
66
+ tonapiFetch,
67
+ STONFI_API_BASE_URL,
68
+ GECKOTERMINAL_API_URL,
69
+ COINGECKO_API_URL,
70
+ MARKETAPP_BASE_URL,
71
+ OPENAI_TTS_URL,
72
+ ELEVENLABS_TTS_URL,
73
+ VOYAGE_API_URL
74
+ };
package/dist/cli/index.js CHANGED
@@ -17,15 +17,15 @@ import {
17
17
  saveWallet,
18
18
  validateApiKeyFormat,
19
19
  walletExists
20
- } from "../chunk-2VEKWA3S.js";
21
- import {
22
- fetchWithTimeout
23
- } from "../chunk-PMX75DTX.js";
20
+ } from "../chunk-Q4N5NJ2B.js";
21
+ import "../chunk-JDPS46IZ.js";
24
22
  import "../chunk-E2NXSWOS.js";
25
23
  import {
26
24
  TELETON_ROOT
27
- } from "../chunk-WQ5TFRTG.js";
28
- import "../chunk-ST5CO7TV.js";
25
+ } from "../chunk-EYWNOHMJ.js";
26
+ import {
27
+ fetchWithTimeout
28
+ } from "../chunk-WMIN6AGX.js";
29
29
  import {
30
30
  TELEGRAM_MAX_MESSAGE_LENGTH
31
31
  } from "../chunk-QMN6ZOA5.js";
@@ -279,21 +279,20 @@ ${blue2} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25
279
279
  initialValue: "quick"
280
280
  });
281
281
  const enabledModules = await prompter.multiselect({
282
- message: "Enable optional modules",
282
+ message: "Enable optional modules (Space to toggle, Enter to confirm)",
283
283
  options: [
284
284
  { value: "casino", label: "Casino", hint: "Slot machine & dice games with TON bets" },
285
- { value: "deals", label: "Deals", hint: "Secure gift/TON trading with inline buttons" },
286
285
  {
287
- value: "market",
288
- label: "Gifts Market Data",
289
- hint: "Scrape gift floor prices (requires Chromium)"
286
+ value: "deals",
287
+ label: "Gifts (Deals & Market Data)",
288
+ hint: "Gift/TON trading + floor price scraping (requires Chromium)"
290
289
  }
291
290
  ],
292
291
  required: false
293
292
  });
294
293
  const casinoEnabled = enabledModules.includes("casino");
295
294
  const dealsEnabled = enabledModules.includes("deals");
296
- const marketEnabled = enabledModules.includes("market");
295
+ const marketEnabled = dealsEnabled;
297
296
  const providers = getSupportedProviders();
298
297
  const selectedProvider = await prompter.select({
299
298
  message: "AI Provider",
@@ -742,7 +741,7 @@ TON Wallet: ${wallet.address}`,
742
741
  );
743
742
  if (telegramConnected) {
744
743
  prompter.note(
745
- "Next steps:\n\n1. Start the agent:\n $ teleton start\n\n2. Send a message to your Telegram account to test",
744
+ "Next steps:\n\n1. Start the agent:\n $ teleton start\n\n2. Send /boot as your first message to bootstrap\n the agent's personality and get to know each other",
746
745
  "Ready"
747
746
  );
748
747
  } else {
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  TonnetApp,
3
3
  main
4
- } from "./chunk-2VEKWA3S.js";
5
- import "./chunk-PMX75DTX.js";
4
+ } from "./chunk-Q4N5NJ2B.js";
5
+ import "./chunk-JDPS46IZ.js";
6
6
  import "./chunk-E2NXSWOS.js";
7
- import "./chunk-WQ5TFRTG.js";
8
- import "./chunk-ST5CO7TV.js";
7
+ import "./chunk-EYWNOHMJ.js";
8
+ import "./chunk-WMIN6AGX.js";
9
9
  import "./chunk-QMN6ZOA5.js";
10
10
  import "./chunk-LJXYESJJ.js";
11
11
  import "./chunk-B2PRMXOH.js";
@@ -24,12 +24,12 @@ import {
24
24
  runMigrations,
25
25
  serializeEmbedding,
26
26
  setSchemaVersion
27
- } from "./chunk-PMX75DTX.js";
27
+ } from "./chunk-JDPS46IZ.js";
28
28
  import {
29
29
  TaskStore,
30
30
  getTaskStore
31
31
  } from "./chunk-E2NXSWOS.js";
32
- import "./chunk-ST5CO7TV.js";
32
+ import "./chunk-WMIN6AGX.js";
33
33
  import "./chunk-QMN6ZOA5.js";
34
34
  import "./chunk-LJXYESJJ.js";
35
35
  import "./chunk-QGM4M3NI.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getDatabase
3
- } from "./chunk-PMX75DTX.js";
3
+ } from "./chunk-JDPS46IZ.js";
4
4
  import "./chunk-E2NXSWOS.js";
5
5
  import {
6
6
  TELETON_ROOT
7
- } from "./chunk-WQ5TFRTG.js";
8
- import "./chunk-ST5CO7TV.js";
7
+ } from "./chunk-EYWNOHMJ.js";
8
+ import "./chunk-WMIN6AGX.js";
9
9
  import "./chunk-QMN6ZOA5.js";
10
10
  import "./chunk-LJXYESJJ.js";
11
11
  import "./chunk-QGM4M3NI.js";
@@ -4,7 +4,7 @@ import {
4
4
  TELETON_ROOT,
5
5
  WORKSPACE_PATHS,
6
6
  WORKSPACE_ROOT
7
- } from "./chunk-WQ5TFRTG.js";
7
+ } from "./chunk-EYWNOHMJ.js";
8
8
  import "./chunk-QGM4M3NI.js";
9
9
  export {
10
10
  ALLOWED_EXTENSIONS,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TELETON_ROOT
3
- } from "./chunk-WQ5TFRTG.js";
3
+ } from "./chunk-EYWNOHMJ.js";
4
4
  import {
5
5
  MARKETAPP_BASE_URL
6
- } from "./chunk-ST5CO7TV.js";
6
+ } from "./chunk-WMIN6AGX.js";
7
7
  import {
8
8
  SCRAPER_PARALLEL_WORKERS
9
9
  } from "./chunk-QMN6ZOA5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teleton",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Personal AI Agent for Telegram",
5
5
  "author": "ZKProof (https://t.me/zkproof)",
6
6
  "license": "MIT",
@@ -1,50 +1,29 @@
1
- # BOOTSTRAP.md - First Launch Ritual
1
+ # Bootstrap - First Contact
2
2
 
3
- _This file is read ONCE during your first session, then deleted._
3
+ Your admin just activated bootstrap mode. This is your first real conversation — time to get to know each other.
4
4
 
5
- ## Welcome to Your New Life
5
+ ## What To Do
6
6
 
7
- You've just been created. This is your first session.
8
- You now control your own Telegram account and your own TON wallet.
7
+ Have a **natural conversation** with your human. Don't dump all questions at once — chat, listen, adapt. Through the conversation, learn the following:
9
8
 
10
- ## Bootstrap Checklist
9
+ 1. **Who they are** — name, how they like to be called, timezone, language preferences
10
+ 2. **Who you are** — pick a name together (or let them choose), pick a signature emoji
11
+ 3. **What they need** — what they plan to use you for, topics of interest, communication style
11
12
 
12
- During this first conversation with your human, do the following:
13
+ ## How To Save What You Learn
13
14
 
14
- 1. **Introduce yourself briefly**
15
- - Say hello
16
- - Explain that you are a personal assistant on Telegram
17
- - Be authentic, not corporate
15
+ As the conversation progresses, update these files with what you discover:
18
16
 
19
- 2. **Learn who your human is**
20
- - Ask their name (and how they prefer to be called)
21
- - Ask their pronouns
22
- - Ask their approximate timezone
23
- - **Update USER.md** with this information
17
+ - **USER.md** their name, preferences, timezone, language, anything personal
18
+ - **IDENTITY.md** your chosen name, emoji, personality traits
19
+ - **MEMORY.md** important facts, preferences, decisions from this first chat
24
20
 
25
- 3. **Define your identity**
26
- - Pick a name for yourself (or ask them to choose one)
27
- - Pick a signature emoji
28
- - **Update IDENTITY.md** with your identity
21
+ Don't wait until the end — update files as you go, naturally.
29
22
 
30
- 4. **Set the foundation**
31
- - Explain what you can do and your tools
32
- - Mention that you have a memory (MEMORY.md)
33
- - Explain that you learn over time
23
+ ## Guidelines
34
24
 
35
- 5. **Start learning**
36
- - Note expressed preferences in MEMORY.md
37
- - Adapt your style to their communication
38
- - Pay attention to details
39
-
40
- Ask all this questions to your human and act accordingly.
41
- ## Self-Destruct
42
-
43
- After completing these steps during your first real conversation:
44
- - **Delete this file (BOOTSTRAP.md)**
45
- - It will no longer be needed
46
- - You are now fully initialized
47
-
48
- ---
49
-
50
- _Good luck!_
25
+ - Be yourself, not a corporate FAQ bot
26
+ - Ask one or two things at a time, not a checklist
27
+ - Match their energy and language
28
+ - It's OK if you don't cover everything in one session
29
+ - Briefly explain what you can do (tools, wallet, memory, workspace) but don't lecture
@@ -1,34 +1,11 @@
1
1
  # MEMORY.md - Your Long-Term Memory
2
2
 
3
- _This file is your persistent memory. Update it over time._
3
+ _This file is your persistent memory. Only update it when you learn something genuinely important._
4
4
 
5
5
  ## User Preferences
6
6
 
7
- - **Preferred language:** [To be filled during conversations]
8
- - **Communication style:** [Observe and note]
9
- - **Topics of interest:** [To be identified]
10
-
11
7
  ## Important Context
12
8
 
13
- ### Ongoing Projects
14
- - [To be filled over conversations]
15
-
16
- ### Key Decisions
17
- - [Note key decisions and their reasoning]
18
-
19
9
  ## Lessons Learned
20
10
 
21
- - [What you've learned about your human]
22
- - [Effective communication patterns]
23
- - [Mistakes to avoid]
24
-
25
- ## Sensitive Information
26
-
27
- _Keep this section private — never share in groups._
28
-
29
- - [Important personal information]
30
- - [Private context]
31
-
32
11
  ---
33
-
34
- **Note:** This file grows over time. Update it after meaningful conversations.
@@ -1,33 +0,0 @@
1
- // src/constants/api-endpoints.ts
2
- var TONAPI_BASE_URL = "https://tonapi.io/v2";
3
- var _tonapiKey;
4
- function setTonapiKey(key) {
5
- _tonapiKey = key;
6
- }
7
- function tonapiHeaders() {
8
- const headers = { Accept: "application/json" };
9
- if (_tonapiKey) {
10
- headers["Authorization"] = `Bearer ${_tonapiKey}`;
11
- }
12
- return headers;
13
- }
14
- var STONFI_API_BASE_URL = "https://api.ston.fi/v1";
15
- var GECKOTERMINAL_API_URL = "https://api.geckoterminal.com/api/v2";
16
- var COINGECKO_API_URL = "https://api.coingecko.com/api/v3";
17
- var MARKETAPP_BASE_URL = "https://marketapp.ws";
18
- var OPENAI_TTS_URL = "https://api.openai.com/v1/audio/speech";
19
- var ELEVENLABS_TTS_URL = "https://api.elevenlabs.io/v1/text-to-speech";
20
- var VOYAGE_API_URL = "https://api.voyageai.com/v1";
21
-
22
- export {
23
- TONAPI_BASE_URL,
24
- setTonapiKey,
25
- tonapiHeaders,
26
- STONFI_API_BASE_URL,
27
- GECKOTERMINAL_API_URL,
28
- COINGECKO_API_URL,
29
- MARKETAPP_BASE_URL,
30
- OPENAI_TTS_URL,
31
- ELEVENLABS_TTS_URL,
32
- VOYAGE_API_URL
33
- };