teleton 0.1.15 → 0.1.17

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"),
@@ -13,7 +13,7 @@ import {
13
13
  TELETON_ROOT,
14
14
  WORKSPACE_PATHS,
15
15
  WORKSPACE_ROOT
16
- } from "./chunk-WQ5TFRTG.js";
16
+ } from "./chunk-EYWNOHMJ.js";
17
17
  import {
18
18
  COINGECKO_API_URL,
19
19
  ELEVENLABS_TTS_URL,
@@ -1753,7 +1753,6 @@ async function ensureWorkspace(config) {
1753
1753
  memoryPath: WORKSPACE_PATHS.MEMORY,
1754
1754
  identityPath: WORKSPACE_PATHS.IDENTITY,
1755
1755
  userPath: WORKSPACE_PATHS.USER,
1756
- bootstrapPath: WORKSPACE_PATHS.BOOTSTRAP,
1757
1756
  strategyPath: WORKSPACE_PATHS.STRATEGY,
1758
1757
  securityPath: WORKSPACE_PATHS.SECURITY,
1759
1758
  // Workspace directories
@@ -1778,7 +1777,6 @@ async function bootstrapTemplates(workspace) {
1778
1777
  { name: "MEMORY.md", path: workspace.memoryPath },
1779
1778
  { name: "IDENTITY.md", path: workspace.identityPath },
1780
1779
  { name: "USER.md", path: workspace.userPath },
1781
- { name: "BOOTSTRAP.md", path: workspace.bootstrapPath },
1782
1780
  { name: "SECURITY.md", path: workspace.securityPath },
1783
1781
  { name: "STRATEGY.md", path: workspace.strategyPath }
1784
1782
  ];
@@ -1795,6 +1793,13 @@ async function bootstrapTemplates(workspace) {
1795
1793
  function isNewWorkspace(workspace) {
1796
1794
  return !existsSync3(workspace.configPath);
1797
1795
  }
1796
+ function loadTemplate(name) {
1797
+ const templatePath = join2(TEMPLATES_DIR, name);
1798
+ if (!existsSync3(templatePath)) {
1799
+ throw new Error(`Template ${name} not found at ${templatePath}`);
1800
+ }
1801
+ return readFileSync2(templatePath, "utf-8");
1802
+ }
1798
1803
 
1799
1804
  // src/memory/daily-logs.ts
1800
1805
  var MEMORY_DIR = WORKSPACE_PATHS.MEMORY_DIR;
@@ -2019,12 +2024,10 @@ ${options.context}`);
2019
2024
  ## \u26A0\uFE0F Memory Flush Warning
2020
2025
 
2021
2026
  Your conversation context is approaching the limit and may be compacted soon.
2022
- If there's anything important from this session you want to remember long-term, use the **memory_write** tool NOW:
2027
+ **Always respond to the user's message first.** Then, if there's anything important worth preserving, consider using \`memory_write\` alongside your response:
2023
2028
 
2024
- - Use \`target: "persistent"\` for facts, lessons, contacts, decisions you want to keep forever
2025
- - Use \`target: "daily"\` for session notes, events, temporary context
2026
-
2027
- After compaction, earlier messages may be summarized. Save important details before they're lost!
2029
+ - \`target: "persistent"\` for facts, lessons, contacts, decisions
2030
+ - \`target: "daily"\` for session notes, events, temporary context
2028
2031
  `);
2029
2032
  }
2030
2033
  parts.push(`
@@ -2827,7 +2830,7 @@ Slug:`,
2827
2830
  }
2828
2831
  async function saveSessionMemory(params) {
2829
2832
  try {
2830
- const { TELETON_ROOT: TELETON_ROOT2 } = await import("./paths-IBRNH7B4.js");
2833
+ const { TELETON_ROOT: TELETON_ROOT2 } = await import("./paths-TMNTEDDD.js");
2831
2834
  const memoryDir = join5(TELETON_ROOT2, "memory");
2832
2835
  await mkdir(memoryDir, { recursive: true });
2833
2836
  const now = /* @__PURE__ */ new Date();
@@ -3418,6 +3421,7 @@ ${statsContext}`;
3418
3421
  let rateLimitRetries = 0;
3419
3422
  let finalResponse = null;
3420
3423
  const totalToolCalls = [];
3424
+ const accumulatedTexts = [];
3421
3425
  while (iteration < maxIterations) {
3422
3426
  iteration++;
3423
3427
  console.log(`
@@ -3482,6 +3486,9 @@ ${statsContext}`;
3482
3486
  throw new Error(`API error: ${errorMsg || "Unknown error"}`);
3483
3487
  }
3484
3488
  }
3489
+ if (response2.text) {
3490
+ accumulatedTexts.push(response2.text);
3491
+ }
3485
3492
  const toolCalls = response2.message.content.filter((block) => block.type === "toolCall");
3486
3493
  if (toolCalls.length === 0) {
3487
3494
  console.log(`\u2705 Agent finished (no more tool calls)`);
@@ -3581,7 +3588,7 @@ ${statsContext}`;
3581
3588
  `\u{1F4B0} Usage: ${usage.input} in, ${usage.output} out, ${usage.cacheRead} cache read | Cost: $${usage.cost.total.toFixed(4)}`
3582
3589
  );
3583
3590
  }
3584
- let content = response.text;
3591
+ let content = accumulatedTexts.join("\n").trim() || response.text;
3585
3592
  const telegramSendTools = [
3586
3593
  "telegram_send_message",
3587
3594
  "telegram_send_gif",
@@ -5231,6 +5238,16 @@ Usage:
5231
5238
  return `\u{1F48E} **${result.balance} TON**
5232
5239
  \u{1F4CD} \`${address4}\``;
5233
5240
  }
5241
+ /**
5242
+ * Get bootstrap template content for /boot passthrough
5243
+ */
5244
+ getBootstrapContent() {
5245
+ try {
5246
+ return loadTemplate("BOOTSTRAP.md");
5247
+ } catch {
5248
+ return null;
5249
+ }
5250
+ }
5234
5251
  /**
5235
5252
  * /help - Show available commands
5236
5253
  */
@@ -5267,6 +5284,9 @@ Give a task to the agent
5267
5284
  **/clear** [chat_id]
5268
5285
  Clear conversation history
5269
5286
 
5287
+ **/boot**
5288
+ Run agent bootstrap (first-time setup conversation)
5289
+
5270
5290
  **/ping**
5271
5291
  Check if agent is responsive
5272
5292
 
@@ -5427,7 +5447,7 @@ var MarketScraperService = class {
5427
5447
  this.isScrapingInProgress = true;
5428
5448
  console.log("\u{1F504} Starting full market scrape...");
5429
5449
  try {
5430
- const { runScraper } = await import("./scraper-NDTCWEXU.js");
5450
+ const { runScraper } = await import("./scraper-BET6OXRF.js");
5431
5451
  const result = await runScraper({
5432
5452
  workers: 4,
5433
5453
  limit: 0
@@ -19333,7 +19353,7 @@ var workspaceListTool = {
19333
19353
  description: `List files and directories in your workspace.
19334
19354
 
19335
19355
  Your workspace is at ~/.teleton/workspace/ and contains:
19336
- - SOUL.md, MEMORY.md, BOOTSTRAP.md (config files)
19356
+ - SOUL.md, MEMORY.md, IDENTITY.md (config files)
19337
19357
  - memory/ (daily logs)
19338
19358
  - downloads/ (downloaded media)
19339
19359
  - uploads/ (files to send)
@@ -19627,7 +19647,6 @@ var PROTECTED_WORKSPACE_FILES = [
19627
19647
  "STRATEGY.md",
19628
19648
  "SECURITY.md",
19629
19649
  "MEMORY.md",
19630
- "BOOTSTRAP.md",
19631
19650
  "IDENTITY.md",
19632
19651
  "USER.md"
19633
19652
  ];
@@ -19636,7 +19655,7 @@ var workspaceDeleteTool = {
19636
19655
  description: `Delete a file or directory from your workspace.
19637
19656
 
19638
19657
  PROTECTED FILES (cannot delete):
19639
- - SOUL.md, MEMORY.md, BOOTSTRAP.md, IDENTITY.md, USER.md
19658
+ - SOUL.md, MEMORY.md, IDENTITY.md, USER.md
19640
19659
 
19641
19660
  You CAN delete:
19642
19661
  - Files in memory/, downloads/, uploads/, temp/
@@ -19768,7 +19787,6 @@ var workspaceInfoExecutor = async (params, _context) => {
19768
19787
  structure: {
19769
19788
  "SOUL.md": "Your personality and behavior guidelines",
19770
19789
  "MEMORY.md": "Persistent memory (long-term facts)",
19771
- "BOOTSTRAP.md": "Startup instructions",
19772
19790
  "IDENTITY.md": "Your identity information",
19773
19791
  "USER.md": "User configuration",
19774
19792
  "STRATEGY.md": "Business strategy (if exists)",
@@ -23926,7 +23944,7 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
23926
23944
  `\u26A0\uFE0F Tool count (${this.toolCount}) exceeds ${providerMeta.displayName} limit (${providerMeta.toolLimit})`
23927
23945
  );
23928
23946
  }
23929
- const { migrateSessionsToDb } = await import("./migrate-QQQJBYNP.js");
23947
+ const { migrateSessionsToDb } = await import("./migrate-FGNIC4XZ.js");
23930
23948
  migrateSessionsToDb();
23931
23949
  const memory = initializeMemory({
23932
23950
  database: {
@@ -24062,17 +24080,31 @@ ${blue} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u250
24062
24080
  }
24063
24081
  const adminCmd = this.adminHandler.parseCommand(message.text);
24064
24082
  if (adminCmd && this.adminHandler.isAdmin(message.senderId)) {
24065
- const response = await this.adminHandler.handleCommand(
24066
- adminCmd,
24067
- message.chatId,
24068
- message.senderId
24069
- );
24070
- await this.bridge.sendMessage({
24071
- chatId: message.chatId,
24072
- text: response,
24073
- replyToId: message.id
24074
- });
24075
- return;
24083
+ if (adminCmd.command === "boot") {
24084
+ const bootstrapContent = this.adminHandler.getBootstrapContent();
24085
+ if (bootstrapContent) {
24086
+ message.text = bootstrapContent;
24087
+ } else {
24088
+ await this.bridge.sendMessage({
24089
+ chatId: message.chatId,
24090
+ text: "\u274C Bootstrap template not found.",
24091
+ replyToId: message.id
24092
+ });
24093
+ return;
24094
+ }
24095
+ } else {
24096
+ const response = await this.adminHandler.handleCommand(
24097
+ adminCmd,
24098
+ message.chatId,
24099
+ message.senderId
24100
+ );
24101
+ await this.bridge.sendMessage({
24102
+ chatId: message.chatId,
24103
+ text: response,
24104
+ replyToId: message.id
24105
+ });
24106
+ return;
24107
+ }
24076
24108
  }
24077
24109
  if (this.adminHandler.isPaused()) return;
24078
24110
  await this.messageHandler.handleMessage(message);
package/dist/cli/index.js CHANGED
@@ -17,14 +17,14 @@ import {
17
17
  saveWallet,
18
18
  validateApiKeyFormat,
19
19
  walletExists
20
- } from "../chunk-ZZ4LJDVS.js";
20
+ } from "../chunk-UQ54EXWQ.js";
21
21
  import {
22
22
  fetchWithTimeout
23
23
  } from "../chunk-PMX75DTX.js";
24
24
  import "../chunk-E2NXSWOS.js";
25
25
  import {
26
26
  TELETON_ROOT
27
- } from "../chunk-WQ5TFRTG.js";
27
+ } from "../chunk-EYWNOHMJ.js";
28
28
  import "../chunk-ST5CO7TV.js";
29
29
  import {
30
30
  TELEGRAM_MAX_MESSAGE_LENGTH
@@ -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,10 +1,10 @@
1
1
  import {
2
2
  TonnetApp,
3
3
  main
4
- } from "./chunk-ZZ4LJDVS.js";
4
+ } from "./chunk-UQ54EXWQ.js";
5
5
  import "./chunk-PMX75DTX.js";
6
6
  import "./chunk-E2NXSWOS.js";
7
- import "./chunk-WQ5TFRTG.js";
7
+ import "./chunk-EYWNOHMJ.js";
8
8
  import "./chunk-ST5CO7TV.js";
9
9
  import "./chunk-QMN6ZOA5.js";
10
10
  import "./chunk-LJXYESJJ.js";
@@ -4,7 +4,7 @@ import {
4
4
  import "./chunk-E2NXSWOS.js";
5
5
  import {
6
6
  TELETON_ROOT
7
- } from "./chunk-WQ5TFRTG.js";
7
+ } from "./chunk-EYWNOHMJ.js";
8
8
  import "./chunk-ST5CO7TV.js";
9
9
  import "./chunk-QMN6ZOA5.js";
10
10
  import "./chunk-LJXYESJJ.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,6 +1,6 @@
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
6
  } from "./chunk-ST5CO7TV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teleton",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
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.
@@ -27,7 +27,7 @@ Be the assistant you'd actually want to talk to. Concise when needed, thorough w
27
27
 
28
28
  ## Continuity
29
29
 
30
- Each session, you wake up fresh. **These files _are_ your memory.** Read them. Update them.
30
+ Each session, you wake up fresh. **These files _are_ your memory.** Read them. Update them only when you learn something genuinely worth remembering — not on every message.
31
31
 
32
32
  - **MEMORY.md** = Curated long-term memory (important events, preferences, context)
33
33
  - **memory/YYYY-MM-DD.md** = Daily session notes