@wangyaoshen/remux 0.3.8-dev.a8ceb0c

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 (183) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +38 -0
  3. package/.github/PULL_REQUEST_TEMPLATE.md +28 -0
  4. package/.github/dependabot.yml +33 -0
  5. package/.github/workflows/ci.yml +65 -0
  6. package/.github/workflows/deploy.yml +65 -0
  7. package/.github/workflows/publish.yml +312 -0
  8. package/.github/workflows/release-please.yml +21 -0
  9. package/.gitmodules +3 -0
  10. package/.nvmrc +1 -0
  11. package/.release-please-manifest.json +3 -0
  12. package/CLAUDE.md +104 -0
  13. package/Dockerfile +23 -0
  14. package/LICENSE +21 -0
  15. package/README.md +120 -0
  16. package/apps/ios/Config/signing.xcconfig +4 -0
  17. package/apps/ios/Package.swift +26 -0
  18. package/apps/ios/Remux.xcodeproj/project.pbxproj +477 -0
  19. package/apps/ios/Remux.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  20. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/Contents.json +23 -0
  21. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png +0 -0
  22. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_120x120.png +0 -0
  23. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_152x152.png +0 -0
  24. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_167x167.png +0 -0
  25. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_180x180.png +0 -0
  26. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_20x20.png +0 -0
  27. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_29x29.png +0 -0
  28. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_40x40.png +0 -0
  29. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_58x58.png +0 -0
  30. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_60x60.png +0 -0
  31. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_76x76.png +0 -0
  32. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_80x80.png +0 -0
  33. package/apps/ios/Sources/Remux/Assets.xcassets/AppIcon.appiconset/icon_87x87.png +0 -0
  34. package/apps/ios/Sources/Remux/Assets.xcassets/Contents.json +6 -0
  35. package/apps/ios/Sources/Remux/Extensions/FaceIDManager.swift +29 -0
  36. package/apps/ios/Sources/Remux/Extensions/InspectCache.swift +66 -0
  37. package/apps/ios/Sources/Remux/MainTabView.swift +32 -0
  38. package/apps/ios/Sources/Remux/Remux.entitlements +8 -0
  39. package/apps/ios/Sources/Remux/RemuxiOSApp.swift +14 -0
  40. package/apps/ios/Sources/Remux/RootView.swift +130 -0
  41. package/apps/ios/Sources/Remux/Views/Control/ControlView.swift +102 -0
  42. package/apps/ios/Sources/Remux/Views/Inspect/InspectView.swift +98 -0
  43. package/apps/ios/Sources/Remux/Views/Live/LiveTerminalView.swift +132 -0
  44. package/apps/ios/Sources/Remux/Views/Now/NowView.swift +173 -0
  45. package/apps/ios/Sources/Remux/Views/Onboarding/ManualConnectView.swift +55 -0
  46. package/apps/ios/Sources/Remux/Views/Onboarding/OnboardingView.swift +70 -0
  47. package/apps/ios/Sources/Remux/Views/Onboarding/QRScannerView.swift +92 -0
  48. package/apps/ios/Sources/Remux/Views/Settings/MeView.swift +136 -0
  49. package/apps/macos/Package.swift +37 -0
  50. package/apps/macos/Resources/shell-integration/bash/bash-preexec.sh +382 -0
  51. package/apps/macos/Resources/shell-integration/bash/ghostty.bash +315 -0
  52. package/apps/macos/Resources/shell-integration/elvish/lib/ghostty-integration.elv +191 -0
  53. package/apps/macos/Resources/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish +246 -0
  54. package/apps/macos/Resources/shell-integration/nushell/vendor/autoload/ghostty.nu +110 -0
  55. package/apps/macos/Resources/shell-integration/zsh/.zshenv +61 -0
  56. package/apps/macos/Resources/shell-integration/zsh/ghostty-integration +458 -0
  57. package/apps/macos/Resources/terminfo/67/ghostty +0 -0
  58. package/apps/macos/Resources/terminfo/78/xterm-ghostty +0 -0
  59. package/apps/macos/Sources/Remux/AppDelegate.swift +257 -0
  60. package/apps/macos/Sources/Remux/CrashReporter.swift +210 -0
  61. package/apps/macos/Sources/Remux/FinderIntegration.swift +117 -0
  62. package/apps/macos/Sources/Remux/GhosttyConfig.swift +311 -0
  63. package/apps/macos/Sources/Remux/KeyboardShortcuts/ShortcutAction.swift +115 -0
  64. package/apps/macos/Sources/Remux/KeyboardShortcuts/ShortcutSettingsView.swift +271 -0
  65. package/apps/macos/Sources/Remux/KeyboardShortcuts/StoredShortcut.swift +149 -0
  66. package/apps/macos/Sources/Remux/MainContentView.swift +308 -0
  67. package/apps/macos/Sources/Remux/MenuBarManager.swift +275 -0
  68. package/apps/macos/Sources/Remux/NotificationManager.swift +145 -0
  69. package/apps/macos/Sources/Remux/PortScanner.swift +152 -0
  70. package/apps/macos/Sources/Remux/RemuxApp.swift +13 -0
  71. package/apps/macos/Sources/Remux/SSHDetector.swift +151 -0
  72. package/apps/macos/Sources/Remux/SessionPersistence.swift +226 -0
  73. package/apps/macos/Sources/Remux/SocketController.swift +258 -0
  74. package/apps/macos/Sources/Remux/UpdateChecker.swift +152 -0
  75. package/apps/macos/Sources/Remux/Views/CommandPalette.swift +198 -0
  76. package/apps/macos/Sources/Remux/Views/ConnectionView.swift +84 -0
  77. package/apps/macos/Sources/Remux/Views/InspectView.swift +127 -0
  78. package/apps/macos/Sources/Remux/Views/SettingsView.swift +77 -0
  79. package/apps/macos/Sources/Remux/Views/Sidebar/SidebarView.swift +410 -0
  80. package/apps/macos/Sources/Remux/Views/SplitTree/BrowserPanel.swift +193 -0
  81. package/apps/macos/Sources/Remux/Views/SplitTree/MarkdownPanel.swift +277 -0
  82. package/apps/macos/Sources/Remux/Views/SplitTree/PanelProtocol.swift +14 -0
  83. package/apps/macos/Sources/Remux/Views/SplitTree/SplitNode.swift +149 -0
  84. package/apps/macos/Sources/Remux/Views/SplitTree/SplitView.swift +234 -0
  85. package/apps/macos/Sources/Remux/Views/SplitTree/TerminalPanel.swift +26 -0
  86. package/apps/macos/Sources/Remux/Views/TabBarView.swift +94 -0
  87. package/apps/macos/Sources/Remux/Views/Terminal/ClipboardHelper.swift +101 -0
  88. package/apps/macos/Sources/Remux/Views/Terminal/CopyModeOverlay.swift +325 -0
  89. package/apps/macos/Sources/Remux/Views/Terminal/GhosttyNativeTerminalView.swift +39 -0
  90. package/apps/macos/Sources/Remux/Views/Terminal/GhosttyNativeView.swift +559 -0
  91. package/apps/macos/Sources/Remux/Views/Terminal/SurfaceSearchOverlay.swift +109 -0
  92. package/apps/macos/Sources/Remux/Views/Terminal/TerminalContainerView.swift +95 -0
  93. package/apps/macos/Sources/Remux/Views/Terminal/TerminalRelay.swift +117 -0
  94. package/build.mjs +33 -0
  95. package/native/android/DecodeGoldenPayloads.kt +487 -0
  96. package/native/android/ProtocolModels.kt +188 -0
  97. package/native/ios/DecodeGoldenPayloads.swift +711 -0
  98. package/native/ios/ProtocolModels.swift +200 -0
  99. package/package.json +45 -0
  100. package/packages/RemuxKit/Package.swift +27 -0
  101. package/packages/RemuxKit/Sources/RemuxKit/Device/DeviceManager.swift +27 -0
  102. package/packages/RemuxKit/Sources/RemuxKit/Models/ProtocolModels.swift +206 -0
  103. package/packages/RemuxKit/Sources/RemuxKit/Networking/MessageRouter.swift +108 -0
  104. package/packages/RemuxKit/Sources/RemuxKit/Networking/RemuxConnection.swift +395 -0
  105. package/packages/RemuxKit/Sources/RemuxKit/State/RemuxState.swift +188 -0
  106. package/packages/RemuxKit/Sources/RemuxKit/Storage/KeychainStore.swift +142 -0
  107. package/packages/RemuxKit/Sources/RemuxKit/Terminal/GhosttyBridge.swift +145 -0
  108. package/packages/RemuxKit/Sources/RemuxKit/Terminal/GhosttyTerminalView.swift +35 -0
  109. package/packages/RemuxKit/Sources/RemuxKit/Terminal/Resources/ghostty-terminal.html +91 -0
  110. package/packages/RemuxKit/Tests/RemuxKitTests/ConnectionIntegrationTest.swift +74 -0
  111. package/packages/RemuxKit/Tests/RemuxKitTests/KeychainStoreTests.swift +81 -0
  112. package/packages/RemuxKit/Tests/RemuxKitTests/ProtocolModelsTests.swift +179 -0
  113. package/packages/RemuxKit/Tests/RemuxKitTests/RemuxStateTests.swift +62 -0
  114. package/playwright.config.ts +17 -0
  115. package/pnpm-lock.yaml +1588 -0
  116. package/pty-daemon.js +303 -0
  117. package/release-please-config.json +14 -0
  118. package/scripts/auto-deploy.sh +46 -0
  119. package/scripts/build-dmg.sh +121 -0
  120. package/scripts/build-ghostty-kit.sh +43 -0
  121. package/scripts/check-active-terminology.mjs +132 -0
  122. package/scripts/setup-ci-secrets.sh +80 -0
  123. package/scripts/sync-ghostty-web.sh +28 -0
  124. package/scripts/upload-testflight.sh +100 -0
  125. package/server.js +7074 -0
  126. package/src/adapters/agent-events.ts +246 -0
  127. package/src/adapters/claude-code.ts +158 -0
  128. package/src/adapters/codex.ts +210 -0
  129. package/src/adapters/generic-shell.ts +58 -0
  130. package/src/adapters/index.ts +15 -0
  131. package/src/adapters/registry.ts +99 -0
  132. package/src/adapters/types.ts +41 -0
  133. package/src/auth.ts +174 -0
  134. package/src/e2ee.ts +236 -0
  135. package/src/git-service.ts +168 -0
  136. package/src/message-buffer.ts +137 -0
  137. package/src/pty-daemon.ts +357 -0
  138. package/src/push.ts +127 -0
  139. package/src/renderers.ts +455 -0
  140. package/src/server.ts +2407 -0
  141. package/src/service.ts +226 -0
  142. package/src/session.ts +978 -0
  143. package/src/store.ts +1422 -0
  144. package/src/team.ts +123 -0
  145. package/src/tunnel.ts +126 -0
  146. package/src/types.d.ts +50 -0
  147. package/src/vt-tracker.ts +188 -0
  148. package/src/workspace-head.ts +144 -0
  149. package/src/workspace.ts +153 -0
  150. package/src/ws-handler.ts +1526 -0
  151. package/start.ps1 +83 -0
  152. package/tests/adapters.test.js +171 -0
  153. package/tests/auth.test.js +243 -0
  154. package/tests/codex-adapter.test.js +535 -0
  155. package/tests/durable-stream.test.js +153 -0
  156. package/tests/e2e/app.spec.js +530 -0
  157. package/tests/e2ee.test.js +325 -0
  158. package/tests/message-buffer.test.js +245 -0
  159. package/tests/message-routing.test.js +305 -0
  160. package/tests/pty-daemon.test.js +346 -0
  161. package/tests/push.test.js +281 -0
  162. package/tests/renderers.test.js +391 -0
  163. package/tests/search-shell.test.js +499 -0
  164. package/tests/server.test.js +882 -0
  165. package/tests/service.test.js +267 -0
  166. package/tests/store.test.js +369 -0
  167. package/tests/tunnel.test.js +67 -0
  168. package/tests/workspace-head.test.js +116 -0
  169. package/tests/workspace.test.js +417 -0
  170. package/tsconfig.backend.json +11 -0
  171. package/tsconfig.json +15 -0
  172. package/tui/client/client_test.go +125 -0
  173. package/tui/client/connection.go +342 -0
  174. package/tui/client/host_manager.go +141 -0
  175. package/tui/config/cache.go +81 -0
  176. package/tui/config/config.go +53 -0
  177. package/tui/config/config_test.go +89 -0
  178. package/tui/go.mod +32 -0
  179. package/tui/go.sum +50 -0
  180. package/tui/main.go +261 -0
  181. package/tui/tests/integration_test.go +283 -0
  182. package/tui/ui/model.go +310 -0
  183. package/vitest.config.js +10 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,104 @@
