|
134 | 134 | t3code = pkgs.callPackage ../../pkgs/t3code-desktop { }; |
135 | 135 | # Desktop Commander MCP: the local half of OpenAI's "Remote Desktop |
136 | 136 | # Commander" plugin. See pkgs/desktop-commander for the packaging; the |
137 | | - # desktop-commander-remote unit below keeps the device agent online. |
| 137 | + # bridge unit below runs it for the self-hosted endpoint. |
138 | 138 | desktop-commander = pkgs.callPackage ../../pkgs/desktop-commander { }; |
139 | 139 | # supergateway: the stdio <-> streamable-HTTP bridge that fronts the |
140 | 140 | # packaged Desktop Commander for the self-hosted endpoint (#13404). |
@@ -1029,62 +1029,17 @@ in |
1029 | 1029 | Install.WantedBy = [ "timers.target" ]; |
1030 | 1030 | }; |
1031 | 1031 |
|
1032 | | - # Desktop Commander's Remote Device: the local half of OpenAI's "Remote |
1033 | | - # Desktop Commander" plugin. The hosted Remote MCP at |
1034 | | - # mcp.desktopcommander.app forwards tool calls to this process, which drives |
1035 | | - # the local Desktop Commander MCP server under the user's own permissions. |
1036 | | - # Installing the plugin itself is a ChatGPT/Codex action and cannot be done |
1037 | | - # by a NixOS unit; what this unit buys is that the device is online whenever |
1038 | | - # the user session is, rather than living in a stray terminal. |
1039 | | - # |
1040 | | - # FIRST RUN IS INTERACTIVE. `remote` starts an OAuth device flow and prints a |
1041 | | - # verification URL and code, so the unit only pairs unattended once a session |
1042 | | - # has been stored. Watch it with: |
1043 | | - # journalctl --user -u desktop-commander-remote -f |
1044 | | - # and approve at mcp.desktopcommander.app. The session is saved to |
1045 | | - # ~/.desktop-commander-device/device.json (0600) and reused on restart. |
1046 | | - # |
1047 | | - # PATH matters for the same reason it does in t3code below: a systemd user |
1048 | | - # unit does not inherit the login shell's PATH, and Desktop Commander exists |
1049 | | - # to run arbitrary user commands, so it needs the real one. Sourcing the |
1050 | | - # profiles is deliberately broader than a makeBinPath list -- a curated set |
1051 | | - # would silently hide most of what the remote shell is meant to reach. The |
1052 | | - # agent's own ripgrep is already on its wrapped PATH from the derivation. |
1053 | | - systemd.user.services.desktop-commander-remote = { |
1054 | | - Unit = { |
1055 | | - Description = "Desktop Commander Remote MCP device agent"; |
1056 | | - Documentation = "https://mcp.desktopcommander.app"; |
1057 | | - After = [ "network-online.target" ]; |
1058 | | - Wants = [ "network-online.target" ]; |
1059 | | - }; |
1060 | | - Service = { |
1061 | | - ExecStart = toString ( |
1062 | | - pkgs.writeShellScript "desktop-commander-remote-start" '' |
1063 | | - export PATH="/run/current-system/sw/bin:/run/wrappers/bin:/etc/profiles/per-user/$USER/bin:$HOME/.nix-profile/bin:$PATH" |
1064 | | - exec ${desktop-commander}/bin/desktop-commander remote |
1065 | | - '' |
1066 | | - ); |
1067 | | - # The device reconnects after a network blip on its own, so only a crash |
1068 | | - # or a revoked authorization should take the unit down: on-failure, with |
1069 | | - # a slow restart so a failing OAuth flow cannot spin. |
1070 | | - Restart = "on-failure"; |
1071 | | - RestartSec = 15; |
1072 | | - }; |
1073 | | - Install.WantedBy = [ "default.target" ]; |
1074 | | - }; |
1075 | | - |
1076 | 1032 | # Self-hosted Desktop Commander endpoint (#13404): the local half of |
1077 | 1033 | # commander.security.cab. supergateway wraps the packaged Desktop |
1078 | 1034 | # Commander (stdio) as a streamable-HTTP MCP server on |
1079 | 1035 | # 127.0.0.1:8931/mcp; the sandbox-link Cloudflare Tunnel carries it to |
1080 | 1036 | # 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. |
| 1037 | + # only), where the desktop-commander Worker picks it up. This is the only |
| 1038 | + # Desktop Commander unit: the vendor device agent (desktop-commander-remote) |
| 1039 | + # was stood down once the self-hosted endpoint soaked. |
1084 | 1040 | # |
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. |
| 1041 | + # PATH matters because the wrapped server exists to run arbitrary user |
| 1042 | + # commands, so it needs the real user PATH. |
1088 | 1043 | systemd.user.services.desktop-commander-bridge = { |
1089 | 1044 | Unit = { |
1090 | 1045 | Description = "Desktop Commander local MCP bridge (stdio to streamable HTTP, 127.0.0.1:8931)"; |
|