@wong2kim/wmux 1.0.0 → 1.0.5

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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +209 -157
  3. package/dist/cli/cli/client.js +1 -1
  4. package/dist/cli/cli/commands/browser.js +19 -19
  5. package/dist/cli/cli/index.js +58 -58
  6. package/dist/cli/shared/constants.js +17 -4
  7. package/dist/mcp/shared/constants.js +17 -4
  8. package/package.json +96 -84
  9. package/assets/icon.ico +0 -0
  10. package/assets/icon.svg +0 -6
  11. package/forge.config.ts +0 -61
  12. package/index.html +0 -12
  13. package/postcss.config.js +0 -6
  14. package/src/cli/client.ts +0 -76
  15. package/src/cli/commands/browser.ts +0 -128
  16. package/src/cli/commands/input.ts +0 -72
  17. package/src/cli/commands/notify.ts +0 -29
  18. package/src/cli/commands/pane.ts +0 -90
  19. package/src/cli/commands/surface.ts +0 -102
  20. package/src/cli/commands/system.ts +0 -95
  21. package/src/cli/commands/workspace.ts +0 -116
  22. package/src/cli/index.ts +0 -145
  23. package/src/cli/utils.ts +0 -44
  24. package/src/main/index.ts +0 -86
  25. package/src/main/ipc/handlers/clipboard.handler.ts +0 -20
  26. package/src/main/ipc/handlers/metadata.handler.ts +0 -56
  27. package/src/main/ipc/handlers/pty.handler.ts +0 -69
  28. package/src/main/ipc/handlers/session.handler.ts +0 -17
  29. package/src/main/ipc/handlers/shell.handler.ts +0 -11
  30. package/src/main/ipc/registerHandlers.ts +0 -31
  31. package/src/main/mcp/McpRegistrar.ts +0 -156
  32. package/src/main/metadata/MetadataCollector.ts +0 -58
  33. package/src/main/notification/ToastManager.ts +0 -32
  34. package/src/main/pipe/PipeServer.ts +0 -190
  35. package/src/main/pipe/RpcRouter.ts +0 -46
  36. package/src/main/pipe/handlers/_bridge.ts +0 -40
  37. package/src/main/pipe/handlers/browser.rpc.ts +0 -132
  38. package/src/main/pipe/handlers/input.rpc.ts +0 -120
  39. package/src/main/pipe/handlers/meta.rpc.ts +0 -59
  40. package/src/main/pipe/handlers/notify.rpc.ts +0 -53
  41. package/src/main/pipe/handlers/pane.rpc.ts +0 -39
  42. package/src/main/pipe/handlers/surface.rpc.ts +0 -43
  43. package/src/main/pipe/handlers/system.rpc.ts +0 -36
  44. package/src/main/pipe/handlers/workspace.rpc.ts +0 -52
  45. package/src/main/pty/AgentDetector.ts +0 -247
  46. package/src/main/pty/OscParser.ts +0 -81
  47. package/src/main/pty/PTYBridge.ts +0 -88
  48. package/src/main/pty/PTYManager.ts +0 -104
  49. package/src/main/pty/ShellDetector.ts +0 -63
  50. package/src/main/session/SessionManager.ts +0 -53
  51. package/src/main/updater/AutoUpdater.ts +0 -132
  52. package/src/main/window/createWindow.ts +0 -71
  53. package/src/mcp/README.md +0 -56
  54. package/src/mcp/index.ts +0 -153
  55. package/src/mcp/wmux-client.ts +0 -127
  56. package/src/preload/index.ts +0 -111
  57. package/src/preload/preload.ts +0 -108
  58. package/src/renderer/App.tsx +0 -5
  59. package/src/renderer/components/Browser/BrowserPanel.tsx +0 -219
  60. package/src/renderer/components/Browser/BrowserToolbar.tsx +0 -253
  61. package/src/renderer/components/Company/ApprovalDialog.tsx +0 -3
  62. package/src/renderer/components/Company/CompanyView.tsx +0 -7
  63. package/src/renderer/components/Company/MessageFeedPanel.tsx +0 -3
  64. package/src/renderer/components/Layout/AppLayout.tsx +0 -234
  65. package/src/renderer/components/Notification/NotificationPanel.tsx +0 -129
  66. package/src/renderer/components/Palette/CommandPalette.tsx +0 -409
  67. package/src/renderer/components/Palette/PaletteItem.tsx +0 -55
  68. package/src/renderer/components/Pane/Pane.tsx +0 -122
  69. package/src/renderer/components/Pane/PaneContainer.tsx +0 -41
  70. package/src/renderer/components/Pane/SurfaceTabs.tsx +0 -46
  71. package/src/renderer/components/Settings/SettingsPanel.tsx +0 -886
  72. package/src/renderer/components/Sidebar/MiniSidebar.tsx +0 -67
  73. package/src/renderer/components/Sidebar/Sidebar.tsx +0 -84
  74. package/src/renderer/components/Sidebar/WorkspaceItem.tsx +0 -241
  75. package/src/renderer/components/StatusBar/StatusBar.tsx +0 -93
  76. package/src/renderer/components/Terminal/SearchBar.tsx +0 -126
  77. package/src/renderer/components/Terminal/Terminal.tsx +0 -102
  78. package/src/renderer/components/Terminal/ViCopyMode.tsx +0 -104
  79. package/src/renderer/hooks/useKeyboard.ts +0 -310
  80. package/src/renderer/hooks/useNotificationListener.ts +0 -80
  81. package/src/renderer/hooks/useNotificationSound.ts +0 -75
  82. package/src/renderer/hooks/useRpcBridge.ts +0 -451
  83. package/src/renderer/hooks/useT.ts +0 -11
  84. package/src/renderer/hooks/useTerminal.ts +0 -349
  85. package/src/renderer/hooks/useViCopyMode.ts +0 -320
  86. package/src/renderer/i18n/index.ts +0 -69
  87. package/src/renderer/i18n/locales/en.ts +0 -157
  88. package/src/renderer/i18n/locales/ja.ts +0 -155
  89. package/src/renderer/i18n/locales/ko.ts +0 -155
  90. package/src/renderer/i18n/locales/zh.ts +0 -155
  91. package/src/renderer/index.tsx +0 -6
  92. package/src/renderer/stores/index.ts +0 -19
  93. package/src/renderer/stores/slices/notificationSlice.ts +0 -56
  94. package/src/renderer/stores/slices/paneSlice.ts +0 -141
  95. package/src/renderer/stores/slices/surfaceSlice.ts +0 -122
  96. package/src/renderer/stores/slices/uiSlice.ts +0 -247
  97. package/src/renderer/stores/slices/workspaceSlice.ts +0 -120
  98. package/src/renderer/styles/globals.css +0 -150
  99. package/src/renderer/themes.ts +0 -99
  100. package/src/shared/constants.ts +0 -53
  101. package/src/shared/electron.d.ts +0 -11
  102. package/src/shared/rpc.ts +0 -71
  103. package/src/shared/types.ts +0 -176
  104. package/tailwind.config.js +0 -11
  105. package/tsconfig.cli.json +0 -24
  106. package/tsconfig.json +0 -21
  107. package/tsconfig.mcp.json +0 -25
  108. package/vite.main.config.ts +0 -14
  109. package/vite.preload.config.ts +0 -9
  110. package/vite.renderer.config.ts +0 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 openwong2kim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,157 +1,209 @@
