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.
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
Calldax.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.
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
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.