GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #13427 from developing-today/feat/desktop-commande… · developing-today/code@631976a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • desktop-commander-worker-promote.yml
    • desktop-commander-worker-publish.yml
    • desktop-commander-worker-tests.yml
  • home/common
    • default.nix
  • pkgs
    • desktop-commander/worker
      • README.md
      • cloudflare.config.ts
      • config.json
      • package-lock.json
      • package.json
      • promote.mjs
      • src
        • index.ts
      • test
        • proxy.test.ts
      • tsconfig.json
      • upload-version.mjs
      • verify-upload-run.mjs
      • vitest.config.ts
      • wrangler.toml
    • supergateway
      • default.nix
      • package-lock.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/desktop-commander-worker-promote.yml‎

Copy file name to clipboard
+70Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: desktop-commander worker promote
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
upload_run_id:
7+
description: Successful desktop-commander publish run ID
8+
required: true
9+
type: string
10+
upload_run_attempt:
11+
description: Successful upload attempt number
12+
required: true
13+
type: string
14+
confirm_promotion:
15+
description: Promote the exact uploaded version to 100 percent
16+
required: true
17+
type: boolean
18+
default: false
19+
20+
permissions:
21+
actions: read
22+
contents: read
23+
24+
concurrency:
25+
group: desktop-commander-worker-lifecycle
26+
cancel-in-progress: false
27+
28+
jobs:
29+
promote-version:
30+
if: github.ref == 'refs/heads/main' && inputs.confirm_promotion
31+
name: Verify and promote desktop-commander Worker Version
32+
runs-on: ubuntu-24.04
33+
timeout-minutes: 20
34+
environment: desktop-commander-production
35+
steps:
36+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
37+
with:
38+
persist-credentials: false
39+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
40+
with:
41+
node-version: 24.22.0
42+
cache: npm
43+
cache-dependency-path: pkgs/desktop-commander/worker/package-lock.json
44+
- name: Install pinned cf CLI
45+
working-directory: pkgs/desktop-commander/worker
46+
run: npm ci --no-audit --no-fund
47+
- name: Verify selected upload attempt
48+
working-directory: pkgs/desktop-commander/worker
49+
env:
50+
GITHUB_TOKEN: ${{ github.token }}
51+
GITHUB_REPOSITORY: ${{ github.repository }}
52+
UPLOAD_RUN_ID: ${{ inputs.upload_run_id }}
53+
UPLOAD_RUN_ATTEMPT: ${{ inputs.upload_run_attempt }}
54+
VERIFIED_UPLOAD_RUN_FILE: ${{ runner.temp }}/desktop-commander-worker-verified-run.json
55+
run: node verify-upload-run.mjs "$UPLOAD_RUN_ID" "$UPLOAD_RUN_ATTEMPT" "$VERIFIED_UPLOAD_RUN_FILE"
56+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
57+
with:
58+
name: desktop-commander-worker-upload-${{ inputs.upload_run_id }}-${{ inputs.upload_run_attempt }}
59+
path: ${{ runner.temp }}/desktop-commander-worker-provenance
60+
github-token: ${{ github.token }}
61+
repository: ${{ github.repository }}
62+
run-id: ${{ inputs.upload_run_id }}
63+
- name: Promote only the verified upload
64+
working-directory: pkgs/desktop-commander/worker
65+
env:
66+
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
67+
DC_WORKER_CF_TOKEN: ${{ secrets.DESKTOP_COMMANDER_WORKER_CF_TOKEN }}
68+
DC_WORKER_VERIFIED_RUN_FILE: ${{ runner.temp }}/desktop-commander-worker-verified-run.json
69+
GITHUB_REPOSITORY: ${{ github.repository }}
70+
run: node promote.mjs --manifest "${{ runner.temp }}/desktop-commander-worker-provenance/desktop-commander-worker-provenance.json" --promote
Collapse file

‎.github/workflows/desktop-commander-worker-publish.yml‎

