authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-06-04 20:05:30-07:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-06-04 20:05:30-07:00
logb5a62504d4f15aa6f6ef4313d5914b485fa64ea4
tree3548d05508c2cc85cd4beec8f0082104d71aee7e
parentec18938bf9be0a4ab682484812dc85395bfed133

move


4 files changed, 136 insertions(+), 136 deletions(-)

apps/mobile/README.md created+98
......@@ -0,0 +1,98 @@
1# T3 Code Mobile
2
3> [!WARNING]
4> T3 Code Mobile is currently in development and is not distributed yet. If you want to try it out, you can build it from source.
5
6## Quickstart
7
8> [!NOTE]
9> Uses native modules so using Expo Go is not supported. You need to use the Expo Dev Client.
10
11This app has three variants:
12
13- `development`: Expo dev client, installable side-by-side as `T3 Code Dev`
14- `preview`: persistent internal preview build, installable side-by-side as `T3 Code Preview`
15- `production`: store/release build as `T3 Code`
16
17Run commands from `apps/mobile`.
18
19T3 Cloud is optional and disabled in a fresh clone. Public configuration belongs in the
20repository-root `.env` or `.env.local`, not an `apps/mobile/.env` file. See
21[`../../.env.example`](../../.env.example).
22
23## Development
24
25Start Metro for the dev client:
26
27```bash
28vp run dev:client
29```
30
31Build and run the local iOS dev client:
32
33```bash
34vp run ios:dev
35```
36
37Build and run the local iOS preview app:
38
39```bash
40vp run ios:preview
41```
42
43Force the review diff highlighter engine:
44
45```bash
46EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=javascript vp run ios:dev
47```
48
49`javascript` is the default and recommended setting for the review diff screen. Set `EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=native` only when you explicitly want to test the native Shiki engine.
50
51Inspect the resolved Expo config for a variant:
52
53```bash
54vp run config:dev
55vp run config:preview
56```
57
58Run static checks for mobile native code:
59
60```bash
61node ../../scripts/mobile-native-static-check.ts
62```
63
64The native lint task runs SwiftLint for Swift plus ktlint and detekt for Kotlin. Missing native tools are reported as warnings and skipped locally. CI installs the default toolset from `apps/mobile/Brewfile` before running the native checks.
65
66## EAS Builds
67
68CI uses Expo fingerprinting with the `preview:dev` profile to reuse an existing compatible build when possible, or start a new internal EAS build when native runtime inputs change. Production and default local builds continue to use the `appVersion` runtime policy.
69
70For preview or production EAS environments, set `T3CODE_CLERK_PUBLISHABLE_KEY`,
71`T3CODE_CLERK_JWT_TEMPLATE`, and `T3CODE_RELAY_URL`
72as EAS environment variables. Expo config maps the canonical values into the mobile build.
73
74Create a PR preview dev-client build manually:
75
76```bash
77vp run eas:ios:preview:dev
78```
79
80Create a cloud dev-client build:
81
82```bash
83vp run eas:ios:dev
84```
85
86Create a persistent preview build:
87
88```bash
89vp run eas:ios:preview
90```
91
92Android equivalents:
93
94```bash
95vp run eas:android:dev
96vp run eas:android:preview:dev
97vp run eas:android:preview
98```
apps/mobile/modules/t3-terminal/README.md created+38
......@@ -0,0 +1,38 @@
1# T3 Mobile Terminal Native Module
2
3This local Expo module owns the native terminal surface for the mobile app.
4
5The JavaScript contract is intentionally small:
6
7- input from the native surface is emitted as `{ data: string }`
8- resize from the native surface is emitted as `{ cols: number, rows: number }`
9- remote PTY output is delivered by the existing `WsRpcClient.terminal` RPC stream
10
11The iOS implementation uses the vendored `GhosttyKit.xcframework` built from the Ghostty custom-I/O
12fork, with T3's iOS 16 compatibility patch applied. `T3TerminalView` owns a `libghostty` surface and
13uses that callback I/O model:
14
151. initialize libghostty once for the process
162. create one Ghostty app and surface per native view
173. feed remote output into the surface with `ghostty_surface_feed_data`
184. send user input back to JS with the write callback
195. emit Ghostty's measured terminal size through `onResize`
20
21Android currently implements the same view name (`T3TerminalSurface`) and event payloads so the
22React Native screen and RPC code stay platform-neutral. The renderer backend can be replaced with a
23future Android Ghostty build without changing JS.
24
25Vendored Ghostty revision and license details are in `THIRD_PARTY_NOTICES.md`.
26
27## Rebuilding GhosttyKit
28
29The checked-in `GhosttyKit.xcframework` is built from the Ghostty custom-I/O fork (https://github.com/Yash-Singh1/ghostty/tree/custom-io).
30Set the directory to the cloned repository checked out on the `custom-io` branch to `GHOSTTY_SOURCE_DIR`.
31
32```bash
33apps/mobile/modules/t3-terminal/scripts/build-libghostty-ios16.sh
34```
35
36The script builds Ghostty with Zig 0.15.2, strips the iOS archives, and replaces only the
37`ios-arm64` and `ios-arm64-simulator` slices. Xcode's Metal toolchain must be installed; if `metal`
38fails, run `xcodebuild -downloadComponent MetalToolchain`.
docs/mobile/app.md deleted-98
......@@ -1,98 +0,0 @@
1# T3 Code Mobile
2
3> [!WARNING]
4> T3 Code Mobile is currently in development and is not distributed yet. If you want to try it out, you can build it from source.
5
6## Quickstart
7
8> [!NOTE]
9> Uses native modules so using Expo Go is not supported. You need to use the Expo Dev Client.
10
11This app has three variants:
12
13- `development`: Expo dev client, installable side-by-side as `T3 Code Dev`
14- `preview`: persistent internal preview build, installable side-by-side as `T3 Code Preview`
15- `production`: store/release build as `T3 Code`
16
17Run commands from `apps/mobile`.
18
19T3 Cloud is optional and disabled in a fresh clone. Public configuration belongs in the
20repository-root `.env` or `.env.local`, not an `apps/mobile/.env` file. See
21[`../../.env.example`](../../.env.example).
22
23## Development
24
25Start Metro for the dev client:
26
27```bash
28vp run dev:client
29```
30
31Build and run the local iOS dev client:
32
33```bash
34vp run ios:dev
35```
36
37Build and run the local iOS preview app:
38
39```bash
40vp run ios:preview
41```
42
43Force the review diff highlighter engine:
44
45```bash
46EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=javascript vp run ios:dev
47```
48
49`javascript` is the default and recommended setting for the review diff screen. Set `EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=native` only when you explicitly want to test the native Shiki engine.
50
51Inspect the resolved Expo config for a variant:
52
53```bash
54vp run config:dev
55vp run config:preview
56```
57
58Run static checks for mobile native code:
59
60```bash
61node ../../scripts/mobile-native-static-check.ts
62```
63
64The native lint task runs SwiftLint for Swift plus ktlint and detekt for Kotlin. Missing native tools are reported as warnings and skipped locally. CI installs the default toolset from `apps/mobile/Brewfile` before running the native checks.
65
66## EAS Builds
67
68CI uses Expo fingerprinting with the `preview:dev` profile to reuse an existing compatible build when possible, or start a new internal EAS build when native runtime inputs change. Production and default local builds continue to use the `appVersion` runtime policy.
69
70For preview or production EAS environments, set `T3CODE_CLERK_PUBLISHABLE_KEY`,
71`T3CODE_CLERK_JWT_TEMPLATE`, and `T3CODE_RELAY_URL`
72as EAS environment variables. Expo config maps the canonical values into the mobile build.
73
74Create a PR preview dev-client build manually:
75
76```bash
77vp run eas:ios:preview:dev
78```
79
80Create a cloud dev-client build:
81
82```bash
83vp run eas:ios:dev
84```
85
86Create a persistent preview build:
87
88```bash
89vp run eas:ios:preview
90```
91
92Android equivalents:
93
94```bash
95vp run eas:android:dev
96vp run eas:android:preview:dev
97vp run eas:android:preview
98```
docs/mobile/terminal-native-module.md deleted-38
......@@ -1,38 +0,0 @@
1# T3 Mobile Terminal Native Module
2
3This local Expo module owns the native terminal surface for the mobile app.
4
5The JavaScript contract is intentionally small:
6
7- input from the native surface is emitted as `{ data: string }`
8- resize from the native surface is emitted as `{ cols: number, rows: number }`
9- remote PTY output is delivered by the existing `WsRpcClient.terminal` RPC stream
10
11The iOS implementation uses the vendored `GhosttyKit.xcframework` built from the Ghostty custom-I/O
12fork, with T3's iOS 16 compatibility patch applied. `T3TerminalView` owns a `libghostty` surface and
13uses that callback I/O model:
14
151. initialize libghostty once for the process
162. create one Ghostty app and surface per native view
173. feed remote output into the surface with `ghostty_surface_feed_data`
184. send user input back to JS with the write callback
195. emit Ghostty's measured terminal size through `onResize`
20
21Android currently implements the same view name (`T3TerminalSurface`) and event payloads so the
22React Native screen and RPC code stay platform-neutral. The renderer backend can be replaced with a
23future Android Ghostty build without changing JS.
24
25Vendored Ghostty revision and license details are in `THIRD_PARTY_NOTICES.md`.
26
27## Rebuilding GhosttyKit
28
29The checked-in `GhosttyKit.xcframework` is built from the Ghostty custom-I/O fork (https://github.com/Yash-Singh1/ghostty/tree/custom-io).
30Set the directory to the cloned repository checked out on the `custom-io` branch to `GHOSTTY_SOURCE_DIR`.
31
32```bash
33apps/mobile/modules/t3-terminal/scripts/build-libghostty-ios16.sh
34```
35
36The script builds Ghostty with Zig 0.15.2, strips the iOS archives, and replaces only the
37`ios-arm64` and `ios-arm64-simulator` slices. Xcode's Metal toolchain must be installed; if `metal`
38fails, run `xcodebuild -downloadComponent MetalToolchain`.