@dmsdc-ai/aigentry-telepty 0.0.10 → 0.0.12

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/cli.js +43 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  `telepty` (Tele-Prompt) is a lightweight background daemon that bridges the gap between the network and interactive AI command-line interfaces. It allows you to seamlessly share, attach to, and inject commands into terminal sessions across different machines.
6
6
 
7
- ## One-Click Installation
7
+ ## One-Click Installation & Update
8
8
 
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.
9
+ To install or update `telepty` on any machine (macOS, Linux, or Windows), just run the command for your OS. (Node.js will be automatically installed if you don't have it).
10
10
 
11
11
  ### For macOS and Linux (Ubuntu, CentOS, etc.)
12
12
  Open your terminal and run:
@@ -15,7 +15,7 @@ curl -fsSL https://raw.githubusercontent.com/dmsdc-ai/aigentry-telepty/main/inst
15
15
  ```
16
16
 
17
17
  ### For Windows (PowerShell)
18
- Open PowerShell and run:
18
+ Open PowerShell as Administrator and run:
19
19
  ```powershell
20
20
  iwr -useb https://raw.githubusercontent.com/dmsdc-ai/aigentry-telepty/main/install.ps1 | iex
21
21
  ```
package/cli.js CHANGED
@@ -89,15 +89,31 @@ async function manageInteractive() {
89
89
  name: 'action',
90
90
  message: 'What would you like to do?',
91
91
  choices: [
92
- { title: '📡 Attach to a session', value: 'attach' },
93
- { title: '🚀 Spawn a new session', value: 'spawn' },
94
- { title: '💉 Inject command into a session', value: 'inject' },
95
- { title: '📋 List active sessions', value: 'list' },
96
- { title: '⚙️ Start background daemon', value: 'daemon' },
92
+ { title: '🖥️ Enter a room (Attach to session)', value: 'attach' },
93
+ { title: ' Create a new room (Spawn session)', value: 'spawn' },
94
+ { title: '💬 Send message to a room (Inject command)', value: 'inject' },
95
+ { title: '📋 View all open rooms (List sessions)', value: 'list' },
96
+ { title: '🔄 Update telepty to latest version', value: 'update' },
97
97
  { title: '❌ Exit', value: 'exit' }
98
98
  ]
99
99
  });
100
100
 
101
+ if (response.action === 'update') {
102
+ console.log('\n\x1b[36m🔄 Updating telepty to the latest version...\x1b[0m');
103
+ try {
104
+ execSync('npm install -g @dmsdc-ai/aigentry-telepty@latest', { stdio: 'inherit' });
105
+ console.log('\n\x1b[32m✅ Update complete! Restarting daemon...\x1b[0m');
106
+ try {
107
+ const os = require('os');
108
+ if (os.platform() === 'win32') execSync('taskkill /IM node.exe /FI "WINDOWTITLE eq telepty daemon*" /F', { stdio: 'ignore' });
109
+ else execSync('pkill -f "telepty daemon"', { stdio: 'ignore' });
110
+ } catch(e) {}
111
+ } catch (e) {
112
+ console.error('\n❌ Update failed.\n');
113
+ }
114
+ process.exit(0);
115
+ }
116
+
101
117
  if (!response.action || response.action === 'exit') {
102
118
  console.log('Goodbye!');
103
119
  process.exit(0);
@@ -227,7 +243,27 @@ async function main() {
227
243
  return manageInteractive();
228
244
  }
229
245
 
230
- if (cmd === 'mcp') {
246
+ if (cmd === 'update') {
247
+ console.log('\x1b[36m🔄 Updating telepty to the latest version...\x1b[0m');
248
+ try {
249
+ execSync('npm install -g @dmsdc-ai/aigentry-telepty@latest', { stdio: 'inherit' });
250
+ console.log('\n\x1b[32m✅ Update complete! Restarting daemon...\x1b[0m');
251
+
252
+ // Kill local daemon if running, so it auto-restarts on next command
253
+ try {
254
+ if (os.platform() === 'win32') {
255
+ execSync('taskkill /IM node.exe /FI "WINDOWTITLE eq telepty daemon*" /F', { stdio: 'ignore' });
256
+ } else {
257
+ execSync('pkill -f "telepty daemon"', { stdio: 'ignore' });
258
+ }
259
+ } catch (e) {} // Ignore if not running
260
+
261
+ console.log('🎉 You are now using the latest version.');
262
+ } catch (e) {
263
+ console.error('\n❌ Update failed. Please try running: npm install -g @dmsdc-ai/aigentry-telepty@latest');
264
+ }
265
+ return;
266
+ }
231
267
  require('./mcp.js');
232
268
  return;
233
269
  }
@@ -425,6 +461,7 @@ Usage:
425
461
  telepty inject <id> "<prompt>" Inject text into a single session
426
462
  telepty multicast <id1,id2> "<prompt>" Inject text into multiple specific sessions
427
463
  telepty broadcast "<prompt>" Inject text into ALL active sessions
464
+ telepty update Update telepty to the latest version
428
465
  telepty mcp Start the MCP stdio server
429
466
  `);
430
467
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "telepty": "cli.js",