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
Release notes
Changelog
Elyra
RFC 0045 — `bigint` all the way: a wide integer that is one in the page

RFC 0045 — bigint all the way: a wide integer that is one in the page

Status: implemented (2026-11-21) · Target: 0.51.0 · builds on codegen · see Decisions

Summary

App::codegen_bigint() makes rata codegen type every 64-bit-and-wider integer as bigint. The runtime doesn't follow: it decodes MessagePack with @msgpack/msgpack's defaults, so a value typed bigint arrives as a number, a value past 2^53 arrives as a number that has already lost its last digits, and a bigint passed as an argument can't be encoded at all. The types say one thing and the values another.

This RFC makes the opt-in true end to end:

App::new().codegen_bigint()
const order = await api.orders_show(9_007_199_254_740_993n);   // a bigint goes out
order.id;            // 9007199254740993n — every i64 field is a bigint, small or not
order.lines.length;  // a number, as before: only the wide integers change
  • The page knows the policy: the shell tells the runtime, as it tells it the token, so codegen_bigint() is one switch, not two.
  • Wide values decode as bigint: the runtime decodes and encodes with useBigInt64, so an int64/uint64 on the wire is a bigint, and a bigint argument is sent as one.
  • Small ones too: MessagePack sends 42 in one byte whatever its Rust type, so rata codegen writes, beside each command, where its result's wide integers are, and the generated api.*, live.* and typed channels turn those into bigints.
  • Without codegen_bigint() nothing changes.

Motivation

  • The types lie today. With codegen_bigint() on, order.id === 42n is false, because order.id is 42. order.id + 1n throws a TypeError mixing bigint and number. Code written to the types fails at runtime.
  • The wide values are the ones that matter. Apps turn it on for ids from another system (Twitter-style snowflakes, 64-bit hashes), byte counts and money in minor units. A snowflake past 2^53 decoded as a number is a different id.
  • Arguments fail. api.orders_show(9007199254740993n) throws in the encoder ("Unrecognized object"), because bigint isn't encoded without useBigInt64.
  • The roadmap lists it under Codegen as "an optional bigint transport"; only the typing half shipped.

Current state (0.50)

  • NumberPolicy::BigInt (App::codegen_bigint()) renders i64, u64, i128, u128, isize, usize as bigint in bindings.ts, struct fields included. serde_json::Value renders as JsonValue, whose numbers are number.
  • Rust encodes with rmp-serde, which writes each integer in its smallest format: 42 is a positive fixint, 5_000_000_000 a uint64, whatever the field's type.
  • The runtime's invoke, invokeCancellable, live, the event poll and channel() decode with decode(buf) and encode with encode(args): int64/uint64 become number, and a bigint can't be encoded.
  • The page doesn't know the app's number policy; only rata codegen does.

Design

The page knows

With codegen_bigint(), the shell adds bigint: true to the globalThis.__ELYRA__ it injects before any page script (beside token and origin). The runtime reads it once. bindings.ts also carries the policy it was generated with, and the runtime warns once in the console when the two disagree (bindings from before the switch, say).

On the wire

With bigint on, every decode and encode in the runtime passes useBigInt64: true:

  • an int64 or uint64 on the wire decodes as a bigint, losslessly. A Rust integer that needs 64 bits to say is always one of those, so a value past 2^53 is never a lossy number;
  • a bigint argument encodes as an int64/uint64, which rmp-serde reads into any Rust integer it fits;
  • values that fit 32 bits are encoded small by Rust whatever their type, and still decode as number. That's what the next part is for.

Narrower integers (i32, u32, …) never need 64 bits on the wire, so they stay number either way.

Where the wide integers are

rata codegen knows each result's type, so with bigint on it writes a shape beside each command whose result has a wide integer somewhere, and one per named type that has one:

// bindings.ts (generated)
const $Order = { id: 1, customer_id: 1, lines: [$Line] };      // 1: a wide integer
const $Line = { qty: 1 };

export const api = {
  orders_show(id: bigint): Promise<Order> {
    return invoke("orders_show", id).then(wide($Order));
  },
};
export const live = {
  orders_show: (id: bigint) => live_("orders_show", id).map(wide($Order)),
};
  • A shape is 1 for a wide integer, [shape] for each item of an array, { field: shape } for an object's fields, and a named type's shape by reference. Option<T> is T's shape (null is left alone); an enum's variants merge their fields' shapes; a map's values, { "*": shape }.
  • wide(shape)(value) (in @elyra/runtime) walks the value along the shape and turns each number it finds there into a bigint, in place. A bigint (a wide one, decoded so already) is left as it is.
  • Only what has one gets one: a command whose result has no wide integer is generated as today, so an app with a few u64 fields pays for those alone.
  • The same for live queries and typed channels (App::event::<T>): live.* maps its values through the shape, and channel<T>() from the bindings gets its type's.

JsonValue

A serde_json::Value can hold a number past 2^53, which now decodes as a bigint. With bigint on, JsonValue is generated as null | boolean | number | bigint | string | …, so the type says it can be one. Its small numbers stay number: a JSON value has no field types to go by.