Copy file name to clipboard
+83Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: desktop-commander worker publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
confirm_upload:
7+
description: Confirm upload of a desktop-commander Worker version from main
8+
required: true
9+
type: boolean
10+
default: false
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: desktop-commander-worker-lifecycle
17+
cancel-in-progress: false
18+
19+
jobs:
20+
publish-version:
21+
if: github.ref == 'refs/heads/main' && inputs.confirm_upload
22+
name: Upload desktop-commander Worker Version
23+
runs-on: ubuntu-24.04
24+
timeout-minutes: 15
25+
environment: desktop-commander-production
26+
steps:
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
with:
29+
persist-credentials: false
30+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
31+
with:
32+
node-version: 24.22.0
33+
cache: npm
34+
cache-dependency-path: pkgs/desktop-commander/worker/package-lock.json
35+
- name: Install pinned cf CLI
36+
working-directory: pkgs/desktop-commander/worker
37+
run: npm ci --no-audit --no-fund
38+
- name: Run Worker tests
39+
working-directory: pkgs/desktop-commander/worker
40+
run: npm test
41+
- name: Validate Worker build without credentials
42+
working-directory: pkgs/desktop-commander/worker
43+
env:
44+
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
45+
GITHUB_SHA: ${{ github.sha }}
46+
run: node upload-version.mjs --dry-run
47+
- name: Stage bridge-door secrets file
48+
env:
49+
BRIDGE_ACCESS_CLIENT_ID: ${{ secrets.BRIDGE_ACCESS_CLIENT_ID }}
50+
BRIDGE_ACCESS_CLIENT_SECRET: ${{ secrets.BRIDGE_ACCESS_CLIENT_SECRET }}
51+
run: |
52+
umask 077
53+
python3 - "$RUNNER_TEMP/desktop-commander-secrets.json" <<'PY'
54+
import json, os, sys
55+
data = {
56+
"ACCESS_CLIENT_ID": os.environ["BRIDGE_ACCESS_CLIENT_ID"],
57+
"ACCESS_CLIENT_SECRET": os.environ["BRIDGE_ACCESS_CLIENT_SECRET"],
58+
}
59+
if not all(data.values()):
60+
raise SystemExit("bridge Access secrets are empty")
61+
with open(sys.argv[1], "w") as f:
62+
json.dump(data, f)
63+
PY
64+
- name: Upload Worker Version and capture provenance
65+
working-directory: pkgs/desktop-commander/worker
66+
env:
67+
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
68+
DC_WORKER_CF_TOKEN: ${{ secrets.DESKTOP_COMMANDER_WORKER_CF_TOKEN }}
69+
DC_WORKER_SECRETS_FILE: ${{ runner.temp }}/desktop-commander-secrets.json
70+
DC_WORKER_PROVENANCE_FILE: ${{ runner.temp }}/desktop-commander-worker-provenance.json
71+
GITHUB_EVENT_NAME: ${{ github.event_name }}
72+
GITHUB_REF: ${{ github.ref }}
73+
GITHUB_REPOSITORY: ${{ github.repository }}
74+
GITHUB_RUN_ID: ${{ github.run_id }}
75+
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
76+
GITHUB_SHA: ${{ github.sha }}
77+
run: node upload-version.mjs
78+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
79+
with:
80+
name: desktop-commander-worker-upload-${{ github.run_id }}-${{ github.run_attempt }}
81+
path: ${{ runner.temp }}/desktop-commander-worker-provenance.json
82+
if-no-files-found: error
83+
retention-days: 90
Collapse file

‎.github/workflows/desktop-commander-worker-tests.yml‎

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: desktop-commander worker tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "pkgs/desktop-commander/worker/**"
8+
- ".github/workflows/desktop-commander-worker-tests.yml"
9+
pull_request:
10+
paths:
11+
- "pkgs/desktop-commander/worker/**"
12+
- ".github/workflows/desktop-commander-worker-tests.yml"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
test:
19+
name: Worker tests and typecheck
20+
runs-on: ubuntu-24.04
21+
timeout-minutes: 10
22+
steps:
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
24+
with:
25+
persist-credentials: false
26+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
27+
with:
28+
node-version: 24.22.0
29+
cache: npm
30+
cache-dependency-path: pkgs/desktop-commander/worker/package-lock.json
31+
- name: Install dependencies
32+
working-directory: pkgs/desktop-commander/worker
33+
run: npm ci --no-audit --no-fund
34+
- name: Run Worker tests
35+
working-directory: pkgs/desktop-commander/worker
36+
run: npm test
37+
- name: Typecheck
38+
working-directory: pkgs/desktop-commander/worker
39+
run: npm run typecheck
Collapse file

‎home/common/default.nix‎

