# Technologies

What is used, why, and where it is configured. Versions are not repeated here: the file in the last column pins them.

Adding a technology is a decision. Record it in [decisions/](decisions/README.md) and justify the dependency in the commit body.

## Core

| Technology | Role | Why | Configured in |
|---|---|---|---|
| Rust | Domain, application, infrastructure, protocol, bridge | One core for macOS, Windows and Linux | `rust-toolchain.toml`, `Cargo.toml` |
| UniFFI | Swift bindings for the core | Generates the bindings from the Rust facade, no hand-written FFI | `crates/bridge` |
| serde, serde_json | Wire format of the protocol and the configuration file | The standard for JSON in Rust | `crates/protocol`, `crates/infrastructure`, `sdks/plugin`, `plugins/status`, `plugins/usage`, `plugins/manifest`, `plugins/releases`, `plugins/news`, `plugins/outdated` |
| schemars | JSON Schema of the protocol | Derived from the same types as the wire format | `crates/protocol` |
| Extism | Host for WASM plugins | A sandbox with a stable plugin interface in many languages | `crates/infrastructure` |
| wasmtime | The configuration Extism compiles with: one function at a time | The runtime under Extism, named directly only to set that | `crates/infrastructure` |
| extism-pdk | Guest side for plugins written in Rust | Matches the Extism host | `sdks/plugin` |
| wasmparser | Reads a plugin module before the runtime compiles it, to refuse one that would cost too much | The parser the runtime itself uses, so both read a module the same way | `crates/infrastructure` |
| wat | Modules written in the WebAssembly text format inside the tests of the plugin host | Lets a test state a misbehaving module in a few lines | `crates/infrastructure` |
| libc | `waitid` without reaping, `kill` and `killpg`, to end an adapter with its process group | The standard library does not offer them; already in the tree through wasmtime and Extism. Unix only | `crates/infrastructure` |
| icu_properties | The Unicode category of each character in the text of a plugin | Already in the tree through Extism, and kept current with Unicode | `crates/infrastructure` |
| ureq | The `GET` a plugin may send once granted, and the `POST` to a host it sends to, over rustls with the bundled `webpki-roots` | Blocking, no runtime, and it lets the core vet addresses and refuse redirects; it trusts the roots it ships, not the keychain | `crates/infrastructure` |
| toml_edit | Reads a hooks file in TOML with where each table, key and value is, so Blossom adds and takes out its entries by lines and keeps the rest as written | Maintained by the authors of the `toml` crate, and already compiled for the macros of Extism; only its parser is built, without the writer | `crates/infrastructure` |
| saphyr-parser | Reads a hooks file in YAML as events with where each node starts and ends, for the same edit by lines | The maintained successor of `yaml-rust`; a parser alone, without the loader or a writer, since none in Rust keeps comments when it writes | `crates/infrastructure` |
| thiserror | Error types | Removes boilerplate without changing the public types | `crates/application`, `crates/bridge` |

## macOS app

| Technology | Role | Why | Configured in |
|---|---|---|---|
| Swift 6, SwiftUI, AppKit | The whole app | Native behavior, focus control, accessibility | `apps/macos/project.yml` |
| XcodeGen | Generates the Xcode project | A reviewable text file instead of a committed project | `apps/macos/project.yml` |
| Sparkle | Updates outside the App Store | The standard for Mac apps | `apps/macos/project.yml` |
| String Catalog | Every user-facing string | Localization-ready from day one | `apps/macos/resources/Localizable.xcstrings` |
| Geist Mono | Font for code | Open Font License, bundled with its license | `apps/macos/resources/fonts` |
| Swift Testing | Tests | Ships with Xcode | `apps/macos/tests` |

The app targets macOS 14 Sonoma or later.

## Adapters and scripts

| Technology | Role | Why | Configured in |
|---|---|---|---|
| Bun | Package manager and TypeScript runtime | Runs TypeScript directly, one tool for install and run | `package.json` (`packageManager`), `bun.lock` |
| TypeScript | Adapter SDK, adapters, scripts | Types for the protocol on the adapter side | `tsconfig.json` |
| AssemblyScript | The SDK for plugins written with the syntax of TypeScript, and its compiler | Compiles to small WebAssembly with no interpreter, so a module passes the inspection of the host as it is; see [roadmap/typescript.md](roadmap/typescript.md) | `sdks/assemblyscript` |
| Binaryen | Moves the start function of a plugin in AssemblyScript into its exports and names its imports | The library the compiler of AssemblyScript already uses | `sdks/assemblyscript/tools/build.ts` |

Use `bun install`, `bun run` and `bunx`. Never npm, npx, pnpm or yarn.

## Landing

| Technology | Role | Why | Configured in |
|---|---|---|---|
| Next.js, React | The website, prerendered as static HTML | The App Router prerenders a page, and a page with nothing to read at request time costs no server work | `apps/landing/next.config.ts` |
| Tailwind CSS | Styles | Runs at build time, through its Turbopack loader, and ships only the classes used | `apps/landing/src/styles/globals.css`, `apps/landing/next.config.ts` |
| React Compiler | Memoizes components at build time | No `useMemo` or `useCallback` written by hand in a page made of animations | `apps/landing/next.config.ts` |
| shadcn/ui on Radix | The navigation menu, the mobile menu and the list of releases | Components copied into the repository, so their look stays in the tokens of the landing; Radix gives keyboard, focus and ARIA, and fumadocs-ui already brings it | `apps/landing/components.json`, `apps/landing/src/components/ui`, `apps/landing/src/lib/classes.ts` |
| Inter, Geist Mono | Typefaces | Served by `next/font` from the build, with no request to another host | `apps/landing/src/styles/fonts.ts` |

See [decisions/landing.md](decisions/landing.md).

## Tooling

| Technology | Role | Configured in |
|---|---|---|
| Turborepo | Runs every task across the three languages | `turbo.json` |
| rustfmt, clippy | Format and lint Rust | `rust-toolchain.toml` |
| cargo-machete | Unused Rust dependencies | each crate's `package.json` |
| oxlint | Lint TypeScript | `.oxlintrc.json` |
| oxfmt | Format TypeScript and JSON | `.oxfmtrc.json` |
| knip | Unused TypeScript files, exports and dependencies | `knip.json` |
| swift-format | Format and lint Swift, with its defaults | `apps/macos/package.json` |
| periphery | Unused Swift declarations | `apps/macos/package.json` |
| lefthook | Git hooks | `lefthook.yml` |
| commitlint | Commit message rules | `commitlint.config.ts` |
| GitHub Actions | Continuous integration | `.github/workflows/ci.yml` |

swift-format comes with Xcode and is called through `xcrun`. xcodegen and periphery come from Homebrew, cargo-machete from `cargo install`; `bun run bootstrap` installs all three.

## Distribution

A Homebrew cask in the tap `galfrevn/homebrew-blossom` installs the archive of a GitHub release, which `.github/workflows/release.yml` builds and signs; Sparkle 2.10.1, pinned in `apps/macos/project.yml`, updates it from the feed of the latest release. See [installation.md](installation.md) and [roadmap/distribution.md](roadmap/distribution.md).
