@wangyaoshen/remux 0.3.8-dev.bab6c95

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 (166) 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 +138 -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 +456 -0
  19. package/apps/ios/Remux.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  20. package/apps/ios/Sources/Remux/Extensions/FaceIDManager.swift +29 -0
  21. package/apps/ios/Sources/Remux/Extensions/InspectCache.swift +66 -0
  22. package/apps/ios/Sources/Remux/MainTabView.swift +32 -0
  23. package/apps/ios/Sources/Remux/Remux.entitlements +8 -0
  24. package/apps/ios/Sources/Remux/RemuxiOSApp.swift +14 -0
  25. package/apps/ios/Sources/Remux/RootView.swift +130 -0
  26. package/apps/ios/Sources/Remux/Views/Control/ControlView.swift +102 -0
  27. package/apps/ios/Sources/Remux/Views/Inspect/InspectView.swift +98 -0
  28. package/apps/ios/Sources/Remux/Views/Live/LiveTerminalView.swift +132 -0
  29. package/apps/ios/Sources/Remux/Views/Now/NowView.swift +173 -0
  30. package/apps/ios/Sources/Remux/Views/Onboarding/ManualConnectView.swift +55 -0
  31. package/apps/ios/Sources/Remux/Views/Onboarding/OnboardingView.swift +70 -0
  32. package/apps/ios/Sources/Remux/Views/Onboarding/QRScannerView.swift +92 -0
  33. package/apps/ios/Sources/Remux/Views/Settings/MeView.swift +136 -0
  34. package/apps/macos/Package.swift +37 -0
  35. package/apps/macos/Resources/shell-integration/bash/bash-preexec.sh +382 -0
  36. package/apps/macos/Resources/shell-integration/bash/ghostty.bash +315 -0
  37. package/apps/macos/Resources/shell-integration/elvish/lib/ghostty-integration.elv +191 -0
  38. package/apps/macos/Resources/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish +246 -0
  39. package/apps/macos/Resources/shell-integration/nushell/vendor/autoload/ghostty.nu +110 -0
  40. package/apps/macos/Resources/shell-integration/zsh/.zshenv +61 -0
  41. package/apps/macos/Resources/shell-integration/zsh/ghostty-integration +458 -0
  42. package/apps/macos/Resources/terminfo/67/ghostty +0 -0
  43. package/apps/macos/Resources/terminfo/78/xterm-ghostty +0 -0
  44. package/apps/macos/Sources/Remux/AppDelegate.swift +257 -0
  45. package/apps/macos/Sources/Remux/CrashReporter.swift +210 -0
  46. package/apps/macos/Sources/Remux/FinderIntegration.swift +117 -0
  47. package/apps/macos/Sources/Remux/GhosttyConfig.swift +311 -0
  48. package/apps/macos/Sources/Remux/KeyboardShortcuts/ShortcutAction.swift +115 -0
  49. package/apps/macos/Sources/Remux/KeyboardShortcuts/ShortcutSettingsView.swift +271 -0
  50. package/apps/macos/Sources/Remux/KeyboardShortcuts/StoredShortcut.swift +149 -0
  51. package/apps/macos/Sources/Remux/MainContentView.swift +308 -0
  52. package/apps/macos/Sources/Remux/MenuBarManager.swift +275 -0
  53. package/apps/macos/Sources/Remux/NotificationManager.swift +145 -0
  54. package/apps/macos/Sources/Remux/PortScanner.swift +152 -0
  55. package/apps/macos/Sources/Remux/RemuxApp.swift +13 -0
  56. package/apps/macos/Sources/Remux/SSHDetector.swift +151 -0
  57. package/apps/macos/Sources/Remux/SessionPersistence.swift +226 -0
  58. package/apps/macos/Sources/Remux/SocketController.swift +258 -0
  59. package/apps/macos/Sources/Remux/UpdateChecker.swift +152 -0
  60. package/apps/macos/Sources/Remux/Views/CommandPalette.swift +198 -0
  61. package/apps/macos/Sources/Remux/Views/ConnectionView.swift +84 -0
  62. package/apps/macos/Sources/Remux/Views/InspectView.swift +127 -0
  63. package/apps/macos/Sources/Remux/Views/SettingsView.swift +77 -0
  64. package/apps/macos/Sources/Remux/Views/Sidebar/SidebarView.swift +410 -0
  65. package/apps/macos/Sources/Remux/Views/SplitTree/BrowserPanel.swift +193 -0
  66. package/apps/macos/Sources/Remux/Views/SplitTree/MarkdownPanel.swift +277 -0
  67. package/apps/macos/Sources/Remux/Views/SplitTree/PanelProtocol.swift +14 -0
  68. package/apps/macos/Sources/Remux/Views/SplitTree/SplitNode.swift +149 -0
  69. package/apps/macos/Sources/Remux/Views/SplitTree/SplitView.swift +234 -0
  70. package/apps/macos/Sources/Remux/Views/SplitTree/TerminalPanel.swift +26 -0
  71. package/apps/macos/Sources/Remux/Views/TabBarView.swift +94 -0
  72. package/apps/macos/Sources/Remux/Views/Terminal/ClipboardHelper.swift +101 -0
  73. package/apps/macos/Sources/Remux/Views/Terminal/CopyModeOverlay.swift +325 -0
  74. package/apps/macos/Sources/Remux/Views/Terminal/GhosttyNativeTerminalView.swift +39 -0
  75. package/apps/macos/Sources/Remux/Views/Terminal/GhosttyNativeView.swift +559 -0
  76. package/apps/macos/Sources/Remux/Views/Terminal/SurfaceSearchOverlay.swift +109 -0
  77. package/apps/macos/Sources/Remux/Views/Terminal/TerminalContainerView.swift +95 -0
  78. package/apps/macos/Sources/Remux/Views/Terminal/TerminalRelay.swift +117 -0
  79. package/build.mjs +33 -0
  80. package/native/android/DecodeGoldenPayloads.kt +487 -0
  81. package/native/android/ProtocolModels.kt +188 -0
  82. package/native/ios/DecodeGoldenPayloads.swift +711 -0
  83. package/native/ios/ProtocolModels.swift +200 -0
  84. package/package.json +45 -0
  85. package/packages/RemuxKit/Package.swift +27 -0
  86. package/packages/RemuxKit/Sources/RemuxKit/Device/DeviceManager.swift +27 -0
  87. package/packages/RemuxKit/Sources/RemuxKit/Models/ProtocolModels.swift +206 -0
  88. package/packages/RemuxKit/Sources/RemuxKit/Networking/MessageRouter.swift +108 -0
  89. package/packages/RemuxKit/Sources/RemuxKit/Networking/RemuxConnection.swift +395 -0
  90. package/packages/RemuxKit/Sources/RemuxKit/State/RemuxState.swift +188 -0
  91. package/packages/RemuxKit/Sources/RemuxKit/Storage/KeychainStore.swift +142 -0
  92. package/packages/RemuxKit/Sources/RemuxKit/Terminal/GhosttyBridge.swift +145 -0
  93. package/packages/RemuxKit/Sources/RemuxKit/Terminal/GhosttyTerminalView.swift +35 -0
  94. package/packages/RemuxKit/Sources/RemuxKit/Terminal/Resources/ghostty-terminal.html +91 -0
  95. package/packages/RemuxKit/Tests/RemuxKitTests/ConnectionIntegrationTest.swift +74 -0
  96. package/packages/RemuxKit/Tests/RemuxKitTests/KeychainStoreTests.swift +81 -0
  97. package/packages/RemuxKit/Tests/RemuxKitTests/ProtocolModelsTests.swift +179 -0
  98. package/packages/RemuxKit/Tests/RemuxKitTests/RemuxStateTests.swift +62 -0
  99. package/playwright.config.ts +17 -0
  100. package/pnpm-lock.yaml +1588 -0
  101. package/pty-daemon.js +303 -0
  102. package/release-please-config.json +14 -0
  103. package/scripts/auto-deploy.sh +46 -0
  104. package/scripts/build-dmg.sh +121 -0
  105. package/scripts/build-ghostty-kit.sh +43 -0
  106. package/scripts/check-active-terminology.mjs +132 -0
  107. package/scripts/sync-ghostty-web.sh +28 -0
  108. package/server.js +7074 -0
  109. package/src/adapters/agent-events.ts +246 -0
  110. package/src/adapters/claude-code.ts +158 -0
  111. package/src/adapters/codex.ts +210 -0
  112. package/src/adapters/generic-shell.ts +58 -0
  113. package/src/adapters/index.ts +15 -0
  114. package/src/adapters/registry.ts +99 -0
  115. package/src/adapters/types.ts +41 -0
  116. package/src/auth.ts +174 -0
  117. package/src/e2ee.ts +236 -0
  118. package/src/git-service.ts +168 -0
  119. package/src/message-buffer.ts +137 -0
  120. package/src/pty-daemon.ts +357 -0
  121. package/src/push.ts +127 -0
  122. package/src/renderers.ts +455 -0
  123. package/src/server.ts +2407 -0
  124. package/src/service.ts +226 -0
  125. package/src/session.ts +978 -0
  126. package/src/store.ts +1422 -0
  127. package/src/team.ts +123 -0
  128. package/src/tunnel.ts +126 -0
  129. package/src/types.d.ts +50 -0
  130. package/src/vt-tracker.ts +188 -0
  131. package/src/workspace-head.ts +144 -0
  132. package/src/workspace.ts +153 -0
  133. package/src/ws-handler.ts +1526 -0
  134. package/start.ps1 +83 -0
  135. package/tests/adapters.test.js +171 -0
  136. package/tests/auth.test.js +243 -0
  137. package/tests/codex-adapter.test.js +535 -0
  138. package/tests/durable-stream.test.js +153 -0
  139. package/tests/e2e/app.spec.js +530 -0
  140. package/tests/e2ee.test.js +325 -0
  141. package/tests/message-buffer.test.js +245 -0
  142. package/tests/message-routing.test.js +305 -0
  143. package/tests/pty-daemon.test.js +346 -0
  144. package/tests/push.test.js +281 -0
  145. package/tests/renderers.test.js +391 -0
  146. package/tests/search-shell.test.js +499 -0
  147. package/tests/server.test.js +882 -0
  148. package/tests/service.test.js +267 -0
  149. package/tests/store.test.js +369 -0
  150. package/tests/tunnel.test.js +67 -0
  151. package/tests/workspace-head.test.js +116 -0
  152. package/tests/workspace.test.js +417 -0
  153. package/tsconfig.backend.json +11 -0
  154. package/tsconfig.json +15 -0
  155. package/tui/client/client_test.go +125 -0
  156. package/tui/client/connection.go +342 -0
  157. package/tui/client/host_manager.go +141 -0
  158. package/tui/config/cache.go +81 -0
  159. package/tui/config/config.go +53 -0
  160. package/tui/config/config_test.go +89 -0
  161. package/tui/go.mod +32 -0
  162. package/tui/go.sum +50 -0
  163. package/tui/main.go +261 -0
  164. package/tui/tests/integration_test.go +283 -0
  165. package/tui/ui/model.go +310 -0
  166. package/vitest.config.js +10 -0
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a regression or defect in the current Zellij-era product path
4
+ title: "[bug] "
5
+ labels: ["bug"]
6
+ assignees: []
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ Describe the problem in one paragraph.
12
+
13
+ ## Affected Layer
14
+
15
+ - [ ] backend gateway
16
+ - [ ] zellij integration
17
+ - [ ] web frontend
18
+ - [ ] docs / devex
19
+ - [ ] tests / CI
20
+
21
+ ## Environment
22
+
23
+ - Remux version:
24
+ - Node.js version:
25
+ - Zellij version:
26
+ - Browser / device:
27
+
28
+ ## Reproduction
29
+
30
+ 1.
31
+ 2.
32
+ 3.
33
+
34
+ ## Expected Behavior
35
+
36
+ What should have happened?
37
+
38
+ ## Validation
39
+
40
+ - [ ] `npm run typecheck`
41
+ - [ ] `npm test`
42
+ - [ ] `npm run build`
43
+
44
+ ## Notes
45
+
46
+ Include logs, screenshots, or links when relevant.
47
+
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose a feature aligned with the current Zellij-era roadmap
4
+ title: "[feature] "
5
+ labels: ["enhancement"]
6
+ assignees: []
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ What capability should Remux gain?
12
+
13
+ ## Scope Bucket
14
+
15
+ - [ ] v1 must ship
16
+ - [ ] v1.5 optional
17
+ - [ ] research / future
18
+
19
+ ## Surfaces
20
+
21
+ - [ ] Inspect
22
+ - [ ] Live
23
+ - [ ] Control
24
+ - [ ] gateway / runtime
25
+ - [ ] docs / devex
26
+
27
+ ## User Outcome
28
+
29
+ What becomes possible or easier after this lands?
30
+
31
+ ## Acceptance
32
+
33
+ How will we know the work is done?
34
+
35
+ ## Risks / Dependencies
36
+
37
+ What could block or complicate this?
38
+
@@ -0,0 +1,28 @@
1
+ ## Summary
2
+
3
+ - what changed
4
+ - why it changed
5
+
6
+ ## Area
7
+
8
+ - [ ] backend gateway
9
+ - [ ] zellij integration
10
+ - [ ] web frontend
11
+ - [ ] docs / devex
12
+ - [ ] tests / CI
13
+
14
+ ## Validation
15
+
16
+ - [ ] `npm run check:terminology`
17
+ - [ ] `npm run typecheck`
18
+ - [ ] `npm test`
19
+ - [ ] `npm run build`
20
+
21
+ ## Acceptance Notes
22
+
23
+ List the user-visible or maintainer-visible acceptance outcomes here.
24
+
25
+ ## Risk
26
+
27
+ Call out migration risk, compatibility risk, or follow-up work.
28
+
@@ -0,0 +1,33 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "monday"
8
+ time: "06:00"
9
+ timezone: "UTC"
10
+ open-pull-requests-limit: 10
11
+ labels:
12
+ - "dependencies"
13
+ commit-message:
14
+ prefix: "deps"
15
+ groups:
16
+ npm-patch-minor:
17
+ update-types:
18
+ - "minor"
19
+ - "patch"
20
+
21
+ - package-ecosystem: "github-actions"
22
+ directory: "/"
23
+ schedule:
24
+ interval: "weekly"
25
+ day: "monday"
26
+ time: "06:30"
27
+ timezone: "UTC"
28
+ open-pull-requests-limit: 5
29
+ labels:
30
+ - "dependencies"
31
+ - "ci"
32
+ commit-message:
33
+ prefix: "deps(ci)"
@@ -0,0 +1,65 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, main]
6
+ pull_request:
7
+ branches: [dev, main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version: [20, 22]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: pnpm/action-setup@v4
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+ cache: pnpm
22
+ - run: pnpm install --frozen-lockfile
23
+ - run: pnpm run build
24
+ - run: pnpm test
25
+
26
+ swift-test:
27
+ runs-on: macos-15
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ submodules: recursive
32
+ - run: cd packages/RemuxKit && swift build && swift test
33
+
34
+ # ── Dev prerelease: publish @dev tag on push to dev ──
35
+ prerelease:
36
+ if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
37
+ needs: test
38
+ runs-on: ubuntu-latest
39
+ permissions:
40
+ contents: read
41
+ id-token: write
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ - uses: pnpm/action-setup@v4
45
+ - uses: actions/setup-node@v4
46
+ with:
47
+ node-version: 22.x
48
+ registry-url: https://registry.npmjs.org
49
+ cache: pnpm
50
+ - run: pnpm install --frozen-lockfile
51
+ - run: pnpm run build
52
+
53
+ - name: Set prerelease version
54
+ run: |
55
+ BASE=$(node -p "require('./package.json').version")
56
+ SHA=$(git rev-parse --short HEAD)
57
+ PREID="${BASE}-dev.${SHA}"
58
+ npm version "$PREID" --no-git-tag-version
59
+ echo "Publishing @wangyaoshen/remux@${PREID} to @dev tag"
60
+
61
+ - name: Publish @dev
62
+ run: pnpm publish --access public --no-git-checks --tag dev
63
+ continue-on-error: true
64
+ env:
65
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,65 @@
1
+ name: Deploy
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ workflow_dispatch:
7
+ inputs:
8
+ branch:
9
+ description: "Branch to deploy (main or dev)"
10
+ required: true
11
+ default: "dev"
12
+ type: choice
13
+ options: [main, dev]
14
+
15
+ jobs:
16
+ deploy:
17
+ runs-on: [self-hosted, remux-deploy]
18
+ timeout-minutes: 10
19
+
20
+ steps:
21
+ - name: Resolve target
22
+ id: target
23
+ run: |
24
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
25
+ BRANCH="${{ inputs.branch }}"
26
+ else
27
+ BRANCH="${GITHUB_REF#refs/heads/}"
28
+ fi
29
+ echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
30
+ if [ "$BRANCH" = "main" ]; then
31
+ echo "app=remux-main" >> "$GITHUB_OUTPUT"
32
+ echo "worktree=$HOME/.remux/runtime-worktrees/runtime-main" >> "$GITHUB_OUTPUT"
33
+ else
34
+ echo "app=remux-dev" >> "$GITHUB_OUTPUT"
35
+ echo "worktree=$HOME/.remux/runtime-worktrees/runtime-dev" >> "$GITHUB_OUTPUT"
36
+ fi
37
+
38
+ - name: Pull latest code
39
+ working-directory: ${{ steps.target.outputs.worktree }}
40
+ run: |
41
+ git fetch origin ${{ steps.target.outputs.branch }}
42
+ git checkout --detach origin/${{ steps.target.outputs.branch }}
43
+
44
+ - name: Install dependencies
45
+ working-directory: ${{ steps.target.outputs.worktree }}
46
+ run: |
47
+ # Use the same Node.js that the launchd service runs (node@20)
48
+ # to ensure native modules (better-sqlite3, node-pty) are compiled
49
+ # for the correct NODE_MODULE_VERSION
50
+ export PATH="/opt/homebrew/opt/node@20/bin:$PATH"
51
+ node --version
52
+ pnpm install
53
+
54
+ - name: Build
55
+ working-directory: ${{ steps.target.outputs.worktree }}
56
+ run: |
57
+ export PATH="/opt/homebrew/opt/node@20/bin:$PATH"
58
+ pnpm run build
59
+
60
+ - name: Restart launchd service
61
+ run: |
62
+ SERVICE="com.remux.${{ steps.target.outputs.branch }}"
63
+ launchctl kickstart -k "gui/$(id -u)/${SERVICE}"
64
+ sleep 2
65
+ launchctl print "gui/$(id -u)/${SERVICE}" 2>&1 | head -5
@@ -0,0 +1,138 @@
1
+ name: Publish
2
+
3
+ # Triggered by release-please creating a tag, or manual tag push
4
+ on:
5
+ push:
6
+ tags: ['v[0-9]+.[0-9]+.[0-9]+']
7
+
8
+ jobs:
9
+ # ── npm publish (@latest) ────────────────────────────
10
+ npm:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ id-token: write
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: pnpm/action-setup@v4
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 22.x
21
+ registry-url: https://registry.npmjs.org
22
+ cache: pnpm
23
+ - run: pnpm install --frozen-lockfile
24
+ - run: pnpm run build
25
+ - run: pnpm test
26
+ - run: pnpm publish --access public --no-git-checks --provenance
27
+ env:
28
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29
+
30
+ # ── Docker image → ghcr.io ──────────────────────────
31
+ docker:
32
+ runs-on: ubuntu-latest
33
+ permissions:
34
+ contents: read
35
+ packages: write
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: docker/login-action@v3
39
+ with:
40
+ registry: ghcr.io
41
+ username: ${{ github.actor }}
42
+ password: ${{ secrets.GITHUB_TOKEN }}
43
+ - uses: docker/metadata-action@v5
44
+ id: meta
45
+ with:
46
+ images: ghcr.io/${{ github.repository }}
47
+ tags: |
48
+ type=semver,pattern={{version}}
49
+ type=semver,pattern={{major}}.{{minor}}
50
+ type=raw,value=latest
51
+ - uses: docker/build-push-action@v6
52
+ with:
53
+ context: .
54
+ push: true
55
+ tags: ${{ steps.meta.outputs.tags }}
56
+ labels: ${{ steps.meta.outputs.labels }}
57
+
58
+ # ── macOS app (.dmg) → GitHub Release ────────────────
59
+ macos:
60
+ runs-on: macos-15
61
+ permissions:
62
+ contents: write
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ with:
66
+ submodules: recursive
67
+
68
+ - name: Install Zig
69
+ uses: mlugg/setup-zig@v2
70
+ with:
71
+ version: 0.15.2
72
+
73
+ - name: Build GhosttyKit xcframework
74
+ run: |
75
+ cd vendor/ghostty
76
+ zig build -Demit-xcframework=true -Dxcframework-target=native -Doptimize=ReleaseFast
77
+
78
+ - name: Build macOS app (release)
79
+ run: |
80
+ cd apps/macos
81
+ swift build -c release
82
+
83
+ - name: Create .app bundle and DMG
84
+ run: |
85
+ TAG="${GITHUB_REF#refs/tags/}"
86
+ VERSION="${TAG#v}"
87
+ bash scripts/build-dmg.sh "$VERSION"
88
+
89
+ - name: Upload DMG to GitHub Release
90
+ env:
91
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92
+ run: |
93
+ TAG="${GITHUB_REF#refs/tags/}"
94
+ VERSION="${TAG#v}"
95
+ DMG="build/Remux-${VERSION}-arm64.dmg"
96
+ if [ -f "$DMG" ]; then
97
+ gh release upload "$TAG" "$DMG" --clobber
98
+ echo "✓ Uploaded $DMG to release $TAG"
99
+ else
100
+ echo "⚠ DMG not found, uploading .app as zip"
101
+ cd build && zip -r "Remux-${VERSION}-arm64.zip" Remux.app
102
+ gh release upload "$TAG" "Remux-${VERSION}-arm64.zip" --clobber
103
+ fi
104
+
105
+ # ── Update Homebrew tap ─────────────────────────────
106
+ homebrew:
107
+ needs: [npm, macos]
108
+ runs-on: ubuntu-latest
109
+ permissions:
110
+ contents: read
111
+ steps:
112
+ - uses: actions/checkout@v4
113
+
114
+ - name: Update Homebrew formula and cask
115
+ env:
116
+ GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
117
+ run: |
118
+ TAG="${GITHUB_REF#refs/tags/}"
119
+ VERSION="${TAG#v}"
120
+
121
+ git clone https://x-access-token:${GH_TOKEN}@github.com/yaoshenwang/homebrew-tap /tmp/tap
122
+ cd /tmp/tap
123
+
124
+ # Update cask version
125
+ sed -i "s/version \".*\"/version \"${VERSION}\"/" Casks/remux-app.rb
126
+
127
+ # Update formula URL
128
+ sed -i "s|remux-.*\.tgz|remux-${VERSION}.tgz|" Formula/remux.rb
129
+
130
+ # Compute sha256 for npm tarball
131
+ NPM_SHA=$(curl -sL "https://registry.npmjs.org/@wangyaoshen/remux/-/remux-${VERSION}.tgz" | sha256sum | cut -d' ' -f1)
132
+ sed -i "s/sha256 \".*\"/sha256 \"${NPM_SHA}\"/" Formula/remux.rb
133
+
134
+ git config user.name "github-actions[bot]"
135
+ git config user.email "github-actions[bot]@users.noreply.github.com"
136
+ git add -A
137
+ git diff --cached --quiet || git commit -m "Update to v${VERSION}"
138
+ git push origin main
@@ -0,0 +1,21 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release-please:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ release_created: ${{ steps.release.outputs.release_created }}
16
+ tag_name: ${{ steps.release.outputs.tag_name }}
17
+ steps:
18
+ - uses: googleapis/release-please-action@v4
19
+ id: release
20
+ with:
21
+ release-type: node
package/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "vendor/ghostty"]
2
+ path = vendor/ghostty
3
+ url = https://github.com/ghostty-org/ghostty.git
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 25
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.6"
3
+ }
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.