Repository navigation
feat: switchboard mode (dial openab-sb /vm/attach) - #53
Merged
Merged
Conversation
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.
Closes #52.
Summary
oab-instance-mcp --switchboard wss://…/vm/attach --switchboard-secret-file <path> [--switchboard-profile observe|desktop|owner]dials an openab-sb switchboard and serves this computer's tools on that socket. The switchboard's callers (Connect, agents, and later Muse, openab-sb#3) can then reach a Mac that only dials out.The change reuses
ReverseAttachClient, which already spoke the same plain-MCP-over-WS. A newKind(.openabPty, the default and unchanged, or.switchboard) selects what differs between the two modes:/tools/attach/{session}waitForCredentials)Other changes:
--switchboard-secret-fileon every dial, so rotating it is a file write.Sources/InstanceMCPCore/Switchboard.swiftholds three things:wss://, orws://to loopback only; the path must end in/vm/attach.observe, and the switchboard's per-caller allowlist applies on top.Terminal.secretRevokedadds thesecret_revokedlabel.Tested (macmini, macOS 15.7)
swift test: 136/136 pass. 14 of them are new inSwitchboardTests.swift: policy, URL validation, instructions, secret re-read, and end to end against a fake switchboard (4003 stop, 4002 stop, 4005 redial, no deadline).Mutation check: each of these breaks at least one new test:
/tools/attachThe last one first survived because the test called the helper directly; it now asserts on the dial request's
Authorizationheader.Live, release build against a real
openab-sb(18/18):observe:tools/list= sys_info, screenshot, vm_status;sys_infoworks;execis refused.desktop+ Playwright upstream: there is noexec*,browser_navigateto example.com works, andbrowser_snapshotsees "Example Domain".SIGHUPgives 4003; the attach stops and the HTTP endpoint keeps serving.redial in 243s, with exactly one auth failure in the switchboard audit.Flag validation:
ws://to a tailnet IP and a secret file without--switchboardboth exit 64 with a message.Not tested
screenshotthrough the switchboard returned the TCC error, because the test binary was unsigned. The relay of that tool error was verified, but not an actual image.wss://from this daemon. Thewsspath throughtailscale servewas verified with openab-sb's Python reference daemon, not this binary.