Skip to content

feat(desktop): bundled Node, service supervision, menu bar item, and release pipeline - #6

Merged
JUNERDD merged 8 commits into
mainfrom
feat/desktop-distribution
Sep 28, 2026
Merged

JUNERDD merged 8 commits into
mainfrom
feat/desktop-distribution

Conversation

@JUNERDD

@JUNERDD JUNERDD commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Eight commits that make the desktop app shippable as a standalone macOS app, plus three small fixes.

  • Fixes
    • The memory update route passed the new content as the entry's saved text, so Hermes could not find the entry. The authority now looks up the stored entry by id and target.
    • Service shutdown no longer cancels queued runs; they stay queued and start on the next boot.
    • The settings window loads its own stylesheet again (each window root is now a separate dynamic import).
  • Refactor: panel window creation moves into electron/panel-window.ts, with no behavior change.
  • Bundled Node and service supervision
    • Packaged apps run the service on the official Node.js pinned by .node-version, which the pack step downloads, verifies against SHASUMS256.txt and stages.
    • The service's PATH comes from the user's login shell.
    • A per-pack build ID decides whether a running service can be reused.
    • A supervisor restarts a crashed service with backoff.
    • Service output goes to rotated log files, and main-process output to main.log.
    • A quit guard asks before stopping running tasks.
  • Menu bar status item (macOS): a second entry to the task panel, with the service or task state shown in its icon. Settings › Shortcuts gains Show in Dock and Open at login.
  • Releases and automatic updates
    • A Release workflow builds arm64 and x64 dmgs and publishes the GitHub Release v<version>.
    • Signed builds also publish the electron-updater feed; installs check it after launch and every 4 hours.
  • Release trigger: a push to main releases only when the desktop version changes.

Merging this does not publish a release

This PR changes apps/desktop/package.json (new dependencies and a script) but keeps version at 0.1.0. The last commit makes the Release workflow compare the version with the one before the push, so this merge builds nothing. Running the script locally with BEFORE set to the current main gave release=false. To publish v0.1.0 later, run the workflow manually from main.

Validation

  • Every commit from the refactor on was type-checked against its own staged tree (desktop, plus the agent service for the service commit), and oxlint reports no errors.
  • pnpm --filter @ai/desktop test: 11 files, 57 tests pass on the final tree.
  • Not run: pnpm test:electron, a packaging build, and the Release workflow itself. The bundled-Node pack, the updater and signing are unverified at runtime.

…ting

The update route passed the new content as the entry's text, so Hermes
could not locate the entry it was asked to replace. The authority now
looks up the live entry by id and target and hands Hermes its stored
text; a missing entry still reports as changed.
Draining used to mark every queued run cancelled. Those runs never
started, so they now stay queued in the ledger; recovery keeps them
queued on the next boot and dispatch starts them once the server listens.
A conditional expression around both window-root imports produced one
preload wrapper carrying only the panel's CSS dependencies, so the
settings window rendered without its stylesheet. Each window's import is
now a separate statement.
createPanelWindow owns the native window options, content security,
renderer-exit reporting and size persistence; main.ts keeps the panel's
lifecycle. No behavior change.
Packaged apps now run the service on the official Node.js release pinned
by .node-version, which the pack step downloads, verifies against
SHASUMS256.txt and stages; unpackaged runs keep the system Node. The
service's PATH starts from the user's login shell, with the bundled Node
last as a fallback.

Each pack writes a build ID that the service publishes in its endpoint,
so a packaged app reuses a running service only from the same build. A
supervisor restarts a service that exits unexpectedly with backoff and
gives up after 3 exits in 5 minutes. Service output goes to rotated
logs/service.log files and main-process output to main.log through
electron-log. The menu gains Restart Agent Service and Show Service Logs.

A quit guard asks before stopping running tasks and passes OS shutdown,
logout and termination signals through without asking.
The status item is a second entry to the task panel: a click shares the
global shortcut's toggle, and a right or Control/Option click opens the
everyday app items. Its template icon shows the highest-priority state
across the service connection and the cached tasks: unavailable,
attention, running or idle.

Settings › Shortcuts gains Show in Dock (macOS, off by default; packaged
apps launch as LSUIElement agents) and Open at login (packaged macOS and
Windows), which reads and writes the OS login item instead of the
settings file. An app opened at login waits in the menu bar without
showing the panel. The window preference switches drop their redundant
tooltips and wrap as a group before Restore defaults moves down.
A Release workflow builds arm64 and x64 dmgs when the desktop version
changes on main and publishes them as the GitHub Release v<version>,
marking suffixed versions as prereleases. With a Developer ID
certificate the build is signed, notarized when Apple credentials are
set, and also publishes per-architecture zips with a merged
latest-mac.yml; without one the dmg is ad-hoc signed.

Signed installs check the feed through electron-updater after launch
and every 4 hours, download in the background and install at the next
quit. The app menu gains Check for Updates… and, once an update is
ready, Restart to Update, which first confirms stopping running tasks.
A package:installer script builds the platform installer locally.
A push to main that edits apps/desktop/package.json without changing its
version (dependencies, scripts) no longer publishes the current version
just because its tag is missing. The version before the push is read
from github.event.before. A manual run still releases an untagged
version, which covers a first release without a bump and retries.
@JUNERDD
JUNERDD merged commit 7987ffa into main Sep 28, 2026
2 checks passed
@JUNERDD
JUNERDD deleted the feat/desktop-distribution branch September 28, 2026 03:27
Jirentian pushed a commit to Jirentian/Atd that referenced this pull request Nov 8, 2026
…s; even out README previews

- Seven case clips in both languages are re-rendered from atd-films 4a5b05f (PR JUNERDD#6): the composer
  expands as soon as dropped files or a long request overflow its one-line row, the subagents view
  and its morph keep their rows whole, the toast and the published app card follow the app, and the
  selection tour's island, toolbar and menus blur the desktop like real glass.
- The README's paired previews share one crop size each (selection toolbar and write-back
  1392 x 1044; conversation and Mini Panel 1072 x 1428), so GitHub's tables give both columns
  the same width and height, and the computer-use preview takes the 1.6:1 ratio of the other
  full-width previews.
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