Skip to content

Commit cda59f2

Browse files
Merge remote-tracking branch 'upstream/main' into t3code/pr-16517/fix/snooze-early-wake
# Conflicts: # apps/server/src/orchestration-v2/Orchestrator.ts # apps/server/src/orchestration-v2/runtimeLayer.test.ts # packages/client-runtime/src/state/threadCommands.test.ts # packages/client-runtime/src/state/threadCommands.ts
2 parents 584a271 + ab6be13 commit cda59f2

1,391 files changed

Lines changed: 87732 additions & 61414 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.

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ github:mackinleysmith
5353
github:maria-rcks
5454
github:MatthewFeroz
5555
github:maxwellyoung
56+
github:mweinbach
5657
github:mwolson
5758
github:myacoub91
5859
github:naMqe-h

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

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -164,25 +164,15 @@ async function main() {
164164
}
165165
const safeName = build.versionName.replace(/[^0-9A-Za-z.]+/g, "-").replace(/^-|-$/g, "");
166166
const apkName = `t3code-android-${channel}-${safeName}-${build.versionCode}.apk`;
167-
const tag = outputDirectory ? undefined : requireEnv("RELEASE_TAG");
168-
const snapshotTag = `android-beta-${build.versionCode}`;
169-
const release = tag ? readRelease(tag) : undefined;
170-
const snapshot = tag ? readRelease(snapshotTag) : undefined;
171-
const hasApk = (value) =>
172-
value &&
173-
!value.isDraft &&
174-
value.assets.some(
167+
const tag = `android-beta-${build.versionCode}`;
168+
const release = outputDirectory ? undefined : readRelease(tag);
169+
if (
170+
release &&
171+
!release.isDraft &&
172+
release.assets.some(
175173
(asset) => asset.name === apkName && asset.state === "uploaded" && asset.size > 0,
176-
);
177-
const pruneBetaAssets = () => {
178-
for (const stale of release?.assets ?? []) {
179-
if (stale.name.endsWith(".apk") && stale.name !== apkName) {
180-
gh("release", "delete-asset", tag, stale.name, "--yes");
181-
}
182-
}
183-
};
184-
if (hasApk(release) && hasApk(snapshot)) {
185-
pruneBetaAssets();
174+
)
175+
) {
186176
console.log(`${apkName} is already published.`);
187177
return;
188178
}
@@ -209,16 +199,8 @@ async function main() {
209199
"",
210200
"These builds have been promoted for wider testing, but may still contain bugs. The beta is optional; the store app also works with Nightly servers.",
211201
].join("\n");
212-
// Publish the versioned beta first, then advance the stable download page.
213202
// The build number makes retries and unchanged hourly checks idempotent.
214-
publishBeta(
215-
snapshotTag,
216-
apkPath,
217-
notes,
218-
`Android beta ${build.versionName} (${build.versionCode})`,
219-
);
220-
publishBeta(tag, apkPath, notes, "T3 Code for Android (beta)");
221-
pruneBetaAssets();
203+
publishBeta(tag, apkPath, notes, `Android beta ${build.versionName} (${build.versionCode})`);
222204
} finally {
223205
fs.rmSync(path.dirname(apkPath), { recursive: true, force: true });
224206
}

‎.github/workflows/ci.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,31 @@ jobs:
268268
- name: Setup Vite+
269269
uses: ./.github/actions/setup-ci-deps
270270

271+
# The browser project runs React tests in headless Chromium. Same cache key as
272+
# test_server, so both jobs share one downloaded browser.
273+
- name: Resolve Playwright version
274+
id: playwright_version
275+
run: echo "version=$(node -p "require('./apps/web/node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
276+
277+
- name: Cache Chromium
278+
id: chromium_cache
279+
uses: actions/cache@v6
280+
with:
281+
path: ~/.cache/ms-playwright
282+
key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
283+
284+
- name: Install Chromium for web browser tests
285+
if: steps.chromium_cache.outputs.cache-hit != 'true'
286+
run: node apps/web/node_modules/playwright/cli.js install --only-shell chromium
287+
288+
- name: Install missing Chromium system dependencies
289+
run: |
290+
browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
291+
test -n "$browser"
292+
if ldd "$browser" | grep '=> not found'; then
293+
node apps/web/node_modules/playwright/cli.js install-deps chromium
294+
fi
295+
271296
- name: Test
272297
run: vp run --filter @t3tools/web test
273298

‎.github/workflows/desktop-macos-preview.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ jobs:
7878
- name: Install browser secret helper build libraries
7979
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
8080

81+
# desktop-macos-preview-publish.yml packages this bundle as the preview channel.
8182
- name: Build JS bundle
83+
env:
84+
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && 'preview' || 'dev' }}
8285
run: vp run build:desktop
8386

8487
# Same layout as release.yml's js-bundle so release-desktop.yml can

‎.github/workflows/mobile-android-apk.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Mobile Android APK
22

