Skip to content

feat(desktop): electron shell + tray + daemon bootstrap#29

Open
Codename-11 wants to merge 1 commit into
feature/v3-foundationfrom
feature/desktop-electron-scaffold
Open

feat(desktop): electron shell + tray + daemon bootstrap#29
Codename-11 wants to merge 1 commit into
feature/v3-foundationfrom
feature/desktop-electron-scaffold

Conversation

@Codename-11
Copy link
Copy Markdown
Owner

Summary

Scaffolds @axiom-labs/arc-desktop — a minimal Electron shell for the ARC v3 daemon pivot (Unit: Electron desktop scaffold).

  • Main process (src/main.ts): on app.whenReady, calls startDaemon({ version }) from @axiom-labs/arc-daemon, polls http://127.0.0.1:7272/health until ready, then opens a BrowserWindow at the daemon root.
  • Dashboard fallback: until Unit 4 wires dashboard assets into the daemon, / returns 404 — the window falls back to the :3700 dev dashboard when reachable, with a clear TODO(Unit 4) comment.
  • Tray: assets/tray.png placeholder (16x16 transparent PNG, hand-built — no "real" icon shipped), with Show / Hide / Quit.
  • Clean shutdown: app.on("before-quit") awaits daemon.stop() before letting the app exit.
  • Single instance: requestSingleInstanceLock focuses the existing window on re-launch.
  • Build: tsup (external: electron) emits dist/main.js + dist/preload.js; electron-builder.yml configured for unsigned mac/linux/win dir targets (pnpm pack).

Root tsconfig.json gains the @axiom-labs/arc-desktop path alias and includes packages/desktop/src/**/*.ts.

No code signing, no auto-update, no installer — all out of scope per unit brief.

Test plan

  • pnpm install — ok (pnpm warns that electron postinstall is ignored; that's the workspace policy, expected)
  • npx tsc --noEmit at repo root — passes
  • pnpm --filter @axiom-labs/arc-desktop build — emits dist/main.js (2.14 KB) + dist/preload.js
  • pnpm --filter @axiom-labs/arc-daemon build — emits dist/index.js (required at runtime since the desktop bundle externalises the daemon import)
  • GUI smoke test not performed — the sandboxed build host has electron postinstall blocked (Error: Electron failed to install correctly). Unblock with pnpm approve-builds on a dev machine, then pnpm --filter @axiom-labs/arc-desktop dev.
  • pnpm --filter @axiom-labs/arc-desktop pack — blocked by the same postinstall gate; rerun after approving electron builds.

🤖 Generated with Claude Code

Adds @axiom-labs/arc-desktop — a minimal Electron main process that:
- boots the daemon via startDaemon({version}) from @axiom-labs/arc-daemon
- waits for /health on 127.0.0.1:7272 before loading the window
- falls back to the :3700 dev dashboard until Unit 4 wires dashboard
  assets into the daemon
- installs a tray icon with show / hide / quit
- calls daemon.stop() on app before-quit for a clean shutdown

Ships as a tsup build (src/main.ts + src/preload.ts -> dist/) so the
workspace path-aliased @axiom-labs/arc-daemon import resolves through the
daemon's compiled dist at runtime rather than its TypeScript sources.

No code signing, no auto-update; electron-builder.yml emits unsigned
per-platform artifacts to dist-electron/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant