Skip to main content
A custom accelerator is a folder with two files: manifest.json and main.js. Your JavaScript describes a view, and Dax draws it with native SwiftUI and AppKit controls. You don’t need Node, HTML, or a web view. Your accelerator opens from the launcher and the sidebar like any built-in tool, and you can give it its own shortcut.

Starter package

Snip to Brief: commented source, types, and a walkthrough. Unzip and install.

TypeScript definitions

dax.d.ts gives your editor completion for the whole API.

Install and develop

1

Create the folder

Add a manifest.json and a main.js. Pick your own reverse-domain ID, such as com.yourname.format-json. IDs starting with app.getdax. are reserved.
2

Install it

Open Settings → Accelerators → Custom Accelerators, then click Install from Folder…. Review the author, version, and requested access before you approve it.
3

Assign a shortcut

Open the accelerator’s settings page and record a shortcut. New packages never claim one by default.
4

Iterate

After each change, install the folder again. Dax snapshots the reviewed files, so edits to an installed copy make it unavailable until you reinstall it. Reload Installed rediscovers approved packages; it does not approve edits.
Using a build tool? Bundle your dependencies into main.js, and compile TypeScript against dax.d.ts. Packages that need filesystem, process, browser, or network globals can’t run.

A complete example

This accelerator formats the JSON you have selected, entirely on your Mac.

Manifest

The manifest can be at most 32 KB.

State and UI

Call dax.defineAccelerator({ activate(context) { … } }) once. Inside it, mount a render function with dax.ui.mount(() => …). Create state with dax.state(initial), read it with .get(), and change it with .set(value) or .set(previous => next). Dax redraws whenever state changes.
Give every interactive component a stable id, especially inside conditional layouts. Without one, Dax derives the ID from position, and your text fields can lose focus or undo history when the layout changes.
Rendering must not change state. Catch errors you expect and show them; an uncaught error replaces your view with Dax’s error screen. Every component accepts id and disabled. Accelerators open in a 700×560 panel that scrolls; heights are clamped to 44–360 points. A view can have up to 200 nodes, 12 levels deep.

Permissions and capabilities

Every method returns a Promise and rejects with a readable message. Your accelerator can only call what its manifest asked for and the user approved. Images are opaque handles, not paths or base64. Pass them to other methods or to dax.ui.image, and release the ones you’re done with. dax.storage.get(key) and dax.storage.set(key, value) keep JSON on this Mac, private to your accelerator (256 KB total). It isn’t a secret store, so don’t keep passwords or tokens there.

AI

Dax asks the user once per run before the first AI request, and again before an upload. AI runs on the user’s Dax account; your code never sees a token.

Limits

  • One accelerator runs at a time, for up to 30 minutes per run.
  • Up to 12 online operations per run, one at a time.
  • Up to 16 images (80 MB) held at once; each input at most 30 MB.
  • No arbitrary HTTP, shell commands, background tasks, or file access beyond the user-chosen files above.
Your code runs in a sandboxed helper with no network or file access of its own. Everything it does goes through the permissions above.