Skip to content

Move the embedded desktop tools to the Swift stack (native2) when desktop-tools is ready #532

Open

Description

@iamnbutler

desktop-tools is replacing its Node client and the vendored Peekaboo with a single Swift codebase, `native2` (githubnext/desktop-tools#143). Ace pins desktop-tools to a commit, `c3e08eb` in the root `package.json` catalog. Keep that pin until the desktop-tools issues below are closed. Pins at or after desktop-tools v0.16.1 still build and run the existing stack by default, so bumping for other fixes is safe as long as nothing below is turned on.

What changes for Ace

Ace touches desktop-tools in four places:

  • `apps/desktop/src/native.ts` (C ABI through `bun:ffi`): no change. `native2`'s `libDesktopTools.dylib` exports the same functions with the same arguments, including `desktop_tools_start(socket, client identifier)`.
  • `apps/desktop/scripts/helper.ts`: pass `--native2` to `dist/build.js`, then copy the same two outputs (`libDesktopTools.dylib`, and `desktop-tools-client` as `ace-desktop-client`). `sign.ts` signs them as today. The host serves only that client identifier from Ace's team.
  • `apps/host/src/desktop.ts`: `createDesktop({ client, socket, wire: 2 })`.
  • `packages/channel/src/desktop.ts`: `/protocol` and `/tools` imports stay the same.

Waiting on desktop-tools

Checks before switching

Activity

  1. iamnbutler commented on Oct 20, 2026

    @iamnbutler
    ContributorAuthor

    Update from desktop-tools: #171 (githubnext/desktop-tools#180), #172 (#182) and #173 (#174) are merged.

    • #173: /tools is generated for native2 now. Pass wire: 2 to both desktopTools({ place, app, wire: 2 }) and desktopToolRules(app, 2) (see Ace: adopt desktopToolRules() #530). Ace's model then reads desktop_launch and desktop_open as background with an activate option, plus the instruction to work in the background. Wire 1, the default, keeps today's text.
    • Keep keyboard focus inside open modal dialogs #172: createDesktop({ wire: 2 }) keeps one desktop-tools-client --serve per config instead of spawning per call. Against one release host, desktop_windows p50 is 13.0 ms (10.8 ms through native2's MCP server, 16.5 ms one-shot). It holds the event loop only while a call waits.
    • feat(app): rebuild Settings and top-anchor every dialog #171: dist/build.js --native2 builds native2 alone, with no Peekaboo.

    Live on native2's dev app: #162 background launch/open and the SELF_TARGET guard pass. The approval prompt and pause are still to run. Keep the pin until desktop-tools releases 0.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions