Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

10.4 KB
Raw Blame
# electron-builder config for the Adelie desktop shell installers.
#
# The app directory is this package itself: `pnpm build` emits self-contained bundles of
# the shell, the server and the CLI into dist/ (see tsup.config.ts). The one dependency tree
# electron-builder collects is the @adelie/* plugin packages this package.json
# declares — data-only directories the bundled server's plugin loader resolves by name from
# the app's node_modules (never imported, so bundling has nothing to absorb). Everything
# else inside an installer is described by `files` below.
#
# asar is off on purpose: the shell forks the server as a child process, the skill
# library reads its .md files from disk, and agent commands spawn real shells — plain
# files sidestep every asar edge (fork-from-archive, unpacked-tree resolution splits)
# at the cost of some inodes.
#
# Fork note (Adelie, 2026-10-05): this config used to carry the upstream product's
# identity — its bundle id, its GitHub coordinates, its artifact names and its EVSign
# certificate. Adelie ships under its own, so every one of those names Adelie now. Adelie
# has no code-signing certificate yet, which is why the Windows signature policy below is
# off rather than pinned to somebody else's publisher: the release artifacts are unsigned
# (macOS builds are not produced at all until an Apple Developer ID exists).
#
# Adelie's own bundle id — the one the earlier Adelie desktop release shipped under, so a
# machine that has that build keeps ONE Adelie: this build upgrades it instead of landing
# beside it. `src/app-identity.ts` must return this exact value for the release profile;
# its unit test reads it back from here.
appId: com.lmliheng.adelie
productName: Adelie
# Declaring the publish target is what makes electron-builder emit the update metadata
# (latest.yml / latest-mac.yml / latest-linux.yml and the .blockmap files) next to the
# installers; nothing is uploaded from here — Adelie's release attaches the artifacts it
# collected. electron-updater reads the same metadata from the Release, and the shell's
# feed is set to this same repository in src/updater.ts.
publish:
  provider: github
  owner: lmliheng
  repo: Adelie
directories:
  output: out
# Everything the app runs, and nothing else. The mapped entry is the web build, which the
# bundled server looks up relative to its own location and which comes straight from the web
# package. No build order between the two packages guarantees it exists before this one
# builds, and electron-builder skips an absent `from:` source in silence, so the pack scripts
# run scripts/preflight.mjs first and verify-packed-cli.mjs checks the packed tree for it —
# and for the collected plugin packages, whose absence would fail nothing else either.
files:
  - dist/**/*
  - "!dist/**/*.map"
  # The staged node-pty package (scripts/build-assets.mjs, src/pty-payload.ts). electron-builder
  # adds a `!**/node_modules/**` of its own: at the head of this list when no non-negated
  # pattern names node_modules, or immediately BEFORE the first one that does. Naming it here
  # is what moves that exclusion behind `dist/**/*` — last match wins, so this one node_modules
  # ships and any other that appears under dist/ does not. The plugin packages are not listed:
  # they arrive as collected dependencies, at the app root's node_modules.
  - dist/node_modules/**/*
  - bin/**/*
  # The builtin plugins (scripts/build-assets.mjs → build-plugins.mjs): a second node_modules
  # that must ship, named for the same reason dist/node_modules is above.
  - plugins/**/*
  - package.json
  - from: ../web/dist
    to: web-dist
# The app's own metadata, which the workspace package.json cannot carry: deb and AppImage
# derive package and executable names from `name`, where "@adelie/…" is invalid, and
# fpm refuses to build without a homepage. It does NOT decide the app data directory: the
# shell calls app.setName() before anything reads userData, so that keeps the name
# src/app-identity.ts chooses per form.
extraMetadata:
  name: adelie-desktop
  homepage: https://github.com/lmliheng/Adelie
asar: false
# Nothing to rebuild: the only native module is node-pty, staged into dist/node_modules as
# the binaries its npm tarball prebuilds (darwin, win32) or as the binding pnpm's install
# already compiled on this host (Linux). Both are N-API, so Electron's Node loads them as
# published — scripts/terminal-smoke.mjs is what proves it.
npmRebuild: false
nodeGypRebuild: false

mac:
  category: public.app-category.developer-tools
  # macOS-specific 1024px master: scripts/render-icon.mjs centres the brand artwork in
  # Apple's 824px safe area so it has the same optical size as neighbouring Dock and
  # Launchpad icons. electron-builder converts the committed PNG to icns.
  icon: build/icon-mac.png
  hardenedRuntime: true
  entitlements: build/entitlements.mac.plist
  entitlementsInherit: build/entitlements.mac.inherit.plist
  notarize: true
  # macOS guards Desktop, Documents, Downloads and removable/network volumes behind TCC, and it
  # only ASKS the user on behalf of an app that says why it wants them: without these purpose
  # strings a read is refused silently, so a Workspace chosen under ~/Downloads looks empty to
  # every agent and nothing ever explains why. The server and the agents' shells run as
  # descendants of this app, so the one prompt the user answers covers all of them.
  extendInfo:
    NSDesktopFolderUsageDescription: Adelie needs access to your Desktop when an agent's workspace is a folder on it.
    NSDocumentsFolderUsageDescription: Adelie needs access to your Documents when an agent's workspace is a folder in it.
    NSDownloadsFolderUsageDescription: Adelie needs access to your Downloads when an agent's workspace is a folder in it.
    NSRemovableVolumesUsageDescription: Adelie needs access to removable volumes when an agent's workspace is on one.
    NSNetworkVolumesUsageDescription: Adelie needs access to network volumes when an agent's workspace is on one.
  # Version-less artifact names, following the CLI bundles (adelie-darwin-arm64.tar.gz):
  # the version lives in the Release tag, so the download page can address every installer
  # by a stable name — and GitHub's `releases/latest/download/<name>` stays a working
  # static link across releases.
  artifactName: adelie-desktop-darwin-${arch}.${ext}
  target:
    - target: dmg
      arch: [arm64, x64]
    - target: zip
      arch: [arm64, x64]

