appId: cn.pingcap.agentteam
productName: AgentTeam
executableName: AgentTeam
copyright: Copyright © 2026 PingCAP Authors

directories:
  buildResources: build
  output: dist/builder

asar: true
files:
  - from: dist/main
    to: dist/main
    filter:
      - "**/*"
  - from: dist/preload
    to: dist/preload
    filter:
      - preload.cjs
  - from: dist/renderer
    to: renderer
    filter:
      - "**/*"
  - package.json

protocols:
  - name: AgentTeam connect URL
    schemes:
      - agentteam
    role: Viewer

publish:
  - provider: generic
    url: https://static.pingcap.com/agentteam/releases/desktop
    channel: latest
generateUpdatesFilesForAllChannels: false
detectUpdateChannel: true

afterPack: scripts/after-pack.mjs
afterSign: scripts/after-sign.mjs
afterAllArtifactBuild: scripts/after-sign.mjs

mac:
  icon: build/icon.icns
  artifactName: AgentTeam-${version}-mac-${arch}.${ext}
  category: public.app-category.productivity
  minimumSystemVersion: "12.0"
  hardenedRuntime: true
  gatekeeperAssess: false
  entitlements: build/entitlements.mac.plist
  entitlementsInherit: build/entitlements.mac.plist
  signIgnore:
    - "\\.pak$"
  notarize: false
  binaries:
    - Contents/Resources/runtimes/opencode/opencode
    - Contents/Resources/bin/agentteam
  extraResources:
    - from: dist/staging-manifest.json
      to: staging-manifest.json
    - from: dist/resources/bin/agentteam
      to: bin/agentteam
    - from: dist/resources/runtimes/opencode/opencode
      to: runtimes/opencode/opencode
    - from: dist/resources/runtimes/opencode/models.json
      to: runtimes/opencode/models.json
    - from: ../internal/icon/assets/tray-black.png
      to: icons/tray-black.png
  target:
    - target: dmg
      arch:
        - arm64
        - x64
    - target: zip
      arch:
        - arm64
        - x64

dmg:
  artifactName: AgentTeam-${version}-mac-${arch}.${ext}
  sign: true
  writeUpdateInfo: false

win:
  icon: build/icon.ico
  compression: maximum
  electronLanguages:
    - en-US
    - zh-CN
    - ja
  target:
    - target: nsis
      arch:
        - arm64
        - x64
  artifactName: AgentTeam-${version}-win-${arch}.${ext}
  signAndEditExecutable: true
  signtoolOptions:
    signingHashAlgorithms:
      - sha256
  verifyUpdateCodeSignature: true
  extraResources:
    - from: dist/staging-manifest.json
      to: staging-manifest.json
    # Keep executable resources directory-based. electron-builder applies its
    # Windows signing transformer only while copying directories; single-file
    # extraResources bypass that transformer and would remain unsigned.
    - from: dist/resources/bin
      to: bin
      filter:
        - agentteam.exe
    - from: dist/resources/runtimes/opencode
      to: runtimes/opencode
      filter:
        - opencode.exe
        - models.json
    - from: ../internal/icon/assets/icon-black.png
      to: icons/icon-black.png

nsis:
  artifactName: AgentTeam-${version}-win-${arch}.${ext}
  oneClick: true
  perMachine: false
  allowElevation: false
  allowToChangeInstallationDirectory: false
  runAfterFinish: true
  include: build/installer.nsh
  installerHeader: ../installer/win/assets/agentteam-header.bmp
  installerSidebar: ../installer/win/assets/agentteam-branding.bmp
  uninstallerSidebar: ../installer/win/assets/agentteam-branding.bmp
  differentialPackage: true
  deleteAppDataOnUninstall: false