Copy file name to clipboardExpand all lines: home/common/default.nix
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ let
136136
# Commander" plugin. See pkgs/desktop-commander for the packaging; the
137137
# desktop-commander-remote unit below keeps the device agent online.
138138
desktop-commander = pkgs.callPackage ../../pkgs/desktop-commander { };
139+
# supergateway: the stdio <-> streamable-HTTP bridge that fronts the
140+
# packaged Desktop Commander for the self-hosted endpoint (#13404).
141+
# See pkgs/supergateway; the desktop-commander-bridge unit below runs it.
142+
supergateway = pkgs.callPackage ../../pkgs/supergateway { };
139143
# Hidden-shell auth hook (1Password service account, Cloudflare).
140144
# Same derivation nixos/agent-auth uses, so the BASH_ENV paths agree.
141145
agent-shell-env = pkgs.callPackage ../../pkgs/agent-shell-env { };
@@ -1069,6 +1073,37 @@ in
10691073
Install.WantedBy = [ "default.target" ];
10701074
};
10711075

1076+
# Self-hosted Desktop Commander endpoint (#13404): the local half of
1077+
# commander.security.cab. supergateway wraps the packaged Desktop
1078+
# Commander (stdio) as a streamable-HTTP MCP server on
1079+
# 127.0.0.1:8931/mcp; the sandbox-link Cloudflare Tunnel carries it to
1080+
# the bridge door (commander-link.security.cab, Access service-token
1081+
# only), where the desktop-commander Worker picks it up. This unit
1082+
# replaces nothing: the vendor device agent above stays until the
1083+
# self-hosted endpoint is verified and is stood down separately.
1084+
#
1085+
# PATH matters for the same reason it does in
1086+
# desktop-commander-remote above: the wrapped server exists to run
1087+
# arbitrary user commands, so it needs the real user PATH.
1088+
systemd.user.services.desktop-commander-bridge = {
1089+
Unit = {
1090+
Description = "Desktop Commander local MCP bridge (stdio to streamable HTTP, 127.0.0.1:8931)";
1091+
After = [ "network-online.target" ];
1092+
Wants = [ "network-online.target" ];
1093+
};
1094+
Service = {
1095+
ExecStart = toString (
1096+
pkgs.writeShellScript "desktop-commander-bridge-start"
1097+
export PATH="/run/current-system/sw/bin:/run/wrappers/bin:/etc/profiles/per-user/$USER/bin:$HOME/.nix-profile/bin:$PATH"
1098+
exec ${supergateway}/bin/supergateway --stdio ${desktop-commander}/bin/desktop-commander --outputTransport streamableHttp --streamableHttpPath /mcp --port 8931 --host 127.0.0.1 --stateful --healthEndpoint /healthz --logFormat json
1099+
1100+
);
1101+
Restart = "on-failure";
1102+
RestartSec = 5;
1103+
};
1104+
Install.WantedBy = [ "default.target" ];
1105+
};
1106+
10721107
# ── Service cascade (2026-11-03) ─────────────────────────────────
10731108
# The three standing services are defined by the fleet's layered
10741109
# modules now, not by hand-rolled units in this file:
Collapse file

‎pkgs/desktop-commander/worker/README.md‎

