Add /orbit: hand the Loom CLI session off to the Orbit desktop app#141
Open
dannon wants to merge 12 commits into
Open
Add /orbit: hand the Loom CLI session off to the Orbit desktop app#141dannon wants to merge 12 commits into
dannon wants to merge 12 commits into
Conversation
The extension API exposes ctx.cwd as the session's working directory, which is the right contract -- process.cwd() reads the shell's current dir and could drift if the user cd's mid-session.
The bundle is Orbit.app, but forge.config sets executableName: "orbit", so the inner binary (and CFBundleExecutable) is lowercase. The darwin candidates pointed at .../MacOS/Orbit, which never exists on a real install, so /orbit always reported "not installed" on macOS. Verified against the built Orbit.app.
…rbit The brain (extensions/loom/) was carrying Orbit-specific knowledge -- install paths, the .app bundle layout, the --cwd launch protocol, ORBIT_BIN, the release URL -- which breaks the shell-neutral rule. Pulled all of it into a sibling pi extension, extensions/orbit-handoff/, that owns the launcher and the /orbit command; bin/loom.js loads it via -e the same way it loads the brain. A sibling extension (not bin/ or shared/) keeps it inside the typecheck scope while staying out of the brain. Also fixes the session-kill bug: bin/loom.js is also Orbit's embedded brain, so /orbit could fire there and shut the embedded session down. The handler now no-ops with a notice when LOOM_SHELL_KIND is "orbit". Test covers that guard.
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.
/orbitlets someone who started innpx @galaxyproject/loompop the same analysis open in Orbit with one keystroke -- same cwd, same notebook, richer view. The CLI shuts down gracefully (its session-shutdown lifecycle writes the notebook summary first) and Orbit resumes that cwd, so there are never two brains writing one session.How it works:
findOrbit()locates an installed Orbit (ORBIT_BINoverride, then platform-conventional paths);launchOrbit()spawns it detached with--cwd <cwd>and unrefs so the CLI can exit./orbitcommand glues those together: launch + graceful shutdown, or a "not installed -- grab a release" message with the URL.--cwd <path>(aboveLOOM_CWD) plus a single-instance lock, so a secondOrbit --cwd Xhands its argv to the running instance, which switches the analysis dir behind a confirm dialog instead of opening a second window.v1 launches an already-installed Orbit; auto-installing from the release feed when it's missing is a deferred follow-up. Discovery is unit-tested per platform; the launch/handoff itself is observation-only (manual macOS smoke still to do).
Note: the macOS binary inside
Orbit.appis lowercaseorbit(forge'sexecutableName), verified against the built app -- the discovery paths reflect that.