Skip to content

Commit 5dba2ee

Browse files
authored
Merge branch 'main' into fix/kde-snapshot-first-reply-race
2 parents 6aa017f + a6d9140 commit 5dba2ee

380 files changed

Lines changed: 17116 additions & 2507 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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ prints one JSON line; on failure it names the next command. Mobile verification
4343
includes that step unless the user prohibits it.
4444

4545
For a device you opened in an agent-device session elsewhere (a device pool,
46-
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`
47-
from the directory you opened the session in. It installs the cached build into
48-
that session (`--abi arm64-v8a` for an ARM Android device; `--metro <url>` also
49-
opens it against Metro) and never builds.
46+
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>
47+
--config <file>` from the directory you opened the session in, passing the
48+
`--config` file from `device_open`'s `targetArgs`. Without it, a device pool's
49+
gateway refuses the install, wrongly saying agent-device is too old. It installs
50+
the cached build into that session (`--abi arm64-v8a` for an ARM Android device;
51+
pool Android emulators are x86_64, the default; `--metro <url>` also opens it
52+
against Metro). Without a cached build for this checkout it builds first, which can
53+
outlast the lease, so run `vp run mobile:install <ios|android> --prepare` (with
54+
the same `--abi`) before you open the device.
5055

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

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ jobs:
591591
name: Mobile Native Static Analysis
592592
needs: changes
593593
if: ${{ !cancelled() && needs.changes.outputs.mobile_native != 'false' }}
594-
runs-on: blacksmith-6vcpu-macos-26
594+
runs-on: blacksmith-6vcpu-macos-27
595595
timeout-minutes: 10
596596
steps:
597597
- name: Checkout

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ jobs:
316316
rust_target: aarch64-apple-darwin
317317
resource_key: darwin-arm64
318318
cli_archive: false
319+
untrusted_bundle: true
319320

320321
# Release assets download without a GitHub account, unlike workflow
321322
# artifacts. All preview DMGs live on one rolling prerelease tagged

‎.github/workflows/mobile-dev-client.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ jobs:
219219
ios:
220220
name: iOS simulator
221221
if: github.repository == 'pingdotgg/t3code' && (github.event_name != 'workflow_dispatch' || inputs.platform == 'ios')
222-
runs-on: blacksmith-12vcpu-macos-26
222+
runs-on: blacksmith-12vcpu-macos-27
223223
timeout-minutes: 60
224224
concurrency:
225225
group: mobile-dev-client-ios-${{ github.event_name == 'pull_request' && github.event.pull_request.number || inputs.fingerprint || github.sha }}

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,8 @@ jobs:
680680
echo ":rocket: android: submitted and recorded \`$BUILD_TAG\`" >> "$GITHUB_STEP_SUMMARY"
681681
682682
# Off unless the MOBILE_IOS_LOCAL_BUILDS repository variable is `true`; the
683-
# production job only sets ios_build then. Store binaries need the final
684-
# Xcode 27.1; MOBILE_IOS_ALLOW_XCODE_RC=true accepts the release candidate.
683+
# production job only sets ios_build then. Xcode 27.1 matches the EAS build
684+
# image in eas.json.
685685
# No sticky disk: it mounts ext4 and only works on Linux runners.
686686
ios:
687687
name: iOS store build
@@ -701,7 +701,6 @@ jobs:
701701
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
702702
PROFILE: ${{ needs.production.outputs.ios_profile }}
703703
BUILD_TAG: mobile-ios-build/${{ needs.production.outputs.ios_profile }}/${{ needs.production.outputs.ios_version }}/${{ needs.production.outputs.ios_fingerprint }}
704-
ALLOW_XCODE_RC: ${{ vars.MOBILE_IOS_ALLOW_XCODE_RC == 'true' }}
705704
steps:
706705
- name: Checkout
707706
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
@@ -739,12 +738,9 @@ jobs:
739738
if: steps.record.outputs.built != 'true'
740739
run: |
741740
xcode=/Applications/Xcode_27.1.app
742-
if [ ! -d "$xcode" ] && [ "$ALLOW_XCODE_RC" = "true" ]; then
743-
xcode=/Applications/Xcode_27.1_Release_Candidate.app
744-
fi
745741
if [ ! -d "$xcode" ]; then
746742
ls -d /Applications/Xcode*.app
747-
echo "::error::Xcode 27.1 (final) is not on this runner. Set the MOBILE_IOS_ALLOW_XCODE_RC repository variable to true to build store binaries with the release candidate."
743+
echo "::error::Xcode 27.1 is not on this runner."
748744
exit 1
749745
fi
750746
sudo xcode-select -s "$xcode/Contents/Developer"

‎.github/workflows/mobile-showcase-screenshots.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
ios:
4646
name: iPhone, iPhone Duo, and iPad 13
4747
if: inputs.platform == 'all' || inputs.platform == 'ios'
48-
runs-on: blacksmith-12vcpu-macos-26
48+
runs-on: blacksmith-12vcpu-macos-27
4949
# Capturing every palette multiplies the device matrix by six, and only the
5050
# one native build is shared between them.
5151
timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ on:
7070
required: false
7171
default: false
7272
type: boolean
73+
# Whether the JS bundle came from a pull request. This job holds the
74+
# signing secrets, so packaging then skips every step that runs the bundle.
75+
untrusted_bundle:
76+
required: false
77+
default: false
78+
type: boolean
7379
# A runner of the target's own platform and architecture, for a `runner`
7480
# that cannot execute the target. The build job skips everything that
7581
# runs the packaged binaries, and a second job runs it there.
@@ -134,6 +140,14 @@ jobs:
134140
T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ inputs.clerk_cli_oauth_client_id }}
135141
T3CODE_RELAY_URL: ${{ inputs.relay_url }}
136142
steps:
143+
# The launch check and the CLI archive smoke test both run the bundle.
144+
- name: Reject running an untrusted bundle
145+
if: inputs.untrusted_bundle && (inputs.launch_check || inputs.cli_archive)
146+
shell: bash
147+
run: |
148+
echo "::error::untrusted_bundle cannot be combined with launch_check or cli_archive, which run the bundle."
149+
exit 1
150+
137151
# This repository is public, so Git needs no credentials. checkout's
138152
# credential cleanup runs submodule foreach even with submodules disabled,
139153
# which fails on the orphaned gitlinks in our vendored .repos tree.
@@ -573,6 +587,7 @@ jobs:
573587
pnpm_config_prefer_offline: "true"
574588
T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: true
575589
T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS: ${{ steps.capture_helper_cache.outputs.cache-hit == 'true' }}
590+
T3CODE_DESKTOP_UNTRUSTED_BUNDLE: ${{ inputs.untrusted_bundle }}
576591
CSC_LINK: ${{ secrets.CSC_LINK }}
577592
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
578593
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}

