opc-agent 4.0.7 → 4.0.8

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.
@@ -169,8 +169,18 @@ class TelegramChannel extends index_1.BaseChannel {
169
169
  chatType: message.chat.type,
170
170
  },
171
171
  };
172
- const response = await this.handler(msg);
173
- await this.sendMessage(message.chat.id, response.content);
172
+ // Show typing indicator while processing
173
+ await this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' });
174
+ const typingInterval = setInterval(() => {
175
+ this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' }).catch(() => { });
176
+ }, 4000);
177
+ try {
178
+ const response = await this.handler(msg);
179
+ await this.sendMessage(message.chat.id, response.content);
180
+ }
181
+ finally {
182
+ clearInterval(typingInterval);
183
+ }
174
184
  }
175
185
  async sendMessage(chatId, text) {
176
186
  // Telegram max message length is 4096
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opc-agent",
3
- "version": "4.0.7",
3
+ "version": "4.0.8",
4
4
  "description": "Open Agent Framework — Build, test, and run AI Agents for business workstations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -170,8 +170,18 @@ export class TelegramChannel extends BaseChannel {
170
170
  },
171
171
  };
172
172
 
173
- const response = await this.handler(msg);
174
- await this.sendMessage(message.chat.id, response.content);
173
+ // Show typing indicator while processing
174
+ await this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' });
175
+ const typingInterval = setInterval(() => {
176
+ this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' }).catch(() => {});
177
+ }, 4000);
178
+
179
+ try {
180
+ const response = await this.handler(msg);
181
+ await this.sendMessage(message.chat.id, response.content);
182
+ } finally {
183
+ clearInterval(typingInterval);
184
+ }
175
185
  }
176
186
 
177
187
  async sendMessage(chatId: number | string, text: string): Promise<void> {