telegram-claude-mcp 1.2.0 → 1.2.1

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.
@@ -6,7 +6,6 @@
6
6
  # and forwards them to the Telegram MCP server.
7
7
  #
8
8
  # The script auto-discovers the MCP server port from session info files.
9
- # No configuration needed - it finds running MCP servers automatically.
10
9
  #
11
10
 
12
11
  SESSION_DIR="/tmp/telegram-claude-sessions"
@@ -17,13 +16,19 @@ find_active_session() {
17
16
  local latest_file=""
18
17
  local latest_time=0
19
18
 
20
- for info_file in "$SESSION_DIR"/*.info 2>/dev/null; do
21
- [ -f "$info_file" ] || continue
19
+ # Check if directory exists
20
+ [ -d "$SESSION_DIR" ] || return
21
+
22
+ for info_file in "$SESSION_DIR"/*.info; do
23
+ # Skip if no matches (glob didn't expand)
24
+ [ -e "$info_file" ] || continue
22
25
 
23
26
  # Check if the process is still running
24
- local pid=$(jq -r '.pid // empty' "$info_file" 2>/dev/null)
27
+ local pid
28
+ pid=$(jq -r '.pid // empty' "$info_file" 2>/dev/null)
25
29
  if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
26
- local file_time=$(stat -f %m "$info_file" 2>/dev/null || stat -c %Y "$info_file" 2>/dev/null)
30
+ local file_time
31
+ file_time=$(stat -f %m "$info_file" 2>/dev/null || stat -c %Y "$info_file" 2>/dev/null)
27
32
  if [ "$file_time" -gt "$latest_time" ]; then
28
33
  latest_time=$file_time
29
34
  latest_file=$info_file
@@ -6,7 +6,6 @@
6
6
  # to the Telegram MCP server for interactive approval via Telegram.
7
7
  #
8
8
  # The script auto-discovers the MCP server port from session info files.
9
- # No configuration needed - it finds running MCP servers automatically.
10
9
  #
11
10
 
12
11
  SESSION_DIR="/tmp/telegram-claude-sessions"
@@ -16,13 +15,19 @@ find_active_session() {
16
15
  local latest_file=""
17
16
  local latest_time=0
18
17
 
19
- for info_file in "$SESSION_DIR"/*.info 2>/dev/null; do
20
- [ -f "$info_file" ] || continue
18
+ # Check if directory exists
19
+ [ -d "$SESSION_DIR" ] || return
20
+
21
+ for info_file in "$SESSION_DIR"/*.info; do
22
+ # Skip if no matches (glob didn't expand)
23
+ [ -e "$info_file" ] || continue
21
24
 
22
25
  # Check if the process is still running
23
- local pid=$(jq -r '.pid // empty' "$info_file" 2>/dev/null)
26
+ local pid
27
+ pid=$(jq -r '.pid // empty' "$info_file" 2>/dev/null)
24
28
  if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
25
- local file_time=$(stat -f %m "$info_file" 2>/dev/null || stat -c %Y "$info_file" 2>/dev/null)
29
+ local file_time
30
+ file_time=$(stat -f %m "$info_file" 2>/dev/null || stat -c %Y "$info_file" 2>/dev/null)
26
31
  if [ "$file_time" -gt "$latest_time" ]; then
27
32
  latest_time=$file_time
28
33
  latest_file=$info_file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-claude-mcp",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "MCP server that lets Claude message you on Telegram with hooks support",
5
5
  "author": "Geravant",
6
6
  "license": "MIT",