Skip to content

Commit 3a07c1e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/dialog-close-transitions
# Conflicts: # apps/web/src/components/ChatView.tsx # apps/web/src/components/CommandPalette.tsx # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/SettingsPanels.tsx
2 parents 1f2f6a3 + 36f4314 commit 3a07c1e

1,172 files changed

Lines changed: 148828 additions & 19944 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-app/SKILL.md‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Treat the overall testing or implementation loop—not an assistant turn or one
4040
- Do not stop the server merely because one verification pass completed or because you are yielding a response to the user.
4141
- Before starting another environment, check whether the existing process and browser tab still serve the task. Reuse them when healthy instead of discarding useful state.
4242
- On a later turn, verify that the existing process is alive and reuse its printed ports and base directory. If it exited, restart with the same base directory; create a new pairing token only when the browser session is no longer valid.
43-
- Tell the user when a test environment remains available, including its non-secret web URL when useful. Never include a pairing token.
43+
- Tell the user when a test environment remains available, including its non-secret web URL when useful. Include a pairing token only when the user still needs to pair (see below).
4444

4545
## Authenticate the browser on the first navigation
4646

@@ -50,24 +50,13 @@ Treat the overall testing or implementation loop—not an assistant turn or one
5050
4. Wait for the pairing exchange and redirect to finish before navigating elsewhere.
5151
5. Continue in the same browser context so its stored bearer session remains available.
5252

53-
Treat pairing URLs as secrets. Do not copy them into final responses, screenshots, committed files, or durable logs. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it.
53+
Keep pairing URLs out of screenshots, committed files, and durable logs. When the user asked for a shared environment, the deliverable IS the full pairing URL — paste it in your reply, token and all; a bare origin is useless to them. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it, so never open a URL you handed to the user.
5454

5555
## Recover a consumed or expired pairing token
5656

57-
Create another token against the same database and web URL as the running dev server:
57+
Run `node apps/server/src/bin.ts pair` from the repository root. It discovers the running dev server (worktree `.t3` first, same precedence as the dev runner) and prints a fresh `Pair URL` against the server's current web origin, including a `--share` tailnet origin. Pass `--base-dir <base-dir>` only when the server was started with `--home-dir`, using the identical path.
5858

59-
```bash
60-
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
61-
--base-dir <base-dir> \
62-
--dev-url <web-url> \
63-
--base-url <web-url> \
64-
--ttl 15m \
65-
--label agent-ui-test
66-
```
67-
68-
Use the `Pair URL` from this command once. Derive `<server-port>` and `<web-url>` from the current dev-runner output, including any automatically selected port offset. Setting `T3CODE_PORT` keeps the administrative CLI from probing for an unrelated free port.
69-
70-
Always pass `--dev-url` for a dev-runner environment so the generated pairing URL uses the current web origin. An explicit base directory stores runtime state in `<base-dir>/userdata`; the `<base-dir>/dev` fallback is only used by an implicit dev home. A worktree-local `.t3` counts as explicit, so its state lives in `<worktree>/.t3/userdata`. Use `auth pairing list` to inspect active token metadata; it intentionally cannot reveal token secrets.
59+
Tokens from `pair` carry standard client scopes. The startup pairing URL carries admin scopes; if the user needs Settings → Connections management (`access:write`), restart the server and hand over the new startup URL instead.
7160

7261
## Inspect or seed SQLite state
7362

‎.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."

‎.env.example‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Optional: T3 Connect source builds
2-
# Leave these unset to disable optional T3 Connect features in local source builds.
3-
# Release builds inject their public values at build time. Do not add server-side
4-
# secrets to this file.
2+
# `cp .env.example .env` enables T3 Connect against the production deployment.
3+
# These are the same public identifiers baked into official release builds, not
4+
# secrets. Remove or comment them out to build with cloud features disabled.
5+
# Do not add server-side secrets to this file.
56

6-
# Get these from the Clerk Dashboard under API keys, JWT templates, and OAuth applications.
7-
# T3CODE_CLERK_PUBLISHABLE_KEY=pk_test_...
8-
# T3CODE_CLERK_JWT_TEMPLATE=t3-relay
9-
# T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauthapp_...
7+
# Production Clerk instance. To use your own, get these from the Clerk Dashboard
8+
# under API keys, JWT templates, and OAuth applications.
9+
T3CODE_CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsudDMuY29kZXMk
10+
T3CODE_CLERK_JWT_TEMPLATE=t3-relay
11+
T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=hzxSgY2cH10sDU2r
1012

1113
# Optional: signed macOS passkey builds. The RP domain defaults to the Frontend API
1214
# hostname encoded in T3CODE_CLERK_PUBLISHABLE_KEY. Set the override only when Clerk
@@ -15,8 +17,9 @@
1517
# T3CODE_MACOS_PROVISIONING_PROFILE=/absolute/path/to/t3code.provisionprofile
1618
# T3CODE_CLERK_PASSKEY_RP_DOMAINS=example.clerk.accounts.dev,clerk.example.com
1719

18-
# Get this from your relay deployment. `infra/relay` deploys update it automatically.
19-
# T3CODE_RELAY_URL=https://relay.example.com
20+
# Production relay. For a self-hosted relay, `infra/relay` deploys update it
21+
# automatically.
22+
T3CODE_RELAY_URL=https://relay.t3.codes
2023

2124
# Optional: hosted app origin used by the CLI's out-of-band OAuth flow.
2225
# Defaults to https://app.t3.codes; override to test against a staging deployment.

‎.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.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Triage report
2+
description: Filed with `npx t3 triage`, where a coding agent investigated the machine. For hand-written reports use the bug report template instead.
3+
labels:
4+
- via-triage
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
This structure is what `t3 triage` agents follow. Keep one problem per issue
10+
and redact secrets and home directory paths from anything you paste.
11+
12+
- type: textarea
13+
id: what-happened
14+
attributes:
15+
label: What happened
16+
description: The problem in the user's own words.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: diagnosis
22+
attributes:
23+
label: Diagnosis
24+
description: What the investigation found, grounded in logs and source.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: steps
30+
attributes:
31+
label: Steps to reproduce
32+
description: Minimal, deterministic repro if one was found.
33+
validations:
34+
required: true
35+
36+
- type: input
37+
id: version
38+
attributes:
39+
label: Version
40+
description: Installed t3 version or commit.
41+
placeholder: 0.0.33
42+
validations:
43+
required: true
44+
45+
- type: input
46+
id: environment
47+
attributes:
48+
label: Environment
49+
description: OS, Node version, agent CLI versions if relevant.
50+
placeholder: macOS 15.3, Node 22.6, claude 2.1.0
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
id: evidence
56+
attributes:
57+
label: Evidence
58+
description: The most relevant log lines, trace entries, or stack traces only. Redacted.
59+
render: shell
60+
61+
- type: input
62+
id: related
63+
attributes:
64+
label: Related issues
65+
description: Existing issues that look similar, and why this is not a duplicate.
66+
67+
- type: textarea
68+
id: workaround
69+
attributes:
70+
label: Fix applied or workaround
71+
description: Anything that was run on the machine to unblock the user.
72+
73+
- type: input
74+
id: agent
75+
attributes:
76+
label: Filed by
77+
description: Which agent and model produced this report.
78+
placeholder: claude (opus-5) via t3 triage

0 commit comments

Comments
 (0)