Elyra
Elyra The coding agent eTerm The terminal that knows where each command ends Huskarl AI colleagues on your own Mac Starf An activity monitor for Apple silicon that never invents a number etrans An SSH and SFTP client for macOS Elyra VM Virtual machines for macOS, Linux and Windows on your Mac Litr A small, native web browser for macOS Notr A notebook for macOS e The native code editor Elyra Grove Native local development environment Askr The real server for Laravel & PHP Elyra Framework Rust + Svelte 5 framework for desktop apps Elyra Conductor Local project conductor Refr Local-first PDF workspace for macOS Elyra Workspace A desktop workspace for coding agents eDock A container runtime for the Mac Elyra SQL Server MySQL-compatible SQL server in Rust Elyra Félagi Agents as teammates on one board Elyra SQL Client Native desktop SQL workbench Elyra SQL Anywhere Replication-ready SQL engine Elyra Sjá SEO & GEO workspace for macOS Elyra DataGrid Server-driven data grid for Laravel
Reference
Ratatosk CLI
Roadmap
RFC 0001: make:resource
RFC 0002: live queries
RFC 0003: MCP server
RFC 0004: MCP resource templates
RFC 0005: a Laravel backend
RFC 0006: Laravel broadcasting
RFC 0007: offline and sync
RFC 0008: Laravel notifications
RFC 0009: Files
RFC 0010: Laravel abilities
RFC 0011: an assistant in the app
RFC 0012: @elyra/ui
RFC 0013: the assistant sees the window
RFC 0014: Elyra Inspector
RFC 0015: presence
RFC 0016: capabilities per window
RFC 0017: record invalidation
RFC 0018: the assistant's answer, streamed
RFC 0019: a window from the tray
RFC 0020: an app that stays in the tray
RFC 0021: a server chosen at sign-in
RFC 0022: signed in to more than one server
RFC 0023: private channels a window listens to
RFC 0024: updates from the backend
RFC 0025: commands and configuration
RFC 0026: the running app, for coding agents
RFC 0027: the assistant's code mode
RFC 0028: the tray's icon, and the app's
RFC 0029: installers
RFC 0030: the app's identity on Windows
RFC 0031: a token per workspace
RFC 0032: the microphone
RFC 0033: diagnostics the user can send
RFC 0034: one screen in several states at once
RFC 0035: point at it, and hand it to the agent
RFC 0036: rata check, the app checked as a whole
RFC 0037: Theme Studio
RFC 0038: edit it in its own app
RFC 0039: a write shown at once in every window
RFC 0040: the two halves agree
RFC 0041: Quick Look
RFC 0042: follow a colleague
RFC 0043: every write seen
RFC 0044: composite keys
RFC 0045: bigint all the way
RFC 0046: pivot columns
RFC 0047: relations on any key
RFC 0048: more providers
RFC 0049: OpenAI web search
RFC 0050: integer-keyed arguments
RFC 0051: citations
RFC 0052: open documents
RFC 0053: exit hooks
RFC 0054: the gui feature
RFC 0055: menus that change
RFC 0056: the framework's own words
RFC 0057: rata upgrade
RFC 0058: @elyra/charts
RFC 0059: all of WireCharts
RFC 0060: exporting a chart
RFC 0061: zoom
RFC 0062: printing
RFC 0063: linked charts
RFC 0064: report pages
RFC 0065: marks
RFC 0066: taking a table out
RFC 0067: totals
RFC 0068: columns the user picks
RFC 0069: filters
RFC 0070: saved views
RFC 0071: lists over Laravel
RFC 0072: targets
RFC 0073: every row out
RFC 0074: grouped rows
RFC 0075: pinned columns
RFC 0076: views on the server
RFC 0077: every match selected
RFC 0078: editing in the table
RFC 0079: many cells at once
RFC 0080: a value for the selected rows
RFC 0081: a new row in the table
RFC 0082: a related record in a cell
RFC 0083: a filter by a related record
RFC 0084: one write for many rows
RFC 0085: the keys shown
RFC 0086: many rows in Laravel
RFC 0087: many rows deleted
RFC 0088: the trash
Release notes
Changelog
Elyra
Codegen — specta → TypeScript

Codegen — specta → TypeScript

rata codegen generates a bindings.ts from your commands, containing:

  1. TypeScript type declarations for every referenced Rust type, and
  2. a typed api.* facade whose calls delegate to @elyra/runtime's invoke.

It uses specta for the type graph and specta-typescript's framework_runtime hook (the same mechanism tauri-specta uses) — but Elyra has its own bridge, so rata codegen is the replacement for tauri-specta's generator.

Running it

rata codegen        # writes to [codegen].out (default app/src/bindings.ts)

Under the hood the app runs in codegen mode (ELYRA_CODEGEN_OUT is set), writes the file, and exits before opening a window.

Example output

// Generated by Ratatosk (`rata codegen`). Do not edit by hand.
import { invoke } from "@elyra/runtime";

export type Todo = { id: number, title: string, done: boolean };

