# Rakazo Exact (alpha) Rakazo Exact is an alpha Rakazo client built with [Exact](https://github.com/expo/exact), Expo's framework with a Rust engine. The screens are written in its Contract language and the data code in TypeScript. One source builds a native iOS app, a native macOS app and a web app. It talks to the same API as the other clients. This is a first version. It covers the core: sign in to a server (or create an account there, or ask for a password reset email), the chats of a Space, a chat's transcript kept current by the live event stream, sending a message (typing `@` names a bot, and each chat keeps its own unsent draft), stopping a run, creating a bot, connecting and disconnecting apps, switching Space and signing out. The chat list shows pinned chats, sections and snoozed chats as the web's does, and a chat's menu pins it, moves it to a section, marks it read or unread, snoozes it and archives it. A transcript draws what chats hold besides text: questions and approvals with their choices, requests for a code, a key, a login, a card or an address typed into the card, a tool's questions, the tools a bot used, a failed run with its retry, pictures and files (and attaching them from the composer), each bot's name in a group, and Markdown tables. Settings (account, appearance, Space, server) open in the Mac's Settings window, a sheet on a phone and a dialog on the web, and a chat's title opens its bot's settings: name, instructions, model and thinking, archive and delete. A bot's routines are listed beside its chat, and a new one is written in the same editor as the web's: its name, instruction and schedules. ## Layout | Path | What lives there | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `app.contract` | The navigation shell: the routes, who is signed in, the chat list's data and the chat a window shows. Exact requires the routes, and everything that navigates, in this file. | | `src//` | Screens, written in Contract, one folder per feature: `auth`, `inbox`, `thread`, `panel`, `routines`, `apps`, `bots`, `settings`. | | `src/ui/` | The component library, one component per job: `avatar` (the drawn bot face), `buttons`, `fields`, `settings` (the cards settings are built from), `sheet` (a sheet's size) and `icons` (generated: the icons Exact's symbols lack, drawn from Lucide). Screens compose these with the platform's own bars, sheets, lists and alerts. | | `app.ts` | The data module's entry. It only re-exports from `logic/`. | | `logic//` | The data module, in TypeScript, with the same feature folders as `src/`. `api/` is the transport (RPC calls, auth routes, live streams) and `common/` holds what more than one feature uses. | | `app.forma` | The colour, corner radius, control height and row height tokens, generated from `@rakazo/ui-tokens` by `bun run tokens`. Screens name tokens (`background`, `radius.card`, `control.sm`), never values. | | `app.test.contract` | Tests. They run unchanged on every host against fixture answers, with no network. | | `tools/` | Scripts for developing the app: `dev-backend.sh`, `sync-shared.mjs` and `link-packages.mjs` (`bun run shared`), `sync-tokens.mjs` (`bun run tokens`). Nothing the app reads at run time. | | `shared/` | Generated, not committed. See below. | ## Rules - A screen never calls the network. It declares what it reads (`resource`) and what it writes (`mutation`), and a source of the same name in `logic//` answers. - A shape one feature reads is in `src//shapes.contract`. A shape more than one feature reads is in `src/shapes.contract`. A shape holds only fields a screen reads. - `app.contract` keeps what outlives a screen: the session and the sign-in form, the chat list and its signal stream, the chat picked, the search both layouts share, and the writes that navigate when they finish. Everything else is state of the feature component that shows it. - A control drawn in more than one feature is a component in `src/ui/`. Check there before drawing a button or a field inline. - A source that reads is named for what it answers (`inbox`, `thread`, `keptPictures`); one that writes is a verb (`sendMessage`, `renameSpace`) and answers through `reply()`, so a refusal reaches the screen as `error` text. Every request goes through `rpc()`, `auth()` or `rpcStream()` in `logic/api/client.ts`. - Server types come from `@rakazo/contracts` with `import type`, and a source's own answer from `Result<"name">`. Behaviour the other clients share comes from `@rakazo/core`, never a copy. ## Shared code The app shares server address validation and types from `@rakazo/contracts` and ten entries of `@rakazo/core`, so it behaves as the other clients do: `live-thread` folds thread events, `thread-cards` reads questions (and what answers them), tool work, files and failed runs, what a message offers (copy, reply, reactions), who a reply names, a chat's preview line and the bots a message names, `avatar-art` draws bot avatars, group avatars and chat colours, `app-catalog` orders the app catalog and tells what is connected, `routine-presets` holds the routine schedule presets the web's editor offers, `bot-sections` groups the chat list into pinned chats and sections, `chat-snooze` says when a snoozed chat wakes and offers the snooze presets, `signup-policy` tells a sign-up that waits for its email to be confirmed, and `bot-model` with `model-providers` tells what models a bot can switch to and how a picker groups them. Exact reads a package's types only from `.d.ts` files, and those packages export source. `bun run shared` compiles what the app uses into `shared/`. Run it after changing either package. To share more of core, export it from one of those entries, or add an entry to `tools/sync-shared.mjs`, `tools/shared.tsconfig.json` and `tsconfig.json`. ## Where Exact stands `scripts/feature-map/feature-map.mjs` lists what a person can do in Rakazo, where web, mobile and Exact each have it, and Exact's status. To print Exact's gaps, missing first, from the repository root: ```sh pnpm --filter @rakazo/exact parity ``` The same command lists any web route, settings section or right panel, Expo route, or Exact route or settings pane the map does not name yet, and any it names that is gone. It is a report: nothing fails on it. Mark a feature `done` or `partial` only after reading the Exact screen that has it. ## Build a macOS alpha download The `release-exact` workflow on `main` takes a version such as `0.1.0-alpha.1`. It builds `Rakazo Exact.app` for Apple silicon, signs it with Developer ID, notarizes the app and disk image, and drafts a separate GitHub prerelease. Publish the draft after testing the disk image on a Mac. The installer keeps Rakazo Exact beside the standard Rakazo app and defaults to Rakazo Cloud. The sign-in screen can also use a self-hosted Rakazo server. The workflow uses the desktop release environment's Developer ID certificate and Apple notarization credentials. The iOS and web alpha still use their own build and distribution paths. ## Run the macOS alpha Use an Apple silicon Mac with Xcode, Rust and Bun 1.4.2. See the [Exact prerequisites](https://github.com/expo/exact/blob/1d0eb53700fa3e540574761bd2b278408d02f3e6/README.md#quick-start) for the SDKs and toolchain. The local demo API also needs Docker and Rakazo's Node and pnpm toolchain. Set up Exact once. Use the tested revision below, since Exact is still changing quickly. ```sh git clone https://github.com/expo/exact.git cd exact git checkout 1d0eb53700fa3e540574761bd2b278408d02f3e6 bun scripts/exact.mjs setup ``` From the Rakazo repository root, start the demo API and leave it running: ```sh pnpm install pnpm db:generate apps/exact/tools/dev-backend.sh --connectors ``` In a second terminal, from the Rakazo repository root: ```sh cd apps/exact export EXACT=/absolute/path/to/exact bun run shared printf '%s\n' 'RAKAZO_API_URL=http://127.0.0.1:3140' > .env.local EXACT_IDENTITY=- bun exact.mjs mac --run ``` In the app, choose **Sign in with demo account**. The demo uses scripted bot replies and offline app connectors, so you can try chat and Connect apps without a model key or third-party account. ## Run the other hosts From `apps/exact`, with the same Exact checkout and demo API: ```sh bun exact.mjs ios --run # the iOS Simulator bun exact.mjs web --port 8765 # the web. The dev backend trusts this port bun exact.mjs test web # or test macos, test ios bun run build:web && bun run start # build locally, then serve the static output ``` The Exact alpha builds with its own toolchain and is outside Rakazo's production build. ## Not here yet Voice and calls, meetings, pages, push notifications, passkeys and single sign-on, billing, translations, Android and Windows. In a transcript: the richer cards (charts, apps, helpers) are not drawn. A file to send is at most 2.9 MB, since it travels inside one request and a native request holds 4 MiB.