‎apps/desktop/src/app/DesktopCliShim.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const fakeAppImage = (canMount = true, app = REPORTER) => {
5656
`echo $$ >'${root}/mounter.pid'`,
5757
canMount ? `echo '${image}'` : 'echo "Cannot mount AppImage"; exit 1',
5858
// Like the FUSE runtime, any of these unmounts. fd 3 reports to the test when it is open.
59-
`trap 'echo unmounted >&3 2>/dev/null; touch "${root}/unmounted"; exit 0' TERM HUP INT`,
59+
"trap 'echo unmounted >&3 2>/dev/null; exit 0' TERM HUP INT",
6060
"trap 'echo mounted >&3 2>/dev/null' WINCH",
6161
"while :; do sleep 0.05; done",
6262
"",

‎apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,35 @@ describe("DesktopLinuxUrlHandler", () => {
204204
assert.include(entry, "Icon=/home/al ice/icons/T3\\\\x.png");
205205
});
206206

207+
it.each([
208+
{ from: "T3-Code-0.1.8-x86_64.AppImage", to: "T3-Code-x86_64.AppImage", restored: true },
209+
{
210+
from: "T3-Code-0.1.9-nightly.20261110.4449-arm64.AppImage",
211+
to: "T3-Code-Nightly-arm64.AppImage",
212+
restored: true,
213+
},
214+
{ from: "T3-Code-0.1.8-x86_64.AppImage", to: "T3-Code-0.1.9-x86_64.AppImage", restored: false },
215+
{ from: "t3code.AppImage", to: "T3-Code-x86_64.AppImage", restored: false },
216+
{ from: "T3-Code-x86_64.AppImage", to: "T3-Code-x86_64.AppImage", restored: false },
217+
{ from: "../T3-Code-0.1.8-x86_64.AppImage", to: "T3-Code-x86_64.AppImage", restored: false },
218+
])("finds the launch path an update from $from to $to removed", ({ from, to, restored }) => {
219+
for (const dir of ["/home/alice/Applications", '/home/al ice/My "100%" $Apps\\x']) {
220+
const previous = dir + "/" + from;
221+
const previousEntry = DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
222+
displayName: "T3 Code (Beta)",
223+
execTarget: previous,
224+
scheme: "t3code",
225+
});
226+
assert.equal(
227+
DesktopLinuxUrlHandler.replacedVersionedAppImagePath({
228+
previousEntry,
229+
appImagePath: dir + "/" + to,
230+
}),
231+
restored ? previous : null,
232+
);
233+
}
234+
});
235+
207236
it.effect(
208237
"writes the handler entry, refreshes the MIME cache, and claims the scheme default",
209238
() => {

‎apps/desktop/src/app/DesktopLinuxUrlHandler.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,38 @@ export function renderUrlHandlerDesktopEntry(input: {
9696
].join("\n");
9797
}
9898

99+
function parseUrlHandlerExecTarget(entry: string): string | null {
100+
const exec = /^Exec=(.*) %U$/mu.exec(entry)?.[1];
101+
if (exec === undefined) return null;
102+
const unescaped = exec.replace(/\\([\\nrt])/gu, (_, char: string) =>
103+
char === "n" ? "\n" : char === "r" ? "\r" : char === "t" ? "\t" : char,
104+
);
105+
const quoted = /^"(.*)"$/su.exec(unescaped)?.[1];
106+
return (
107+
quoted === undefined ? unescaped : quoted.replace(/\\([\\`$"])/gu, (_, char: string) => char)
108+
).replaceAll("%%", "%");
109+
}
110+
111+
const APPIMAGE_NAME_VERSION = /\d+\.\d+\.\d+/u;
112+
113+
// An updater from before version-free AppImage names deletes its own file and installs the update
114+
// beside it under the new name. The previous launch's entry still names the path launchers use.
115+
export function replacedVersionedAppImagePath(input: {
116+
readonly previousEntry: string;
117+
readonly appImagePath: string;
118+
}): string | null {
119+
const previous = parseUrlHandlerExecTarget(input.previousEntry);
120+
if (previous === null) return null;
121+
const previousName = previous.slice(previous.lastIndexOf("/") + 1);
122+
const currentName = input.appImagePath.slice(input.appImagePath.lastIndexOf("/") + 1);
123+
return previous.startsWith("/") &&
124+
previous.slice(0, -previousName.length) === input.appImagePath.slice(0, -currentName.length) &&
125+
APPIMAGE_NAME_VERSION.test(previousName) &&
126+
!APPIMAGE_NAME_VERSION.test(currentName)
127+
? previous
128+
: null;
129+
}
130+
99131
// Docks may look up the Wayland app id without a desktop entry; icon theme lookups are case-sensitive.
100132
const LINUX_THEME_ICON_SIZE = "256x256";
101133

0 commit comments

Comments
 (0)