export const api = {
  greet(name: string): Promise<string> {
    return invoke("greet", name);
  },
  list_todos(): Promise<Todo[]> {
    return invoke("list_todos");
  },
  checked_div(a: number, b: number): Promise<number> {
    return invoke("checked_div", a, b);
  },
};
  • Named types render as references (Promise<Todo>), not inlined.
  • A command's doc comment is its JSDoc, with @remarks for its can = "…" and, above api.*, for live (below).
  • Result<T, E> commands surface T; errors reject the promise.
  • Every command arg/return type must implement specta::Type (and serde).

A command's docs

What a command says about itself is in the editor's hover on the frontend (RFC 0025): its doc comment, the ability it needs, and whether it's live.

/// Archive a customer: hidden from the lists, kept for the invoices.
#[command(can = "customers.archive")]
async fn customers_archive(_ctx: Ctx, id: i64) -> Customer { … }
export const api = {
  /**
   * Archive a customer: hidden from the lists, kept for the invoices.
   *
   * @remarks Needs `customers.archive`.
   */
  customers_archive(id: number): Promise<Customer> { … },
};

A #[command(live)] adds Live: `live.name(..)` re-runs it when the data it read changes. above its api.* entry; its live.* store has the doc and the ability. A command with neither a doc comment, an ability nor live has no block. Types keep their own doc comments, as before.

serde attributes

Types are exported through specta-serde, so serde container attributes are reflected in the generated TypeScript:

  • #[serde(rename = "...")] / #[serde(rename_all = "...")] — field and variant renaming.
  • Tagged enums (#[serde(tag = "...")], tag + content, untagged) — rendered as discriminated (or bare) unions.
  • #[serde(flatten)] — merged as a TypeScript intersection (A & B).
  • #[serde(skip)] / skip_serializing — omitted fields.

Keep serde symmetric (the same shape for serialize and deserialize); asymmetric attributes aren't supported by this single-shape export.

Number policy

The sqlx/JS number story has sharp edges; Elyra's policy (in codegen.rs):

  • specta-typescript refuses to export 64-bit integers (they can't round-trip through a JS number). Elyra's wire is MessagePack, where they already arrive as JS numbers, so i64/u64/… render as number.
  • Floats render as number (not specta's JSON-oriented number | null) — MessagePack represents NaN/Infinity natively.
  • This applies both to the facade and to named-struct fields (a collection-level pass), so a struct with an i64 field exports cleanly.

If you need integers beyond 2^53, opt in to bigint (RFC 0045):

App::new().codegen_bigint()   // i64/u64/i128/u128/isize/usize -> bigint

Then a wide integer is a bigint in the page, as its type says:

  • The page is told (__ELYRA__.bigint), and @elyra/runtime decodes and encodes MessagePack with useBigInt64: a value that needs 64 bits arrives as a bigint, losslessly, and a bigint argument is sent as one.

  • Small ones too. MessagePack sends 42 in one byte whatever its Rust type, so the bindings carry, beside each command whose result has a wide integer, where they are, and wide(shape) turns those into bigints:

    orders_show(id: bigint): Promise<Order> {
      return invoke("orders_show", id).then(wide<Order>({ "id": 1, "lines": [{ "qty": 1 }] }));
    },
    

    live.* and the typed channel() do the same. A command with no wide integer is generated as before.

  • JsonValue is null | boolean | number | bigint | …: a JSON number past 2^53 is a bigint, a small one a number (a JSON value has no field types to go by).

  • Untyped values (a hand-written invoke, the store, the cache) get a bigint for a wide value and a number for a small one; wide(shape) is exported for a hand-written call.

  • Map keys that are wide integers (HashMap<u64, T>) are strings in the page, { [key in string]: T }: an object can't be keyed by a bigint, so the runtime keys the map by each key's exact digits (byId["9007199254740993"], or byId[String(id)]).

  • As a command argument, a map keyed by integers works with either policy: the page sends its keys as strings, and the command reads each one as the integer its type asks for (RFC 0050).

  • The bindings call bigintPolicy(true), and the runtime warns once in the console when the app and the bindings disagree: run rata codegen again.

Without codegen_bigint() nothing of this happens: the bytes and the values are as they were.

serde_json::Value renders as JsonValue, declared once in the bindings as null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue } — specta can only inline it, and refuses to since it's recursive.

Typed event channels

Commands were typed, events weren't: channel("progress") gave unknown, and a typo in the channel name failed silently at runtime. Declare the payload type:

#[derive(serde::Serialize, specta::Type)]
struct Progress { percent: u8 }

App::new()
    .commands(commands![..])
    .event::<Progress>("progress")

rata codegen then emits, alongside api.*:

export type ElyraEvents = { "progress": Progress };
export type ElyraEventName = keyof ElyraEvents;
export function channel<K extends ElyraEventName>(name: K): { … };
import { channel } from "./bindings";

channel("progress").subscribe((p) => {   // p: Progress | undefined
  bar = p?.percent ?? 0;
});
channel("progres");                      // ❌ compile error

Un-declared channels keep working through @elyra/runtime's untyped channel().

Typed translations

With an I18nProvider registered, the bindings also carry a Translations type (every key in the fallback locale, with its :placeholder parameters) and t / tc / translate / choice narrowed to it — an unknown key or a missing parameter is a compile error. See i18n.

Related