3-
# Checks closed testing hourly. New beta builds get a versioned prerelease and
4-
# update the android-beta download page. Unchanged checks publish nothing.
3+
# Checks closed testing hourly. Each new beta gets one versioned prerelease.
4+
# Unchanged checks publish nothing.
55
on:
66
schedule:
77
# Avoid minute zero, when GitHub scheduled jobs are busiest.
@@ -21,7 +21,6 @@ jobs:
2121
contents: write
2222
env:
2323
PACKAGE_NAME: com.t3tools.t3code
24-
RELEASE_TAG: android-beta
2524
steps:
2625
- id: credentials
2726
name: Check for Play credentials

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,29 @@ jobs:
234234
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
235235
run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
236236

237+
# @expo/fingerprint swallows autolinking errors and returns no Expo module
238+
# sources, so native changes stop moving the hash and OTAs reach binaries
239+
# that lack them. Refuse to publish any OTA from such a fingerprint.
240+
- name: Verify fingerprints hash Expo native modules
241+
if: steps.expo-token.outputs.present == 'true' && (github.event_name == 'push' || inputs.mode == 'update')
242+
working-directory: apps/mobile
243+
env:
244+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
245+
PLATFORM: ${{ inputs.platform || 'all' }}
246+
run: |
247+
if [ "$PLATFORM" = "all" ]; then platforms="ios android"; else platforms="$PLATFORM"; fi
248+
failed=0
249+
for platform in $platforms; do
250+
# eas-cli prints an environment-loaded notice to stdout before the
251+
# JSON even with --json, so discard everything before the document.
252+
expo_modules="$(eas fingerprint:generate --platform "$platform" --environment production --json --non-interactive | sed -n '/^{/,$p' | jq --arg reason "expoAutolinking${platform^}" '[.sources[] | select((.reasons // []) | index($reason))] | length')"
253+
if [ "${expo_modules:-0}" -eq 0 ]; then
254+
failed=1
255+
echo ":x: $platform: the native fingerprint hashes no Expo native modules — OTAs and builds skipped" >> "$GITHUB_STEP_SUMMARY"
256+
fi
257+
done
258+
exit "$failed"
259+
237260
- name: Publish OTA update (manual)
238261
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'
239262
working-directory: apps/mobile

‎.github/workflows/release-desktop.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ jobs:
501501
# the runner, and only exact versions have a dist directory. Keep in
502502
# step with SEA_NODE_VERSION in apps/server/vite.config.ts.
503503
VP_NODE_VERSION: "26.8.2"
504+
# The executable bundles the server again, so it needs the same stamp
505+
# as release.yml's JS bundle.
506+
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && inputs.release_channel || 'dev' }}
504507
run: node apps/server/scripts/cli.ts build-exe --verbose
505508

506509
- name: Import macOS signing certificate for the CLI archive

‎.github/workflows/release.yml‎

Lines changed: 56 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ jobs:
297297
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
298298
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config build-essential
299299
300+
# The web package's browser project runs React tests in headless Chromium.
301+
- name: Install Chromium for web browser tests
302+
run: node apps/web/node_modules/playwright/cli.js install --with-deps --only-shell chromium
303+
300304
- name: Test
301305
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
302306

@@ -521,7 +525,11 @@ jobs:
521525
# Runs t3#build (which depends on @t3tools/web#build) and
522526
# @t3tools/desktop#build, so apps/server/dist holds the server bundle
523527
# plus the web client and apps/desktop/dist-electron the Electron main.
528+
# The release channel is already stable, nightly, or preview. Builds in
529+
# other repositories report "dev" telemetry.
524530
- name: Build JS bundle
531+
env:
532+
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && needs.preflight.outputs.release_channel || 'dev' }}
525533
run: vp run build:desktop
526534

527535
# Two paths under apps/ so the artifact root is apps/; consumers download
@@ -689,11 +697,8 @@ jobs:
689697
resource_key: win32-arm64
690698
cli_archive: true
691699