win:
  # Same source PNG; electron-builder converts it to the multi-size ico embedded in the
  # exe (>=256px required).
  icon: build/icon.png
  artifactName: adelie-desktop-win32-${arch}.${ext}
  # Adelie has no code-signing certificate yet, so there is nothing to check a downloaded
  # update against — and with a publisherName configured, electron-updater would read our
  # own unsigned installer as "not signed by the expected publisher" and refuse to install
  # it. This states that plainly; Windows shows its SmartScreen warning for the unsigned
  # installer. Turn it back on together with the first signed release, and give
  # signtoolOptions a `publisherName` list then: the current identity first, the previous
  # ones after it, each in the full-DN and bare-CN forms the verifier compares, so a client
  # installed by an older signed release still accepts the next rotation's builds.
  verifyUpdateCodeSignature: false
  signExts:
    - Adelie.exe
    - elevate.exe
    - adelie-desktop-win32-x64.exe
    - .__uninstaller.exe
    - "!.exe"
  signtoolOptions:
    # EVSign, the upstream project's signing service; build/evsign.cjs signs only when
    # EVSIGN_KEY is configured and logs a skip otherwise, so an unsigned build stays
    # possible (which is what Adelie produces today).
    sign: build/evsign.cjs
    signingHashAlgorithms:
      - sha256
  target:
    - target: nsis
      arch: [x64]
  # MinGit, downloaded by the CI job into build/minigit (empty for local non-Windows
  # builds, hence the committed .gitkeep — an extraResources source must always exist):
  # lands under resources/git, and the shell advertises git/usr/bin/sh.exe as
  # PENGUIN_BUNDLED_SHELL so the agent shell behaves like the npm-installed package.
  extraResources:
    - from: build/minigit
      to: git

nsis:
  oneClick: false
  allowToChangeInstallationDirectory: true
  # The installer's own artwork, instead of what NSIS draws without it: the welcome and finish
  # pages would carry NSIS's stock `${NSISDIR}/Contrib/Graphics/Wizard/nsis3-metro.bmp`, and the
  # inner pages would have a blank header bar. Both sizes are NSIS's fixed ones — 164×314 for the
  # sidebar, 150×57 for the header, at 24 bits per pixel — and a bitmap of any other size is
  # ignored in silence, which is why scripts/render-installer-art.mjs draws at exactly these
  # pixels and test/installer-art.test.ts pins the two files to them. Rendered from the brand
  # mark, so they change only when it does. The uninstaller reuses the sidebar
  # (uninstallerSidebar defaults to installerSidebar).
  installerSidebar: build/nsis/installerSidebar.bmp
  installerHeader: build/nsis/installerHeader.bmp
  # The installer's own NSIS hooks: `customUnInstall` removes the sign-in entry Settings ›
  # Appearance can register (HKCU's Run value and its StartupApproved half), which would otherwise
  # outlive the app as a dead row in Task Manager › Startup apps. See build/installer.nsh.
  include: build/installer.nsh

linux:
  # Pre-rendered freedesktop icon set (scripts/render-icon.mjs): a directory of NxN.png
  # files is used as-is for AppImage/deb, no conversion step.
  icon: build/icons
  # Pinned rather than derived from the app name, which the deb postinst templates also
  # interpolate (build/linux/*.tpl).
  executableName: adelie
  # ${arch} expands to each Linux target's own convention — x86_64 for AppImage, amd64
  # for deb — so the published names are adelie-desktop-linux-x86_64.AppImage and
  # adelie-desktop-linux-amd64.deb.
  artifactName: adelie-desktop-linux-${arch}.${ext}
  category: Development
  maintainer: lmliheng <[email protected]>
  target:
    - target: AppImage
      arch: [x64]
    - target: deb
      arch: [x64]

deb:
  # Extended copies of electron-builder's default scripts (overriding REPLACES them):
  # they additionally create/remove the /usr/bin/penguin symlink to the bundled CLI
  # launcher (resources/app/bin/penguin), so a deb install gets the `penguin` command
  # on PATH without the in-app install flow the other formats use.
  afterInstall: build/linux/after-install.tpl
  afterRemove: build/linux/after-remove.tpl