@ebowwa/terminal 0.3.0 → 0.3.2

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 CHANGED
@@ -1,86 +1,22 @@
1
1
  {
2
2
  "name": "@ebowwa/terminal",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Terminal session management with tmux integration, SSH client, WebSocket support, and MCP interface",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- },
13
- "./sessions": {
14
- "types": "./dist/sessions.d.ts",
15
- "default": "./dist/sessions.js"
16
- },
17
- "./tmux": {
18
- "types": "./dist/tmux.d.ts",
19
- "default": "./dist/tmux.js"
20
- },
21
- "./manager": {
22
- "types": "./dist/manager.d.ts",
23
- "default": "./dist/manager.js"
24
- },
25
- "./types": {
26
- "types": "./dist/types.d.ts",
27
- "default": "./dist/types.js"
28
- },
29
- "./api": {
30
- "types": "./dist/api.d.ts",
31
- "default": "./dist/api.js"
32
- },
33
- "./config": {
34
- "types": "./dist/config.d.ts",
35
- "default": "./dist/config.js"
36
- },
37
- "./pool": {
38
- "types": "./dist/pool.d.ts",
39
- "default": "./dist/pool.js"
40
- },
41
- "./exec": {
42
- "types": "./dist/exec.d.ts",
43
- "default": "./dist/exec.js"
44
- },
45
- "./pty": {
46
- "types": "./dist/pty.d.ts",
47
- "default": "./dist/pty.js"
48
- },
49
- "./files": {
50
- "types": "./dist/files.d.ts",
51
- "default": "./dist/files.js"
52
- },
53
- "./scp": {
54
- "types": "./dist/scp.d.ts",
55
- "default": "./dist/scp.js"
56
- },
57
- "./fingerprint": {
58
- "types": "./dist/fingerprint.d.ts",
59
- "default": "./dist/fingerprint.js"
60
- },
61
- "./tmux-exec": {
62
- "types": "./dist/tmux-exec.d.ts",
63
- "default": "./dist/tmux-exec.js"
64
- },
65
- "./client": {
66
- "types": "./dist/client.d.ts",
67
- "default": "./dist/client.js"
68
- },
69
- "./network-error-detector": {
70
- "types": "./dist/network-error-detector.d.ts",
71
- "default": "./dist/network-error-detector.js"
72
- },
73
- "./mcp": {
74
- "types": "./dist/mcp/index.d.ts",
75
- "default": "./dist/mcp/index.js"
76
- }
9
+ ".": "./dist/index.js",
10
+ "./mcp": "./dist/mcp/index.js",
11
+ "./client": "./dist/index.js"
77
12
  },
78
13
  "scripts": {
79
- "build": "bun build src/index.ts --outdir dist --target node && bun build src/mcp/index.ts --outdir dist/mcp --target node",
80
- "mcp": "bun run src/mcp/index.ts",
81
- "mcp-dev": "MCP_PORT=8913 bun run src/mcp/index.ts",
82
- "mcp-stdio": "bun run src/mcp/stdio.ts"
14
+ "build": "bun build src/index.ts --outdir dist --target bun --external '@ebowwa/*' --external 'node-ssh' --external 'hono' --external 'zod' && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external '@ebowwa/*' --external 'node-ssh' --external 'hono' --external 'zod' --external '@modelcontextprotocol/*'",
15
+ "prepublishOnly": "bun run build"
83
16
  },
17
+ "files": [
18
+ "dist"
19
+ ],
84
20
  "keywords": [
85
21
  "terminal",
86
22
  "tmux",
@@ -107,13 +43,15 @@
107
43
  "node": ">=18.0.0"
108
44
  },
109
45
  "dependencies": {
110
- "@ebowwa/codespaces-types": "^1.1.0",
46
+ "@ebowwa/codespaces-types": "^1.4.0",
47
+ "@ebowwa/ssh": "^0.1.0",
111
48
  "node-ssh": "^13.2.1",
112
49
  "hono": "^4.11.3",
113
50
  "zod": "^3.24.1"
114
51
  },
115
52
  "devDependencies": {
116
53
  "@types/bun": "latest",
117
- "@types/node-ssh": "^11.0.0"
54
+ "@types/node-ssh": "^11.0.0",
55
+ "typescript": "^5.9.3"
118
56
  }
119
57
  }
