Skip to content

Commit b14d1b3

Browse files
committed
chore: merge main into fix/composer-screen-reader-suggestions
2 parents 8c54eeb + 112a708 commit b14d1b3

297 files changed

Lines changed: 17856 additions & 4548 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/workflows/release-desktop.yml‎

Lines changed: 528 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/release.yml‎

Lines changed: 358 additions & 455 deletions
Large diffs are not rendered by default.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_modules
55
*.log
66
*.tsbuildinfo
77
apps/*/dist
8+
apps/*/dist-exe
89
infra/*/dist
910
.astro
1011
packages/*/dist

‎.macroscope/check-run-agents/effect-service-conventions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Effect Service Conventions
33
model: gpt-5-6-sol
44
effort: medium
5-
input: full_diff
5+
input: incremental
66
tools:
77
- browse_code
88
- modify_pr

‎.macroscope/check-run-agents/ui-consistency.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: UI Consistency
3-
model: gpt-5-6-terra
3+
model: gpt-5-6-sol
44
effort: medium
5-
input: full_diff
5+
input: incremental
66
tools:
77
- browse_code
88
- modify_pr

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ The most common defect in this repo is a change that works on the path you teste
7979
- `vp i` installs. Worktrees get this from the t3.json setup script; if module resolution looks broken, it probably did not run.
8080
- `vp run dev` starts server and web. In a worktree, state defaults to that worktree's gitignored `.t3`, which deliberately outranks an ambient `T3CODE_HOME` so you cannot land on shared state by accident. An explicit `--home-dir` still wins.
8181
- Ports derive from the worktree path and are stable across restarts, but read the real ones from the `[dev-runner]` line since occupied ports shift.
82-
- Sharing over the tailnet is three steps: run `vp run dev --share` in the background, wait for the `pairingUrl:` line in its output, paste that full URL (token included) in your reply. Do not wire up `tailscale serve` by hand for this, and do not open the URL yourself.
83-
- The web app requires pairing. Hand over the pairing URL, not the bare origin. A URL without its token is useless to whoever you gave it to. If the token got consumed, mint a fresh one with `node apps/server/src/bin.ts pair` — note it carries standard scopes, while the startup URL carries admin scopes (needed for Settings → Connections management).
82+
- Sharing over the tailnet is three steps: run `vp run dev --share` in the background, wait for the `pairingUrl:` line in its output, then give that full URL to an unpaired browser. Do not wire up `tailscale serve` by hand, open the URL yourself, or consume the user's pairing link. A browser with the reusable dev cookie can use the bare origin. If a normal one-time token was consumed, mint a fresh one with `node apps/server/src/bin.ts pair`. It carries standard scopes, while the startup URL carries admin scopes needed for Connections settings.
83+
- To reuse web dev auth across worktrees, configure one fixed `T3CODE_DEV_AUTH_TOKEN` in the main checkout's gitignored `.env`. The `t3.json` setup links that file into worktrees. Never commit or publish the token or a startup URL. See [Reusable dev credential](docs/operations/development.md#reusable-dev-credential).
8484
- Stop what you started, by the PID you tracked. See rule 1.
8585

8686
## Test data

‎apps/desktop/scripts/electron-launcher.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export function makeDevelopmentEnvironmentScript(environment) {
116116
["T3CODE_COMMIT_HASH", environment.T3CODE_COMMIT_HASH],
117117
["T3CODE_OTLP_TRACES_URL", environment.T3CODE_OTLP_TRACES_URL],
118118
["T3CODE_OTLP_EXPORT_INTERVAL_MS", environment.T3CODE_OTLP_EXPORT_INTERVAL_MS],
119+
["T3CODE_OTLP_HEADERS", environment.T3CODE_OTLP_HEADERS],
120+
["T3CODE_OTLP_PROTOCOL", environment.T3CODE_OTLP_PROTOCOL],
119121
["T3CODE_DESKTOP_APP_USER_MODEL_ID", APP_BUNDLE_ID],
120122
].filter((entry) => typeof entry[1] === "string" && entry[1].trim().length > 0);
121123
return [

‎apps/desktop/scripts/electron-launcher.test.mjs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ describe("electron development launcher", () => {
2121
VITE_DEV_SERVER_URL: "http://127.0.0.1:8526",
2222
T3CODE_PORT: "16566",
2323
T3CODE_HOME: "/tmp/t3",
24+
T3CODE_OTLP_PROTOCOL: "http/protobuf",
2425
});
2526

2627
assert.include(
2728
environmentScript,
2829
"if [ -z \"${VITE_DEV_SERVER_URL:-}\" ]; then export VITE_DEV_SERVER_URL='http://127.0.0.1:8526'; fi",
2930
);
31+
assert.include(
32+
environmentScript,
33+
"if [ -z \"${T3CODE_OTLP_PROTOCOL:-}\" ]; then export T3CODE_OTLP_PROTOCOL='http/protobuf'; fi",
34+
);
3035
assert.notInclude(environmentScript, "\nexport VITE_DEV_SERVER_URL=");
3136
});
3237

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

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,43 @@ export const stopAllPoolInstances = Effect.fn("desktop.app.stopAllPoolInstances"
158158
);
159159

