Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
505b585
feat(mobile): add the Linger Mobile App and its computer side
jeffrey-bin Nov 24, 2026
ef7571f
test(mobile): add the app's acceptance recipes and cover the phone re…
jeffrey-bin Nov 24, 2026
4166489
test(mobile): expect the Phones Settings link and use errors.Is
jeffrey-bin Nov 24, 2026
c21e2ac
fix(mobile): drop dictation from the microphone prompt
jeffrey-bin Nov 24, 2026
8bc9865
fix(mobile): give the file preview module Expo's default Android SDK …
jeffrey-bin Nov 24, 2026
9e399c9
fix(mobile): deflake the gateway pipe, report pairing storage errors,…
jeffrey-bin Nov 25, 2026
77f0890
Merge branch 'main' into feat/mobile-app
jeffrey-bin Nov 25, 2026
6431d40
test(local-installation): wait for the BYOK mount before advancing fa…
jeffrey-bin Nov 25, 2026
1b5acca
Merge branch 'main' into feat/mobile-app
jeffrey-bin Nov 25, 2026
2b8b7d6
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 25, 2026
17e0788
feat(mobile): attach from Camera, Photos or Files; a centered bar wit…
jeffrey-bin Nov 25, 2026
c62b828
feat(mobile): move a Relay session to the LAN once the LAN answers
jeffrey-bin Nov 25, 2026
d93a1cb
fix(mobile): resend an upload cut off by a route change; share the St…
jeffrey-bin Nov 25, 2026
27618af
fix(mobile): retry an interrupted upload on the session open now
jeffrey-bin Nov 25, 2026
7740fd0
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 25, 2026
675c7c3
feat(mobile): push once per turn, never while you are looking, and tu…
jeffrey-bin Nov 25, 2026
975b774
fix(mobile): build without the time-sensitive entitlement the profile…
jeffrey-bin Nov 25, 2026
5231ef2
fix(mobile): alert only the decider, and only hold back for the Human…
jeffrey-bin Nov 25, 2026
6e74ab9
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 25, 2026
2daf8e0
test(node-services): give the streamed-body HttpHost fake an upgrade …
jeffrey-bin Nov 25, 2026
9427a60
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 26, 2026
2b83558
feat(mobile): view files in the app, choose the interface language, g…
jeffrey-bin Nov 26, 2026
b2a91cf
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 26, 2026
7a8d2a0
fix(teamhub): order the mobile migrations after main's 895 and 896
jeffrey-bin Nov 26, 2026
6e30ece
test(scripts): expect the mobile check when service-kit changes
jeffrey-bin Nov 26, 2026
d2b6724
chore(release): regenerate the Computer lockfile after merging main
jeffrey-bin Nov 26, 2026
c91b048
fix(teamhub): let earlier mobile version histories upgrade
jeffrey-bin Nov 26, 2026
081a2ad
fix(mobile): supply plural rules on Hermes and show the whole tile on…
jeffrey-bin Nov 26, 2026
76ab995
feat(mobile): answer every decision card kind on the phone
jeffrey-bin Nov 26, 2026
508fd3c
fix(mobile): run the file viewer on iOS before 18.4 and localize file…
jeffrey-bin Nov 26, 2026
109cd37
fix(mobile): send no reason with a denial TeamHub refuses one for
jeffrey-bin Nov 26, 2026
b472123
Merge remote-tracking branch 'origin/main' into feat/mobile-app
jeffrey-bin Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
106 changes: 61 additions & 45 deletions .agents/skills/verify-linger/features/README.md

Large diffs are not rendered by default.

345 changes: 345 additions & 0 deletions .agents/skills/verify-linger/features/mobile.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ LIVEKIT_API_SECRET=devsecret-livekit-voice-local-only-32-bytes
# LIVEKIT_NODE_IP=203.0.113.10
# LIVEKIT_RTC_BIND_ADDRESS=0.0.0.0

