# Isolink Connect

Isolink Connect lets other apps keep their data in Isolink. Their data is end-to-end encrypted and
synced between people and devices over Bluetooth, Wi-Fi and relays, with no server of the app's own
and without the app's company seeing any of it. Apps get capabilities, not data: an app sees only
its own spaces, and people only as handles that are different in every app.

An app uses Isolink in one of two ways:

- **Host mode:** the person has Isolink installed, and the app talks to it. The person allows the
  app once and can turn it off or remove it in **Settings › Privacy › Connected apps**. The app
  shares its data with the people the person picks in Isolink.
- **Embedded mode:** the app runs Isolink's engine inside itself, as an Isolink account of its own.
  It needs no Isolink installed, and every update of the SDK brings the engine's improvements.

Either way an app can also keep its own server: Isolink then works as the app's offline layer,
carrying changes between people when there's no signal, and the server keeps a copy for when there
is (see [Online and offline](#online-and-offline-with-your-own-server)).

The API is the same in both modes. It's a small protocol of JSON frames, so any language can speak
it; there are SDKs for Dart (Flutter included) and TypeScript.

| Package | What it is |
| --- | --- |
| `packages/isolink_connect` | Dart SDK, the embedded engine (`InProcessPort`), Isolink on a computer (`SocketPort`), and `isolink codegen` |
| `packages/isolink_connect_flutter` | Flutter plugin: the installed Isolink app on Android (`AndroidHostPort`), and `connectIsolink`, which picks the best way in |
| `packages/isolink_connect_ts` | `@isolink/connect` for TypeScript: Node and Electron (`@isolink/connect/node`) and a React hook (`@isolink/connect/react`) |
| `packages/isolink_core` | The engine: spaces, records, the protocol and `ConnectServer`, which answers apps |

## Quick start

### 1. Describe your data

Write an `.isoschema.yaml`: your app, and the record types it keeps.

```yaml
app:
  id: com.billdue.app        # on Android, your package name
  name: BillDue
types:
  bill:
    title: string
    amount: int
    due: datetime
    paidBy: set<string>      # handles of the people who paid
    reminders: counter
  payment:
    bill: string
    amount: int
    by: string
```

Field types: `string`, `int`, `double`, `bool`, `datetime`, `json`, `list<...>` of those, `set<...>`
and `counter`. How each merges is under [Records](#records).

### 2. Generate models

```sh
dart run isolink_connect:isolink codegen billdue.isoschema.yaml --dart lib/billdue.g.dart --ts src/billdue.g.ts
```

This writes model classes for Dart and TypeScript, and `billdue.isoschema.lock` beside the schema.
**Commit the lock file.** It holds every field id, so a field keeps its id forever, and the id of a
field you remove is never given to a new one. You can also give an id by hand:
`note: {type: string, id: 9}`. Changing a field's type is refused, because data already written
wouldn't read; give the field a new name instead. In CI, `--check` fails if anything is out of date.

### 3. Connect and use it

Dart and Flutter:

```dart
import 'package:isolink_connect_flutter/isolink_connect_flutter.dart';
import 'billdue.g.dart';

// The installed Isolink on Android or a computer, or else an engine inside the app.
final isolink = await connectIsolink(
  billDueApp,
  embedded: () => InProcessPort.open(myStore, app: billDueApp.id, name: 'My phone'),
  token: savedToken,          // on a computer: isolink.token from last time
);

final house = await isolink.spaces.open('house:14-elm', name: '14 Elm St');
final people = await isolink.people.pick();            // the person picks, in Isolink
await isolink.spaces.add(house.id, [for (final p in people) p.handle]);

await Bill.edit(isolink, house.id, 'rent', [Bill.setTitle('Rent'), Bill.setAmount(180000)]);
Bill.watch(isolink, house.id).listen((bills) => print(bills.map((b) => b.title)));
```

TypeScript (Node or Electron, reaching Isolink on the computer):

```ts
import { IsolinkConnect } from '@isolink/connect';
import { socketPort } from '@isolink/connect/node';
import { Bill, billDueApp } from './billdue.g.js';

const port = await socketPort();
if (!port) throw new Error('Open Isolink first');
const isolink = await IsolinkConnect.connect(port, billDueApp, { token: savedToken });
saveToken(isolink.token);

const house = await isolink.spaces.open('house:14-elm', { name: '14 Elm St' });
await Bill.edit(isolink, house.id, 'rent', [Bill.setTitle('Rent'), Bill.setAmount(180000)]);
const stop = Bill.watch(isolink, house.id, (bills) => render(bills));
```

React: `const bills = useRecords(isolink, house.id, Bill.type, Bill.fromRecord);` from
`@isolink/connect/react`.

## Spaces

A space is the people an app shares a set of records with: a house sharing bills, a kitchen sharing
meals. Inside Isolink it's a variation of a group chat, with the same members, admins and sealed
delivery, so it's relayed, carried by contacts and kept in step across the person's devices. It
belongs to one app and never shows in the chat list.

- `spaces.open(key, name:)` returns the space your app calls `key`, and makes it if there isn't
  one. Use it for things that exist once, like a house.
- `spaces.create(name, key:, people:)` makes a new one with people (handles).
- `spaces.add(space, people)`, `spaces.leave(space)`, `spaces.list()`, `spaces.get(space)`.
- When two people make "the same" space while apart, `spaces.duplicates` (Dart) or
  `spaces.onDuplicate` (TypeScript) says so when they meet. Ask the person, then
  `spaces.merge(keep:, fold:)`. Isolink never merges by itself.
- `spaces.changes` / `onChange`: a space was made, joined or changed. `spaces.removed` /
  `onRemove`: it was left, or we were taken out.

## Records

A record is an id, a type and fields named by number. You don't need the numbers: the generated
models use them for you. Edits arrive in any order and more than once, and every device ends up the
same:

| Field | Edit | Merge |
| --- | --- | --- |
| Value | `setValue(field, value)` | The latest write wins (hybrid logical clocks; the device id breaks ties) |
| Counter | `addToCounter(field, by)` | Every device's additions add up, so two people adding at once both count. Counters only go up; keep a second counter for what's taken away |
| Set | `addToSet` / `removeFromSet` | An item is in the set while its latest add is later than its latest remove |

- `records.edit(space, type, id, edits)` makes the record if it's new.
- `records.delete(space, id)` leaves a tombstone; a later edit brings the record back.
- `records.list(space, type:)`, `records.get(space, id)`, `records.changes`, `records.watch`.
- Fields an older version of your app doesn't know are kept and passed on.
- Limits: 64 KB per record, 50,000 records per space on each device.

## People

An app sees a person as a **handle**, `h_` and 32 hex characters: the same everywhere in that app,
and different in every other app, so two apps can't match their users up. Each person has a `name`,
and `me` is true for the person using the app.

- **Host mode:** `people.pick(many:)` opens Isolink's picker; the person chooses contacts to share
  with your app. Your app can add to its spaces only people the person picked, and people already
  in its spaces. It can't read the person's contacts or Isolink code.
- **Embedded mode:** your app's engine is its own Isolink account. `people.code()` is its code (show
  it as a QR code), `people.add(code)` adds someone from theirs, and `people.list()` lists everyone
  it knows.

## Online and offline, with your own server

An app that already has a server and an API can keep both, and use Isolink as the way its data
moves when the internet doesn't. The server keeps a copy of each space's records; Isolink keeps one
on every phone in the space. Changes go to the server whenever the phone can reach it, and between
people over Bluetooth, Wi-Fi and Isolink's relays when it can't. Every copy ends up the same,
because record states merge the same whatever order they arrive in, however often.

The SDKs do this with `ServerSync`. Your server needs to keep, for each space, the latest state of
each record by id, merged with `mergeRecordStates`, and say what changed since a cursor:

```dart
class MyServer implements SyncServer {
  @override
  Future<void> upload(Space space, List<Map<String, Object?>> states) =>
      api.post('/spaces/${space.id}/states', states); // the server merges each with mergeRecordStates

  @override
  Future<({List<Map<String, Object?>> states, String? cursor})> download(Space space, String? cursor) async {
    final r = await api.get('/spaces/${space.id}/states', since: cursor);
    return (states: r.states, cursor: r.cursor);
  }
}

final sync = ServerSync(isolink, MyServer(), cursors: saved)..start();
// Later: save sync.cursors, so a restart sends only what changed.
```

```ts
import { ServerSync, mergeRecordStates, recordFromState } from '@isolink/connect/sync';

const sync = new ServerSync(isolink, myServer, { cursors: saved, onError: showOffline });
sync.start();

// On the server (Node): keep the merged state, and read it as a record.
const next = before ? mergeRecordStates(before, incoming) : incoming;
const record = recordFromState(next); // { id, type, fields } or null when deleted
```

- `ServerSync` syncs every space of the app at start, half a second after a change, and every
  minute. When the server can't be reached the change stays in Isolink, still goes to people
  nearby, and is sent on the next sync. Failures go to `errors` (Dart) or `onError` (TypeScript).
- A state is JSON: `{id, t: type, f: {fieldId: field}, del?}`, where a field is a value
  `{v, c: clock}`, a counter `{n: {device: total}}` or a set `{e: {item: {a?: added, r?: removed}}}`,
  and clocks are `millis-counter-device` text. Store it as it is. `recordFromState` reads it when your server needs the
  values, with the same field ids as your generated models.
- Spaces have the same id on every phone in them, so use it (or the app's own `key`) as the
  server's id for the space.
- Merging is safe to repeat, so a lost cursor only means sending everything once more.
- An app that wants the server's copy on a phone with no Isolink installed uses embedded mode with
  `ServerSync`: the same code works online through the server and offline through the engine
  inside the app.
- Under the hood are `sync.pull` and `sync.push` (see [the protocol](#the-protocol)).

## Push: hearing about changes while the app is away

An app that isn't connected still wants to know when someone changes its records, to post its own
notification ("Sam is done, your go"). Ask once with `push.register`; it answers how wakes will come.

```dart
final via = await isolink.push.register(target: PushToken.fcm(myFcmToken)); // embedded
```

- **Embedded:** the engine is your app, so its relay pushes your app directly. Pass your own push
  token (`PushToken.fcm`, or `PushToken.apns` with your bundle id). It answers `relay`. Hand each
  push your app receives to `isolink.push.handle(data)`: the engine connects, takes its mail, and
  `records.changed` follows. On iPhone the relay sends an alert push that your notification
  service extension can rewrite; the relay names it after your app when its `APNS_ALERTS` lists
  your bundle id.
- **Host, on Android:** Isolink holds the connection, so call `push.register()` with no target. It
  answers `host`. When a record in one of your spaces changes and your app isn't connected,
  Isolink wakes it, at most every 5 seconds: `isolink_connect_flutter` gives you the space's id
  on `IsolinkWakes.events`, or runs the Dart function your manifest names in the background (see
  `IsolinkWakes`). Connect and read what's new.
- **Host, on a computer:** answers `null`. Apps there run while they're needed.

`push.unregister()` stops it.

## Consent and Connected apps

The first time an app connects to an installed Isolink, the person is asked:

- **Android:** Isolink's consent sheet opens over the app. Android says which app is asking, so the
  name and icon come from the system, not from the app. The SDK does this for you.
- **Computers:** Isolink shows the sheet in its window. A computer can't say which app is on the
  other end, so the sheet says so, and Isolink gives the app a secret (`token`). Keep it and pass
  it next time, or the person is asked again.

In **Settings › Privacy › Connected apps** the person sees each app with how many spaces and records
it keeps. **Turn off** cuts it off but keeps its data; **Remove** leaves its spaces and deletes its
data from the device, and on Android it has to ask again.

## Capabilities

Beyond keeping its data, an app can ask to do more, by name, in `hello`'s `capabilities`. The consent
sheet lists what each one lets the app do. An app allowed before that asks for a new one is asked
about just that, once; a capability the person refused isn't asked for again. Each one has its own
switch under the app in **Connected apps**. The answer to `hello` says which ones the app has now, and
`capabilities.changed` says when that changes. A method of a capability the app doesn't have is
refused with `not_allowed`, and an engine offers only the capabilities it can serve.

| Capability | Lets the app | Where |
| --- | --- | --- |
| `contacts` | List and watch the person's contacts, write back nicknames and notes, and add any contact to its spaces | Windows, macOS, Linux |
| `presence` | See whether the people it sees are reachable now, and when they were last seen | Windows, macOS, Linux |
| `files` | Keep the files it makes in My devices, under a label with its name | Windows, macOS, Linux |
| `notify` | Show notifications, titled with its name | Windows, macOS, Linux |
| `share` | Open Isolink's share sheet with text or files, for the person to pick chats | Windows, macOS, Linux |
| `calls` | Start calls with people it sees or everyone in one of its spaces, and hear calls start and end | Windows, macOS, Linux |
| `windows` | Hear a floating chat being dragged, and open one under the pointer, still held | Windows, macOS |

Capabilities are for host mode on a computer for now: an embedded engine is the app's own, so it
offers none, and Android's consent screen doesn't ask for them yet.

In the SDKs, ask with `capabilities` when connecting, and use each one by its name:

```dart
final isolink = await IsolinkConnect.connect(port, myApp, capabilities: [ConnectCapability.contacts, ConnectCapability.files]);
if (isolink.has(ConnectCapability.contacts)) {
  for (final c in await isolink.contacts.list()) print(c.displayName);
}
await isolink.files.save('march.csv', bytes, mime: 'text/csv');
```

```ts
const isolink = await IsolinkConnect.connect(port, myApp, { capabilities: [ConnectCapability.notify] });
await isolink.notify.post('rent', { title: 'Rent is due', body: 'Tomorrow' });
isolink.onCapabilities((now) => render(now));
```

### `contacts`

For an address book or CRM on the device that syncs with Isolink both ways. A contact is a person's
handle (the same as in `people.pick` and spaces) with what the person knows about them. Blocked
people and relays' bots are left out.

- `contacts.list` → `[Contact]`, `contacts.get` `{person}` → `Contact`.
- `contacts.update` `{person, nickname?, note?}` → `Contact`: sets the nickname or private note, on
  all of the person's devices. `null` or `""` clears one; one left out stays.
- `contacts.changed` event (a `Contact`) when one is added or changes, and `contacts.removed`
  `{person}` when one is removed or blocked.
- `Contact`: `{handle, name, nickname?, note?, status?, verified}`. `name` is the one they chose.

### `presence`

- `presence.list` → `[{handle, online, lastSeen?}]` for everyone the app sees: people in its spaces,
  people picked for it, and every contact with `contacts`. `lastSeen` is in milliseconds.
- `presence.changed` event (the same shape) when someone comes online or goes offline.

### `files`

The app's files go to My devices, so they reach all of the person's devices, under a label named
after the app (made the first time, with the `app` icon). The app sees the files under its label:
the ones it saved, and any the person adds the label to.

- `files.save` `{name, mime, data, caption?}` → `File`, with `data` in base64, for a file that fits in
  one frame.
- A bigger one, up to 64 MB, goes a piece at a time: `files.start` `{name, mime, size, caption?}` →
  `{upload}`, then `files.append` `{upload, data}` until `size` bytes have gone, then `files.finish`
  `{upload}` → `File`.
- `files.list` → `[File]`, oldest first. `files.read` `{id, offset?}` → `{data, size, more}`, up to
  160 KB at a time; `failed` when the file hasn't reached this device yet. `files.delete` `{id}`
  deletes it from all of the person's devices.
- `File`: `{id, name, mime, size, caption, at}`.

### `notify`

- `notify.post` `{id, title, body?}` → `bool`: a notification titled with the app's name. One posted
  again with the same `id` replaces it. False when the person has notifications off.
- `notify.clear` `{id}` takes it back.

### `share`

- `share.send` `{text?, files?: [{name, mime, data}]}` → `bool`: opens Isolink's share sheet, and the
  person picks the chats it goes to. True once something was sent, false when they closed the sheet.
  Up to 10 files, each fitting in the frame. The app never learns where it went.

### `calls`

- `calls.start` `{person | space, video?}` → `{call}`: Isolink calls the person (someone the app sees)
  or everyone in one of its spaces, and shows the call itself.
- `calls.changed` event `{call, person | space, video, incoming, state}`, with `state` one of
  `ringing`, `calling`, `active` and `ended`, for calls with people the app sees or in its spaces.

### `windows`

`windows` is for an app that carries the pointer to another computer, like Curslink: a floating
chat dragged off one computer opens on the other, as long as both are linked to the same account.
Chats are handles, like people: different in every app, the same on all of the person's devices, and
never the same as a person's handle. Both computers are the same account when `hello` gives the same
`me` handle on each.

- `windows.drag` event `{chat, held, open, width, height, grabX, grabY}`: a floating chat was picked
  up (`held: true`) or let go (`held: false`). `open` says the chat was open rather than its bubble;
  `grabX`/`grabY` are where the pointer holds it, from its top left, in logical pixels.
- `windows.prepare` `{chat}` → `null`: gets `chat`'s floating chat ready, hidden, because it may be
  carried here soon. Call it when the drag starts on the other computer, so `windows.open` shows it at
  once instead of starting it then.
- `windows.unprepare` `{chat}` → `null`: it wasn't carried here after all; the hidden one goes.
- `windows.open` `{chat, held?, open?, grabX?, grabY?}` → `bool`: floats `chat`. With `held`, it
  comes under the pointer and moves with the press that's down now (the app presses the button
  first), to be let go anywhere. With `open` it's carried open, held at `grabX`/`grabY` from its top
  left as it was on the other computer; without, as its bubble. False when floating chats are off.
- `windows.close` `{chat}` → `null`: closes `chat`'s floating chat, once it opened on the other
  computer.

## Errors

Every refusal has a `code`:

| Code | Meaning |
| --- | --- |
| `bad_request` | The request is malformed, or an edit is invalid (a counter going down, a field of another kind) |
| `not_connected` | Say hello first, or the connection ended |
| `consent_required` | Nobody has allowed this app yet; on Android the SDK asks and tries again |
| `denied` | The person said no, the app was removed, or it isn't the app the system says |
| `turned_off` | The person turned this app off |
| `unknown_space` | No such space, or not this app's |
| `unknown_person` | A handle this app can't add: pick them first |
| `too_big` | The record would pass 64 KB, or the space is full |
| `not_allowed` | Not in this mode, like reading the person's code on an installed Isolink |
| `unsupported` | A method this engine doesn't have |
| `failed` | Something else; on Android, Isolink handed over between its engines: try again |

## The protocol

Every frame is one JSON object in UTF-8, at most 256 KB. [connect.schema.json](connect.schema.json)
describes them all.

```text
request  {"id": 7, "m": "records.edit", "p": {"space": "...", "type": "bill", "id": "rent", "edits": [...]}}
answer   {"id": 7, "r": {...}}   or   {"id": 7, "e": {"code": "unknown_space", "message": "..."}}
event    {"ev": "records.changed", "p": {...}}
```

The first request is `hello`: `{"protocol": 1, "app": {"id", "name", "publisher"?, "types"?}, "token"?,
"capabilities"?}`. It answers `{"protocol", "mode": "host" | "embedded", "me": Person, "capabilities",
"token"?}`.

| Method | Params | Answer |
| --- | --- | --- |
| `status` | | `{running, reachable}` |
| `spaces.list` | | `[Space]` |
| `spaces.get` | `space` | `Space` |
| `spaces.open` | `key`, `name` | `Space` |
| `spaces.create` | `name`, `key`?, `people`? | `Space` |
| `spaces.add` | `space`, `people` | `Space` |
| `spaces.leave` | `space` | `null` |
| `spaces.merge` | `keep`, `fold` | `Space` |
| `records.list` | `space`, `type`? | `[Record]` |
| `records.get` | `space`, `id` | `Record` or `null` |
| `records.edit` | `space`, `type`, `id`, `edits` | `Record` |
| `records.delete` | `space`, `id` | `null` |
| `sync.pull` | `space`, `cursor`? | `{states, cursor, more}`: every record state that changed since `cursor` (all when missing or from before a restart), about 192 KB a page |
| `sync.push` | `space`, `states` | `{changed}`: joins states from the app's server into the space and sends what's new to everyone in it |
| `people.pick` | `many`? | `[Person]` (host; on Android the SDK opens the picker itself) |
| `people.code` | | `string` (embedded) |
| `people.add` | `code` | `Person` (embedded) |
| `people.list` | | `[Person]` (embedded) |
| `contacts.list` | | `[Contact]` (`contacts`) |
| `contacts.get` | `person` | `Contact` (`contacts`) |
| `contacts.update` | `person`, `nickname`?, `note`? | `Contact` (`contacts`) |
| `presence.list` | | `[{handle, online, lastSeen?}]` (`presence`) |
| `files.save` | `name`, `mime`, `data`, `caption`? | `File` (`files`) |
| `files.start` | `name`, `mime`, `size`, `caption`? | `{upload}` (`files`) |
| `files.append` | `upload`, `data` | `{received}` (`files`) |
| `files.finish` | `upload` | `File` (`files`) |
| `files.list` | | `[File]` (`files`) |
| `files.read` | `id`, `offset`? | `{data, size, more}` (`files`) |
| `files.delete` | `id` | `null` (`files`) |
| `push.register` | `target`? `{kind: "fcm" \| "apns" \| "apns-voip", token, topic?, sandbox?}` (embedded) | `{via: "relay" \| "host" \| null}` |
| `push.unregister` | | `null` |
| `push.handle` | `data` (the push's strings) | `null` (embedded) |
| `notify.post` | `id`, `title`, `body`? | `bool` (`notify`) |
| `notify.clear` | `id` | `null` (`notify`) |
| `share.send` | `text`?, `files`? | `bool` (`share`) |
| `calls.start` | `person` or `space`, `video`? | `{call}` (`calls`) |
| `windows.prepare` | `chat` | `null` (`windows`) |
| `windows.unprepare` | `chat` | `null` (`windows`) |
| `windows.open` | `chat`, `held`?, `open`?, `grabX`?, `grabY`? | `bool` (`windows`) |
| `windows.close` | `chat` | `null` (`windows`) |

- `Space`: `{id, key, name, admin, people: [Person]}`
- `Person`: `{handle, name, me, admin?}`
- `Record`: `{id, type, fields: {"1": value, ...}}`. A counter's value is its total; a set's is a list.
- `Edit`: `{"op": "setValue", "field": 1, "value": ...}`, `{"op": "addToCounter", "field": 2, "by": 3}`,
  `{"op": "addToSet" | "removeFromSet", "field": 4, "items": [...]}`

Events: `records.changed` `{space, id, type, deleted, record, by}`, `spaces.changed` (a `Space`),
`spaces.removed` `{space}`, `spaces.duplicate` `{older, newer}`, `capabilities.changed`
`{capabilities}`, `contacts.changed`, `contacts.removed`, `presence.changed`, `calls.changed` and
`windows.drag` (see [Capabilities](#capabilities)), and `closed` `{reason}` when
Isolink ends the connection.

### Transports

- **Embedded:** frames go straight to the engine in the same process (`InProcessPort`).
- **Android:** bind the service with action `dev.isolink.action.CONNECT_SERVICE` in package
  `dev.isolink.isolink`, and send `android.os.Message`s: `what = 1` with the frame in
  `data.getString("frame")` and `replyTo` set, `what = 2` to hang up. Answers come back the same
  way. For consent, start `dev.isolink.action.CONNECT` for a result; for the picker,
  `dev.isolink.action.CONNECT_PICK` (extra `many`), whose result has the picked people as JSON in
  `people`. Declare `<queries><package android:name="dev.isolink.isolink"/></queries>`.
  For wakes (`push.register`), declare an exported receiver for `dev.isolink.action.CONNECT_WAKE`
  with `android:permission="dev.isolink.isolink.permission.CONNECT_WAKE"`. Isolink defines and
  requests this signature permission. Check that its owner is `dev.isolink.isolink` before
  processing a wake. Isolink sends to your package with the space's id in extra `space`.
  `isolink_connect_flutter` does all of this.
- **Windows, macOS and Linux:** TCP on `127.0.0.1:47231`, one frame per line. Only programs on the
  same computer reach it, and web pages can't open raw sockets.

To write an SDK for another language, speak these frames and run the conformance vectors in
`packages/isolink_core/test/connect/*.json`: they're data, so every SDK runs the same ones.

## Tests

- `packages/isolink_core/test/spaces_test.dart` and `connect_server_test.dart`: merging, spaces end
  to end, consent, scoping, turning off and removing.
- `packages/isolink_connect/test/sdk_test.dart`: two phones split a bill with the engine inside the
  app and no server, and Isolink on a computer over its socket.
- `packages/isolink_connect/test/server_sync_test.dart`: two people in different towns stay in
  step through the app's own server, one of them with no signal for a while, and merge cleanly.
- `packages/isolink_connect/test/codegen_test.dart`: field ids, the lock file, and that the example
  models are current.
- `packages/isolink_connect_ts`: `npm test` runs the TypeScript SDK against the real Dart engine.

## Not built yet

- The engine for browsers (WebAssembly), so a web page can use Isolink embedded.
- Kotlin, Swift and React Native SDKs, and iOS (embedded only there, since iOS has no way for apps
  to reach each other's services).
- Files in spaces. Keep files out of records for now: a record holds at most 64 KB.
- Capabilities on Android: its consent screen, over the app, asking for them too.
