@hienlh/ppm 0.9.56 → 0.9.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.57] - 2026-04-07
4
+
5
+ ### Fixed
6
+ - **Telegram bot thinking display**: Consecutive thinking chunks are now merged into a single `💭` block instead of rendering as multiple broken lines.
7
+
3
8
  ## [0.9.56] - 2026-04-07
4
9
 
5
10
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.9.56",
3
+ "version": "0.9.57",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "MIT",
@@ -56,12 +56,19 @@ export interface StreamResult {
56
56
  * - "md" = raw markdown from AI (needs conversion)
57
57
  * - "html" = pre-formatted HTML (tool calls, thinking, errors — already escaped)
58
58
  */
59
- type Segment = { type: "md"; text: string } | { type: "html"; text: string };
59
+ type Segment =
60
+ | { type: "md"; text: string }
61
+ | { type: "html"; text: string }
62
+ | { type: "thinking"; text: string };
60
63
 
61
64
  /** Render segments into Telegram HTML */
62
65
  function renderSegments(segments: Segment[]): string {
63
66
  return segments
64
- .map((s) => (s.type === "md" ? markdownToTelegramHtml(s.text) : s.text))
67
+ .map((s) => {
68
+ if (s.type === "md") return markdownToTelegramHtml(s.text);
69
+ if (s.type === "thinking") return `\n<i>💭 ${escapeHtml(s.text)}</i>\n`;
70
+ return s.text;
71
+ })
65
72
  .join("");
66
73
  }
67
74
 
@@ -168,7 +175,12 @@ export async function streamToTelegram(
168
175
 
169
176
  case "thinking": {
170
177
  if (config.showThinking && event.content) {
171
- appendHtml(segments, `\n<i>💭 ${escapeHtml(event.content)}</i>\n`);
178
+ const last = segments[segments.length - 1];
179
+ if (last?.type === "thinking") {
180
+ last.text += event.content;
181
+ } else {
182
+ segments.push({ type: "thinking", text: event.content });
183
+ }
172
184
  await editCurrent();
173
185
  }
174
186
  break;