160160
const bootstrap = Effect.gen(function* () {
161-
const pool = yield* DesktopBackendPool.DesktopBackendPool;
162-
const primaryBackend = yield* pool.primary;
163161
const state = yield* DesktopState.DesktopState;
164162
const environment = yield* DesktopEnvironment.DesktopEnvironment;
165163
const desktopSettings = yield* DesktopAppSettings.DesktopAppSettings;
166-
const serverExposure = yield* DesktopServerExposure.DesktopServerExposure;
167-
const wslBackend = yield* DesktopWslBackend.DesktopWslBackend;
168164
const desktopWindow = yield* DesktopWindow.DesktopWindow;
169165
const snapShot = yield* DesktopSnapShot.DesktopSnapShot;
170166
const appActivation = yield* DesktopAppActivation.DesktopAppActivation;
171167
yield* logBootstrapInfo("bootstrap start");
172168

169+
const settings = yield* desktopSettings.get;
170+
// The renderer is served from the bundled client (or Vite in development)
171+
// rather than through the local backend, so the window can open without one.
172+
const electronProtocol = yield* ElectronProtocol.ElectronProtocol;
173+
yield* electronProtocol.registerDesktopProtocol({
174+
scheme: ElectronProtocol.getDesktopScheme(environment.isDevelopment),
175+
...(environment.isDevelopment
176+
? { targetOrigin: Option.getOrThrow(environment.devServerUrl) }
177+
: { assetDirectory: environment.clientAssetsDir }),
178+
clerkFrontendApiHostname: DesktopClerk.desktopClerkFrontendApiHostname,
179+
});
180+
yield* installDesktopIpcHandlers();
181+
yield* logBootstrapInfo("bootstrap ipc handlers registered");
182+
183+
yield* snapShot.initialize;
184+
185+
if (!settings.localEnvironmentEnabled) {
186+
yield* logBootstrapInfo("bootstrap skipping local environment (disabled in settings)");
187+
if (!(yield* Ref.get(state.quitting))) {
188+
yield* desktopWindow.createMainIfBackendReady;
189+
}
190+
return;
191+
}
192+
193+
const pool = yield* DesktopBackendPool.DesktopBackendPool;
194+
const primaryBackend = yield* pool.primary;
195+
const serverExposure = yield* DesktopServerExposure.DesktopServerExposure;
196+
const wslBackend = yield* DesktopWslBackend.DesktopWslBackend;
197+
173198
if (environment.isDevelopment && Option.isNone(environment.configuredBackendPort)) {
174199
return yield* new DesktopDevelopmentBackendPortRequiredError();
175200
}
@@ -186,24 +211,13 @@ const bootstrap = Effect.gen(function* () {
186211
},
187212
);
188213

189-
const settings = yield* desktopSettings.get;
190214
if (settings.serverExposureMode !== environment.defaultDesktopSettings.serverExposureMode) {
191215
yield* logBootstrapInfo("bootstrap restoring persisted server exposure mode", {
192216
mode: settings.serverExposureMode,
193217
});
194218
}
195219
const serverExposureState = yield* serverExposure.configureFromSettings({ port: backendPort });
196220
const backendConfig = yield* serverExposure.backendConfig;
197-
const electronProtocol = yield* ElectronProtocol.ElectronProtocol;
198-
const rendererTarget = environment.isDevelopment
199-
? Option.getOrThrow(environment.devServerUrl)
200-
: backendConfig.httpBaseUrl;
201-
yield* electronProtocol.registerDesktopProtocol({
202-
scheme: ElectronProtocol.getDesktopScheme(environment.isDevelopment),
203-
targetOrigin: rendererTarget,
204-
backendOrigin: backendConfig.httpBaseUrl,
205-
clerkFrontendApiHostname: DesktopClerk.desktopClerkFrontendApiHostname,
206-
});
207221
yield* logBootstrapInfo("bootstrap resolved backend endpoint", {
208222
baseUrl: backendConfig.httpBaseUrl.href,
209223
});
@@ -219,16 +233,13 @@ const bootstrap = Effect.gen(function* () {
219233
"bootstrap fell back to local-only because no advertised network host was available",
220234
);
221235
}
222-
yield* snapShot.initialize;
223-
224-
yield* installDesktopIpcHandlers();
225-
yield* logBootstrapInfo("bootstrap ipc handlers registered");
226236

227237
if (!(yield* Ref.get(state.quitting))) {
228-
// In wsl-only mode the renderer is served by the WSL backend, which can be
229-
// slow to cold-boot — show a "Connecting to WSL" splash immediately so the
230-
// app feels responsive instead of presenting no window until WSL is ready.
231-
// (Dual mode opens fast off the Windows primary, so no splash there.)
238+
// The main window waits for the primary backend. In wsl-only mode that is
239+
// the WSL backend, which can be slow to cold-boot — show a "Connecting to
240+
// WSL" splash immediately so the app feels responsive instead of presenting
241+
// no window until WSL is ready. (Dual mode opens fast off the Windows
242+
// primary, so no splash there.)
232243
if (settings.wslOnly === true && settings.wslBackendEnabled === true) {
233244
yield* desktopWindow.showConnectingSplash;
234245
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { OtlpHeadersFromString, OtlpProtocol } from "@t3tools/shared/observability";
12
import * as Config from "effect/Config";
23
import * as ConfigProvider from "effect/ConfigProvider";
34
import * as Option from "effect/Option";
@@ -48,6 +49,10 @@ export const DesktopConfig = Config.all({
4849
otlpExportIntervalMs: Config.int("T3CODE_OTLP_EXPORT_INTERVAL_MS").pipe(
4950
Config.withDefault(10_000),
5051
),
52+
otlpHeaders: Config.schema(OtlpHeadersFromString, "T3CODE_OTLP_HEADERS").pipe(Config.option),
53+
otlpProtocol: Config.schema(OtlpProtocol, "T3CODE_OTLP_PROTOCOL").pipe(
54+
Config.withDefault("http/json"),
55+
),
5156
appImagePath: trimmedString("APPIMAGE"),
5257
disableAutoUpdate: optionalBoolean("T3CODE_DISABLE_AUTO_UPDATE"),
5358
mockUpdates: optionalBoolean("T3CODE_DESKTOP_MOCK_UPDATES"),

0 commit comments

Comments
 (0)