Binary file
Binary file
Binary file
Binary file
package/mcp/README.md DELETED
@@ -1,181 +0,0 @@
1
- # Terminal MCP Server
2
-
3
- Model Context Protocol server for terminal session management, SSH operations, tmux integration, and file operations.
4
-
5
- ## Features
6
-
7
- - **Session Management**: Create, list, manage terminal sessions
8
- - **SSH Operations**: Execute commands, test connections, manage SSH pool
9
- - **Tmux Integration**: List and manage tmux sessions
10
- - **File Operations**: List, upload, download files via SCP
11
- - **PTY Operations**: Create and manage PTY sessions
12
-
13
- ## Installation
14
-
15
- ```bash
16
- bun install
17
- ```
18
-
19
- ## Usage
20
-
21
- ### Start the MCP Server
22
-
23
- ```bash
24
- # Default port 8913
25
- bun run mcp
26
-
27
- # Custom port
28
- MCP_PORT=8914 bun run mcp
29
-
30
- # Dev mode (with port 8913)
31
- bun run mcp-dev
32
- ```
33
-
34
- ### Available Tools
35
-
36
- #### Session Management
37
-
38
- | Tool | Description | Arguments |
39
- |------|-------------|------------|
40
- | `list_sessions` | List all active terminal sessions | none |
41
- | `get_session_info` | Get detailed info about a session | `session_id` |
42
- | `create_session` | Create a new terminal session | `host`, `type?`, `command?` |
43
- | `write_command` | Write a command to a session | `session_id`, `command` |
44
- | `resize_session` | Resize a session terminal | `session_id`, `rows`, `cols` |
45
- | `close_session` | Close a terminal session | `session_id` |
46
-
47
- #### SSH Operations
48
-
49
- | Tool | Description | Arguments |
50
- |------|-------------|------------|
51
- | `exec_ssh` | Execute command via SSH | `host`, `command`, `options?` |
52
- | `test_connection` | Test SSH connection | `host` |
53
-
54
- #### Tmux Operations
55
-
56
- | Tool | Description | Arguments |
57
- |------|-------------|------------|
58
- | `list_tmux_sessions` | List all tmux sessions | none |
59
-
60
- #### File Operations
61
-
62
- | Tool | Description | Arguments |
63
- |------|-------------|------------|
64
- | `list_files` | List files on remote host | `host`, `path?` |
65
- | `upload_file` | Upload file via SCP | `host`, `local_path`, `remote_path` |
66
- | `download_file` | Download file via SCP | `host`, `remote_path`, `local_path` |
67
-
68
- #### Connection Management
69
-
70
- | Tool | Description | Arguments |
71
- |------|-------------|------------|
72
- | `get_active_connections` | Get active SSH connections | none |
73
-
74
- ## API Endpoints
75
-
76
- ### Health Check
77
-
78
- ```bash
79
- curl http://localhost:8913/health
80
- ```
81
-
82
- Response:
83
- ```json
84
- {
85
- "status": "ok",
86
- "port": 8913,
87
- "service": "terminal-mcp"
88
- }
89
- ```
90
-
91
- ### List Available Tools
92
-
93
- ```bash
94
- curl http://localhost:8913/mcp
95
- ```
96
-
97
- ### Execute Tool
98
-
99
- ```bash
100
- curl -X POST http://localhost:8913/mcp \
101
- -H "Content-Type: application/json" \
102
- -d '{
103
- "tool": "list_sessions",
104
- "args": {}
105
- }'
106
- ```
107
-
108
- ## Examples
109
-
110
- ### List All Sessions
111
-
112
- ```bash
113
- curl -X POST http://localhost:8913/mcp \
114
- -H "Content-Type: application/json" \
115
- -d '{"tool": "list_sessions"}'
116
- ```
117
-
118
- ### Create SSH Session
119
-
120
- ```bash
121
- curl -X POST http://localhost:8913/mcp \
122
- -H "Content-Type: application/json" \
123
- -d '{
124
- "tool": "create_session",
125
- "args": {
126
- "host": "user@server.com",
127
- "type": "ssh"
128
- }
129
- }'
130
- ```
131
-
132
- ### Execute SSH Command
133
-
134
- ```bash
135
- curl -X POST http://localhost:8913/mcp \
136
- -H "Content-Type: application/json" \
137
- -d '{
138
- "tool": "exec_ssh",
139
- "args": {
140
- "host": "user@server.com",
141
- "command": "ls -la"
142
- }
143
- }'
144
- ```
145
-
146
- ### List Tmux Sessions
147
-
148
- ```bash
149
- curl -X POST http://localhost:8913/mcp \
150
- -H "Content-Type: application/json" \
151
- -d '{"tool": "list_tmux_sessions"}'
152
- ```
153
-
154
- ### Upload File
155
-
156
- ```bash
157
- curl -X POST http://localhost:8913/mcp \
158
- -H "Content-Type: application/json" \
159
- -d '{
160
- "tool": "upload_file",
161
- "args": {
162
- "host": "user@server.com",
163
- "local_path": "/local/file.txt",
164
- "remote_path": "/remote/file.txt"
165
- }
166
- }'
167
- ```
168
-
169
- ## Integration with Claude
170
-
171
- This MCP server can be integrated with Claude Code or other MCP-compatible clients to provide terminal management capabilities.
172
-
173
- ## Dependencies
174
-
175
- - `node-ssh`: SSH client functionality
176
- - `hono`: HTTP server framework
177
- - `zod`: Schema validation
178
-
179
- ## License
180
-
181
- MIT
package/mcp/package.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "name": "@ebowwa/terminal-mcp",
3
- "version": "1.0.6",
4
- "description": "Terminal session management MCP server with SSH, tmux, and file operations",
5
- "type": "module",
6
- "main": "stdio.js",
7
- "bin": {
8
- "terminal-mcp": "stdio.js"
9
- },
10
- "exports": {
11
- ".": "./stdio.js"
12
- },
13
- "scripts": {
14
- "dev": "bun --hot stdio.ts",
15
- "start": "bun stdio.ts",
16
- "build": "npx esbuild stdio.ts --bundle --external:@ebowwa/terminal --external:@ebowwa/codespaces-types --external:@modelcontextprotocol/sdk --external:zod --platform=node --format=esm --outfile=stdio.js"
17
- },
18
- "keywords": [
19
- "mcp",
20
- "terminal",
21
- "ssh",
22
- "tmux",
23
- "session-management"
24
- ],
25
- "author": "ebowwa",
26
- "license": "MIT",
27
- "dependencies": {
28
- "@ebowwa/codespaces-types": "^1.1.0",
29
- "@ebowwa/terminal": "^0.2.0",
30
- "@modelcontextprotocol/sdk": "^1.0.4",
31
- "zod": "^3.24.1"
32
- },
33
- "devDependencies": {
34
- "@types/bun": "latest",
35
- "esbuild": "^0.27.3"
36
- },
37
- "peerDependencies": {
38
- "bun": ">=1.0.0"
39
- }
40
- }