Skip to content

Commit 95204ce

Browse files
akjclaude
andcommitted
chore: merge main into fix/mcp-project-settings-overrides
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 parents 59f27e6 + 220eb73 commit 95204ce

5,117 files changed

Lines changed: 418521 additions & 384725 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: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ when inspecting or seeding SQLite. Stop the test server before fixture writes.
3131
From the checkout being tested on the selected device host, run:
3232

3333
```bash
34-
node scripts/mobile-native-client.ts ensure <ios|android> <device-id>
34+
vp run mobile:install <ios|android> <device-id>
3535
```
3636

37-
This reuses a matching native client or builds and installs one. Authorized
38-
mobile verification includes that build step unless the user prohibits it.
37+
This installs the dev client for the checkout's native fingerprint: from the
38+
device, the local cache, or the shared cache in seconds, building once only
39+
when no machine has that fingerprint yet (5-15 minutes, logged to the file it
40+
names). The device id may be omitted when exactly one device is booted. It
41+
prints one JSON line; on failure it names the next command. Authorized mobile
42+
verification includes that step unless the user prohibits it.
43+
44+
For a device you opened in an agent-device session elsewhere (a device pool,
45+
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`
46+
from the directory you opened the session in. It installs the cached build into
47+
that session (`--abi arm64-v8a` for an ARM Android device; `--metro <url>` also
48+
opens it against Metro) and never builds.
3949

4050
Start `vp run dev:client` from `apps/mobile`, or reuse a healthy Metro belonging
4151
to this checkout. Open its printed development-client URL with AgentDevice

‎.devcontainer/devcontainer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 24, Rust stable)
1+
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 26, Rust stable)
22
// and the canonical setup in docs/operations/development.md: global `vp`, `vp i`.
33
// Contributor doc: docs/internals/devcontainer.md
44
{
@@ -8,7 +8,7 @@
88
// nodeGypDependencies (default true) brings python3/make/g++, which Linux
99
// needs for node-pty's node-gyp fallback (its prebuilds are mac/win only).
1010
"ghcr.io/devcontainers/features/node:2": {
11-
"version": "24"
11+
"version": "26"
1212
},
1313
// native/resource-monitor (edition 2024, needs stable >= 1.85). The server
1414
// degrades gracefully without the binary, but CI checks cargo fmt + test.

‎.gitattributes‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Batch files need CRLF for cmd.exe to parse them reliably.
44
*.cmd text eol=crlf
55
*.bat text eol=crlf
6-
# GitHub's GraphQL schema and the operations graphqlgen writes from it.
6+
# GitHub's and Expo's GraphQL schemas and the operations graphqlgen writes from them.
77
packages/source-control-github/schema/** linguist-generated
8+
apps/server/schema/** linguist-generated
89
**/*.graphql.ts linguist-generated

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
name: Setup CI dependencies
22
description: Install Vite+ and the workspace dependencies from cache.
3+
inputs:
4+
task-cache-read-token:
5+
description: Read-only credential for the private maintainer task cache
6+
required: false
7+
default: ""
38
runs:
49
using: composite
510
steps:
6-
# setup-vp reuses an installed exact version, so restoring its home skips the
7-
# installer download on every job.
11+
# ~/.vite-plus holds vp, the Node.js runtime, and pnpm. A cache entry never
12+
# updates, so the key names all three versions; otherwise a pnpm or Node.js
13+
# bump makes every job download them from npm again.
814
- name: Resolve Vite+ version
915
id: vp
1016
shell: bash
1117
run: |
1218
echo "version=$(sed -nE 's/^ vite-plus: ([0-9][^ ]*)$/\1/p' pnpm-workspace.yaml)" >> "$GITHUB_OUTPUT"
19+
echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
20+
echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
1321
1422
- name: Cache Vite+
23+
id: vp_cache
1524
if: steps.vp.outputs.version != ''
1625
uses: actions/cache@v6
1726
with:
1827
path: ~/.vite-plus
19-
key: vite-plus-home-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}
28+
key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
29+
30+
# setup-vp always runs the installer, which fetches vp from npm even when
31+
# this exact version is installed. A cache hit already has everything, so
32+
# skip setup-vp and do its remaining work here. This keeps npm outages from
33+
# failing jobs.
34+
- name: Use cached Vite+
35+
if: steps.vp_cache.outputs.cache-hit == 'true'
36+
shell: bash
37+
run: |
38+
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
39+
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
2040
2141
- name: Setup Vite+
42+
if: steps.vp_cache.outputs.cache-hit != 'true'
2243
uses: voidzero-dev/setup-vp@v1
2344
with:
2445
node-version-file: package.json
@@ -49,3 +70,20 @@ runs:
4970
- name: Install dependencies
5071
shell: bash
5172
run: vp install
73+
74+
- name: Enable shared task cache
75+
if: >-
76+
github.repository == 'pingdotgg/t3code' &&
77+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
78+
hashFiles('.task-cache.json') != '' &&
79+
inputs.task-cache-read-token != ''
80+
shell: bash
81+
env:
82+
T3_TASK_CACHE_READ_TOKEN: ${{ inputs.task-cache-read-token }}
83+
run: |
84+
node infra/task-cache/scripts/install-ci.ts
85+
if [[ ( "$GITHUB_EVENT_NAME" == pull_request && "$GITHUB_BASE_REF" == main ) || ( "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main ) ]]; then
86+
echo 'VP_REMOTE_CACHE=read-write' >> "$GITHUB_ENV"
87+
else
88+
echo 'VP_REMOTE_CACHE=read' >> "$GITHUB_ENV"
89+
fi

‎.github/scripts/check-nightly-release.test.cjs‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ for (const releaseChannel of ["stable", "nightly"]) {
6161
);
6262
assert.equal(calls.length, 0);
6363
});
64-
65-
test(`allows a manual ${releaseChannel} release from main`, async () => {
66-
const { options, calls } = releaseSourceFixture();
67-
await assertReleaseSource({ ...options, releaseChannel });
68-
assert.equal(calls[0].basehead, "candidate...main");
69-
});
7064
}
7165

7266
for (const comparisonStatus of ["behind", "diverged"]) {
@@ -79,13 +73,6 @@ for (const comparisonStatus of ["behind", "diverged"]) {
7973
});
8074
}
8175

82-
test("accepts a release commit already contained in main", async () => {
83-
for (const comparisonStatus of ["ahead", "identical"]) {
84-
const { options } = releaseSourceFixture({ comparisonStatus, eventName: "push" });
85-
await assertCommitOnDefaultBranch({ ...options, sha: "release-commit" });
86-
}
87-
});
88-
8976
function fixture({ releases = [nightly(7)], comparisonStatus = "ahead" } = {}) {
9077
const calls = [];
9178
return {
@@ -119,26 +106,6 @@ test("releases the first nightly when no nightly is published", async () => {
119106
assert.equal(await shouldReleaseNightly(options), true);
120107
});
121108

122-
test("waits six hours after publication, including manual nightlies", async () => {
123-
for (const age of [0, 3, 6 - 1 / 3600]) {
124-
const { options, calls } = fixture({ releases: [nightly(age)] });
125-
assert.equal(await shouldReleaseNightly(options), false);
126-
assert.equal(calls.length, 0);
127-
}
128-
});
129-
130-
test("releases new commits at six hours and after an idle period", async () => {
131-
for (const age of [6, 7, 24]) {
132-
const { options } = fixture({ releases: [nightly(age)] });
133-
assert.equal(await shouldReleaseNightly(options), true);
134-
}
135-
});
136-
137-
test("skips unchanged commits after the gap", async () => {
138-
const { options } = fixture({ comparisonStatus: "identical" });
139-
assert.equal(await shouldReleaseNightly(options), false);
140-
});
141-
142109
test("uses publication time, not release order or the tagged commit date", async () => {
143110
const { options } = fixture({
144111
releases: [nightly(10), nightly(1), nightly(20, { tag_name: "nightly-v0.9.0" })],
@@ -153,13 +120,6 @@ test("ignores stable releases and drafts when checking the gap", async () => {
153120
assert.equal(await shouldReleaseNightly(options), true);
154121
});
155122

156-
test("compares against the published tag, including legacy nightly tags", async () => {
157-
const tag = "nightly-v0.9.0";
158-
const { options, calls } = fixture({ releases: [nightly(7, { tag_name: tag })] });
159-
assert.equal(await shouldReleaseNightly(options), true);
160-
assert.equal(calls[0].basehead, `${tag}...new`);
161-
});
162-
163123
test("fails instead of releasing when GitHub cannot supply release state", async () => {
164124
const { options } = fixture();
165125
options.github.paginate = async () => {
@@ -211,8 +171,3 @@ test("stable releases derive the version from legacy nightly tags", async () =>
211171
});
212172
assert.equal((await resolveLatestNightlyCommit(options)).version, "0.9.0");
213173
});
214-
215-
test("stable releases fail without a published nightly", async () => {
216-
const { options } = nightlyCommitFixture({ releases: [nightly(0, { tag_name: "v1.0.0" })] });
217-
await assert.rejects(resolveLatestNightlyCommit(options), /No published nightly/);
218-
});

‎.github/scripts/ci-changes.cjs‎

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,36 @@
1-
// Decides which CI jobs a change needs. Prints `key=value` lines for
2-
// $GITHUB_OUTPUT; a job runs unless its key is "false".
3-
//
4-
// node ci-changes.cjs --paths <file> gate by the listed paths
5-
// node ci-changes.cjs --paths <file> --full run every Linux job, gate only the macOS lint
6-
// node ci-changes.cjs changed paths unknown: run everything
7-
//
8-
// Every changed path maps to workspace packages, which then pull in their
9-
// dependents from package.json. A path this file does not recognize runs
10-
// everything, so a new root file or directory can only cost minutes.
1+
// Unknown paths run every job; recognized packages pull in their dependents.
2+
// scripts/check-changed.ts shares these decisions so local checks match CI.
113
const fs = require("node:fs");
124
const path = require("node:path");
135

146
const root = path.resolve(__dirname, "../..");
157

16-
// Never read by a build, typecheck, or test. Lint still formats them.
178
const INERT = [
189
/^docs\//,
1910
/^\.(agents|cursor|vscode|devcontainer|macroscope|repos)\//,
2011
/^[^/]+\.md$/,
2112
/^LICENSE$/,
2213
];
2314

24-
// Run everything: the root vite.config.ts loads the first as setup for every
25-
// package's tests, and the vendored mobile tarballs are installed dependencies.
15+
// Shared test setup and vendored mobile dependencies affect every package.
2616
const RUNS_EVERYTHING = [
2717
/^packages\/shared\/src\/(HostProcess|testing\/longTempDir)\.ts$/,
2818
/^apps\/mobile\/deps\//,
2919
];
3020

31-
// Paths outside a package, or files inside one that other packages read
32-
// through relative imports rather than a package.json dependency.
21+
// Includes cross-package reads absent from package.json dependencies.
3322
const EXTRA_OWNERS = [
3423
// Vite configs and tsconfigs of these apps import scripts/lib directly.
3524
[/^scripts\/lib\//, ["@t3tools/desktop", "@t3tools/mobile", "@t3tools/web", "t3"]],
3625
// scripts/build-desktop-artifact.ts reads the GNOME extension manifest.
3726
[/^apps\/desktop\/gnome-extension\//, ["@t3tools/scripts"]],
3827
[/^native\/browser-secret\//, ["@t3tools/desktop"]],
28+
[/^native\/kde-snap-shot\//, ["@t3tools/desktop"]],
3929
[/^native\/libghostty-vt\//, ["@t3tools/web"]],
4030
];
4131
const RUST = /^native\/(resource-monitor|kde-snap-shot|hyprland-snap-shot)\//;
4232

43-
// Tests that read another package's files without declaring it. The scripts
44-
// tests read app manifests, assets, and sources (cursor-sdk-packaging,
45-
// third-party-licenses, brand-assets, build-desktop-artifact).
33+
// These tests read other packages without declaring dependencies.
4634
const TEST_ONLY_DEPS = {
4735
"@t3tools/provider-pi": ["@t3tools/client-runtime"],
4836
"@t3tools/scripts": [
@@ -53,17 +41,12 @@ const TEST_ONLY_DEPS = {
5341
"@t3tools/provider-cursor",
5442
],
5543
};
56-
// Declared dependencies that only feed a build step: the server bundles the
57-
// built web app (apps/server/vite.config.ts) but never imports it.
44+
// The server bundles the web build without importing it.
5845
const BUILD_ONLY_DEPS = { t3: ["@t3tools/web"] };
5946

60-
// Sources scripts/mobile-native-static-check.ts lints, plus the tool and rule
61-
// configuration that decides how it lints them, plus the root package.json
62-
// that defines the lint:mobile command.
6347
const MOBILE_NATIVE =
6448
/^apps\/mobile\/.*\.(swift|kt|kts)$|^apps\/mobile\/(\.swiftlint\.yml|detekt\.yml|\.editorconfig|Brewfile)$|^scripts\/mobile-native-static-check\.ts$|^package\.json$|^\.github\/workflows\/ci\.yml$|^\.github\/scripts\/ci-changes\.cjs$|^\.github\/actions\/ci-changes\//;
6549

66-
// Jobs that test every package except these, which have jobs of their own.
6750
const OWN_TEST_JOB = new Set(["t3", "@t3tools/web", "@t3tools/monorepo"]);
6851

6952
function readWorkspace() {
@@ -105,17 +88,16 @@ function readWorkspace() {
10588
return packages;
10689
}
10790

108-
// Returns the packages a path touches, [] for an inert path, or null when the
109-
// path is not understood and everything must run.
91+
// [] means inert; null means unknown and requires every job.
11092
function ownersOf(file, packages) {
11193
if (INERT.some((pattern) => pattern.test(file))) return [];
11294
// A manifest can change dependencies or versions other packages read.
11395
if (path.posix.basename(file) === "package.json") return null;
11496
if (RUNS_EVERYTHING.some((pattern) => pattern.test(file))) return null;
97+
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
11598
// scripts/build-desktop-artifact.test.ts reads the crates' sources.
116-
if (RUST.test(file)) return ["@t3tools/scripts"];
99+
if (RUST.test(file)) return ["@t3tools/scripts", ...extra];
117100

118-
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
119101
const owner = packages
120102
.filter((pkg) => file.startsWith(`${pkg.dir}/`))
121103
.sort((a, b) => b.dir.length - a.dir.length)[0];
@@ -145,7 +127,6 @@ function decide(files, packages, full) {
145127
if (everything) {
146128
affected = all;
147129
} else {
148-
// Add dependents until nothing changes.
149130
let grew = true;
150131
while (grew) {
151132
grew = false;
@@ -200,4 +181,6 @@ function main() {
200181
for (const [key, value] of Object.entries(outputs)) console.log(`${key}=${value}`);
201182
}
202183

203-
main();
184+
module.exports = { readWorkspace, decide };
185+
186+
if (require.main === module) main();

‎.github/scripts/ci-changes.d.cts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
interface WorkspacePackage {
2+
readonly name: string;
3+
readonly dir: string;
4+
readonly hasTest: boolean;
5+
readonly deps: ReadonlyArray<string>;
6+
}
7+
8+
export function readWorkspace(): Array<WorkspacePackage>;
9+
10+
export function decide(
11+
files: ReadonlyArray<string> | null,
12+
packages: ReadonlyArray<WorkspacePackage>,
13+
full: boolean,
14+
): {
15+
affected: Array<string>;
16+
outputs: {
17+
typecheck: boolean;
18+
build: boolean;
19+
test: boolean;
20+
test_packages: string;
21+
test_web: boolean;
22+
test_server: boolean;
23+
rust: boolean;
24+
release_smoke: boolean;
25+
mobile_native: boolean;
26+
};
27+
};

‎.github/scripts/mirror-play-apk.cjs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// Publishes closed-testing betas, or downloads the internal APK for a normal
2-
// nightly release. Play generates and signs the APK from the
3-
// uploaded bundle with the app signing key, so it carries the same signature
4-
// as the Play Store install. Run by .github/workflows/mobile-android-apk.yml.
1+
// Play signs generated APKs with the app signing key, matching Play Store installs.
52
const { execFileSync } = require("node:child_process");
63
const crypto = require("node:crypto");
74
const fs = require("node:fs");
@@ -50,10 +47,7 @@ async function play(token, method, url) {
5047
return response;
5148
}
5249

53-
// Highest version code the track serves, with its release name. Play names a
54-
// release after the bundle's versionName unless the uploader sets one. This
55-
// endpoint reads without opening an edit; an edit would invalidate any open
56-
// EAS Submit edit made with the same service account.
50+
// Opening an edit would invalidate any EAS Submit edit using the same service account.
5751
async function newestTrackBuild(token, appUrl, trackName) {
5852
const { releases = [] } = await (
5953
await play(token, "GET", `${appUrl}/tracks/${trackName}/releases`)
@@ -82,8 +76,7 @@ function readRelease(tag) {
8276
}
8377
}
8478

85-
// Download to a temporary directory so a failed request cannot leave a partial
86-
// APK among the release assets.
79+
// Stage downloads so failed requests cannot leave partial release assets.
8780
async function downloadApk({ token, appUrl, build, apkName }) {
8881
const generated = await (
8982
await play(token, "GET", `${appUrl}/generatedApks/${build.versionCode}`)

‎.github/scripts/stage-preview-bundle.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"server/dist/client/index.html",
1313
"desktop/dist-electron/main.cjs",
1414
}
15-
# The current bundle is about 32 MiB compressed. Bound extraction on the
16-
# trusted runner even when the PR replaces the uploader entirely.
15+
# Bound trusted-runner extraction even when a PR replaces the uploader.
1716
MAX_ARCHIVE_BYTES = 512 * 1024 * 1024
1817
MAX_EXPANDED_BYTES = 2 * 1024 * 1024 * 1024
1918
MAX_ENTRIES = 50_000
@@ -58,9 +57,7 @@ def stage_bundle(archive: Path, destination: Path):
5857
files.add(name)
5958
if not REQUIRED_FILES <= files:
6059
raise ValueError("Preview bundle is missing required entry points")
61-
# Validate all names before writing anything. This is a fresh directory
62-
# outside the checkout; neither pre-existing links nor trusted files
63-
# can be followed or overwritten. ZIP permissions are never restored.
60+
# Validate before writing into a fresh directory so existing links/files cannot be followed or overwritten.
6461
destination.mkdir(parents=True, exist_ok=False)
6562
for entry in entries:
6663
target = destination / entry.filename

0 commit comments

Comments
 (0)