@inceptionstack/roundhouse 0.3.24 → 0.3.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inceptionstack/roundhouse",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
4
4
  "type": "module",
5
5
  "description": "Multi-platform chat gateway that routes messages through a configured AI agent",
6
6
  "license": "MIT",
package/src/gateway.ts CHANGED
@@ -450,7 +450,7 @@ export class Gateway {
450
450
  const agent = this.router.resolve(agentThreadId);
451
451
  if (agent.restart) {
452
452
  await agent.restart(agentThreadId);
453
- await thread.post("🔄 Session restarted. Send a message to begin a new conversation.");
453
+ await thread.post(`🔄 Session restarted (\`${agentThreadId}\`). Send a message to begin a new conversation.`);
454
454
  } else {
455
455
  await thread.post("⚠️ New session not supported for this agent.");
456
456
  }
@@ -548,6 +548,7 @@ export class Gateway {
548
548
  const lines = [
549
549
  `📊 *Roundhouse Status*`,
550
550
  ``,
551
+ `🎫 Session: \`${agentThreadId}\``,
551
552
  `📦 Roundhouse: v${ROUNDHOUSE_VERSION}`,
552
553
  `🤖 Agent: ${agentLabel}`,
553
554
  ];
@@ -1187,25 +1188,29 @@ export class Gateway {
1187
1188
  cronInfo = `Cron jobs: ${cs.enabledCount}/${cs.jobCount} enabled`;
1188
1189
  }
1189
1190
 
1190
- const text = [
1191
- `\u2705 Roundhouse is online`,
1192
- ``,
1193
- `Host: ${host}`,
1194
- `Platforms: ${platforms}`,
1195
- `Agent: ${agentName}${agentInfo}`,
1196
- `Roundhouse: v${ROUNDHOUSE_VERSION}`,
1197
- `Node: ${nodeVer}`,
1198
- `Started: ${now}`,
1199
- `Boot time: ${bootTime.toFixed(1)}s`,
1200
- cronInfo,
1201
- ``,
1202
- `System:`,
1203
- ` CPU: ${sys.cpuPct}% (load ${sys.load1.toFixed(2)}, ${sys.cpuCount} cores)`,
1204
- ` RAM: ${sys.usedGB}/${sys.totalGB} GB (${sys.memPct}%)`,
1205
- ` Process: ${memMB} MB RSS`,
1206
- ].filter(line => line != null).join("\n");
1207
-
1208
- await sendTelegramToMany(chatIds, text);
1191
+ for (const chatId of chatIds) {
1192
+ const sessionId = Number(chatId) < 0 ? `group:${chatId}` : "main";
1193
+ const perChatText = [
1194
+ `\u2705 Roundhouse is online`,
1195
+ ``,
1196
+ `Session: ${sessionId}`,
1197
+ `Host: ${host}`,
1198
+ `Platforms: ${platforms}`,
1199
+ `Agent: ${agentName}${agentInfo}`,
1200
+ `Roundhouse: v${ROUNDHOUSE_VERSION}`,
1201
+ `Node: ${nodeVer}`,
1202
+ `Started: ${now}`,
1203
+ `Boot time: ${bootTime.toFixed(1)}s`,
1204
+ cronInfo,
1205
+ ``,
1206
+ `System:`,
1207
+ ` CPU: ${sys.cpuPct}% (load ${sys.load1.toFixed(2)}, ${sys.cpuCount} cores)`,
1208
+ ` RAM: ${sys.usedGB}/${sys.totalGB} GB (${sys.memPct}%)`,
1209
+ ` Process: ${memMB} MB RSS`,
1210
+ ].filter(line => line != null).join("\n");
1211
+
1212
+ await sendTelegramToMany([chatId], perChatText);
1213
+ }
1209
1214
  }
1210
1215
 
1211
1216
  async stop() {
@@ -133,11 +133,12 @@ function formatTable(tableMd: string): string {
133
133
  if (cp >= 0xFE00 && cp <= 0xFE0F) return 0;
134
134
  // Tags block (used in flag sequences etc)
135
135
  if (cp >= 0xE0001 && cp <= 0xE007F) return 0;
136
- // Emoji — Telegram renders these ~3 monospace columns wide in <pre> blocks
137
- if (cp >= 0x1F100 && cp <= 0x1FAFF) return 3;
138
- if (cp >= 0x231A && cp <= 0x23FF) return 3;
139
- if (cp >= 0x2600 && cp <= 0x27BF) return 3;
140
- if (cp >= 0x2B50 && cp <= 0x2B55) return 3;
136
+ // Emoji — standard 2-column width (Telegram renders slightly wider but
137
+ // fractional widths can't be fixed with integer padding; 2 is closest)
138
+ if (cp >= 0x1F100 && cp <= 0x1FAFF) return 2;
139
+ if (cp >= 0x231A && cp <= 0x23FF) return 2;
140
+ if (cp >= 0x2600 && cp <= 0x27BF) return 2;
141
+ if (cp >= 0x2B50 && cp <= 0x2B55) return 2;
141
142
  // CJK Unified Ideographs
142
143
  if (cp >= 0x3400 && cp <= 0x4DBF) return 2;
143
144
  if (cp >= 0x4E00 && cp <= 0x9FFF) return 2;
@@ -155,7 +156,7 @@ function formatTable(tableMd: string): string {
155
156
  const segmenter = new Intl.Segmenter();
156
157
  const graphemeDisplayWidth = (grapheme: string): number => {
157
158
  // ZWJ emoji sequences: multiple code points but render as a single wide emoji
158
- if (grapheme.includes('\u200D')) return 3;
159
+ if (grapheme.includes('\u200D')) return 2;
159
160
  // Single code point: use lookup
160
161
  const cps = Array.from(grapheme);
161
162
  if (cps.length === 1) return codePointWidth(cps[0].codePointAt(0)!);