teleton 0.1.15 → 0.1.16

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.
@@ -2019,12 +2019,10 @@ ${options.context}`);
2019
2019
  ## \u26A0\uFE0F Memory Flush Warning
2020
2020
 
2021
2021
  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:
2022
+ **Always respond to the user's message first.** Then, if there's anything important worth preserving, consider using \`memory_write\` alongside your response:
2023
2023
 
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!
2024
+ - \`target: "persistent"\` for facts, lessons, contacts, decisions
2025
+ - \`target: "daily"\` for session notes, events, temporary context
2028
2026
  `);
2029
2027
  }
2030
2028
  parts.push(`
@@ -3418,6 +3416,7 @@ ${statsContext}`;
3418
3416
  let rateLimitRetries = 0;
3419
3417
  let finalResponse = null;
3420
3418
  const totalToolCalls = [];
3419
+ const accumulatedTexts = [];
3421
3420
  while (iteration < maxIterations) {
3422
3421
  iteration++;
3423
3422
  console.log(`
@@ -3482,6 +3481,9 @@ ${statsContext}`;
3482
3481
  throw new Error(`API error: ${errorMsg || "Unknown error"}`);
3483
3482
  }
3484
3483
  }
3484
+ if (response2.text) {
3485
+ accumulatedTexts.push(response2.text);
3486
+ }
3485
3487
  const toolCalls = response2.message.content.filter((block) => block.type === "toolCall");
3486
3488
  if (toolCalls.length === 0) {
3487
3489
  console.log(`\u2705 Agent finished (no more tool calls)`);
@@ -3581,7 +3583,7 @@ ${statsContext}`;
3581
3583
  `\u{1F4B0} Usage: ${usage.input} in, ${usage.output} out, ${usage.cacheRead} cache read | Cost: $${usage.cost.total.toFixed(4)}`
3582
3584
  );
3583
3585
  }
3584
- let content = response.text;
3586
+ let content = accumulatedTexts.join("\n").trim() || response.text;
3585
3587
  const telegramSendTools = [
3586
3588
  "telegram_send_message",
3587
3589
  "telegram_send_gif",
package/dist/cli/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  saveWallet,
18
18
  validateApiKeyFormat,
19
19
  walletExists
20
- } from "../chunk-ZZ4LJDVS.js";
20
+ } from "../chunk-2VEKWA3S.js";
21
21
  import {
22
22
  fetchWithTimeout
23
23
  } from "../chunk-PMX75DTX.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TonnetApp,
3
3
  main
4
- } from "./chunk-ZZ4LJDVS.js";
4
+ } from "./chunk-2VEKWA3S.js";
5
5
  import "./chunk-PMX75DTX.js";
6
6
  import "./chunk-E2NXSWOS.js";
7
7
  import "./chunk-WQ5TFRTG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teleton",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Personal AI Agent for Telegram",
5
5
  "author": "ZKProof (https://t.me/zkproof)",
6
6
  "license": "MIT",
@@ -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