What doesn't change

  • Without codegen_bigint(), no bigint: true, no useBigInt64, no shapes: the bytes and the values are 0.50's.
  • Rust's side: rmp-serde reads an int64 into an i64 and a positive fixint into an i64 alike; nothing changes in commands.
  • The store (store.get), the cache and the other facades aren't typed by codegen; a wide integer in them is a bigint, a small one a number, as with any untyped value. The docs say so.

Testing

  • Runtime unit tests: wide over objects, arrays, options, maps and nested named shapes; a bigint left alone; null left alone.
  • invoke, live and the event poll decoding a uint64 as a bigint only with the policy on, and encoding a bigint argument.
  • Codegen tests: the shapes for a struct, a Vec, an Option, a Page<T>, an enum and a map; nothing emitted without the policy, or for a command with no wide integer.
  • An end-to-end test over the protocol (TestShell): u64::MAX and 42u64 both arrive as bigints through a generated call.

Implementation plan

  1. Shell: bigint: true in __ELYRA__ with the policy.
  2. Runtime: one codec with useBigInt64 behind the flag, used by every decode and encode; wide(shape); the mismatch warning.
  3. Codegen: the shapes, the wrapped api.*, live.* and channels, and JsonValue with bigint.
  4. Docs: codegen's number policy; the CHANGELOG's Upgrading for apps that already call codegen_bigint() (their values now match their types).

Not in this RFC

  • Map keys that are wide integers (HashMap<u64, T>): @msgpack/msgpack only takes string and number keys; such a map still decodes with number keys, and a key past 2^53 is an error. The docs say to key it by String.
  • Shapes for hand-written invoke calls: wide($Order) is exported from the bindings, so a hand-written call can use it, but nothing does it for them.
  • bigint per field (#[specta(type = bigint)] on one field while the rest stay number): the policy is the app's.

Alternatives considered

  • Every integer as a bigint (a reviver over every decoded value): no shapes needed, but i32 fields would be bigints too, against their number type, and every count and index in the app would need converting.
  • Rust always writing int64 for a wide field (no small encodings): rmp-serde has no such switch; a custom serializer for every i64 in every type the app sends is far more code than shapes, and still wrong for values inside serde_json::Value.
  • Strings for wide integers (#[serde(with = "string")]): what JSON APIs do, and what an app can already choose per field; not what a binary protocol that carries 64-bit integers natively should need.
  • Keep the types and drop the promise (document that a bigint field may be a number): what 0.50 does implicitly, and the reason for this RFC.

As built

  • The shell. Policy carries the number policy (with_bigint, set from App::codegen_bigint()), and its init script adds bigint: true to the frozen __ELYRA__ only then.
  • The runtime. Every encode/decode in @elyra/runtime goes through pack/unpack, which pass { useBigInt64: true } with the policy and nothing without it. wide(shape), the WideShape type, liveWith(map, command, ...args) (what live is built on now) and bigintPolicy(..) are exported. wide converts in place, only integer numbers, and leaves null, bigints and anything the shape doesn't reach.
  • Codegen. The shapes come from the types as they're exported (ElyraFormat after specta-serde), where each wide integer is already a bigint generic, so serde's renames, tags and flattening are what the shapes follow. A shape is 1, [..] or { "key": .. }, rendered inline beside each call; named types are expanded where they're used, generic ones (Page<T>) with their arguments' shapes, and a recursive type is cut off where it comes round again. An enum's variants are merged both under the variant's name (externally tagged) and beside the tag (internally tagged or untagged); an adjacently tagged enum's content isn't reached. A newtype is its field. rawLive is imported only when a live command has no shape, so the bindings pass noUnusedLocals.
  • Typed channels get an eventShapes table and a channel() that widens each payload, only when a payload has a wide integer.
  • Tested: runtime unit tests (a wide value decoded losslessly, a bigint argument encoded, wide over objects, arrays, maps, tuples, null and nested pages, liveWith, the policy warning); codegen tests (the exact shapes for a struct with a Vec, Option, map, tuple, tagged enum and JsonValue, Page<T>, a bare i64 result, a result with none, a typed channel, and nothing without the policy); the init script, and the wire premise (42i64 is one byte, u64::MAX a uint64). The generated bindings were type-checked with tsc --strict --noUnusedLocals against the runtime. Not tested: a real page in a webview decoding them, which the runtime tests stand in for.

Decisions

  1. The page learns the policy from the shell (__ELYRA__.bigint), since the runtime decodes before any bindings run; the bindings carry their own, and the runtime warns once in the console when they differ.
  2. Shapes beside each command in the bindings, not a registry in the runtime: the generated code says what it converts, and the runtime knows nothing of the app's types.
  3. Commands, live.* and typed channels, all three.
  4. Upgrading says that an app already calling codegen_bigint() gets bigints where it got numbers, and names the patterns to look for (Number(order.id), comparisons with a number literal).