@sarkar-ai/deskmate 0.2.0

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 ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@sarkar-ai/deskmate",
3
+ "version": "0.2.0",
4
+ "description": "Control your local machine from anywhere using natural language via Telegram or MCP.",
5
+ "author": "Deskmate Contributors",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/sarkar-ai-taken/deskmate#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/sarkar-ai-taken/deskmate/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/sarkar-ai-taken/deskmate.git"
14
+ },
15
+ "keywords": [
16
+ "telegram",
17
+ "bot",
18
+ "ai",
19
+ "agent",
20
+ "remote",
21
+ "macos",
22
+ "linux",
23
+ "cli",
24
+ "assistant",
25
+ "mcp",
26
+ "automation",
27
+ "desktop",
28
+ "control"
29
+ ],
30
+ "main": "dist/index.js",
31
+ "bin": {
32
+ "deskmate": "./dist/cli.js"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE",
38
+ ".env.example",
39
+ "install.sh",
40
+ "uninstall.sh"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ },
48
+ "scripts": {
49
+ "build": "tsc",
50
+ "start": "node dist/index.js telegram",
51
+ "start:telegram": "node dist/index.js telegram",
52
+ "start:mcp": "node dist/index.js mcp",
53
+ "start:gateway": "node dist/index.js gateway",
54
+ "start:both": "node dist/index.js both",
55
+ "dev": "tsx src/index.ts telegram",
56
+ "dev:mcp": "tsx src/index.ts mcp",
57
+ "test": "vitest run",
58
+ "prepublishOnly": "npm run build"
59
+ },
60
+ "dependencies": {
61
+ "@anthropic-ai/claude-agent-sdk": "^0.2.6",
62
+ "@modelcontextprotocol/sdk": "^1.0.0",
63
+ "dotenv": "^16.3.1",
64
+ "grammy": "^1.21.1",
65
+ "zod": "^3.22.4"
66
+ },
67
+ "devDependencies": {
68
+ "@types/node": "^20.10.0",
69
+ "tsx": "^4.7.0",
70
+ "typescript": "^5.3.0",
71
+ "vitest": "^4.0.18"
72
+ }
73
+ }
package/uninstall.sh ADDED
@@ -0,0 +1,121 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ # Colors for output
6
+ RED='\033[0;31m'
7
+ GREEN='\033[0;32m'
8
+ YELLOW='\033[1;33m'
9
+ BLUE='\033[0;34m'
10
+ NC='\033[0m' # No Color
11
+
12
+ # =============================================================================
13
+ # OS Detection
14
+ # =============================================================================
15
+ OS_TYPE="$(uname -s)"
16
+ case "$OS_TYPE" in
17
+ Darwin) PLATFORM="macos" ;;
18
+ Linux) PLATFORM="linux" ;;
19
+ *) PLATFORM="unknown" ;;
20
+ esac
21
+
22
+ # Platform-specific paths
23
+ if [ "$PLATFORM" = "macos" ]; then
24
+ PLIST_NAME="com.deskmate.service"
25
+ PLIST_PATH="$HOME/Library/LaunchAgents/$PLIST_NAME.plist"
26
+ CLAUDE_DESKTOP_CONFIG="$HOME/Library/Application Support/Claude/claude_desktop_config.json"
27
+ elif [ "$PLATFORM" = "linux" ]; then
28
+ SYSTEMD_SERVICE="deskmate.service"
29
+ SYSTEMD_PATH="$HOME/.config/systemd/user/$SYSTEMD_SERVICE"
30
+ CLAUDE_DESKTOP_CONFIG="$HOME/.config/Claude/claude_desktop_config.json"
31
+ fi
32
+
33
+ echo -e "${BLUE}"
34
+ echo "╔════════════════════════════════════════╗"
35
+ echo "║ Deskmate Uninstaller ║"
36
+ echo "╚════════════════════════════════════════╝"
37
+ echo -e "${NC}"
38
+ echo -e "Detected platform: ${GREEN}$PLATFORM${NC}"
39
+
40
+ # =============================================================================
41
+ # Stop and remove the service (platform-specific)
42
+ # =============================================================================
43
+ if [ "$PLATFORM" = "macos" ]; then
44
+ if launchctl list 2>/dev/null | grep -q "$PLIST_NAME"; then
45
+ echo -e "${YELLOW}Stopping service...${NC}"
46
+ launchctl unload "$PLIST_PATH" 2>/dev/null || true
47
+ echo -e "${GREEN}✓ Service stopped${NC}"
48
+ else
49
+ echo -e "${YELLOW}Service not running${NC}"
50
+ fi
51
+
52
+ # Remove plist file
53
+ if [ -f "$PLIST_PATH" ]; then
54
+ rm "$PLIST_PATH"
55
+ echo -e "${GREEN}✓ Service configuration removed${NC}"
56
+ fi
57
+
58
+ elif [ "$PLATFORM" = "linux" ]; then
59
+ if systemctl --user is-active "$SYSTEMD_SERVICE" &>/dev/null; then
60
+ echo -e "${YELLOW}Stopping service...${NC}"
61
+ systemctl --user stop "$SYSTEMD_SERVICE" 2>/dev/null || true
62
+ echo -e "${GREEN}✓ Service stopped${NC}"
63
+ else
64
+ echo -e "${YELLOW}Service not running${NC}"
65
+ fi
66
+
67
+ if systemctl --user is-enabled "$SYSTEMD_SERVICE" &>/dev/null; then
68
+ systemctl --user disable "$SYSTEMD_SERVICE" 2>/dev/null || true
69
+ echo -e "${GREEN}✓ Service disabled${NC}"
70
+ fi
71
+
72
+ # Remove systemd unit file
73
+ if [ -f "$SYSTEMD_PATH" ]; then
74
+ rm "$SYSTEMD_PATH"
75
+ systemctl --user daemon-reload 2>/dev/null || true
76
+ echo -e "${GREEN}✓ Service configuration removed${NC}"
77
+ fi
78
+ fi
79
+
80
+ # =============================================================================
81
+ # Ask about Claude Desktop config
82
+ # =============================================================================
83
+ if [ -f "$CLAUDE_DESKTOP_CONFIG" ] && grep -q '"deskmate"' "$CLAUDE_DESKTOP_CONFIG"; then
84
+ echo ""
85
+ read -p "Remove deskmate from Claude Desktop config? [y/N]: " REMOVE_MCP
86
+ if [ "$REMOVE_MCP" = "y" ] || [ "$REMOVE_MCP" = "Y" ]; then
87
+ # Backup and remove using Python
88
+ cp "$CLAUDE_DESKTOP_CONFIG" "$CLAUDE_DESKTOP_CONFIG.backup"
89
+ python3 << 'PYTHON_EOF'
90
+ import json, os
91
+
92
+ config_path = os.path.expanduser("~/.config/Claude/claude_desktop_config.json") if os.uname().sysname == "Linux" else os.path.expanduser("~/Library/Application Support/Claude/claude_desktop_config.json")
93
+ with open(config_path, 'r') as f:
94
+ config = json.load(f)
95
+
96
+ if 'mcpServers' in config and 'deskmate' in config['mcpServers']:
97
+ del config['mcpServers']['deskmate']
98
+ with open(config_path, 'w') as f:
99
+ json.dump(config, f, indent=2)
100
+ print("Removed deskmate from config")
101
+ PYTHON_EOF
102
+ echo -e "${GREEN}✓ Removed from Claude Desktop config${NC}"
103
+ echo -e "${YELLOW}Note: Restart Claude Desktop for changes to take effect${NC}"
104
+ fi
105
+ fi
106
+
107
+ # =============================================================================
108
+ # Ask about sleep settings (macOS only)
109
+ # =============================================================================
110
+ if [ "$PLATFORM" = "macos" ]; then
111
+ echo ""
112
+ read -p "Restore default sleep settings? [y/N]: " RESTORE_SLEEP
113
+ if [ "$RESTORE_SLEEP" = "y" ] || [ "$RESTORE_SLEEP" = "Y" ]; then
114
+ echo -e "${YELLOW}Restoring default sleep settings...${NC}"
115
+ sudo pmset -c sleep 1
116
+ echo -e "${GREEN}✓ Sleep settings restored${NC}"
117
+ fi
118
+ fi
119
+
120
+ echo ""
121
+ echo -e "${GREEN}Uninstall complete!${NC}"