feat(studio-desktop): Electron shell — Phase 1 (scaffold → buildable app)#144
Open
Necmttn wants to merge 6 commits into
Open
feat(studio-desktop): Electron shell — Phase 1 (scaffold → buildable app)#144Necmttn wants to merge 6 commits into
Necmttn wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add DesktopLifecycle (DesktopShutdown deferred backbone + before-quit/ activate/window-all-closed/SIGINT/SIGTERM wiring + relaunch) and DesktopWindow (ax:// studio loading, external-link routing, nav-deny). Theme sync dropped for v0. Adds DesktopEnvironment.preloadPath derived from the bundled main dirname. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the main-process integration for the Electron studio shell:
- preload.ts: minimal contextBridge exposing axDesktop marker
(studio<->daemon is HTTP, so no IPC surface needed).
- app/DesktopApp.ts: boot program (Effect). Waits for app ready,
registers the ax:// protocol in prod, installs the app menu, wires
lifecycle listeners, then opens the window against a manually-running
daemon via DesktopWindow.handleBackendReady. Phase 2 replaces that
direct call with AxBackendManager.start driving readiness.
- main.ts: builds DesktopEnvironment input from electron/process/os,
composes electron + foundation + window layers, provides platform
deps (NodeServices = FileSystem+Path, NodeHttpClient.layerUndici),
applies scheme privileges eagerly before app ready, and runs via
NodeRuntime.runMain.
bun run build:main emits dist-electron/{main,preload}.cjs with electron
left external and effect bundled inline. Typecheck passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying ax with
|
| Latest commit: |
bbc17b5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a53d44db.ax-62d.pages.dev |
| Branch Preview URL: | https://feat-studio-desktop.ax-62d.pages.dev |
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.
Phase 1 of the studio-desktop plan (#139). Standalone Electron shell (Effect v4 +
@effect/platform-node, mirroring.references/t3code/apps/desktop) that renders the@ax/studioSPA via a customax://protocol pointed at the local daemon. Stacked on #143 (Phase 0) — base isfeat/studio-extract; retarget tomainafter #143 merges.Built task-by-task via subagent-driven-development (implementer per task; two-stage review; code-quality review over the full phase = approved).
What's here (
apps/studio-desktop)tsdownCJS build (dist-electron/{main,preload}.cjs; electron external, effect bundled)DesktopState,DesktopEnvironment,DesktopObservability(OTLP dropped → console logger + rotating file)ElectronApp/Window/Protocol/Menu/Shell(schemeax; traversal guard + scheme-privileges preserved)DesktopLifecycle(before-quit/activate/SIGINT/SIGTERM/Deferred shutdown) +DesktopWindow(loads studio dev-server in dev /ax://studio/index.html?endpoint=…in prod;setWindowOpenHandlerdeny + external routing)main.tslayer composition + minimalpreload.ts+DesktopAppboot programVerified
bun run build(studiodist-desktop+dist-electron): ✓bun --filter @ax/studio-desktop typecheck+ rootbun run typecheck: exit 0webPreferences(contextIsolation/no-nodeIntegration/sandbox) + window-open deny correct, Effect layer composition delivers FileSystem/Path/HttpClient correctly, lifecycle signals intactNOT verified here (needs a human on a Mac)
Task 1.6 — GUI launch can't run in this headless environment. To verify:
Tracked hardening (v0 pass, not blocking)
will-navigatetop-level-nav guard (port t3code's same-origin check) — bounded UI-redress, no RCE under sandboxregisterFileProtocol→protocol.handleNext: Phase 2 (two-process supervisor: surreal + bun
ax serve, readiness/restart) — testable via bun:test. Phase 3 (packaging/codesign/notarize) is blocked on Apple Developer credentials.🤖 Generated with Claude Code