Copy file name to clipboard
+77Lines changed: 77 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# desktop-commander Worker — self-hosted MCP endpoint (#13404)
2+
3+
The self-hosted replacement for the vendor's metered Remote Desktop
4+
Commander relay. The vendor's hosted plan meters tool calls (free tier
5+
10,000/month, Pro $20/month); this endpoint has no meter and keeps the
6+
whole path inside the fleet's own Cloudflare account and hardware.
7+
8+
## Path of a request
9+
10+
```
11+
AI client
12+
-> POST https://commander.security.cab/mcp
13+
Access app "desktop-commander": owner Google identity (the IdP
14+
wired under #12412 with the client saved under #12417), or the
15+
"desktop-commander" service token for machine clients.
16+
-> this Worker (src/index.ts): refuses requests without an Access
17+
JWT assertion, then proxies the streamable-HTTP MCP request,
18+
swapping the caller's Access material for its own egress token.
19+
-> https://commander-link.security.cab/mcp
20+
Access app "desktop-commander link (bridge)": service-token-only
21+
policy (the atlas-search pattern).
22+
-> sandbox-link Cloudflare Tunnel -> http://localhost:8931 on amd
23+
-> supergateway (systemd user unit desktop-commander-bridge,
24+
pkgs/supergateway) in streamable-HTTP mode
25+
-> the packaged Desktop Commander (pkgs/desktop-commander, stdio)
26+
```
27+
28+
`workers_dev` is off; `commander.security.cab` (a Worker custom
29+
domain) is the only public door.
30+
31+
## Secrets — by name only, never values
32+
33+
| Where | Name |
34+
| --- | --- |
35+
| fleet secrets (Bitwarden) | `cloudflare.access.desktop-commander-link-client-id` / `-client-secret` — bridge-door token the Worker presents |
36+
| fleet secrets (Bitwarden) | `cloudflare.access.desktop-commander-client-id` / `-client-secret` — public-door token for machine MCP clients |
37+
| fleet secrets (Bitwarden) | `cloudflare.api-token-desktop-commander-worker` — scoped deploy token |
38+
| GitHub environment `desktop-commander-production` | `DESKTOP_COMMANDER_WORKER_CF_TOKEN` (same deploy token), `BRIDGE_ACCESS_CLIENT_ID`, `BRIDGE_ACCESS_CLIENT_SECRET` |
39+
| Worker version secrets | `ACCESS_CLIENT_ID`, `ACCESS_CLIENT_SECRET` — uploaded per version by the publish workflow from the environment secrets |
40+
41+
## Deploys — cf version deployments via GitHub Actions
42+
43+
Modeled on the id-mail publisher/promoter pair:
44+
45+
1. **Publish** (`desktop-commander-worker-publish.yml`, manual dispatch
46+
on main, `confirm_upload`): tests, a credential-free dry run, then
47+
`upload-version.mjs` runs `cf workers versions create` with the
48+
bridge secrets file. Uploading changes no traffic. The run emits a
49+
provenance artifact naming the exact version, tag, and baseline.
50+
2. **Promote** (`desktop-commander-worker-promote.yml`, manual dispatch
51+
with the publish run id + attempt, `confirm_promotion`):
52+
`verify-upload-run.mjs` vouches the run was a successful manual
53+
publish on main, then `promote.mjs` checks the live deployment
54+
still matches the manifest baseline and creates a deployment with
55+
exactly that version at 100%.
56+
57+
Tests (`desktop-commander-worker-tests.yml`) run on pushes and PRs
58+
touching this directory.
59+
60+
## Laptop side
61+
62+
- `desktop-commander-bridge.service` (user unit; defined in
63+
`home/common/default.nix` next to `desktop-commander-remote`):
64+
supergateway wrapping the packaged Desktop Commander on
65+
`127.0.0.1:8931`, path `/mcp`, stateful sessions, `/healthz` for
66+
gateway health.
67+
- The vendor device agent (`desktop-commander-remote.service`) stays
68+
running until this endpoint is verified end to end; standing it down
69+
is a separate recorded step.
70+
71+
## Client setup
72+
73+
- Header-capable clients (Claude Code, Cursor, mcpx): send
74+
`CF-Access-Client-Id` / `CF-Access-Client-Secret` with the
75+
public-door token values.
76+
- Browser clients: sign in with the owner's Google identity at the
77+
Access prompt.
Collapse file

‎pkgs/desktop-commander/worker/cloudflare.config.ts‎

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { bindings, defineConfig } from "cf/config";
2+
import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };
3+
4+
// desktop-commander Worker — deployment source of truth for the cf
5+
// versions flow (see README.md). Mirrors wrangler.toml, kept in step
6+
// as the human-readable config record. The Worker's secrets
7+
// (ACCESS_CLIENT_ID, ACCESS_CLIENT_SECRET) are never here: fleet
8+
// secrets hold them by name, and a publish uploads them with the new
9+
// version (cf workers versions create --secrets-file) so no version
10+
// ever deploys without its bridge credentials.
11+
export default defineConfig({
12+
worker: {
13+
name: "desktop-commander",
14+
compatibilityDate: "2025-09-15",
15+
entrypoint,
16+
env: {
17+
BRIDGE_BASE: bindings.text("https://commander-link.security.cab"),
18+
},
19+
},
20+
});
Collapse file

‎pkgs/desktop-commander/worker/config.json‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"compatibilityDate":"2025-09-15","routes":["commander.security.cab"],"worker":"desktop-commander","workersDev":false}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.