@dmsdc-ai/aigentry-telepty 0.0.6 ā 0.0.7
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/README.md +12 -5
- package/daemon.js +1 -1
- package/install.ps1 +33 -0
- package/install.sh +118 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,14 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
## One-Click Installation
|
|
8
8
|
|
|
9
|
-
To install and set up `telepty` on any machine (macOS, Linux, or Windows)
|
|
9
|
+
To install and set up `telepty` on any machine (macOS, Linux, or Windows). These scripts will automatically install Node.js if it is missing from your system.
|
|
10
10
|
|
|
11
|
-
###
|
|
12
|
-
Open your terminal
|
|
11
|
+
### For macOS and Linux (Ubuntu, CentOS, etc.)
|
|
12
|
+
Open your terminal and run:
|
|
13
13
|
```bash
|
|
14
|
-
|
|
14
|
+
curl -fsSL https://raw.githubusercontent.com/dmsdc-ai/aigentry-telepty/main/install.sh | bash
|
|
15
15
|
```
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
### For Windows (PowerShell)
|
|
18
|
+
Open PowerShell and run:
|
|
19
|
+
```powershell
|
|
20
|
+
iwr -useb https://raw.githubusercontent.com/dmsdc-ai/aigentry-telepty/main/install.ps1 | iex
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
*These single commands will install the package globally and automatically configure it to run as a background service specific to your OS (`systemd` for Linux, `launchd` for macOS, or a detached background process for Windows).*
|
|
17
24
|
|
|
18
25
|
## Seamless Usage
|
|
19
26
|
|
package/daemon.js
CHANGED
|
@@ -53,7 +53,7 @@ app.post('/api/sessions/spawn', (req, res) => {
|
|
|
53
53
|
cols: parseInt(cols),
|
|
54
54
|
rows: parseInt(rows),
|
|
55
55
|
cwd,
|
|
56
|
-
env: { ...process.env, TERM: isWin ? undefined : 'xterm-256color' }
|
|
56
|
+
env: { ...process.env, TERM: isWin ? undefined : 'xterm-256color', TELEPTY_SESSION_ID: session_id }
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
sessions[session_id] = {
|
package/install.ps1
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Write-Host "š Installing @dmsdc-ai/aigentry-telepty..." -ForegroundColor Cyan
|
|
2
|
+
|
|
3
|
+
# 1. Check for Node.js/npm and install if missing
|
|
4
|
+
if (!(Get-Command npm -ErrorAction SilentlyContinue)) {
|
|
5
|
+
Write-Host "ā ļø Node.js/npm not found. Attempting to install via winget..." -ForegroundColor Yellow
|
|
6
|
+
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
|
7
|
+
winget install OpenJS.NodeJS --accept-package-agreements --accept-source-agreements
|
|
8
|
+
Write-Host "š Refreshing environment variables..." -ForegroundColor Cyan
|
|
9
|
+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
|
10
|
+
} else {
|
|
11
|
+
Write-Host "ā winget not found. Please install Node.js manually: https://nodejs.org/" -ForegroundColor Red
|
|
12
|
+
exit 1
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
# 2. Install telepty via npm
|
|
17
|
+
Write-Host "š¦ Installing telepty globally..." -ForegroundColor Cyan
|
|
18
|
+
npm install -g @dmsdc-ai/aigentry-telepty
|
|
19
|
+
|
|
20
|
+
# 3. Setup Daemon
|
|
21
|
+
Write-Host "āļø Setting up Windows background process..." -ForegroundColor Cyan
|
|
22
|
+
$teleptyCmd = Get-Command telepty -ErrorAction SilentlyContinue
|
|
23
|
+
if (!$teleptyCmd) {
|
|
24
|
+
Write-Host "ā Failed to locate telepty executable after installation." -ForegroundColor Red
|
|
25
|
+
exit 1
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
$teleptyPath = $teleptyCmd.Source
|
|
29
|
+
Start-Process -NoNewWindow -FilePath node -ArgumentList "$teleptyPath daemon" -WindowStyle Hidden
|
|
30
|
+
Write-Host "ā
Windows daemon started in background." -ForegroundColor Green
|
|
31
|
+
|
|
32
|
+
Write-Host "`nš Installation complete! Telepty daemon is running." -ForegroundColor Cyan
|
|
33
|
+
Write-Host "š Try running: telepty attach" -ForegroundColor Yellow
|
package/install.sh
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
echo "š Installing @dmsdc-ai/aigentry-telepty..."
|
|
5
|
+
|
|
6
|
+
# 1. Check for Node.js and install if missing
|
|
7
|
+
if ! command -v npm &> /dev/null; then
|
|
8
|
+
echo "ā ļø Node.js/npm not found. Attempting to install Node.js..."
|
|
9
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
10
|
+
if ! command -v brew &> /dev/null; then
|
|
11
|
+
echo "ā Homebrew not found. Please install Node.js manually: https://nodejs.org/"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
brew install node
|
|
15
|
+
elif command -v apt-get &> /dev/null; then
|
|
16
|
+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|
17
|
+
sudo apt-get install -y nodejs
|
|
18
|
+
elif command -v yum &> /dev/null; then
|
|
19
|
+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
|
|
20
|
+
sudo yum install -y nodejs
|
|
21
|
+
elif command -v dnf &> /dev/null; then
|
|
22
|
+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
|
|
23
|
+
sudo dnf install -y nodejs
|
|
24
|
+
elif command -v pacman &> /dev/null; then
|
|
25
|
+
sudo pacman -Sy nodejs npm --noconfirm
|
|
26
|
+
elif command -v pkg &> /dev/null; then
|
|
27
|
+
# Termux environment
|
|
28
|
+
pkg install -y nodejs
|
|
29
|
+
else
|
|
30
|
+
echo "ā Could not determine package manager. Please install Node.js manually: https://nodejs.org/"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# 2. Install telepty via npm
|
|
36
|
+
echo "š¦ Installing telepty globally..."
|
|
37
|
+
if [[ "$OSTYPE" == "darwin"* ]] || command -v pkg &> /dev/null || [ "$EUID" -eq 0 ]; then
|
|
38
|
+
npm install -g @dmsdc-ai/aigentry-telepty
|
|
39
|
+
else
|
|
40
|
+
# Linux non-root might need sudo for global install depending on npm setup
|
|
41
|
+
sudo npm install -g @dmsdc-ai/aigentry-telepty || npm install -g @dmsdc-ai/aigentry-telepty
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
TELEPTY_PATH=$(which telepty || true)
|
|
45
|
+
if [ -z "$TELEPTY_PATH" ]; then
|
|
46
|
+
TELEPTY_PATH="$(npm prefix -g)/bin/telepty"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# 3. Setup Daemon
|
|
50
|
+
echo "āļø Setting up daemon..."
|
|
51
|
+
if command -v systemctl &> /dev/null && [ -d "/etc/systemd/system" ]; then
|
|
52
|
+
if [ "$EUID" -ne 0 ]; then
|
|
53
|
+
echo "ā ļø systemd requires root to install service. Prompting for sudo..."
|
|
54
|
+
SUDO_CMD="sudo"
|
|
55
|
+
else
|
|
56
|
+
SUDO_CMD=""
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
$SUDO_CMD bash -c "cat <<EOF > /etc/systemd/system/telepty.service
|
|
60
|
+
[Unit]
|
|
61
|
+
Description=Telepty Daemon
|
|
62
|
+
After=network.target
|
|
63
|
+
|
|
64
|
+
[Service]
|
|
65
|
+
ExecStart=$TELEPTY_PATH daemon
|
|
66
|
+
Restart=always
|
|
67
|
+
User=${SUDO_USER:-$USER}
|
|
68
|
+
Environment=PATH=/usr/bin:/usr/local/bin:\$PATH
|
|
69
|
+
Environment=NODE_ENV=production
|
|
70
|
+
|
|
71
|
+
[Install]
|
|
72
|
+
WantedBy=multi-user.target
|
|
73
|
+
EOF"
|
|
74
|
+
|
|
75
|
+
$SUDO_CMD systemctl daemon-reload
|
|
76
|
+
$SUDO_CMD systemctl enable telepty
|
|
77
|
+
$SUDO_CMD systemctl start telepty
|
|
78
|
+
echo "ā
Linux systemd service installed and started. (Auto-starts on boot)"
|
|
79
|
+
|
|
80
|
+
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
81
|
+
PLIST_PATH="$HOME/Library/LaunchAgents/com.aigentry.telepty.plist"
|
|
82
|
+
mkdir -p "$HOME/Library/LaunchAgents"
|
|
83
|
+
cat <<EOF > "$PLIST_PATH"
|
|
84
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
85
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
86
|
+
<plist version="1.0">
|
|
87
|
+
<dict>
|
|
88
|
+
<key>Label</key>
|
|
89
|
+
<string>com.aigentry.telepty</string>
|
|
90
|
+
<key>ProgramArguments</key>
|
|
91
|
+
<array>
|
|
92
|
+
<string>$TELEPTY_PATH</string>
|
|
93
|
+
<string>daemon</string>
|
|
94
|
+
</array>
|
|
95
|
+
<key>RunAtLoad</key>
|
|
96
|
+
<true/>
|
|
97
|
+
<key>KeepAlive</key>
|
|
98
|
+
<true/>
|
|
99
|
+
<key>EnvironmentVariables</key>
|
|
100
|
+
<dict>
|
|
101
|
+
<key>PATH</key>
|
|
102
|
+
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
|
103
|
+
</dict>
|
|
104
|
+
</dict>
|
|
105
|
+
</plist>
|
|
106
|
+
EOF
|
|
107
|
+
launchctl unload "$PLIST_PATH" 2>/dev/null || true
|
|
108
|
+
launchctl load "$PLIST_PATH"
|
|
109
|
+
echo "ā
macOS LaunchAgent installed and started. (Auto-starts on boot)"
|
|
110
|
+
else
|
|
111
|
+
echo "ā ļø Skipping OS-level service setup (Termux or missing systemd). Starting in background..."
|
|
112
|
+
nohup $TELEPTY_PATH daemon > /dev/null 2>&1 &
|
|
113
|
+
echo "ā
Daemon started in background. (Note: Will not auto-start on device reboot)"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo ""
|
|
117
|
+
echo "š Installation complete! Telepty daemon is running in the background."
|
|
118
|
+
echo "š Try running: telepty attach"
|