1
- # wmux
2
-
3
- > Terminal multiplexer for Windows with built-in browser, notifications, and AI agent status detection.
4
-
5
- Windows-native terminal multiplexer with workspaces, panes, tabs, integrated browser, notification system, CLI/API access, and session management.
6
-
7
- ## Quick Install
8
-
9
- **PowerShell (recommended):**
10
- ```powershell
11
- irm https://raw.githubusercontent.com/openwong2kim/wmux/main/install.ps1 | iex
12
- ```
13
-
14
- **Git Bash / WSL:**
15
- ```bash
16
- curl -fsSL https://raw.githubusercontent.com/openwong2kim/wmux/main/install.sh | bash
17
- ```
18
-
19
- **Manual:**
20
- ```bash
21
- git clone https://github.com/openwong2kim/wmux.git
22
- cd wmux
23
- npm install
24
- npm start
25
- ```
26
-
27
- ## Requirements
28
-
29
- - Windows 10/11
30
- - Node.js 18+
31
- - Git
32
-
33
- ## Features
34
-
35
- - **Terminal**: xterm.js + WebGL GPU rendering, ConPTY, PowerShell native
36
- - **Workspaces**: Vertical sidebar, drag-and-drop, Ctrl+1~9 switching
37
- - **Split Panes**: Ctrl+D / Ctrl+Shift+D, directional focus
38
- - **In-App Browser**: Ctrl+Shift+L, scriptable API
39
- - **Notifications**: OSC 9/99/777, rings, toast, Ctrl+I panel
40
- - **AI Agent Status**: Detects Claude Code, Cursor, Aider, Codex, Gemini, Copilot, OpenCode
41
- - **Command Palette**: Ctrl+K fuzzy search
42
- - **Terminal Search**: Ctrl+F
43
- - **Vi Copy Mode**: Ctrl+Shift+X
44
- - **CLI + API**: Named Pipe JSON-RPC, `wmux` CLI
45
- - **MCP Server**: Claude Code can control browser and terminal via MCP tools
46
- - **Multi-Agent**: Each agent targets its own browser surface via `surfaceId`
47
- - **Session Management**: Save and restore sessions
48
- - **i18n**: English, Korean, Japanese, Chinese
49
-
50
- ## Usage
51
-
52
- ```bash
53
- npm start # Run in dev mode
54
- npm run package # Build executable
55
- npm run make # Create installer
56
- wmux --help # CLI commands
57
- ```
58
-
59
- ## CLI Examples
60
-
61
- ```bash
62
- # Workspace management
63
- wmux workspace create "MyWorkspace"
64
- wmux workspace list
65
- wmux workspace switch "MyWorkspace"
66
-
67
- # Pane operations
68
- wmux pane split-right
69
- wmux pane split-down
70
- wmux pane send-text "echo hello"
71
-
72
- # Surface (browser)
73
- wmux surface open "https://example.com"
74
- wmux surface eval "window.location"
75
- ```
76
-
77
- ## Keyboard Shortcuts
78
-
79
- | Key | Action |
80
- |-----|--------|
81
- | Ctrl+B | Toggle sidebar |
82
- | Ctrl+N | New workspace |
83
- | Ctrl+D | Split right |
84
- | Ctrl+Shift+D | Split down |
85
- | Ctrl+T | New tab |
86
- | Ctrl+W | Close tab |
87
- | Ctrl+F | Search terminal |
88
- | Ctrl+K | Command palette |
89
- | Ctrl+I | Notifications |
90
- | Ctrl+, | Settings |
91
- | Ctrl+Shift+L | Open browser |
92
- | Ctrl+Shift+H | Flash pane |
93
- | Ctrl+1~9 | Switch workspace |
94
-
95
- ## Tech Stack
96
-
97
- Electron 41 + React 19 + TypeScript 5.9 + Tailwind 3 + Zustand 5 + xterm.js 6 + node-pty
98
-
99
- ## MCP Server (Claude Code Integration)
100
-
101
- wmux includes an MCP server that lets Claude Code directly control the browser and terminal.
102
-
103
- ### Setup
104
-
105
- ```bash
106
- npm run build:mcp
107
- ```
108
-
109
- Add to your project's `.mcp.json`:
110
- ```json
111
- {
112
- "mcpServers": {
113
- "wmux": {
114
- "command": "node",
115
- "args": ["<path-to-wmux>/dist/mcp/mcp/index.js"]
116
- }
117
- }
118
- }
119
- ```
120
-
121
- `WMUX_SOCKET_PATH` and `WMUX_AUTH_TOKEN` are automatically set in wmux terminal sessions — no extra env config needed when running Claude Code inside wmux.
122
-
123
- ### Available MCP Tools
124
-
125
- | Tool | Description |
126
- |------|-------------|
127
- | `browser_navigate` | Navigate browser to URL |
128
- | `browser_snapshot` | Get page HTML |
129
- | `browser_click` | Click element by CSS selector |
130
- | `browser_fill` | Fill input by CSS selector |
131
- | `browser_eval` | Execute JS in browser |
132
- | `terminal_read` | Read terminal screen |
133
- | `terminal_send` | Send text to terminal |
134
- | `terminal_send_key` | Send key (enter, ctrl+c, etc.) |
135
- | `workspace_list` | List workspaces |
136
- | `surface_list` | List surfaces (terminals + browsers) |
137
- | `pane_list` | List panes |
138
-
139
- ### Multi-Agent Usage
140
-
141
- All browser tools accept an optional `surfaceId` parameter for multi-agent scenarios:
142
-
143
- ```
144
- 1. Call surface_list find your browser surface ID
145
- 2. Call browser_navigate with surfaceId="<your-browser-id>"
146
- 3. Call browser_snapshot with surfaceId="<your-browser-id>"
147
- ```
148
-
149
- Each agent can independently control its own browser surface. When `surfaceId` is omitted, the currently active browser surface is used.
150
-
151
- ## Note on AI Agents
152
-
153
- WinMux detects AI coding agents for status display purposes only. It does not call any AI APIs, capture agent outputs, or automate agent interactions. Users are responsible for complying with their AI provider's Terms of Service.
154
-
155
- ## License
156
-
157
- MIT
1
+ # wmux
2
+
3
+ **AI Agent Terminal for Windows**
4
+
5
+ Run Claude Code, Codex, Gemini CLI side by side — with built-in browser, smart notifications, and MCP integration.
6
+
7
+ Inspired by [cmux](https://github.com/manaflow-ai/cmux) (macOS), wmux brings the same philosophy to Windows: **a primitive, not a solution.** Composable building blocks for multi-agent workflows.
8
+
9
+ ![Windows](https://img.shields.io/badge/Windows-10%2F11-0078D6?logo=windows)
10
+ ![Electron](https://img.shields.io/badge/Electron-41-47848F?logo=electron)
11
+ ![License](https://img.shields.io/badge/License-MIT-green)
12
+
13
+ ---
14
+
15
+ ## Install
16
+
17
+ **Download:** [wmux-1.0.0 Setup.exe](https://github.com/openwong2kim/wmux/releases/latest)
18
+
19
+ Or build from source:
20
+ ```powershell
21
+ irm https://raw.githubusercontent.com/openwong2kim/wmux/main/install.ps1 | iex
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Why wmux?
27
+
28
+ | Problem | wmux |
29
+ |---------|------|
30
+ | Windows has no cmux | Native Windows terminal multiplexer for AI agents |
31
+ | Agents can't see the browser | Built-in browser with MCP — Claude clicks, fills, evaluates JS |
32
+ | "Is it done yet?" | Smart activity-based notifications + taskbar flash |
33
+ | Can't compare agents | Multiview — Ctrl+click workspaces to view side by side |
34
+ | Hard to describe UI elements to LLM | Inspector — click any element, LLM-friendly context copied |
35
+
36
+ ---
37
+
38
+ ## Features
39
+
40
+ ### Terminal
41
+ - **xterm.js + WebGL** GPU-accelerated rendering
42
+ - **ConPTY** native Windows pseudo-terminal
43
+ - **Split panes** `Ctrl+D` horizontal, `Ctrl+Shift+D` vertical
44
+ - **Tabs** multiple surfaces per pane
45
+ - **Vi copy mode** `Ctrl+Shift+X`
46
+ - **Search** `Ctrl+F`
47
+ - **Unlimited scrollback** 999,999 lines default
48
+
49
+ ### Workspaces
50
+ - Sidebar with drag-and-drop reordering
51
+ - `Ctrl+1` ~ `Ctrl+9` quick switch
52
+ - **Multiview** — `Ctrl+click` workspaces to split-view them simultaneously
53
+ - `Ctrl+Shift+G` to exit multiview
54
+ - Session persistence everything restored on restart
55
+
56
+ ### Browser
57
+ - Built-in browser panel — `Ctrl+Shift+L`
58
+ - Navigation bar, DevTools, back/forward
59
+ - **Element Inspector** — magnifying glass button to inspect elements
60
+ - Hover to highlight, click to copy LLM-friendly context:
61
+ ```
62
+ [Inspector] Google (https://www.google.com/)
63
+ selector: input.gLFyf
64
+ <input type="text" name="q" aria-label="Search">
65
+ text: ""
66
+ parent: div.RNNXgb > siblings: button"Google Search", button"I'm Feeling Lucky"
67
+ ```
68
+ - Paste directly into Claude — it understands the element immediately
69
+
70
+ ### Notifications
71
+ - **Activity-based detection** — monitors output throughput, no fragile pattern matching
72
+ - **Taskbar flash** — orange flash when notifications arrive while unfocused
73
+ - **Windows toast** — native OS notification with click-to-focus
74
+ - **Process exit alerts** — notifies on non-zero exit codes
75
+ - **Notification panel** — `Ctrl+I`, read/unread tracking, per-workspace filtering
76
+ - **Sound** — Web Audio synthesized tones per notification type
77
+
78
+ ### MCP Server (Claude Code Integration)
79
+ wmux automatically registers its MCP server when launched. Claude Code can:
80
+
81
+ | Tool | What it does |
82
+ |------|-------------|
83
+ | `browser_open` | Open a new browser panel |
84
+ | `browser_navigate` | Go to URL |
85
+ | `browser_snapshot` | Get full page HTML |
86
+ | `browser_click` | Click element by CSS selector |
87
+ | `browser_fill` | Fill input field |
88
+ | `browser_eval` | Execute JavaScript |
89
+ | `terminal_read` | Read terminal screen |
90
+ | `terminal_send` | Send text to terminal |
91
+ | `terminal_send_key` | Send key (enter, ctrl+c, etc.) |
92
+ | `workspace_list` | List all workspaces |
93
+ | `surface_list` | List surfaces |
94
+ | `pane_list` | List panes |
95
+
96
+ **Multi-agent:** All browser tools accept `surfaceId` — each Claude Code session controls its own browser independently.
97
+
98
+ ### Agent Status Detection
99
+ Gate-based detection for AI coding agents:
100
+ - Claude Code, Cursor, Aider, Codex CLI, Gemini CLI, OpenCode, GitHub Copilot CLI
101
+ - Detects agent startup activates monitoring
102
+ - Critical action warnings (git push --force, rm -rf, DROP TABLE, etc.)
103
+
104
+ ### Themes
105
+ Catppuccin, Tokyo Night, Dracula, Nord, Gruvbox, Solarized, One Dark, and more.
106
+
107
+ ### i18n
108
+ English, 한국어, 日本語, 中文
109
+
110
+ ---
111
+
112
+ ## Keyboard Shortcuts
113
+
114
+ | Key | Action |
115
+ |-----|--------|
116
+ | `Ctrl+D` | Split right |
117
+ | `Ctrl+Shift+D` | Split down |
118
+ | `Ctrl+T` | New tab |
119
+ | `Ctrl+W` | Close tab |
120
+ | `Ctrl+N` | New workspace |
121
+ | `Ctrl+1~9` | Switch workspace |
122
+ | `Ctrl+click` | Add workspace to multiview |
123
+ | `Ctrl+Shift+G` | Exit multiview |
124
+ | `Ctrl+Shift+L` | Open browser |
125
+ | `Ctrl+B` | Toggle sidebar |
126
+ | `Ctrl+K` | Command palette |
127
+ | `Ctrl+I` | Notifications |
128
+ | `Ctrl+,` | Settings |
129
+ | `Ctrl+F` | Search terminal |
130
+ | `Ctrl+Shift+X` | Vi copy mode |
131
+ | `Ctrl+Shift+H` | Flash pane |
132
+ | `Alt+Ctrl+Arrow` | Focus adjacent pane |
133
+ | `F12` | Browser DevTools |
134
+
135
+ ---
136
+
137
+ ## CLI
138
+
139
+ ```bash
140
+ wmux workspace list
141
+ wmux workspace create "backend"
142
+ wmux pane split-right
143
+ wmux pane send-text "npm test"
144
+ wmux notify --title "Done" --body "Tests passed"
145
+ wmux browser snapshot
146
+ wmux browser click "#submit-btn"
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Development
152
+
153
+ ```bash
154
+ git clone https://github.com/openwong2kim/wmux.git
155
+ cd wmux
156
+ npm install
157
+ npm start # Dev mode
158
+ npm run make # Build installer
159
+ ```
160
+
161
+ ### Requirements (development only)
162
+ - Node.js 18+
163
+ - Python 3.x (for node-gyp)
164
+ - Visual Studio Build Tools with C++ workload
165
+
166
+ The `install.ps1` script auto-installs Python and VS Build Tools if missing.
167
+
168
+ ---
169
+
170
+ ## Architecture
171
+
172
+ ```
173
+ Electron Main Process
174
+ ├── PTYManager (node-pty)
175
+ ├── PTYBridge (data forwarding + ActivityMonitor)
176
+ ├── AgentDetector (gate-based agent status)
177
+ ├── PipeServer (Named Pipe JSON-RPC)
178
+ ├── McpRegistrar (auto-registers MCP in ~/.claude.json)
179
+ └── ToastManager (OS notifications + taskbar flash)
180
+
181
+ Renderer Process (React 19 + Zustand)
182
+ ├── PaneContainer (recursive split layout)
183
+ ├── Terminal (xterm.js + WebGL)
184
+ ├── BrowserPanel (webview + Inspector)
185
+ ├── NotificationPanel
186
+ └── Multiview grid
187
+
188
+ MCP Server (stdio)
189
+ └── Bridges Claude Code ↔ wmux via Named Pipe RPC
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Acknowledgments
195
+
196
+ - [cmux](https://github.com/manaflow-ai/cmux) — The macOS AI agent terminal that inspired wmux. Same philosophy: primitives over prescriptive workflows.
197
+ - [xterm.js](https://xtermjs.org/) — Terminal rendering
198
+ - [node-pty](https://github.com/microsoft/node-pty) — Pseudo-terminal
199
+ - [Electron](https://www.electronjs.org/) — Desktop framework
200
+
201
+ ---
202
+
203
+ ## Note on AI Agents
204
+
205
+ wmux detects AI coding agents for status display purposes only. It does not call any AI APIs, capture agent outputs, or automate agent interactions. Users are responsible for complying with their AI provider's Terms of Service.
206
+
207
+ ## License
208
+
209
+ MIT
@@ -37,7 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.sendRequest = sendRequest;
38
38
  const net = __importStar(require("net"));
39
39
  const crypto = __importStar(require("crypto"));
40
- const PIPE_NAME = process.env.WMUX_SOCKET_PATH || '\\\\.\\pipe\\wmux';
40
+ const PIPE_NAME = process.env.WMUX_SOCKET_PATH || (process.platform === 'win32' ? '\\\\.\\pipe\\wmux' : '/tmp/wmux.sock');
41
41
  const TIMEOUT_MS = 5000;
42
42
  function sendRequest(method, params = {}) {
43
43
  return new Promise((resolve, reject) => {
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleBrowser = handleBrowser;
4
4
  const client_1 = require("../client");
5
5
  const utils_1 = require("../utils");
6
- const BROWSER_HELP = `
7
- wmux browser — Scriptable Browser API
8
-
9
- USAGE
10
- wmux browser <subcommand> [args]
11
-
12
- SUBCOMMANDS
13
- snapshot Return the full page HTML (document.documentElement.outerHTML)
14
- click <selector> Click the first element matching the CSS selector
15
- fill <selector> <text> Set the value of an input matching the CSS selector
16
- eval <code> Execute arbitrary JavaScript in the page context
17
- navigate <url> Navigate the active browser surface to a URL
18
-
19
- EXAMPLES
20
- wmux browser snapshot
21
- wmux browser click "#submit-btn"
22
- wmux browser fill "input[name=email]" "user@example.com"
23
- wmux browser eval "document.title"
24
- wmux browser navigate "https://example.com"
6
+ const BROWSER_HELP = `
7
+ wmux browser — Scriptable Browser API
8
+
9
+ USAGE
10
+ wmux browser <subcommand> [args]
11
+
12
+ SUBCOMMANDS
13
+ snapshot Return the full page HTML (document.documentElement.outerHTML)
14
+ click <selector> Click the first element matching the CSS selector
15
+ fill <selector> <text> Set the value of an input matching the CSS selector
16
+ eval <code> Execute arbitrary JavaScript in the page context
17
+ navigate <url> Navigate the active browser surface to a URL
18
+
19
+ EXAMPLES
20
+ wmux browser snapshot
21
+ wmux browser click "#submit-btn"
22
+ wmux browser fill "input[name=email]" "user@example.com"
23
+ wmux browser eval "document.title"
24
+ wmux browser navigate "https://example.com"
25
25
  `.trimStart();
26
26
  async function handleBrowser(args, jsonMode) {
27
27
  const sub = args[0];
@@ -12,64 +12,64 @@ const input_1 = require("./commands/input");
12
12
  const notify_1 = require("./commands/notify");
13
13
  const system_1 = require("./commands/system");
14
14
  const browser_1 = require("./commands/browser");
15
- const HELP_TEXT = `
16
- wmux CLI
17
-
18
- USAGE
19
- wmux <command> [options]
20
-
21
- WORKSPACE COMMANDS
22
- list-workspaces List all workspaces
23
- new-workspace [--name <name>] Create a new workspace
24
- focus-workspace <id> Focus a workspace by ID
25
- close-workspace <id> Close a workspace by ID
26
- current-workspace Show the active workspace
27
-
28
- SURFACE COMMANDS
29
- list-surfaces List all surfaces in the active workspace
30
- new-surface Open a new surface (terminal tab)
31
- focus-surface <id> Focus a surface by ID
32
- close-surface <id> Close a surface by ID
33
-
34
- PANE COMMANDS
35
- list-panes List all panes in the active workspace
36
- focus-pane <id> Focus a pane by ID
37
- split [--direction right|down] Split the active pane (default: right)
38
-
39
- INPUT COMMANDS
40
- send <text> Send text to the active terminal
41
- send-key <keystroke> Send a key (e.g. Enter, ctrl-c, Tab)
42
- read-screen Read the current terminal screen content
43
-
44
- NOTIFICATION COMMANDS
45
- notify --title <title> --body <body> Show a notification in wmux
46
-
47
- SYSTEM COMMANDS
48
- set-status <text> Set a status message on the active workspace
49
- set-progress <0-100> Set a progress value on the active workspace
50
- identify Show wmux app info
51
- capabilities List all supported RPC methods
52
-
53
- BROWSER COMMANDS
54
- browser snapshot Return the full page HTML of the active browser surface
55
- browser click <selector> Click an element by CSS selector
56
- browser fill <selector> <text> Fill an input field by CSS selector
57
- browser eval <code> Execute JavaScript in the browser context
58
- browser navigate <url> Navigate the browser surface to a URL
59
-
60
- GLOBAL FLAGS
61
- --json Output raw JSON (useful for scripting)
62
- --help Show this help text
63
-
64
- EXAMPLES
65
- wmux list-workspaces
66
- wmux new-workspace --name dev
67
- wmux send "echo hello"
68
- wmux notify --title "Done" --body "Build finished"
69
- wmux identify --json
70
- wmux browser snapshot
71
- wmux browser navigate "https://example.com"
72
- wmux browser click "#login-btn"
15
+ const HELP_TEXT = `
16
+ wmux CLI
17
+
18
+ USAGE
19
+ wmux <command> [options]
20
+
21
+ WORKSPACE COMMANDS
22
+ list-workspaces List all workspaces
23
+ new-workspace [--name <name>] Create a new workspace
24
+ focus-workspace <id> Focus a workspace by ID
25
+ close-workspace <id> Close a workspace by ID
26
+ current-workspace Show the active workspace
27
+
28
+ SURFACE COMMANDS
29
+ list-surfaces List all surfaces in the active workspace
30
+ new-surface Open a new surface (terminal tab)
31
+ focus-surface <id> Focus a surface by ID
32
+ close-surface <id> Close a surface by ID
33
+
34
+ PANE COMMANDS
35
+ list-panes List all panes in the active workspace
36
+ focus-pane <id> Focus a pane by ID
37
+ split [--direction right|down] Split the active pane (default: right)
38
+
39
+ INPUT COMMANDS
40
+ send <text> Send text to the active terminal
41
+ send-key <keystroke> Send a key (e.g. Enter, ctrl-c, Tab)
42
+ read-screen Read the current terminal screen content
43
+
44
+ NOTIFICATION COMMANDS
45
+ notify --title <title> --body <body> Show a notification in wmux
46
+
47
+ SYSTEM COMMANDS
48
+ set-status <text> Set a status message on the active workspace
49
+ set-progress <0-100> Set a progress value on the active workspace
50
+ identify Show wmux app info
51
+ capabilities List all supported RPC methods
52
+
53
+ BROWSER COMMANDS
54
+ browser snapshot Return the full page HTML of the active browser surface
55
+ browser click <selector> Click an element by CSS selector
56
+ browser fill <selector> <text> Fill an input field by CSS selector
57
+ browser eval <code> Execute JavaScript in the browser context
58
+ browser navigate <url> Navigate the browser surface to a URL
59
+
60
+ GLOBAL FLAGS
61
+ --json Output raw JSON (useful for scripting)
62
+ --help Show this help text
63
+
64
+ EXAMPLES
65
+ wmux list-workspaces
66
+ wmux new-workspace --name dev
67
+ wmux send "echo hello"
68
+ wmux notify --title "Done" --body "Build finished"
69
+ wmux identify --json
70
+ wmux browser snapshot
71
+ wmux browser navigate "https://example.com"
72
+ wmux browser click "#login-btn"
73
73
  `.trimStart();
74
74
  const WORKSPACE_CMDS = new Set([
75
75
  'list-workspaces',
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ENV_KEYS = exports.PIPE_NAME = exports.IPC = void 0;
3
+ exports.ENV_KEYS = exports.IPC = void 0;
4
4
  exports.getPipeName = getPipeName;
5
5
  exports.getAuthTokenPath = getAuthTokenPath;
6
6
  // IPC Channel names
@@ -11,6 +11,8 @@ exports.IPC = {
11
11
  PTY_DISPOSE: 'pty:dispose',
12
12
  PTY_DATA: 'pty:data',
13
13
  PTY_EXIT: 'pty:exit',
14
+ PTY_LIST: 'pty:list',
15
+ PTY_RECONNECT: 'pty:reconnect',
14
16
  SHELL_LIST: 'shell:list',
15
17
  SESSION_SAVE: 'session:save',
16
18
  SESSION_LOAD: 'session:load',
@@ -24,6 +26,8 @@ exports.IPC = {
24
26
  // Clipboard (main process bridge)
25
27
  CLIPBOARD_WRITE: 'clipboard:write',
26
28
  CLIPBOARD_READ: 'clipboard:read',
29
+ CLIPBOARD_READ_IMAGE: 'clipboard:read-image',
30
+ CLIPBOARD_HAS_IMAGE: 'clipboard:has-image',
27
31
  // Phase 4: Auto updater
28
32
  UPDATE_CHECK: 'update:check',
29
33
  UPDATE_AVAILABLE: 'update:available',
@@ -33,12 +37,21 @@ exports.IPC = {
33
37
  UPDATE_INSTALL: 'update:install',
34
38
  // Settings sync (renderer → main)
35
39
  TOAST_ENABLED: 'settings:toast-enabled',
40
+ // Agent critical action approval
41
+ APPROVAL_REQUEST: 'approval:request',
42
+ // File system
43
+ FS_READ_DIR: 'fs:read-dir',
44
+ FS_READ_FILE: 'fs:read-file',
45
+ FS_WATCH: 'fs:watch',
46
+ FS_UNWATCH: 'fs:unwatch',
47
+ FS_CHANGED: 'fs:changed',
36
48
  };
37
- // Named Pipe path for wmux API
49
+ // Named Pipe / Unix socket path for wmux API
38
50
  // Fixed name so MCP clients (e.g. Claude Code) can reconnect across wmux restarts
39
- exports.PIPE_NAME = '\\\\.\\pipe\\wmux';
40
51
  function getPipeName() {
41
- return exports.PIPE_NAME;
52
+ if (process.platform === 'win32')
53
+ return '\\\\.\\pipe\\wmux';
54
+ return '/tmp/wmux.sock';
42
55
  }
43
56
  // Environment variable names injected into PTY sessions
44
57
  exports.ENV_KEYS = {