remote-cli-agent 0.5.0 → 0.6.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.
Files changed (2) hide show
  1. package/dist/connection.js +15 -5
  2. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import WebSocket from 'ws';
2
- import { getSessionList, writeToSession, resizeSession, attachSession, spawnSession, setOutputHandler, setSessionsChangeHandler } from './terminal.js';
2
+ import { getSessionList, writeToSession, resizeSession, attachSession, spawnSession, createTmuxSession, attachTmuxSession, setOutputHandler, setSessionsChangeHandler } from './terminal.js';
3
3
  let ws = null;
4
4
  let reconnectTimer = null;
5
5
  let reconnectAttempts = 0;
@@ -78,10 +78,20 @@ function handleMessage(msg) {
78
78
  break;
79
79
  }
80
80
  case 'spawn': {
81
- const command = msg.command || undefined;
82
- const session = spawnSession(command);
83
- console.log(`Spawned session: ${session.name} (${session.id})`);
84
- // Notify server of updated sessions
81
+ const name = msg.name || `session-${Date.now()}`;
82
+ // Create a tmux session so it can be shared locally
83
+ const tmuxName = createTmuxSession(name);
84
+ if (tmuxName) {
85
+ const session = attachTmuxSession(tmuxName);
86
+ if (session) {
87
+ console.log(`Created tmux session: ${tmuxName} (${session.id})`);
88
+ }
89
+ }
90
+ else {
91
+ // Fallback to PTY
92
+ const session = spawnSession(msg.command);
93
+ console.log(`Spawned session: ${session.name} (${session.id})`);
94
+ }
85
95
  sendMessage({ type: 'sessions_update', sessions: getSessionList() });
86
96
  break;
87
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remote-cli-agent",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "remote-cli": "./dist/index.js"