th-c8816b: Big Smooth desktop — connect to a remote daemon over the tailnet - #334
Merged
Conversation
Tray gains a Connect submenu: 'This Mac (local)' + Big Smooth daemons discovered on the Tailscale tailnet (e.g. smoo-hub). A remote daemon serves its own token-injected SPA, so attaching = loading its tailnet URL; nothing is passed by the client. - discovery.ts: shell `tailscale status --json`, enumerate online peers, probe each on :443/:8443 for the ungated /health + /api/auth/status. - daemon.ts: SMOOTH_REMOTE_URL drives baseUrl(); startDaemon() skips the spawn in remote mode (never spawns/kills a local daemon). +3 tests. - config.ts: persist the chosen target in userData/config.json. - main.ts: set the target from config at startup, build the Connect submenu, relaunch on switch, and offer a one-click fall-back to local if the remote is unreachable (instead of stranding the window). Set Up (TCC) hidden when remote. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L3xMBWMtMRNayBC2GjHntk
🦋 Changeset detectedLatest commit: dc60e28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… /health Tested against live smoo-hub: :443 runs the SmooHub dashboard (also 200 on /health, serves SPA HTML at /api/auth/status) while the daemon is on :8443. /health alone would mis-identify the dashboard as a daemon. Now require /api/auth/status to parse as JSON with a `loggedIn` boolean (the daemon's shape). Also fixes the field casing: the daemon returns camelCase loggedIn/orgId, not snake_case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L3xMBWMtMRNayBC2GjHntk
…(carrying its daemon) to a remote Mac The app is the install package: one bundle = GUI + the daemon it manages. ditto-packs the .app, ships it, boots out the old standalone-daemon LaunchAgents (com.smooai.smooth-daemon + com.smooai.smooth/th-up), backs up + swaps the app, and installs a keep-alive LaunchAgent that launches the app with the ports that dodge the SmooHub dashboard (:8788 local + :8443 serve) and the SAME operator.db + workspace so history carries over. Verified live on smoo-hub: Electron app + its daemon child running, /api/stats = 243 conversations, survives reboot, dashboard untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L3xMBWMtMRNayBC2GjHntk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Electron app could only talk to its bundled local daemon. Now the tray has a Connect submenu:
smoo-hub, shown with its signed-in Smoo identityPick one and the window attaches to it. The title shows which (
Big Smooth — smoo-hub).Why it's simple
A remote daemon serves its own SPA with its own token injected (
web_router_with_token), so pointing the window at the remote's tailnet URL is a complete, authenticated connection — nothing is passed by the client, exactly like the browser PWA.How
discovery.ts— shellstailscale status --json, enumerates online peers, probes each on :443 and :8443 (the smoo-hub coexistence port) for the ungated/health(is a daemon here?) +/api/auth/status(whose daemon).daemon.ts—SMOOTH_REMOTE_URLdrivesbaseUrl();startDaemon()skips the spawn in remote mode, so the app never spawns or kills a local daemon while attached to a remote one. +3 unit tests.config.ts— persists the chosen target inuserData/config.json.main.ts— reads the target at startup, builds the Connect submenu (radio-checked to the active one, with Refresh), relaunches on switch, and if the remote is unreachable offers a one-click "Switch to This Mac" instead of stranding the window. TheSet Up(macOS TCC) submenu hides when remote, since those grants are the local daemon's.Verification
pnpm typecheckclean,oxlintclean,oxfmtformatted.pnpm test— 4/4 pass (2 new: remote-URL override + trailing-slash trim; local fallback).Note
This is Electron-app code (in
app.asar), so it needs a full desktop rebuild to appear in the installed app —pnpm install:bigsmoothonly swaps the daemon binary. Follow-up: teachinstall:bigsmoothto also refresh the app bundle.🤖 Generated with Claude Code