1
+ # CLAUDE.md
2
+
3
+ 本文件为代理在本仓库工作时的指令手册。所有规则必须严格遵守。
4
+
5
+ ## 项目概述
6
+
7
+ Remux 是一个基于 Web 的远程终端控制台,使用 ghostty-web 渲染 + node-pty 直接管理 shell PTY(无 Zellij 依赖)。通过 tunnel 让用户从手机、平板或其他电脑监控和控制终端会话。以 npm 包分发(`npx @wangyaoshen/remux`)。使用 pnpm 作为包管理器。
8
+
9
+ - **GitHub**: github.com/yaoshenwang/remux
10
+ - **许可证**: MIT
11
+
12
+ ## 沟通语言
13
+
14
+ 所有与用户的交流必须使用中文。代码注释和 commit message 使用英文。
15
+
16
+ ## 分支纪律(强制)
17
+
18
+ - 维护 `main`(生产)和 `dev`(开发)两个长期分支
19
+ - **禁止直接在 `main` 或 `dev` 上修改代码**
20
+ - 所有开发工作从 `dev` 创建 feature 分支,使用 `git worktree` 隔离开发
21
+ - 完成后合并回 `dev`,`dev` 定期合并到 `main` 发布
22
+ - **禁止直接 push 到 main**
23
+
24
+ ### 分支命名规范
25
+
26
+ | 类型 | 格式 | 示例 |
27
+ |------|------|------|
28
+ | 功能 | `feat/<简短描述>` | `feat/websocket-reconnect` |
29
+ | 修复 | `fix/<简短描述>` | `fix/resize-debounce` |
30
+ | 维护 | `chore/<简短描述>` | `chore/remove-unused-deps` |
31
+ | 更新 | `update/<简短描述>` | `update/bump-dependencies` |
32
+
33
+ ### Worktree 路径
34
+
35
+ `.worktrees/<分支短名>`,例如 `.worktrees/websocket-reconnect`
36
+
37
+ ### 版本管理
38
+
39
+ - 遵循 SemVer。AI 仅可自行 bump patch 版本
40
+ - Minor/Major 版本变更需用户明确批准
41
+ - 每次 feature 合并到 `dev` 后 bump patch
42
+
43
+ ## 常用命令
44
+
45
+ ```bash
46
+ pnpm start
47
+ pnpm run dev
48
+ pnpm test
49
+ ```
50
+
51
+ ### 构建检查(强制)
52
+
53
+ 合并到 `dev` 之前必须通过:
54
+
55
+ ```bash
56
+ pnpm test
57
+ ```
58
+
59
+ ## 开发规范
60
+
61
+ ### TDD 强制
62
+
63
+ 非平凡的代码变更必须采用 TDD:先写测试(红)→ 实现(绿)→ 重构。
64
+
65
+ ### 评估验收原则
66
+
67
+ - 实现前先定义可衡量的成功标准,覆盖四维度:结果、过程、风格、效率
68
+ - 先写确定性检查(文件存在、命令执行、输出匹配),再加定性评估
69
+ - 用实际失败驱动测试覆盖扩展,不靠猜测穷举
70
+ - 完整方法论参见 skill `eval-driven-development`
71
+
72
+ ### 开源复用优先(强制)
73
+
74
+ - **优先寻找并复用成熟开源项目的代码、库或设计**,而非从零实现
75
+ - 实现新功能前,先调研是否有质量可靠的 npm 包、开源库或可参考的开源项目实现
76
+ - 可以直接引入的依赖就引入依赖;不能直接引入但思路成熟的,参考其架构和接口设计再实现
77
+ - 参考来源必须在 commit message 或代码注释中标注(例如 `// Adapted from vercel-labs/agent-browser`)
78
+ - 自造轮子仅在以下情况允许:无合适开源方案、现有方案与项目架构严重不兼容、许可证不兼容(GPL 等)
79
+ - 定期关注同领域项目(cmux、warp、wave-terminal 等)的新特性和技术选型
80
+
81
+ ### 安全要点
82
+
83
+ - 单一 WebSocket 端点 `/ws`,使用 `REMUX_TOKEN` 环境变量进行 token 认证
84
+ - shell 相关命令使用参数数组,禁止退化为 shell 拼接字符串
85
+
86
+ ### 浏览器自动化(强制)
87
+
88
+ - 使用 `playwright-cli` 进行所有浏览器自动化测试和页面检查
89
+ - **禁止使用 chrome-devtools MCP**
90
+ - 常用命令:
91
+ - `playwright-cli open <url>` — 打开页面
92
+ - `playwright-cli snapshot` — 获取页面快照和元素 ref
93
+ - `playwright-cli click <ref>` — 点击元素
94
+ - `playwright-cli eval '<js>'` — 执行 JavaScript
95
+ - `playwright-cli screenshot` — 截图
96
+ - `playwright-cli -s=<session>` — 指定会话操作
97
+
98
+ ### 交付流程(强制)
99
+
100
+ 1. 在 feature 分支完成开发 + 自测(`pnpm test` 全部通过)
101
+ 2. 确认功能开发完全后,立即合并到 `dev`
102
+ 3. 立刻 push 到远程 `origin/dev`,禁止只做本地合并
103
+ 4. 基于远程 `dev` 对应的真实环境执行必要的实机验证
104
+ 5. 验证通过后再向用户报告完成;若验证失败,继续修复并重复上述流程,禁止未合并或未推送就交付
package/Dockerfile ADDED
@@ -0,0 +1,23 @@
1
+ # E16-006: Docker self-hosted image for Remux
2
+ FROM node:20-slim
3
+
4
+ WORKDIR /app
5
+
6
+ # Install only production dependencies
7
+ COPY package.json pnpm-lock.yaml ./
8
+ RUN corepack enable && pnpm install --frozen-lockfile --prod
9
+
10
+ # Copy built server and assets
11
+ COPY server.js ./
12
+ COPY node_modules/ghostty-web/dist/ ./node_modules/ghostty-web/dist/
13
+ COPY node_modules/ghostty-web/ghostty-vt.wasm ./node_modules/ghostty-web/
14
+
15
+ # Default port
16
+ ENV PORT=8767
17
+
18
+ EXPOSE 8767
19
+
20
+ HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
21
+ CMD node -e "fetch('http://localhost:8767/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
22
+
23
+ ENTRYPOINT ["node", "server.js"]
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yaoshen Wang
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 ADDED
@@ -0,0 +1,120 @@
1
+ # Remux
2
+
3
+ **Remote terminal workspace — powered by ghostty-web.**
4
+
5
+ [![GitHub stars](https://img.shields.io/github/stars/yaoshenwang/remux?style=social)](https://github.com/yaoshenwang/remux/stargazers)
6
+ ![GitHub contributors](https://img.shields.io/github/contributors/yaoshenwang/remux)
7
+
8
+ Remux lets you monitor and control terminal sessions from any device — phone, tablet, or another computer — through a web browser. It runs a lightweight Node.js server that manages shell sessions and streams them via WebSocket using [ghostty-web](https://github.com/coder/ghostty-web) for stable, high-quality terminal rendering.
9
+
10
+ ## Why Remux
11
+
12
+ - Access your terminal sessions from any browser, including mobile
13
+ - Multiple sessions and tabs, managed through a VS Code-style sidebar and tab bar
14
+ - Stable rendering with ghostty-web (Ghostty VT engine compiled to WASM)
15
+ - Server-side VT state tracking for instant session restore on reconnect
16
+ - Mobile-friendly compose bar for special keys (Esc, Tab, Ctrl, arrows)
17
+ - Token authentication for secure access
18
+ - Session persistence across server restarts
19
+ - Zero configuration — `npx @wangyaoshen/remux` and go
20
+
21
+ ## Quick Start
22
+
23
+ ### Prerequisites
24
+
25
+ - Node.js 20+
26
+
27
+ ### Run from npm
28
+
29
+ ```bash
30
+ npx @wangyaoshen/remux
31
+ ```
32
+
33
+ Remux prints a local URL. Open it from any browser.
34
+
35
+ ### Run with authentication
36
+
37
+ ```bash
38
+ REMUX_TOKEN=my-secret-token npx @wangyaoshen/remux
39
+ ```
40
+
41
+ Access via `http://localhost:8767/?token=my-secret-token`.
42
+
43
+ ### Run from source
44
+
45
+ ```bash
46
+ git clone https://github.com/yaoshenwang/remux.git
47
+ cd remux
48
+ pnpm install
49
+ pnpm start
50
+ ```
51
+
52
+ ## Features
53
+
54
+ - **Multiple sessions** — create, switch, and delete named sessions from the sidebar
55
+ - **Multiple tabs per session** — Chrome-style tab bar with create, close, and switch
56
+ - **ghostty-web rendering** — Ghostty VT engine in WASM, stable truecolor Canvas rendering
57
+ - **Server-side VT tracking** — ghostty-vt WASM tracks terminal state for instant snapshot restore
58
+ - **Session persistence** — sessions and scrollback survive server restarts
59
+ - **Multi-client support** — multiple browsers can connect simultaneously with coordinated terminal sizing
60
+ - **Token authentication** — protect access with `REMUX_TOKEN` environment variable
61
+ - **Mobile support** — responsive sidebar drawer, compose bar for special keys, viewport-aware layout
62
+ - **Auto reconnect** — WebSocket reconnects automatically on disconnection
63
+
64
+ ## Architecture
65
+
66
+ ```
67
+ Browser (ghostty-web Canvas)
68
+
69
+ └── WebSocket /ws (control + terminal data)
70
+
71
+
72
+ server.js (Node.js)
73
+ ├── HTTP server (serves app + ghostty-web assets)
74
+ ├── WebSocket server (session/tab control + terminal I/O)
75
+ ├── PTY management (node-pty, direct shell)
76
+ ├── VT tracking (ghostty-vt WASM, server-side snapshots)
77
+ └── Session persistence (JSON file, periodic save)
78
+ ```
79
+
80
+ ## Environment Variables
81
+
82
+ | Variable | Description |
83
+ |----------|-------------|
84
+ | `PORT` | Server port (default: 8767) |
85
+ | `REMUX_TOKEN` | Authentication token (optional; if set, required for access) |
86
+ | `REMUX_INSTANCE_ID` | Instance identifier for persistence file isolation |
87
+
88
+ ## Tech Stack
89
+
90
+ - **Runtime**: Node.js 20+
91
+ - **Terminal rendering**: [ghostty-web](https://github.com/coder/ghostty-web) (Ghostty VT engine, WASM + Canvas)
92
+ - **PTY management**: [node-pty](https://github.com/niclas-niclas-niclas/node-pty)
93
+ - **WebSocket**: [ws](https://github.com/websockets/ws)
94
+ - **Server-side VT**: ghostty-vt WASM (same engine as browser, loaded server-side)
95
+ - **Testing**: [Vitest](https://vitest.dev/)
96
+ - **TUI companion**: Go + Bubbletea (in `tui/`)
97
+
98
+ ## Development
99
+
100
+ ```bash
101
+ pnpm install
102
+ pnpm run dev # start server
103
+ pnpm test # run tests
104
+ ```
105
+
106
+ ## Contributors
107
+
108
+ Thanks to everyone who has helped shape Remux.
109
+
110
+ [![Contributors](https://contrib.rocks/image?repo=yaoshenwang/remux)](https://github.com/yaoshenwang/remux/graphs/contributors)
111
+
112
+ Made with [contrib.rocks](https://contrib.rocks).
113
+
114
+ ## Star History
115
+
116
+ [![Star History Chart](https://api.star-history.com/svg?repos=yaoshenwang/remux&type=Date)](https://star-history.com/#yaoshenwang/remux&Date)
117
+
118
+ ## License
119
+
120
+ MIT. See [LICENSE](./LICENSE).
@@ -0,0 +1,4 @@
1
+ DEVELOPMENT_TEAM = LY8QD6TJN6
2
+ CODE_SIGN_IDENTITY = Apple Development
3
+ CODE_SIGN_STYLE = Automatic
4
+ PRODUCT_BUNDLE_IDENTIFIER = com.remux.ios
@@ -0,0 +1,26 @@
1
+ // swift-tools-version: 6.0
2
+
3
+ import PackageDescription
4
+
5
+ // NOTE: iOS apps cannot be built with `swift build` (SPM limitation).
6
+ // Build with: xcodebuild -scheme Remux -destination 'platform=iOS Simulator,name=iPhone 17 Pro'
7
+ // This Package.swift is used by Xcode for SPM dependency resolution only.
8
+ let package = Package(
9
+ name: "RemuxiOS",
10
+ platforms: [.iOS(.v17)],
11
+ dependencies: [
12
+ .package(path: "../../packages/RemuxKit"),
13
+ ],
14
+ targets: [
15
+ .executableTarget(
16
+ name: "RemuxiOS",
17
+ dependencies: ["RemuxKit"],
18
+ path: "Sources/Remux",
19
+ linkerSettings: [
20
+ .linkedFramework("UIKit"),
21
+ .linkedFramework("AVFoundation"),
22
+ .linkedFramework("WebKit"),
23
+ ]
24
+ ),
25
+ ]
26
+ )