Skip to content

Commit a223032

Browse files
authored
Merge branch 'main' into main
2 parents 6cd7cb7 + e9ae134 commit a223032

456 files changed

Lines changed: 35612 additions & 5915 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/test-t3-mobile/SKILL.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,29 @@ Do not start, stop, erase, or reconfigure an emulator owned by another task. Tra
125125

126126
## Pair each client once
127127

128-
Issue a fresh credential against the running backend's exact base directory:
128+
Use the bundled helper from the repository root. It issues a fresh credential against the running backend's exact base directory, opens the existing Add Environment route with the credential in an encoded query parameter, and asks that route to connect once:
129129

130130
```bash
131-
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
132-
--base-dir <base-dir> \
133-
--base-url <mobile-origin> \
134-
--ttl 15m \
135-
--label agent-mobile-<short-device-id>
131+
.agents/skills/test-t3-mobile/scripts/pair-client.sh \
132+
ios <simulator-udid> <server-port> <base-dir>
133+
134+
.agents/skills/test-t3-mobile/scripts/pair-client.sh \
135+
android <emulator-serial> <server-port> <base-dir>
136136
```
137137

138-
In PowerShell, set `$env:T3CODE_PORT = "<server-port>"` first and run the `node ... auth pairing create` command without the leading assignment.
138+
Run only the command for the selected platform. The helper uses `http://127.0.0.1:<server-port>` for iOS and `http://10.0.2.2:<server-port>` for Android. Pass a fifth argument only when testing a non-development URL scheme.
139139

140-
If the visible Add Environment action is not exposed as a semantic target, open the app's registered route instead of guessing coordinates:
140+
The helper opens this registered route:
141141

