Skip to content

Commit 6f98ee7

Browse files
Merge pull request #9 from crimsonsunset/dev-rebased
feat: land fork on main — machine-scoped routing, web admin, remote MCP
2 parents b66cd02 + 0d784c8 commit 6f98ee7

483 files changed

Lines changed: 64430 additions & 10947 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copy to `.env` in the repo root (gitignored). Used by remote tunnel smoke scripts
2+
# and Playwright admin tests — never commit real values.
3+
4+
# Cloudflare Access service token (Zero Trust → Access → Service Auth)
5+
MCPMUX_CF_ACCESS_CLIENT_ID=
6+
MCPMUX_CF_ACCESS_CLIENT_SECRET=
7+
8+
# Optional tunnel hostnames for `pnpm remote:smoke`
9+
MCPMUX_REMOTE_GATEWAY_URL=https://mcp.example.com
10+
MCPMUX_REMOTE_ADMIN_URL=https://mux.example.com
11+
12+
# Playwright admin parity against loopback admin with CF trust enabled
13+
# MCPMUX_ADMIN_CF_JWT=
14+
# MCPMUX_ADMIN_CF_TRUST_ENABLED=1
15+
# MCPMUX_ADMIN_BASE_URL=http://localhost:45819

.github/actions/install-linux-deps/action.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,30 @@ runs:
1313
using: composite
1414
steps:
1515
# Cache apt packages to avoid re-downloading on every run
16+
# The runner image ships an apt index from its build date, and
17+
# cache-apt-pkgs-action's own refresh (update_apt_lists_if_stale) is a
18+
# no-op outside nektos/act -- it guards on ACT=true. A stale index names
19+
# .debs that Ubuntu has since superseded and dropped from the pool, so the
20+
# install 404s; the action then caches the empty result instead of failing,
21+
# and every later run restores that as a hit and skips installing at all.
22+
- name: Refresh apt lists
23+
shell: bash
24+
run: sudo apt-get update
25+
26+
# Pinned to a SHA: `@latest` is a moving tag, so a broken upstream release
27+
# (e.g. v1.6.2) would otherwise roll straight into CI unreviewed.
1628
- name: Cache apt packages (base)
17-
uses: awalsh128/cache-apt-pkgs-action@latest
29+
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
1830
with:
1931
packages: build-essential pkg-config libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev libfuse2
20-
version: 1.1
32+
version: 1.2
2133

2234
- name: Cache apt packages (E2E)
2335
if: ${{ inputs.e2e == 'true' }}
24-
uses: awalsh128/cache-apt-pkgs-action@latest
36+
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
2537
with:
2638
packages: webkit2gtk-driver xvfb gnome-keyring gsettings-desktop-schemas dbus-x11 at-spi2-core libglib2.0-bin libwayland-server0 libwayland-client0
27-
version: 1.3
39+
version: 1.4
2840

2941
# Compile gsettings schemas (required after restore from cache)
3042
- name: Compile gsettings schemas

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ permissions:
1717
actions: read
1818
checks: write
1919
pull-requests: write
20+
id-token: write
2021

2122
env:
2223
CARGO_TERM_COLOR: always

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+
# prompt: 'Update the pull request description to include a summary of changes.'
45+
46+
# Optional: Add claude_args to customize behavior and configuration
47+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+
# or https://code.claude.com/docs/en/cli-reference for available options
49+
# claude_args: '--allowed-tools Bash(gh pr *)'
50+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ coverage/
6060
# Test reports & assets
6161
test-results/
6262
playwright-report/
63+
.playwright-mcp/
6364
blob-report/
6465
html-report/
6566
tests/e2e/reports/
@@ -92,3 +93,6 @@ apps/desktop/src-tauri/target/release/bundle/
9293
debug/
9394
*.dSYM/
9495

96+
97+
# Cursor rules — symlinked from ~/.cursor/rules/projects/
98+
.cursor/rules/

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"rust-analyzer.rustfmt.extraArgs": [
77
"+nightly"
88
],
9+
"rust-analyzer.cargo.targetDir": true,
910
"files.eol": "\n",
1011
"files.insertFinalNewline": true,
1112
"files.trimTrailingWhitespace": true,

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Run everything from `mcp-mux/`:
3232
| `pnpm setup` | First-time dev environment setup (PowerShell on Windows). |
3333
| `pnpm dev` | Tauri desktop dev mode (Rust + React hot-reload). |
3434
| `pnpm dev:web` | Web UI only via Vite — no Rust, no Tauri shell. |
35+
| `pnpm dev:admin` | Full stack + web admin: `tauri dev` with admin enabled, opens browser at `:1420` once the gateway is stable. Primary dev driver. |
36+
| `pnpm dev:web:admin` | Browser-only admin UI; auto-starts the backend detached if it isn't already up. |
37+
| `pnpm dev:stop` | Quit McpMux.app and free the dev ports (`:1420`, `:45818`, `:45819`). |
38+
| `pnpm dev:rebuild` | Force `cargo build --workspace` (debug) without launching — recovery for stale binaries. |
3539
| `pnpm build` | Production Tauri build for the current platform. |
3640
| `pnpm validate` | Full correctness gate — runs the items below in sequence. |
3741
| `pnpm lint` | ESLint (recursive) + `cargo clippy --workspace -- -D warnings`. |
@@ -40,6 +44,8 @@ Run everything from `mcp-mux/`:
4044
| `pnpm format:check` | Formatting check (no writes). |
4145
| `pnpm typecheck` | Recursive TypeScript typecheck. |
4246

47+
**Hot-reload while developing:** `pnpm dev:admin` keeps the desktop window, the `:1420` browser tab (Vite HMR), and the CF tunnel / `:45819` static UI in sync. TS/CSS changes hot-reload instantly on `:1420`; the same edits trigger `vite build --watch` to rebuild `apps/desktop/dist/` for `:45819` and remote tunnel tabs (hard-refresh those after each rebuild, ~10s). Rust changes in any workspace crate trigger `tauri dev` to recompile and restart the backend automatically. Rust is compiled, so "auto-reload" means recompile + process restart, not live patching. After a stalled restart, orphaned backend, or stale binary, recover with `pnpm dev:stop && pnpm dev:rebuild && pnpm dev:admin`. The repo's `.vscode/settings.json` sets `rust-analyzer.cargo.targetDir` so the editor's `cargo check` doesn't fight `tauri dev` over `target/` (avoids double compiles). When `.env` carries CF Access credentials the admin runs with `cf_access=true`; the dev scripts' health probes send `adminCfProbeHeaders()` so `/api/v1/health` doesn't 401. One-off production bundle: `pnpm build:web:admin`.
48+
4349
**Before claiming a change is done**, run `pnpm validate` (or the relevant subset) — it mirrors what CI enforces.
4450

4551
## Testing

0 commit comments

Comments
 (0)