692-
# npm gets the same bytes as the GitHub Release: the launcher plus one
693-
# package per CLI archive. Preview publishes too, under the `preview`
694-
# dist-tag, which nothing resolves unless asked for by name.
695-
publish_cli:
696-
name: Publish CLI to npm
700+
release:
701+
name: Publish GitHub Release
697702
needs:
698703
[
699704
preflight,
@@ -702,74 +707,13 @@ jobs:
702707
test,
703708
test_server,
704709
desktop_mac_arm64,
705-
desktop_linux_x64,
706-
desktop_linux_arm64,
707-
desktop_win_x64,
708-
desktop_win_arm64,
709-
]
710-
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.test.result == 'success' && needs.test_server.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }}
711-
runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
712-
timeout-minutes: 15
713-
permissions:
714-
contents: read
715-
id-token: write
716-
steps:
717-
- name: Checkout
718-
uses: actions/checkout@v6
719-
with:
720-
ref: ${{ needs.preflight.outputs.ref }}
721-
sparse-checkout: |
722-
/*
723-
!/.repos/
724-
sparse-checkout-cone-mode: false
725-
726-
- name: Setup Vite+
727-
uses: voidzero-dev/setup-vp@v1
728-
with:
729-
node-version-file: package.json
730-
cache: true
731-
run-install: |
732-
args:
733-
- --filter=t3...
734-
- --filter=@t3tools/scripts...
735-
736-
- name: Download all CLI archives
737-
uses: actions/download-artifact@v8
738-
with:
739-
pattern: cli-*
740-
merge-multiple: true
741-
path: release-cli
742-
743-
- name: Build npm packages from CLI archives
744-
run: node scripts/build-npm-platform-packages.ts --archives-dir release-cli --version "${{ needs.preflight.outputs.version }}" --output-dir npm-packages
745-
746-
# A dry run of every package first: an auth or scope error here (the
747-
# @t3code org missing, a package without a trusted publisher) fails
748-
# before anything is live, instead of after some platforms already are.
749-
- name: Check npm publish access (dry run)
750-
run: |
751-
if ! node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --dry-run --verbose; then
752-
echo "::error::npm publish --dry-run failed. Make sure the @t3code npm org exists and that t3 and every @t3code/t3-<platform> package has a trusted publisher registered for .github/workflows/release.yml (see docs/operations/release.md)." >&2
753-
exit 1
754-
fi
755-
756-
- name: Publish CLI packages
757-
run: node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --verbose
758-
759-
release:
760-
name: Publish GitHub Release
761-
needs:
762-
[
763-
preflight,
764-
desktop_mac_arm64,
765710
desktop_mac_x64,
766711
desktop_linux_x64,
767712
desktop_linux_arm64,
768713
desktop_win_x64,
769714
desktop_win_arm64,
770-
publish_cli,
771715
]
772-
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' && needs.publish_cli.result == 'success' }}
716+
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.test.result == 'success' && needs.test_server.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }}
773717
runs-on: blacksmith-8vcpu-ubuntu-2404
774718
timeout-minutes: 30
775719
permissions:
@@ -957,6 +901,49 @@ jobs:
957901
fail_on_unmatched_files: true
958902
token: ${{ github.token }}
959903

904+
# The `t3` npm package is a launcher that downloads this version's CLI
905+
# archive from the GitHub Release, so it publishes only once that release
906+
# exists. Preview publishes too, under the `preview` dist-tag, which
907+
# nothing resolves unless asked for by name.
908+
publish_cli:
909+
name: Publish CLI to npm
910+
needs: [preflight, release]
911+
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
912+
runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
913+
timeout-minutes: 15
914+
permissions:
915+
contents: read
916+
id-token: write
917+
steps:
918+
- name: Checkout
919+
uses: actions/checkout@v6
920+
with:
921+
ref: ${{ needs.preflight.outputs.ref }}
922+
sparse-checkout: |
923+
/*
924+
!/.repos/
925+
sparse-checkout-cone-mode: false
926+
927+
- name: Setup Vite+
928+
uses: voidzero-dev/setup-vp@v1
929+
with:
930+
node-version-file: package.json
931+
cache: true
932+
run-install: |
933+
args:
934+
- --filter=t3...
935+
- --filter=@t3tools/scripts...
936+
937+
- name: Build the npm launcher
938+
run: node scripts/build-npm-launcher.ts --version "${{ needs.preflight.outputs.version }}" --output-dir npm-packages
939+
940+
- name: Publish the npm launcher
941+
run: |
942+
if ! node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --verbose; then
943+
echo "::error::npm publish failed. Make sure package t3 has a trusted publisher registered for .github/workflows/release.yml (see docs/operations/release.md)." >&2
944+
exit 1
945+
fi
946+
960947
publish_aur:
961948
name: Publish AUR package
962949
needs: [preflight, release]
@@ -1074,8 +1061,8 @@ jobs:
10741061
10751062
deploy_web:
10761063
name: Deploy hosted web app
1077-
needs: [preflight, build_web, release]
1078-
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build_web.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }}
1064+
needs: [preflight, build_web, release, publish_cli]
1065+
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build_web.result == 'success' && needs.release.result == 'success' && needs.publish_cli.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }}
10791066
runs-on: blacksmith-2vcpu-ubuntu-2404
10801067
timeout-minutes: 10
10811068
env:

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dist-electron/
3333
.showcase/
3434
apps/mobile/.showcase/
3535
apps/mobile/.generated/
36+
apps/mobile/.android-cache/
3637
/.generated/
3738
artifacts/app-store/screenshots/
3839
.github/pr-assets/

‎apps/desktop/gnome-extension/metadata.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"uuid": "[email protected]",
33
"name": "T3 Code SnapShots",
44
"description": "Allows T3 Code to capture the focused window, identify it for optional accessibility text, and animate it into T3 Code. Disable this extension to revoke access.",
5-
"shell-version": ["45", "46", "47", "48", "49", "50"],
6-
"version": 2,
5+
"shell-version": ["45", "46", "47", "48", "49", "50", "51"],
6+
"version": 3,
77
"url": "https://github.com/pingdotgg/t3code"
88
}

0 commit comments

Comments
 (0)