142-
```bash
143-
xcrun simctl openurl <simulator-udid> 't3code-dev://connections/new'
144-
adb -s <emulator-serial> shell am start -W \
145-
-a android.intent.action.VIEW \
146-
-d 't3code-dev://connections/new' \
147-
com.t3tools.t3code.dev
142+
```text
143+
t3code-dev://connections/new?pairingUrl=<encoded-pairing-url>&autoConnect=1
148144
```
149145

150-
Run only the command for the selected platform.
146+
The Add Environment route owns the behavior: `pairingUrl` prefills its normal host and token inputs, while `autoConnect=1` submits once in development builds and returns to Home after success. Without `autoConnect`, the same route only prefills the form for manual inspection.
147+
148+
Do not enter pairing hosts or tokens through simulator keyboard automation. Xcode's semantic typer sends HID-style key events through the simulator's active keyboard state, which can corrupt uppercase tokens and punctuation even when the host Mac uses a U.S. input source. The one-shot route is the deterministic pairing path. Use the visible form only as a fallback, and paste credentials rather than typing them character by character.
151149

152-
In T3 Code Dev, open Add Environment and enter the complete `<mobile-origin>` and newly printed `Token`. Verify the expected seeded projects appear before exercising the affected flow.
150+
Verify the expected seeded projects appear before exercising the affected flow.
153151

154152
Pairing credentials are secret, short-lived, and single-use. Create a different credential for every simulator, emulator, physical device, or browser. If an attempt fails, issue a new credential rather than retrying the old one. Do not expose tokens in screenshots, commits, or final responses.
155153

@@ -183,6 +181,8 @@ Keep local verification focused. Do not turn this workflow into a full repositor
183181
- **Old UI or an old error appears:** verify Metro's worktree, variant, URL, and port before diagnosing the app.
184182
- **The environment remains empty:** verify the platform-specific HTTP origin, use a fresh token, and confirm project seeding used the identical base directory.
185183
- **A second client cannot pair:** pairing tokens are single-use; issue another token.
184+
- **The pairing form opens but does not connect:** confirm the deep link uses the existing `connections/new` route, includes `autoConnect=1`, and carries a freshly minted encoded `pairingUrl`.
185+
- **Pairing text changes case or punctuation:** do not retry semantic typing. Use `scripts/pair-client.sh`; the simulator keyboard layout and HID input path are not reliable for credentials.
186186
- **iOS semantic actions fail:** set explicit XcodeBuildMCP defaults and refresh with `snapshot_ui`.
187187
- **Android cannot reach Metro:** verify `adb reverse` for the exact Metro port and relaunch the development-client URL.
188188
- **Android cannot reach the backend:** use `10.0.2.2`, not `127.0.0.1`, for the Android Emulator.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
usage() {
6+
echo "Usage: $0 <ios|android> <device-id> <server-port> <base-dir> [url-scheme]" >&2
7+
exit 2
8+
}
9+
10+
[[ $# -ge 4 && $# -le 5 ]] || usage
11+
12+
platform="$1"
13+
device_id="$2"
14+
server_port="$3"
15+
base_dir="$4"
16+
url_scheme="${5:-t3code-dev}"
17+
18+
case "$platform" in
19+
ios)
20+
mobile_origin="http://127.0.0.1:${server_port}"
21+
;;
22+
android)
23+
mobile_origin="http://10.0.2.2:${server_port}"
24+
;;
25+
*)
26+
usage
27+
;;
28+
esac
29+
30+
repo_root="$(git rev-parse --show-toplevel)"
31+
cd "$repo_root"
32+
33+
if ! pairing_output="$({
34+
T3CODE_PORT="$server_port" node apps/server/src/bin.ts auth pairing create \
35+
--base-dir "$base_dir" \
36+
--base-url "$mobile_origin" \
37+
--ttl 15m \
38+
--label "agent-mobile-${device_id:0:8}"
39+
} 2>&1)"; then
40+
echo "Could not mint a mobile pairing credential." >&2
41+
exit 1
42+
fi
43+
44+
pairing_url="$(printf '%s\n' "$pairing_output" | sed -n 's/^Pair URL: //p' | tail -n 1)"
45+
if [[ -z "$pairing_url" ]]; then
46+
echo "Could not parse the mobile pairing URL." >&2
47+
exit 1
48+
fi
49+
50+
deep_link="$(PAIRING_URL="$pairing_url" URL_SCHEME="$url_scheme" node - <<'NODE'
51+
const query = new URLSearchParams({
52+
pairingUrl: process.env.PAIRING_URL,
53+
autoConnect: "1",
54+
});
55+
process.stdout.write(`${process.env.URL_SCHEME}://connections/new?${query}`);
56+
NODE
57+
)"
58+
59+
case "$platform" in
60+
ios)
61+
xcrun simctl openurl "$device_id" "$deep_link"
62+
;;
63+
android)
64+
# adb shell re-joins its arguments and evaluates them through the device
65+
# shell, so the deep link's `?`/`&` must be quoted once more for that shell.
66+
adb -s "$device_id" shell \
67+
"am start -W -a android.intent.action.VIEW -d '$deep_link' com.t3tools.t3code.dev" \
68+
>/dev/null
69+
;;
70+
esac
71+
72+
echo "Opened the existing Add Environment route with a fresh pairing credential."

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ body:
99
attributes:
1010
value: |
1111
Use this form for broken behavior, regressions, crashes, or reliability problems.
12+
Feature requests belong in [Discussions](https://github.com/pingdotgg/t3code/discussions/categories/ideas).
1213
Search existing issues first and keep the report focused on one problem.
1314
1415
- type: checkboxes

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature request
4+
url: https://github.com/pingdotgg/t3code/discussions/categories/ideas
5+
about: Suggest an improvement or new capability in Discussions.

‎.github/ISSUE_TEMPLATE/feature_request.yml‎

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎.github/VOUCHED.td‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ github:shivamhwp
3737
github:jappyjan
3838
github:justsomelegs
3939
github:UtkarshUsername
40+
github:SunkenInTime
41+
github:bil0000

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ name: Mobile EAS Production
88
#
99
# Every merge to main that touches the mobile app reconciles, per platform:
1010
# 1. Store builds: if the latest production build's version differs from
11-
# app.config.ts, cut a new build with --auto-submit (TestFlight +
12-
# Play internal track). Bumping `version` is therefore all it takes to
11+
# app.config.ts, cut a new build and submit it (TestFlight + Play internal
12+
# track). Bumping `version` is therefore all it takes to
1313
# start the next release train — the first build of a version enters
1414
# external-TestFlight beta review immediately, and later builds of the
15-
# same version auto-approve. Releasing to the App Store stays a manual
16-
# App Store Connect step.
15+
# same version auto-approve until that version is released. After App
16+
# Store approval, Apple closes the release train and `version` must be
17+
# bumped before another iOS build can be submitted. Releasing to the App
18+
# Store stays a manual App Store Connect step.
1719
# 2. OTA: publish a production-channel update for each platform where at
1820
# least one finished production build matches the current native
1921
# fingerprint. Old-version binaries with a matching fingerprint receive
@@ -42,6 +44,10 @@ on:
4244
- ios
4345
- android
4446
- all
47+
version:
48+
description: "Optional build version override (blank uses app.config.ts; an override is committed before building)"
49+
required: false
50+
type: string
4551
message:
4652
description: "OTA update message (mode=update only)"
4753
required: false
@@ -89,11 +95,21 @@ jobs:
8995
echo "EXPO_TOKEN is not available; skipping EAS production job."
9096
fi
9197
98+
- id: version_app_token
99+
name: Mint release app token for version override
100+
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.version != ''
101+
uses: actions/create-github-app-token@v2
102+
with:
103+
app-id: ${{ secrets.RELEASE_APP_ID }}
104+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
105+
owner: ${{ github.repository_owner }}
106+
92107
- name: Checkout
93108
if: steps.expo-token.outputs.present == 'true'
94109
uses: actions/checkout@v6
95110
with:
96111
fetch-depth: 0
112+
token: ${{ steps.version_app_token.outputs.token || github.token }}
97113
# No sparse-checkout here: it makes actions/checkout fetch with
98114
# --filter=blob:none, and eas-cli archives the project via
99115
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
@@ -135,6 +151,65 @@ jobs:
135151
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
136152
run: eas env:pull production --non-interactive
137153

154+
- name: Apply manual version override
155+
if: steps.version_app_token.outcome == 'success'
156+
env:
157+
GH_TOKEN: ${{ steps.version_app_token.outputs.token }}
158+
APP_SLUG: ${{ steps.version_app_token.outputs.app-slug }}
159+
RELEASE_VERSION: ${{ inputs.version }}
160+
run: |
161+
if [ "$GITHUB_REF_TYPE" != "branch" ]; then
162+
echo "Version overrides require dispatching this workflow from a branch; received $GITHUB_REF_TYPE '$GITHUB_REF_NAME'." >&2
163+
exit 1
164+
fi
165+
if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+){1,2}$ ]]; then
166+
echo "Version override must contain two or three dot-separated integers; received '$RELEASE_VERSION'." >&2
167+
exit 1
168+
fi
169+
170+
node --input-type=module -e '
171+
import fs from "node:fs";
172+
const path = "apps/mobile/app.config.ts";
173+
const source = fs.readFileSync(path, "utf8");
174+
const next = source.replace(
175+
/^( version: ")[^"]+(".*)$/m,
176+
`$1${process.env.RELEASE_VERSION}$2`,
177+
);
178+
if (next === source && !source.includes(` version: "${process.env.RELEASE_VERSION}"`)) {
179+
throw new Error("Could not update app version");
180+
}
181+
fs.writeFileSync(path, next);
182+
'
183+
vp fmt apps/mobile/app.config.ts
184+
185+
if git diff --quiet -- apps/mobile/app.config.ts; then
186+
echo "app.config.ts is already at $RELEASE_VERSION; no version commit needed."
187+
exit 0
188+
fi
189+
190+
user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
191+
git config user.name "${APP_SLUG}[bot]"
192+
git config user.email "${user_id}+${APP_SLUG}[bot]@users.noreply.github.com"
193+
git add apps/mobile/app.config.ts
194+
git commit \
195+
-m "chore(mobile): bump app version to $RELEASE_VERSION" \
196+
-m "Co-authored-by: codex <[email protected]>"
197+
git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"
198+
199+
- name: Summarize manual build version
200+
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
201+
working-directory: apps/mobile
202+
run: |
203+
version="$(npx expo config --json --type public | jq -r '.version')"
204+
{
205+
echo "## Manual production build"
206+
echo
207+
echo "- App version: \`$version\`"
208+
echo "- Platform: \`${{ inputs.platform }}\`"
209+
echo
210+
echo "> Apple closes an iOS release train after App Store approval. Before building iOS, confirm \`$version\` is newer than the approved App Store version."
211+
} >> "$GITHUB_STEP_SUMMARY"
212+
138213
- name: Build and submit (manual)
139214
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
140215
working-directory: apps/mobile
@@ -157,10 +232,8 @@ jobs:
157232
158233
# No --status filter on build:list: an in-queue/in-progress build must
159234
# count as existing, or every merge during the build window would cut a
160-
# duplicate. Builds started here stay attached to this serialized run so
161-
# the queued run for a later merge cannot overtake them and lose its OTA.
162-
# After an errored build, retry via workflow_dispatch mode=build — pushes
163-
# won't re-trigger it until the app version changes.
235+
# duplicate. After an errored build, retry via workflow_dispatch
236+
# mode=build — pushes won't re-trigger it until the app version changes.
164237
- id: store_builds
165238
name: Ensure store builds exist for the current app version
166239
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
@@ -178,8 +251,8 @@ jobs:
178251
continue
179252
fi
180253
echo "$platform: latest production build is $latest, app.config.ts says $version — building"
181-
if eas build --platform "$platform" --profile production --auto-submit --non-interactive; then
182-
echo ":building_construction: $platform: cut production build for $version (auto-submitted)" >> "$GITHUB_STEP_SUMMARY"
254+
if eas build --platform "$platform" --profile production --auto-submit --non-interactive --no-wait; then
255+
echo ":building_construction: $platform: scheduled production build and submission for $version" >> "$GITHUB_STEP_SUMMARY"
183256
else
184257
failed=1
185258
echo ":x: $platform: production build or submission failed for $version" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)