# --- Mobile App ---------------------------------------------------------------
# Paired phones reach TeamHub through its Mobile Gateway (docs/mobile.md).
# The local-network listener; a taken port falls back to a free one, and an
# empty value turns it off.
TEAMHUB_MOBILE_LAN_ADDRESS=0.0.0.0:7787
# A Relay node to add to the computer's node list at start, beside the
# official nodes; one you run from apps/relay, for example. Empty turns every
# Relay link off and keeps phones on the local network only.
TEAMHUB_MOBILE_RELAY_URL=wss://relay.heylinger.com
# The only Push Service a phone may ask this computer to deliver alerts
# through; set it to your own when your app build names another.
TEAMHUB_MOBILE_PUSH_SERVICE_URL=https://relay.heylinger.com

# --- Local development ------------------------------------------------------
# `pnpm stack:up` host ports. They move only the published ports; the
# containers keep listening on the defaults. Left commented until a port clashes.
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ __pycache__/
/apps/computer/local-daemon/cmd/linger-computer-daemon/linger-computer-daemon

.idea/
# The Desktop app builds TeamHub for a source checkout here.
.simplexai-runtime/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ skills/builtin/*/*/**
apps/node-services/prompts/llm-wiki/personal/session-meeting-note/*.md
# Preserve supplied Profile Skill bytes and its explicitly maintained references.
apps/teamhub/internal/personalprofile/skill/
# Built by apps/mobile/scripts/build-viewer.mjs; ignored by Git.
apps/mobile/assets/viewer
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Memory, and Voice services.
Memory, and LLM Wiki share one HTTP port; the Document Runtime is the
Hocuspocus/Yjs protocol and BlockNote/Yjs computation adapter on its own
port, and it loads and saves native Documents' `document_bodies` rows in
TeamHub's database. Voice supervises isolated ASR, recorder and Live workers from the voice-runtime package. TeamHub parses SKILL.md itself.
TeamHub's database. Voice supervises isolated ASR, recorder, Live and Bridge workers from the voice-runtime package. TeamHub parses SKILL.md itself.
- `apps/teamhub-cli`: standalone Agent CLI calling TeamHub business APIs directly
through the client generated from `teamhub-agent-api`; it owns its command
schemas and host file helpers.
Expand Down Expand Up @@ -126,8 +126,9 @@ Memory, and Voice services.
strings, prompts, Skills, tests, fixtures, and benchmark data.
`make check-repository-gate` rejects CJK ideographs in changed files. The
only exceptions are the translation catalogs under
`apps/web/src/i18n/locales/` (Web client) and `apps/desktop/src/i18n/locales/`
(desktop shell); text in another language goes nowhere else.
`apps/web/src/i18n/locales/` (Web client), `apps/desktop/src/i18n/locales/`
(desktop shell) and `apps/mobile/src/i18n/locales/` (Mobile App); text in
another language goes nowhere else.
- NO: a test fixture with a literal Chinese sentence.
- OK: the same text as escaped code points (`"\u4f60\u597d"`), or kana,
accented Latin, or emoji when any unspaced script will do.
Expand Down
25 changes: 25 additions & 0 deletions GLOSSARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Linger

Linger is a personal agent that runs on the user's own computer. This glossary fixes the words the product and the code use for its concepts.

## Language

### Clients

**Mobile App**:
The Linger client for phones, on iOS and Android. Together with Web and Desktop it is one of the three clients of a deployment.
_Avoid_: phone client, app, native app

**Relay**:
A service between the Mobile App and the user's computer that forwards their traffic and keeps no product data. Linger runs an official Relay, and a user can run their own. The Local MCP Relay is a different thing and always carries its full name.
_Avoid_: sync server, tunnel, proxy, cloud

**Pairing**:
The one-time act that lets one Mobile App reach one computer: the user scans a code that Desktop shows. A Paired Phone can be removed on the computer without affecting the others.
_Avoid_: login, binding, linking, enrollment (that word belongs to a Local Computer)

### Voice hardware

**Bean**:
The wearable microphone made for Linger. It sends the wearer's live speech to the Mobile App.
_Avoid_: recorder, hardware, device, recording bean
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SCRIPT_FAST_PURE_TESTS = $(filter-out $(SCRIPT_FAST_SPAWN_TESTS),$(SCRIPT_FAST_P
# immutability check inside check-teamhub.
FAST_CHECKS := check-repository check-docs check-contracts check-packages \
check-voice-runtime check-teamhub-cli check-installer check-desktop \
check-teamhub check-teamhub-tooling check-scripts-fast
check-teamhub check-teamhub-tooling check-scripts-fast check-relay check-mobile
HEAVY_CHECKS := check-web check-node-services check-computer
CHECK_JOBS ?= 4
# The planned targets; `make check` sets them for its sub-make.
Expand Down Expand Up @@ -156,6 +156,12 @@ check-voice-runtime:
check-teamhub:
$(MAKE) -C apps/teamhub check-code sqlc-verify

check-relay:
$(MAKE) -C apps/relay check

check-mobile:
pnpm --filter @linger/mobile check

check-teamhub-tooling:
$(MAKE) -C apps/teamhub test-scripts

Expand Down
3 changes: 3 additions & 0 deletions apps/assets/logo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Its L symbol is the first letter of the word, followed directly by `inger`.
- `tray/`: black L-and-dot template shapes on transparency and full-color tiles, at 16 and 32 pixels.
- `preview.jpg`: brand lockup and small-size preview.

`apps/mobile/assets` holds the phone's launcher icons and splash, derived from
`source/linger.svg` by `apps/mobile/scripts/export-app-icons.mjs`.

`apps/web/public` holds the four public favicon/touch-icon copies. `BrandMark`
uses the same favicon SVG on the login screen, navigation and error surfaces.
Connector logos and agent avatars are separate identities and stay unchanged.
Expand Down
10 changes: 10 additions & 0 deletions apps/desktop/src/main/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ describe("window policy", () => {
it("grants only notifications and audio to the server origin", () => {
const from = { requestingUrl: `${server}/rooms` };
expect(permissionAllowed("notifications", from, server)).toBe(true);
expect(permissionAllowed("clipboard-sanitized-write", from, server)).toBe(
true,
);
expect(
permissionAllowed(
"clipboard-sanitized-write",
{ requestingUrl: "https://evil.example.com/" },
server,
),
).toBe(false);
expect(
permissionAllowed("media", { ...from, mediaTypes: ["audio"] }, server),
).toBe(true);
Expand Down
8 changes: 7 additions & 1 deletion apps/desktop/src/main/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ export const permissionAllowed = (
): boolean => {
if (!serverUrl || !details.requestingUrl) return false;
if (!sameOrigin(details.requestingUrl, serverUrl)) return false;
if (permission === "notifications") return true;
// clipboard-sanitized-write backs navigator.clipboard.writeText, which the
// SPA's copy buttons (such as the phone pairing link) use.
if (
permission === "notifications" ||
permission === "clipboard-sanitized-write"
)
return true;
if (permission === "media") {
const types = details.mediaTypes ?? [];
return types.length > 0 && types.every((t) => t === "audio");
Expand Down
44 changes: 44 additions & 0 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
.kotlin/
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# generated native folders
/ios
/android

# Built by scripts/build-viewer.mjs
/assets/viewer/
150 changes: 150 additions & 0 deletions apps/mobile/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Mobile App: the phone client of one Linger computer

React Native 0.88 with Expo SDK 58 (New Architecture, Hermes) and
expo-router. The phone reaches TeamHub on the user's own computer over one
end-to-end encrypted session, directly on the local network or through the
Relay. `docs/mobile.md` specifies the session, pairing, push, phone storage
and reading rules; `docs/adr/0001` to `0004` record why.

## Common Commands

- `pnpm --filter @linger/mobile check`: typecheck, lint and unit tests (the
`make check-mobile` fast check).
- `pnpm --filter @linger/mobile exec vitest run <file>`: run one test.
`src/session/session.test.ts` runs against the real Go gateway test server
and is skipped without `go`.
- `cd apps/mobile && npx expo export --platform ios --platform android --output-dir /tmp/linger-mobile-export`:
check that both JS bundles build; delete the output afterwards.
- `README.md` explains development builds and pairing with a local TeamHub.

## Structure

- `src/app`: expo-router routes. `(main)` is the drawer, an iOS-style
sidebar with the Library, every chat under Messages (Another Me first) and
Settings at the bottom; `pair`,
`document/[documentId]`, `voice/[mode]` (Live with the chat's own Agent,
or a recording) and `agent/[agentId]` (an Agent's read-only profile sheet:
details, the chat's Routines and its connected accounts, no Skills) sit on
the root stack. A chat's header opens Record; its composer opens Live when
empty and sends when not.
- `src/session`: Noise XK handshake, frames, the session and HTTP over it.
- `src/computer`: pairing links, the pairing handshake, per-computer storage,
and `ComputerConnection` (LAN-first race, backoff, status).
`relay-nodes.ts` holds the Relay node list each computer names and the dial
order: Automatic tries the fastest node it measured first, or only the node
the Human pinned in Settings, Relay.
- `src/api`: typed TeamHub calls over the session, using the
`@linger/wire-contracts` teamhub-public types; multipart bodies as bytes.
- `src/realtime`: the `/v0/events` stream, Room cursors and gap paging, and
the projection of Room Events into the query cache.
- `src/chat`: timeline, composer, outbox, run status with Stop, decision
cards. Every decision kind is answered as on the web: approvals in
`decision-card.tsx`, Connected App setup and authorization in
`decision-setup-views.tsx` (logic in `connections.ts`,
`setup-sources.ts`), API keys in `decision-key-views.tsx`; a browser
connection or macOS permission can only be declined here.
- `src/library`: the Library's three tabs (Meetings, Documents, Wiki, with
Wiki pages chosen as the web's Wiki tree does), meeting recordings, and
read-only Markdown, text, images and audio. Generated knowledge pages hide
their leading metadata block (`knowledge-markdown.ts`).
- `src/push`: push grants and notification routing.
- `src/voice`: dictation, Live and meeting recording over the Voice Bridge
(`docs/mobile.md`, "Voice"). `bridge-client.ts` is the `/v1/voice-bridge`
socket protocol (sequence numbers, acks, resume, drain); `pcm.ts` frames
audio; `live-turns.ts` ports the browser's Live turn rules;
`voice-session.ts`, `voice-link.ts` and `voice-events.ts` open the
VoiceSession, start the Bridge and follow the voice events stream;
`audio.ts` is the only module that touches `react-native-audio-api`.
Live and recording are `voice/[mode]` screens.
- `modules/file-preview`: the one local native module, handing a cached
file to the system viewer. Changing it needs a native build.
- `src/library/file-kind.ts`: file kinds, labels and which viewer opens a
file, following the web's `artifact-file-kind.ts`.
- `viewer/`: the offline file viewer page (pdf.js, open-file-viewer,
papaparse, mermaid, as on the desktop). `scripts/build-viewer.mjs` bundles
it into the ignored `assets/viewer/viewer.html`; `pnpm start`, `check` and
EAS's `eas-build-post-install` run it. `src/library/file-viewer.tsx` shows
it in a WebView.
- `src/i18n`: the interface language (Follow System, English, Simplified
Chinese) kept on this phone, `useTranslation()` for screens and `t()` for
plain modules, over `@linger/service-kit/messages` as on the Web. English
source text lives in `*.messages.ts` files beside the code (outside
`src/app`, whose every file is a route); translations live in
`src/i18n/locales/zh-CN.json` and follow the Web's glossary
(`apps/web/src/i18n/locales/zh-CN.glossary.md`).
`src/i18n/catalog.test.ts` checks every message is translated with the
same placeholders.
- `src/theme.ts`: the Linger design system's tokens from the web
(`apps/web/src/app/visual-theme.css`, `globals.css`): colors, the radius
steps 4/6/8/12/16/pill, the chat text sizes 15/22 and 13/18, and shadows
for floating layers only. Screens use these tokens, not literal values.
- `src/ui`: shared controls, the design system's dialog
(`confirm-dialog.tsx`, never the system alert for a question), settings
groups and rows (`settings.tsx`, iOS inset grouped), the Reduce Motion
hook (`motion.ts`, which every loop and swell follows), press feedback
(`press-scale.tsx`: buttons and cards sink to 97% in 120 ms on the UI
thread; list rows highlight instead), haptics for a few commits
(`haptics.ts`), avatars and icons. React Native has no SVG renderer here, so
`scripts/export-agent-avatars.mjs` renders the web's Agent figures
(`apps/web/public/agent-avatars`) and `scripts/export-icons.mjs` the web's Hugeicons (the
same icon for the same job, stroke 2 up to 16px and 1.5 from 20px)
into PNGs under `assets/`, with generated `*.generated.ts` tables.
`scripts/export-app-icons.mjs` derives the launcher icons and splash from
the approved tile in `apps/assets/logo/source/linger.svg`. Rerun them (they
need Google Chrome) when the figures, icons or logo change.

## Invariants

- Everything the phone keeps belongs to one paired computer: files under
`<documents>/computers/<hostId>/` and one keychain entry
(`AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY`). Unpairing, or learning that the
computer removed the phone, deletes all of it. Document bodies are not
kept, and audio from the computer lives in the cache only while its screen
is open. The phone's own meeting recording lives under
`computers/<hostId>/recordings/` until the computer has the meeting (its
Capture finalized without gaps, or the files were uploaded to the Another
Me chat); `voice-session.json` names the VoiceSession the phone has open,
so one left by a crash is closed before the next.
- Every TeamHub route the app calls must be on the Mobile API allowlist
(`apps/teamhub/internal/mobilegateway/allowlist.go`). Add a route there in
the same change, and only a `teamhub-public` operation the phone needs.
- The phone never accepts a different computer key: a handshake that fails
against the pinned key asks the Human to pair again.
- Writes carry an `Idempotency-Key`. The outbox stores each message's Room,
key and exact body before sending and resends that identical request until
the computer answers.
- Never log keys, invites, messages, document text or audio. The only log is
`src/lib/app-log.ts`: JSON lines of event names, codes, counts and timings
in `<documents>/logs/` (two files of 256 KB). Settings › Send Diagnostics
zips it to the desktop's receiver (`src/lib/diagnostics-upload.ts`,
docs/diagnostics-upload.md) when the build names one in
`LINGER_DIAGNOSTICS_UPLOAD_URL`, and Save Diagnostics hands it to the
share sheet; logic modules write through
`logEvent`, and `no-console` is an error. `src/lib/timing.ts` counts where
the phone spends its time and the log records a summary each minute.
- The only web view is the offline file viewer. It loads the bundled page
from beside the downloaded file, may read only that directory, and never
reaches the network. Text, Markdown, code, small images and audio render
natively; files the viewer cannot show are handed to the system viewer
(`modules/file-preview`: Quick Look on iOS, the app the system picks on
Android). The cache file is deleted when its screen closes. A Connected
App's sign-in opens in the system's in-app browser (`expo-web-browser`),
which the app cannot read, never in a web view.
- English source text, like the rest of the repository; other languages go
only in `src/i18n/locales/`. Call `t()` when text is shown, never at
module scope, because the language can change while the app runs.
- Logic lives in modules that import no Expo or React Native code, so Vitest
runs them in Node; the device adapters (`store-expo.ts`, `push.ts`,
`voice/audio.ts`, screens) stay thin.
- Voice follows the browser: a dictation turn becomes the Human's Message
keyed `voice-mode:<turn>`, a Live turn is saved once with its
`voice_live_turn` marker, and both go through the outbox. Audio waits on the
phone until the Runtime reports input ready, and ending a dictation turn or
a recording waits for the Bridge to acknowledge the last frame.
- Messages are built as the browser builds them (`src/chat/compose-message.ts`):
an @ the Human picked becomes a reference segment, and in a direct Agent
chat every message leads with that Agent's @ so it wakes; the screen hides
that leading @.
- One voice feature holds the microphone at a time; a voice screen ends only
through its own End or Stop (swipe-to-dismiss is off), which closes the
VoiceSession.
Loading
Loading