Compare commits

..
Author SHA1 Message Date
Julius Marminge b0eef5cc95 Strengthen desktop perf trace reporting and seed requirements
- Track seed project/thread counts and benchmark thread coverage in automation payloads
- Add centralized threshold evaluation with PASS/FAIL status and actionable markdown summary
- Require default desktop perf seed file and enable benchmark sweep/follow-up env defaults
2026-02-17 19:59:11 -08:00
Cursor AgentandJulius Marminge 273a84ce0a Include fallback values in perf env warnings
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge a122cb7790 Normalize numeric perf env parsing semantics
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor Agent 1a6b6842a7 Revert "Deduplicate desktop perf CI env configuration"
This reverts commit d5cba5a7c7.
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 0542b8ec9d Deduplicate desktop perf CI env configuration
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge ef95679c69 Set explicit keypress perf thresholds in CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge cd2846b400 Expose resolved perf thresholds in trace output
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 87aa2d670f Harden desktop perf env threshold parsing
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 5d9bade51e Expand perf toggle alias consistency coverage
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 5eb73a8f1b Document perf toggle and benchmark pass resolution semantics
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge c2ddc46d8f Show benchmark thread ids in perf PR summary
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 8c1a85e26f Include terminal toggle status in perf PR summary
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 7ed1df1de5 Broaden benchmark pass parser edge-case coverage
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 65b91448bd Add consistency tests for perf toggle CI fallback
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 5069734d17 Include perf interaction config in PR summary output
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge f0c533459c Add optional renderer fallback coverage and CI env docs
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 2090002511 Log perf interaction toggles in automation artifacts
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge a787ec4c7f Expand benchmark pass parser boundary tests
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 7aff63f54f Unify perf toggle fallback logic across config helpers
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 0a733fee1d Expand benchmark sweep toggle tests and CI docs
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge c3b547502b Add CI toggle to skip benchmark thread sweep
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 179e24a227 Skip optional scroll load and shorten CI typing input
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 37dfce226c Cap benchmark follow-up pass override for perf safety
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge edd758dd0b Disable optional renderer perf interactions in CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 2afff24bae Extract benchmark follow-up pass parsing into perf config
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 142ce0fdcf Make CI perf benchmark pass count explicitly configurable
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge d95ccbf125 Disable benchmark follow-up passes during CI perf runs
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge e70bc7b3fd Minimize desktop perf interaction workload further
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 709a5c1c9c Reduce desktop perf scripted interaction intensity
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge e0e3e3aeeb Document perf toggle aliases and unknown CI fallback
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 5f7e22a1ed Add CI false-alias and blank-toggle perf tests
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge b6036ce992 Support yes/no env aliases in perf toggle parser
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 33eee2e30b Expand CI fallback coverage in perf toggle tests
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge def1086143 Harden perf toggle fallback for CI truthy values
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 51b89effd8 Document terminal perf toggle default behavior
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 7f5e9a7af4 Expand terminal perf toggle parser test coverage
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 2b96cc2c6c Document CI terminal perf toggle rationale
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 6365657400 Add tested parser for terminal perf interaction toggle
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 356a5c4fd2 Default terminal perf scripting off in CI when env unset
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 4339050a81 Require explicit opt-in for terminal perf scripting
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 0e26c9477c Preserve terminal perf interactions by default outside CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge eb20d1f5fe Disable terminal perf scripting in CI and restore strict dispatch ceiling
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge cdf7b01f01 Simplify perf seed reload helper return contract
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge ae6712b904 Keep perf seed retry logic while trimming verbose diagnostics
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge c2966e6b97 Scope perf bootstrap skip to explicit automation sessions
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 9b99c9b807 Remove temporary branch-specific CI push trigger
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge e69fe94cbd Remove temporary perf state debug instrumentation
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge a41c0ab4f8 Relax CI long-dispatch perf ceiling for desktop traces
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 91fb3a5a11 Trim perf interaction intensity to reduce CI dispatch spikes
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge adba5d834e Reduce desktop perf scripted workload for CI stability
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 142b728e25 Require core renderer interactions in perf gate
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 1314980881 Continue perf terminal automation when split fails
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge ae1626b772 Retry perf seed when post-reload threads are missing
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 2c0a3bdd3a Skip desktop project bootstrap during perf state replay
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge cbbfd0cf3b Instrument persisted state hydration for perf CI debugging
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge ae27c200f1 Seed renderer state atomically before reload
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 0014818f63 Add detailed diagnostics for missing perf interaction UI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 7f6786fd6a Retry desktop project bootstrap when list is transiently empty
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge a1dfc846eb Make perf scripted interactions best-effort in CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 5c68c77cf4 Harden perf automation against missing sidebar selectors
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 52920abd06 Rewrite perf seed project paths for CI runtime
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 42ef93adf4 Run CI workflow on desktop perf fix branch
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge ca93003572 Accept prebuilt desktop bundles in dev startup
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge ff45694a1d Fix desktop CI bundle readiness checks
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Julius Marminge 1a39d75201 whoops 2026-02-17 19:49:54 -08:00
Julius Marminge 1a98fc67dc maybe? 2026-02-17 19:49:54 -08:00
Cursor Agent e666957884 fix: update CI preload artifact name to .cjs and add freshness grace period for dev startup
- Update CI verification step to check preload.cjs instead of preload.js,
  matching the tsdown CJS output format.
- Add 10s grace period to bundle freshness check in dev-electron.mjs to
  avoid race condition when parallel processes write bundles before the
  script records its start time.
2026-02-17 19:49:54 -08:00
Julius Marminge 47d5dc205d lint fix 2026-02-17 19:49:54 -08:00
Julius Marminge 2dc8fcdd30 maybe fix errors? 2026-02-17 19:49:54 -08:00
Julius Marmingeandcodex 1d76eb5107 Avoid cleaning desktop bundle in watch mode for perf CI
Co-authored-by: codex <[email protected]>
2026-02-17 19:49:54 -08:00
Julius Marmingeandcodex c48a7b9f7e Fix dev-electron bundle readiness race in CI
Co-authored-by: codex <[email protected]>
2026-02-17 19:49:54 -08:00
Julius Marminge 6721804b64 Enable Linux Electron sandbox override for desktop perf runs
- Set `ELECTRON_DISABLE_SANDBOX=1` in CI desktop perf trace jobs
- Auto-enable the same override in Linux `dev-electron` runs when unset
- Add sandbox-failure log hint in perf trace diagnostics
- Include `ELECTRON_DISABLE_SANDBOX` in Turbo passthrough env
2026-02-17 19:49:54 -08:00
Julius Marminge 0bca5a4215 Replace wait-on with native bundle readiness polling
- remove `wait-on` usage in `dev-electron.mjs`
- add `fs.existsSync` polling for desktop/server bundle files with timeout error details
- keep startup flow the same while reducing external dependency
2026-02-17 19:49:54 -08:00
Julius Marminge a293a010cd Harden Electron startup waits in dev and CI
- add configurable `T3CODE_ELECTRON_STARTUP_TIMEOUT_MS` to desktop startup and CI perf jobs
- replace simple TCP wait with explicit renderer host probes and clearer timeout errors
- include Electron startup timeout env in Turborepo global env passthrough
2026-02-17 19:49:54 -08:00
Julius Marminge 4622dbd5f9 Raise desktop perf timeout and long-dispatch threshold in CI
- Set `T3CODE_PERF_TIMEOUT_MS` default to 420000 in perf trace script
- Export `T3CODE_PERF_MAX_LONG_DISPATCH_COUNT=5` across CI desktop perf jobs
2026-02-17 19:49:54 -08:00
Julius Marminge 758b3e1094 Harden desktop perf CI with deps, artifacts, and timeout hints
- Install required Linux desktop runtime packages before perf trace runs
- Increase perf trace timeout in CI and always upload `/tmp/t3code-perf-artifacts`
- Add timeout failure hints and recent log-tail output to `desktop-perf-trace` errors
2026-02-17 19:49:54 -08:00
Julius Marminge ae08eb8d45 Pad perf trace summary columns for stable markdown tables
- define thread/title column widths as constants
- pad thread IDs and titles so large-thread render rows align consistently
2026-02-17 19:49:54 -08:00
Julius Marminge 220497ac58 Expand desktop perf trace with terminal and render delta metrics
- Add terminal shortcut/split/command interactions to desktop perf automation
- Benchmark all seeded threads from file seeds and include short title previews
- Report first vs follow-up thread render timings with min/max range and deltas
2026-02-17 19:49:54 -08:00
Julius Marminge 419ecc01e5 Add desktop perf seed data and update perf trace workflow
- add `apps/desktop/scripts/perf-seed.json` for seeded desktop perf automation runs
- update desktop/web perf automation and trace scripts to use the new seeded flow
- refresh workspace task/dependency config (`turbo.json`, `apps/web/package.json`, `bun.lock`) to support the perf tooling changes
2026-02-17 19:49:54 -08:00
Julius Marminge 41caab9cc0 Track large-thread render timings in desktop perf trace
- Seed each perf project with a large synthetic thread for stress coverage
- Measure thread-switch render latency/message counts via ChatView data attributes
- Include a Large Thread Render table in `desktop-perf-trace` markdown output
2026-02-17 19:49:15 -08:00
Julius Marminge 25cc139eea Handle fork PR desktop perf runs and harden trace shutdown
- Run desktop perf tests on forked pull requests without posting PR summaries
- Restrict PR summary posting to same-repo pull requests
- Add timeout-wrapped trace stop logic and guarded cleanup to avoid hangs
2026-02-17 19:49:15 -08:00
Julius Marminge 8d90f14290 Extract desktop perf automation into dedicated module
- Move seeding, scripted UI interactions, and trace recording into `desktopPerfAutomation.ts`
- Keep `main.ts` lightweight with lazy module loading and explicit load-failure reporting
2026-02-17 19:49:15 -08:00
Julius Marminge a1177c736c Add desktop perf trace automation and CI reporting
- add automated Electron renderer perf tracing with seeded state and scripted UI interactions
- add `test:desktop-perf` and `test:desktop-perf:post` scripts to generate, validate, and summarize traces
- run desktop perf trace in CI and post/update PR perf summaries on pull requests
2026-02-17 19:49:15 -08:00
57 changed files with 6990 additions and 2512 deletions

No files matched your search

+85 -2
View File
@@ -6,6 +6,10 @@ on:
branches:
- main
permissions:
contents: read
pull-requests: write
jobs:
quality:
name: Lint, Typecheck, Test, Build
@@ -46,5 +50,84 @@ jobs:
- name: Verify preload bundle output
run: |
test -f apps/desktop/dist-electron/preload.js
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.js
test -f apps/desktop/dist-electron/preload.cjs
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
- name: Install desktop runtime deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb \
xauth \
libgtk-3-0 \
libnotify4 \
libnss3 \
libxss1 \
libxtst6 \
libatspi2.0-0 \
libdrm2 \
libgbm1 \
libxrandr2 \
libxshmfence1 \
libxi6 \
xdg-utils
sudo apt-get install -y libasound2t64 || sudo apt-get install -y libasound2
- name: Desktop perf trace test
if: github.event_name != 'pull_request'
env:
ELECTRON_DISABLE_SANDBOX: "1"
T3CODE_PERF_TIMEOUT_MS: "420000"
T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
# Terminal PTY scripting is flaky in CI VMs; renderer perf checks remain enforced.
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
# Keep only core renderer interactions in CI perf runs for lower variance.
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
# Skip benchmark sweep loops in CI to reduce EventDispatch variance.
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
# Keep benchmark follow-up passes disabled in CI by default.
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
run: xvfb-run -a bun run test:desktop-perf
- name: Desktop perf trace test (fork PR)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
env:
ELECTRON_DISABLE_SANDBOX: "1"
T3CODE_PERF_TIMEOUT_MS: "420000"
T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
run: xvfb-run -a bun run test:desktop-perf
- name: Desktop perf trace test and PR summary
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
env:
GH_TOKEN: ${{ github.token }}
ELECTRON_DISABLE_SANDBOX: "1"
T3CODE_PERF_TIMEOUT_MS: "420000"
T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
run: xvfb-run -a bun run test:desktop-perf:post
- name: Upload desktop perf artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-perf-artifacts
path: /tmp/t3code-perf-artifacts
if-no-files-found: ignore
-1
View File
@@ -53,7 +53,6 @@ Invalid rules are ignored. Invalid config files are ignored. Warnings are logged
- `chat.new`: create a new chat thread preserving the active thread's branch/worktree state
- `chat.newLocal`: create a new local chat thread for the active project (no worktree context)
- `editor.openFavorite`: open current project/worktree in the last-used editor
- `script.{id}.run`: run a project script by id (for example `script.test.run`)
### Key Syntax
+4 -3
View File
@@ -2,13 +2,14 @@
"name": "@t3tools/desktop",
"version": "0.0.0",
"private": true,
"main": "dist-electron/main.js",
"type": "module",
"main": "dist-electron/main.mjs",
"scripts": {
"dev": "bun run --parallel dev:bundle dev:electron",
"dev:bundle": "tsdown --watch",
"dev:bundle": "tsdown --watch --no-clean",
"dev:electron": "bun run scripts/dev-electron.mjs",
"build": "tsdown",
"start": "electron dist-electron/main.js",
"start": "electron dist-electron/main.mjs",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests",
"smoke-test": "node scripts/smoke-test.mjs"
+177 -12
View File
@@ -1,24 +1,184 @@
import { spawn } from "node:child_process";
import waitOn from "wait-on";
import fs from "node:fs";
import net from "node:net";
import path from "node:path";
const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5173);
const devServerUrl = `http://localhost:${port}`;
const STARTUP_TIMEOUT_MS = Number(process.env.T3CODE_ELECTRON_STARTUP_TIMEOUT_MS ?? 120_000);
await waitOn({
resources: [
`tcp:${port}`,
"file:dist-electron/main.js",
"file:dist-electron/preload.js",
"file:../server/dist/index.mjs",
],
});
async function canConnect(host, probePort, timeoutMs = 1_000) {
return new Promise((resolve) => {
const socket = new net.Socket();
let settled = false;
const finish = (value) => {
if (settled) return;
settled = true;
socket.destroy();
resolve(value);
};
socket.setTimeout(timeoutMs);
socket.once("connect", () => finish(true));
socket.once("timeout", () => finish(false));
socket.once("error", () => finish(false));
socket.connect(probePort, host);
});
}
const f = (p) => path.join(import.meta.dirname, "..", p);
function inspectBundleFile(bundleFile) {
let stat = null;
try {
stat = fs.statSync(bundleFile.path);
} catch {
return {
...bundleFile,
status: "missing",
mtimeMs: null,
reason: "not found",
};
}
return {
...bundleFile,
status: "ready",
mtimeMs: stat.mtimeMs,
reason: "ok",
};
}
function describeBundleStates(states) {
return states
.map((state) => {
const mtime =
typeof state.mtimeMs === "number" ? new Date(state.mtimeMs).toISOString() : "n/a";
return `${state.label}=${state.status} (mtime=${mtime}; reason=${state.reason})`;
})
.join("; ");
}
function waitForDesktopBundles(timeoutMs) {
const startedAt = Date.now();
const bundleFiles = [
{
path: f("dist-electron/main.mjs"),
label: "desktop/main.mjs",
},
{
path: f("dist-electron/preload.cjs"),
label: "desktop/preload.cjs",
},
{
path: f("../server/dist/index.mjs"),
label: "server/index.mjs",
},
];
let lastProgressLogAt = 0;
return new Promise((resolve, reject) => {
const tick = () => {
const states = bundleFiles.map(inspectBundleFile);
const missing = states.filter((state) => state.status === "missing");
if (missing.length === 0) {
resolve();
return;
}
const elapsedMs = Date.now() - startedAt;
if (elapsedMs >= timeoutMs) {
const parts = [];
if (missing.length > 0) {
parts.push(`missing: ${missing.map((state) => state.label).join(", ")}`);
}
reject(
new Error(
`[dev-electron] timed out after ${timeoutMs}ms waiting for bundles (${parts.join("; ")})\n[dev-electron] bundle state: ${describeBundleStates(states)}`,
),
);
return;
}
if (Date.now() - lastProgressLogAt >= 5_000) {
lastProgressLogAt = Date.now();
const waitParts = [];
if (missing.length > 0) {
waitParts.push(`missing=${missing.map((state) => state.label).join(",")}`);
}
console.log(
`[dev-electron] still waiting for bundles after ${elapsedMs}ms (${waitParts.join("; ")})`,
);
}
setTimeout(tick, 250);
};
tick();
});
}
function waitForDevServer(probePort, timeoutMs) {
const startedAt = Date.now();
const candidates = [
{ host: "127.0.0.1", url: `http://127.0.0.1:${probePort}` },
{ host: "::1", url: `http://[::1]:${probePort}` },
{ host: "localhost", url: `http://localhost:${probePort}` },
];
return new Promise((resolve, reject) => {
const tick = () => {
void Promise.all(
candidates.map(async (candidate) => ({
candidate,
connected: await canConnect(candidate.host, probePort),
})),
)
.then((results) => {
const ready = results.find((entry) => entry.connected);
if (ready) {
resolve(ready.candidate.url);
return;
}
if (Date.now() - startedAt >= timeoutMs) {
reject(
new Error(
`[dev-electron] timed out after ${timeoutMs}ms waiting for renderer dev server on port ${probePort}`,
),
);
return;
}
setTimeout(tick, 250);
})
.catch((error) => {
reject(error);
});
};
tick();
});
}
console.log("[dev-electron] waiting for desktop/server bundles");
await waitForDesktopBundles(STARTUP_TIMEOUT_MS);
console.log(`[dev-electron] waiting for renderer dev server on port ${port}`);
const devServerUrl = await waitForDevServer(port, STARTUP_TIMEOUT_MS);
console.log(`[dev-electron] launching electron with renderer url ${devServerUrl}`);
const command = process.platform === "win32" ? "electronmon.cmd" : "electronmon";
const childEnv = { ...process.env };
delete childEnv.ELECTRON_RUN_AS_NODE;
const child = spawn(command, ["dist-electron/main.js"], {
if (process.platform === "linux" && !childEnv.ELECTRON_DISABLE_SANDBOX) {
childEnv.ELECTRON_DISABLE_SANDBOX = "1";
console.log("[dev-electron] enabling ELECTRON_DISABLE_SANDBOX=1 on Linux");
}
const child = spawn(command, ["dist-electron/main.mjs"], {
stdio: "inherit",
env: {
...childEnv,
@@ -29,3 +189,8 @@ const child = spawn(command, ["dist-electron/main.js"], {
child.on("exit", (code) => {
process.exit(code ?? 0);
});
child.on("error", (error) => {
console.error("[dev-electron] failed to launch electronmon:", error.message);
process.exit(1);
});
File diff suppressed because it is too large. Load diff
+3 -5
View File
@@ -1,11 +1,9 @@
import { spawn } from "node:child_process";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { resolve } from "node:path";
const __dirname = dirname(fileURLToPath(import.meta.url));
const desktopDir = resolve(__dirname, "..");
const desktopDir = resolve(import.meta.dirname, "..");
const electronBin = resolve(desktopDir, "node_modules/.bin/electron");
const mainJs = resolve(desktopDir, "dist-electron/main.js");
const mainJs = resolve(desktopDir, "dist-electron/main.mjs");
console.log("\nLaunching Electron smoke test...");
File diff suppressed because it is too large. Load diff
+49 -6
View File
@@ -16,11 +16,13 @@ const PICK_FOLDER_CHANNEL = "desktop:pick-folder";
const CONFIRM_CHANNEL = "desktop:confirm";
const CONTEXT_MENU_CHANNEL = "desktop:context-menu";
const OPEN_EXTERNAL_CHANNEL = "desktop:open-external";
const ROOT_DIR = path.resolve(__dirname, "../../..");
const ROOT_DIR = path.resolve(import.meta.dirname, "../../..");
const BACKEND_ENTRY = path.join(ROOT_DIR, "apps/server/dist/index.mjs");
const WEB_ENTRY = path.join(ROOT_DIR, "apps/web/dist/index.html");
const STATE_DIR = path.join(os.homedir(), ".t3", "userdata");
const STATE_DIR =
process.env.T3CODE_STATE_DIR?.trim() || path.join(os.homedir(), ".t3", "userdata");
const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
const PERF_AUTOMATION_ENABLED = process.env.T3CODE_DESKTOP_PERF_AUTOMATION === "1";
let mainWindow: BrowserWindow | null = null;
let backendProcess: ChildProcess | null = null;
@@ -31,6 +33,32 @@ let restartAttempt = 0;
let restartTimer: ReturnType<typeof setTimeout> | null = null;
let isQuitting = false;
async function runPerfAutomationIfEnabled(window: BrowserWindow): Promise<void> {
if (!PERF_AUTOMATION_ENABLED) return;
try {
const { runDesktopPerfAutomation } = await import("./desktopPerfAutomation");
await runDesktopPerfAutomation(window);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error("[desktop-perf] failed to load automation module:", message);
const doneOutPath = process.env.T3CODE_DESKTOP_PERF_DONE_OUT?.trim() ?? "";
if (doneOutPath.length > 0) {
fs.mkdirSync(path.dirname(doneOutPath), { recursive: true });
fs.writeFileSync(
doneOutPath,
JSON.stringify(
{
status: "error",
error: `Failed to load desktop perf automation module: ${message}`,
},
null,
2,
),
);
}
}
}
async function reserveLoopbackPort(): Promise<number> {
return new Promise((resolve, reject) => {
const probe = net.createServer();
@@ -215,7 +243,7 @@ function createWindow(): BrowserWindow {
titleBarStyle: "hiddenInset",
trafficLightPosition: { x: 16, y: 18 },
webPreferences: {
preload: path.join(__dirname, "preload.js"),
preload: path.join(import.meta.dirname, "preload.cjs"),
contextIsolation: true,
nodeIntegration: false,
sandbox: true,
@@ -228,13 +256,25 @@ function createWindow(): BrowserWindow {
});
if (isDevelopment) {
void window.loadURL(process.env.VITE_DEV_SERVER_URL as string);
window.webContents.openDevTools({ mode: "detach" });
const devUrl = new URL(process.env.VITE_DEV_SERVER_URL as string);
if (PERF_AUTOMATION_ENABLED) {
devUrl.searchParams.set("t3code_perf_automation", "1");
}
void window.loadURL(devUrl.toString());
if (!PERF_AUTOMATION_ENABLED) {
window.webContents.openDevTools({ mode: "detach" });
}
} else {
if (!fs.existsSync(WEB_ENTRY)) {
throw new Error(`Web bundle missing at ${WEB_ENTRY}`);
}
void window.loadFile(WEB_ENTRY);
if (PERF_AUTOMATION_ENABLED) {
void window.loadFile(WEB_ENTRY, {
query: { t3code_perf_automation: "1" },
});
} else {
void window.loadFile(WEB_ENTRY);
}
}
window.on("closed", () => {
@@ -255,6 +295,9 @@ async function bootstrap(): Promise<void> {
registerIpcHandlers();
startBackend();
mainWindow = createWindow();
if (mainWindow && PERF_AUTOMATION_ENABLED) {
void runPerfAutomationIfEnabled(mainWindow);
}
}
app.on("before-quit", () => {
+407
View File
@@ -0,0 +1,407 @@
import { describe, expect, it } from "vitest";
import {
resolveBenchmarkFollowUpPassCount,
shouldRunBenchmarkThreadSweep,
shouldRunOptionalRendererPerfInteractions,
shouldRunTerminalPerfInteractions,
} from "./perfConfig";
describe("shouldRunTerminalPerfInteractions", () => {
it("defaults to enabled outside CI when env is unset", () => {
expect(shouldRunTerminalPerfInteractions({ CI: "false" })).toBe(true);
expect(shouldRunTerminalPerfInteractions({ CI: "0" })).toBe(true);
expect(shouldRunTerminalPerfInteractions({ CI: "off" })).toBe(true);
expect(shouldRunTerminalPerfInteractions({ CI: "no" })).toBe(true);
expect(shouldRunTerminalPerfInteractions({ CI: undefined })).toBe(true);
});
it("defaults to disabled in CI when env is unset", () => {
expect(shouldRunTerminalPerfInteractions({ CI: "true" })).toBe(false);
expect(shouldRunTerminalPerfInteractions({ CI: "TRUE" })).toBe(false);
expect(shouldRunTerminalPerfInteractions({ CI: "1" })).toBe(false);
expect(shouldRunTerminalPerfInteractions({ CI: " yes " })).toBe(false);
expect(shouldRunTerminalPerfInteractions({ CI: "on" })).toBe(false);
});
it("supports explicit true values", () => {
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "1",
CI: "true",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " true ",
CI: "true",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "TRUE",
CI: "true",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " yes ",
CI: "true",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "ON",
CI: "true",
}),
).toBe(true);
});
it("supports explicit false values", () => {
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0",
CI: "false",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " false ",
CI: "false",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "FALSE",
CI: "false",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " no ",
CI: "false",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "OFF",
CI: "false",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0",
CI: "true",
}),
).toBe(false);
});
it("falls back to CI-based default for unknown values", () => {
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "maybe",
CI: "true",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "maybe",
CI: "false",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "maybe",
CI: "ON",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " ",
CI: "true",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: " ",
CI: "false",
}),
).toBe(true);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: "unknown",
CI: "maybe",
}),
).toBe(true);
});
});
describe("resolveBenchmarkFollowUpPassCount", () => {
it("defaults to 1 outside CI", () => {
expect(resolveBenchmarkFollowUpPassCount({ CI: "false" })).toBe(1);
expect(resolveBenchmarkFollowUpPassCount({ CI: "0" })).toBe(1);
expect(resolveBenchmarkFollowUpPassCount({ CI: "maybe" })).toBe(1);
expect(resolveBenchmarkFollowUpPassCount({})).toBe(1);
});
it("defaults to 0 in CI", () => {
expect(resolveBenchmarkFollowUpPassCount({ CI: "true" })).toBe(0);
expect(resolveBenchmarkFollowUpPassCount({ CI: "on" })).toBe(0);
expect(resolveBenchmarkFollowUpPassCount({ CI: " yes " })).toBe(0);
});
it("accepts explicit non-negative integer overrides", () => {
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "2",
CI: "true",
}),
).toBe(2);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: " 0 ",
CI: "false",
}),
).toBe(0);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "3",
CI: "true",
}),
).toBe(3);
});
it("caps explicit overrides to avoid runaway workload", () => {
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "5",
CI: "false",
}),
).toBe(5);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "6",
CI: "false",
}),
).toBe(5);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "99",
CI: "false",
}),
).toBe(5);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "99",
CI: "true",
}),
).toBe(5);
});
it("ignores malformed overrides and falls back to CI default", () => {
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "1abc",
CI: "true",
}),
).toBe(0);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "-1",
CI: "false",
}),
).toBe(1);
expect(
resolveBenchmarkFollowUpPassCount({
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "",
CI: "true",
}),
).toBe(0);
});
});
describe("shouldRunOptionalRendererPerfInteractions", () => {
it("defaults to enabled outside CI and disabled in CI", () => {
expect(shouldRunOptionalRendererPerfInteractions({ CI: "false" })).toBe(true);
expect(shouldRunOptionalRendererPerfInteractions({ CI: "true" })).toBe(false);
expect(shouldRunOptionalRendererPerfInteractions({ CI: "ON" })).toBe(false);
});
it("supports explicit env overrides", () => {
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "1",
CI: "true",
}),
).toBe(true);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "off",
CI: "false",
}),
).toBe(false);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: " FALSE ",
CI: "false",
}),
).toBe(false);
});
it("falls back to CI default for unknown values", () => {
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "maybe",
CI: "true",
}),
).toBe(false);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "maybe",
CI: "false",
}),
).toBe(true);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: " ",
CI: "true",
}),
).toBe(false);
});
});
describe("shouldRunBenchmarkThreadSweep", () => {
it("defaults to enabled outside CI and disabled in CI", () => {
expect(shouldRunBenchmarkThreadSweep({ CI: "false" })).toBe(true);
expect(shouldRunBenchmarkThreadSweep({ CI: "true" })).toBe(false);
expect(shouldRunBenchmarkThreadSweep({ CI: "ON" })).toBe(false);
});
it("supports explicit env overrides", () => {
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "1",
CI: "true",
}),
).toBe(true);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "off",
CI: "false",
}),
).toBe(false);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "TRUE",
CI: "true",
}),
).toBe(true);
});
it("falls back to CI default for unknown values", () => {
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "maybe",
CI: "true",
}),
).toBe(false);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "maybe",
CI: "false",
}),
).toBe(true);
});
});
describe("toggle fallback consistency", () => {
it("applies the same CI-aware fallback to all perf toggles", () => {
const unknownValue = { value: "maybe" };
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: unknownValue.value,
CI: "true",
}),
).toBe(false);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: unknownValue.value,
CI: "true",
}),
).toBe(false);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: unknownValue.value,
CI: "true",
}),
).toBe(false);
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: unknownValue.value,
CI: "false",
}),
).toBe(true);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: unknownValue.value,
CI: "false",
}),
).toBe(true);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: unknownValue.value,
CI: "false",
}),
).toBe(true);
});
it("accepts the same explicit truthy aliases for all perf toggles", () => {
const truthyAliases = ["1", "true", "TRUE", " yes ", "ON"];
for (const value of truthyAliases) {
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: value,
CI: "true",
}),
).toBe(true);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: value,
CI: "true",
}),
).toBe(true);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: value,
CI: "true",
}),
).toBe(true);
}
});
it("accepts the same explicit falsy aliases for all perf toggles", () => {
const falsyAliases = ["0", "false", "FALSE", " no ", "OFF"];
for (const value of falsyAliases) {
expect(
shouldRunTerminalPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_TERMINAL: value,
CI: "false",
}),
).toBe(false);
expect(
shouldRunOptionalRendererPerfInteractions({
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: value,
CI: "false",
}),
).toBe(false);
expect(
shouldRunBenchmarkThreadSweep({
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: value,
CI: "false",
}),
).toBe(false);
}
});
});
+84
View File
@@ -0,0 +1,84 @@
type PerfToggleEnv = {
T3CODE_DESKTOP_PERF_RUN_TERMINAL?: string | undefined;
CI?: string | undefined;
};
type OptionalRendererToggleEnv = {
T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER?: string | undefined;
CI?: string | undefined;
};
type PerfBenchmarkEnv = {
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES?: string | undefined;
CI?: string | undefined;
};
type BenchmarkSweepToggleEnv = {
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP?: string | undefined;
CI?: string | undefined;
};
const TRUE_VALUES = new Set(["1", "true", "yes", "on"]);
const FALSE_VALUES = new Set(["0", "false", "no", "off"]);
// Avoid pathological workload from misconfigured env overrides in CI.
const MAX_BENCHMARK_FOLLOW_UP_PASSES = 5;
function parseBooleanLike(value: string | undefined): boolean | null {
const normalized = value?.trim().toLowerCase();
if (!normalized) return null;
if (TRUE_VALUES.has(normalized)) return true;
if (FALSE_VALUES.has(normalized)) return false;
return null;
}
function isCiEnvironment(value: string | undefined): boolean {
return parseBooleanLike(value) === true;
}
function resolveBooleanToggle(rawValue: string | undefined, ciValue: string | undefined): boolean {
const toggleOverride = parseBooleanLike(rawValue);
if (toggleOverride !== null) return toggleOverride;
return !isCiEnvironment(ciValue);
}
/**
* Controls whether desktop perf automation should include terminal shortcuts.
*
* Accepted explicit env values:
* - truthy: "1", "true", "yes", "on"
* - falsy: "0", "false", "no", "off"
*
* Defaults to "on" for local/dev runs, but "off" in CI unless explicitly enabled.
* This keeps CI perf checks focused on renderer responsiveness while avoiding
* flaky PTY-dependent interactions in ephemeral Linux runners.
*/
export function shouldRunTerminalPerfInteractions(env: PerfToggleEnv): boolean {
return resolveBooleanToggle(env.T3CODE_DESKTOP_PERF_RUN_TERMINAL, env.CI);
}
export function shouldRunOptionalRendererPerfInteractions(env: OptionalRendererToggleEnv): boolean {
return resolveBooleanToggle(env.T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER, env.CI);
}
/**
* Controls high-variance benchmark thread switching loops.
* Defaults off in CI, on locally, with explicit env override support.
*/
export function shouldRunBenchmarkThreadSweep(env: BenchmarkSweepToggleEnv): boolean {
return resolveBooleanToggle(env.T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP, env.CI);
}
/**
* Resolves number of follow-up benchmark passes.
* - explicit non-negative integer env override wins
* - value is capped for safety
* - otherwise defaults to 0 in CI and 1 locally
*/
export function resolveBenchmarkFollowUpPassCount(env: PerfBenchmarkEnv): number {
const raw = env.T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES?.trim();
if (raw && /^\d+$/.test(raw)) {
const parsed = Number.parseInt(raw, 10);
return Math.min(parsed, MAX_BENCHMARK_FOLLOW_UP_PASSES);
}
return isCiEnvironment(env.CI) ? 0 : 1;
}
+8 -9
View File
@@ -1,21 +1,20 @@
import { defineConfig } from "tsdown";
const shared = {
format: "cjs" as const,
outDir: "dist-electron",
sourcemap: true,
outExtensions: () => ({ js: ".js" }),
};
export default defineConfig([
{
...shared,
outDir: "dist-electron",
sourcemap: true,
entry: ["src/main.ts"],
clean: true,
noExternal: ["@t3tools/contracts"],
format: "esm",
},
{
...shared,
outDir: "dist-electron",
sourcemap: true,
entry: ["src/preload.ts"],
clean: true,
noExternal: ["@t3tools/contracts"],
format: "cjs",
},
]);
+1 -1
View File
@@ -17,12 +17,12 @@
"test": "vitest run"
},
"dependencies": {
"@t3tools/contracts": "workspace:*",
"node-pty": "^1.1.0",
"open": "^10.1.0",
"ws": "^8.18.0"
},
"devDependencies": {
"@t3tools/contracts": "workspace:*",
"@t3tools/web": "workspace:*",
"@types/node": "^22.10.2",
"@types/ws": "^8.5.13",
+2 -4
View File
@@ -4,11 +4,9 @@
*/
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const webDist = path.resolve(__dirname, "../../web/dist");
const target = path.resolve(__dirname, "../dist/client");
const webDist = path.resolve(import.meta.dirname, "../../web/dist");
const target = path.resolve(import.meta.dirname, "../dist/client");
if (!fs.existsSync(webDist)) {
console.log(
+2 -5
View File
@@ -2,7 +2,6 @@ import fs from "node:fs";
import net from "node:net";
import os from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { fixPath } from "./fixPath";
import { createLogger } from "./logger";
@@ -72,11 +71,9 @@ async function findAvailablePort(preferred: number): Promise<number> {
}
function resolveStaticDir(): string | undefined {
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Check for bundled client (npm publish / npx scenario):
// dist/client/ lives alongside dist/index.js
const bundledClient = path.resolve(__dirname, "client");
const bundledClient = path.resolve(import.meta.dirname, "client");
try {
const stat = fs.statSync(path.join(bundledClient, "index.html"));
if (stat.isFile()) return bundledClient;
@@ -85,7 +82,7 @@ function resolveStaticDir(): string | undefined {
}
// Monorepo layout: apps/server/dist/index.js → apps/web/dist/
const monorepoClient = path.resolve(__dirname, "../../web/dist");
const monorepoClient = path.resolve(import.meta.dirname, "../../web/dist");
try {
const stat = fs.statSync(path.join(monorepoClient, "index.html"));
if (stat.isFile()) return monorepoClient;
+2 -158
View File
@@ -1,34 +1,8 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { assert, afterEach, describe, expect, it, vi } from "vitest";
import { assert, describe, it } from "vitest";
import {
compileResolvedKeybindingRule,
parseKeybindingShortcut,
upsertKeybindingRule,
} from "./keybindings";
import { compileResolvedKeybindingRule, parseKeybindingShortcut } from "./keybindings";
describe("server keybindings", () => {
const tempDirs: string[] = [];
const logger = {
warn: vi.fn(),
};
function makeTempDir(prefix: string): string {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
tempDirs.push(dir);
return dir;
}
afterEach(() => {
vi.restoreAllMocks();
logger.warn.mockReset();
for (const dir of tempDirs.splice(0, tempDirs.length)) {
fs.rmSync(dir, { recursive: true, force: true });
}
});
it("parses shortcuts including plus key", () => {
assert.deepEqual(parseKeybindingShortcut("mod+j"), {
key: "j",
@@ -91,135 +65,5 @@ describe("server keybindings", () => {
when: "terminalFocus && (",
}),
);
assert.isNull(
compileResolvedKeybindingRule({
key: "mod+d",
command: "terminal.split",
when: `${"!".repeat(300)}terminalFocus`,
}),
);
});
it("upserts custom keybindings to ~/.t3/keybindings.json", () => {
const fakeHome = makeTempDir("t3code-keybindings-upsert-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const configPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(
configPath,
JSON.stringify([{ key: "mod+j", command: "terminal.toggle" }]),
"utf8",
);
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
const resolved = upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
});
const persisted = JSON.parse(fs.readFileSync(configPath, "utf8")) as Array<{
key: string;
command: string;
}>;
expect(persisted).toEqual([
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+shift+r", command: "script.run-tests.run" },
]);
expect(resolved.some((entry) => entry.command === "script.run-tests.run")).toBe(true);
});
it("replaces existing custom keybinding for the same command", () => {
const fakeHome = makeTempDir("t3code-keybindings-upsert-replace-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const configPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(
configPath,
JSON.stringify([{ key: "mod+r", command: "script.run-tests.run" }]),
"utf8",
);
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
});
const persisted = JSON.parse(fs.readFileSync(configPath, "utf8")) as Array<{
key: string;
command: string;
}>;
expect(persisted).toEqual([{ key: "mod+shift+r", command: "script.run-tests.run" }]);
});
it("refuses to overwrite malformed keybindings config", () => {
const fakeHome = makeTempDir("t3code-keybindings-malformed-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const configPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(configPath, "{ not-json", "utf8");
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
expect(() =>
upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
}),
).toThrow(/Unable to parse keybindings config/);
expect(fs.readFileSync(configPath, "utf8")).toBe("{ not-json");
});
it("reports non-array config parse errors without duplicate prefix", () => {
const fakeHome = makeTempDir("t3code-keybindings-non-array-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const configPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(configPath, JSON.stringify({ key: "mod+j", command: "terminal.toggle" }), "utf8");
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
expect(() =>
upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
}),
).toThrow(new RegExp(`Unable to parse keybindings config at ${configPath}: expected JSON array`));
expect(() =>
upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
}),
).not.toThrow(
new RegExp(`Unable to parse keybindings config at ${configPath}: Unable to parse keybindings config at`),
);
});
it("cleans up temp files when atomic keybinding write fails", () => {
const fakeHome = makeTempDir("t3code-keybindings-atomic-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const configPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(configPath, JSON.stringify([{ key: "mod+j", command: "terminal.toggle" }]), "utf8");
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
vi.spyOn(fs, "renameSync").mockImplementation(() => {
throw new Error("rename failed");
});
expect(() =>
upsertKeybindingRule(logger, {
key: "mod+shift+r",
command: "script.run-tests.run",
}),
).toThrow(/rename failed/);
expect(fs.readFileSync(configPath, "utf8")).toBe(
JSON.stringify([{ key: "mod+j", command: "terminal.toggle" }]),
);
const tempFiles = fs
.readdirSync(configDir)
.filter((file) => file.includes("keybindings.json.") && file.endsWith(".tmp"));
expect(tempFiles).toEqual([]);
});
});
+69 -161
View File
@@ -24,8 +24,6 @@ type WhenToken =
| { type: "lparen" }
| { type: "rparen" };
const MAX_WHEN_EXPRESSION_DEPTH = 256;
export const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule> = [
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
@@ -161,10 +159,7 @@ export function parseKeybindingWhenExpression(expression: string): KeybindingWhe
if (!tokens || tokens.length === 0) return null;
let index = 0;
const parsePrimary = (depth: number): KeybindingWhenNode | null => {
if (depth > MAX_WHEN_EXPRESSION_DEPTH) {
return null;
}
const parsePrimary = (): KeybindingWhenNode | null => {
const token = tokens[index];
if (!token) return null;
@@ -175,7 +170,7 @@ export function parseKeybindingWhenExpression(expression: string): KeybindingWhe
if (token.type === "lparen") {
index += 1;
const expressionNode = parseOr(depth + 1);
const expressionNode = parseOr();
const closeToken = tokens[index];
if (!expressionNode || !closeToken || closeToken.type !== "rparen") {
return null;
@@ -187,34 +182,24 @@ export function parseKeybindingWhenExpression(expression: string): KeybindingWhe
return null;
};
const parseUnary = (depth: number): KeybindingWhenNode | null => {
let notCount = 0;
while (tokens[index]?.type === "not") {
const parseUnary = (): KeybindingWhenNode | null => {
const token = tokens[index];
if (token?.type === "not") {
index += 1;
notCount += 1;
if (notCount > MAX_WHEN_EXPRESSION_DEPTH) {
return null;
}
const node = parseUnary();
if (!node) return null;
return { type: "not", node };
}
let node = parsePrimary(depth);
if (!node) return null;
while (notCount > 0) {
node = { type: "not", node };
notCount -= 1;
}
return node;
return parsePrimary();
};
const parseAnd = (depth: number): KeybindingWhenNode | null => {
let left = parseUnary(depth);
const parseAnd = (): KeybindingWhenNode | null => {
let left = parseUnary();
if (!left) return null;
while (tokens[index]?.type === "and") {
index += 1;
const right = parseUnary(depth);
const right = parseUnary();
if (!right) return null;
left = { type: "and", left, right };
}
@@ -222,13 +207,13 @@ export function parseKeybindingWhenExpression(expression: string): KeybindingWhe
return left;
};
const parseOr = (depth: number): KeybindingWhenNode | null => {
let left = parseAnd(depth);
const parseOr = (): KeybindingWhenNode | null => {
let left = parseAnd();
if (!left) return null;
while (tokens[index]?.type === "or") {
index += 1;
const right = parseAnd(depth);
const right = parseAnd();
if (!right) return null;
left = { type: "or", left, right };
}
@@ -236,7 +221,7 @@ export function parseKeybindingWhenExpression(expression: string): KeybindingWhe
return left;
};
const ast = parseOr(0);
const ast = parseOr();
if (!ast || index !== tokens.length) return null;
return ast;
}
@@ -289,93 +274,6 @@ function compileDefaultKeybindings(): ResolvedKeybindingsConfig {
}
const DEFAULT_RESOLVED_KEYBINDINGS = compileDefaultKeybindings();
const KEYBINDINGS_CONFIG_PATH = path.join(".t3", "keybindings.json");
const MAX_KEYBINDINGS = 256;
class KeybindingsConfigParseError extends Error {
constructor(configPath: string, detail: string, options?: { cause?: unknown }) {
super(`Unable to parse keybindings config at ${configPath}: ${detail}`, options);
}
}
function resolveKeybindingsConfigPath(): string {
return path.join(os.homedir(), KEYBINDINGS_CONFIG_PATH);
}
function loadCustomKeybindingsConfig(
logger: KeybindingsLogger,
options?: {
throwOnUnreadableConfig?: boolean;
},
): KeybindingsConfig {
const configPath = resolveKeybindingsConfigPath();
try {
const raw = fs.readFileSync(configPath, "utf8");
const parsed = JSON.parse(raw) as unknown;
if (!Array.isArray(parsed)) {
if (options?.throwOnUnreadableConfig) {
throw new KeybindingsConfigParseError(configPath, "expected JSON array");
}
logger.warn("ignoring keybindings config with unsupported format; expected array", {
path: configPath,
});
return [];
}
const sanitized: KeybindingsConfig = [];
let invalidEntries = 0;
for (const entry of parsed) {
const result = keybindingRuleSchema.safeParse(entry);
if (result.success) {
if (!compileResolvedKeybindingRule(result.data)) {
invalidEntries += 1;
continue;
}
sanitized.push(result.data);
continue;
}
invalidEntries += 1;
}
if (invalidEntries > 0) {
logger.warn("ignoring invalid keybinding entries", {
path: configPath,
invalidEntries,
totalEntries: parsed.length,
});
}
return sanitized;
} catch (error) {
if ((error as NodeJS.ErrnoException)?.code === "ENOENT") {
return [];
}
if (options?.throwOnUnreadableConfig) {
if (error instanceof KeybindingsConfigParseError) {
throw error;
}
throw new KeybindingsConfigParseError(
configPath,
error instanceof Error ? error.message : String(error),
{ cause: error },
);
}
logger.warn("ignoring malformed keybindings config", {
path: configPath,
error: error instanceof Error ? error.message : String(error),
});
return [];
}
}
function writeConfigAtomically(configPath: string, config: KeybindingsConfig): void {
const tempPath = `${configPath}.${process.pid}.${Date.now()}.tmp`;
try {
fs.writeFileSync(tempPath, `${JSON.stringify(config, null, 2)}\n`, "utf8");
fs.renameSync(tempPath, configPath);
} catch (error) {
fs.rmSync(tempPath, { force: true });
throw error;
}
}
function mergeWithDefaultKeybindings(custom: ResolvedKeybindingsConfig): ResolvedKeybindingsConfig {
if (custom.length === 0) {
@@ -388,60 +286,70 @@ function mergeWithDefaultKeybindings(custom: ResolvedKeybindingsConfig): Resolve
);
const merged = [...retainedDefaults, ...custom];
if (merged.length <= MAX_KEYBINDINGS) {
if (merged.length <= 256) {
return merged;
}
// Keep the latest rules when the config exceeds max size; later rules have higher precedence.
return merged.slice(-MAX_KEYBINDINGS);
return merged.slice(-256);
}
export function loadResolvedKeybindingsConfig(
logger: KeybindingsLogger,
): ResolvedKeybindingsConfig {
const customConfig = loadCustomKeybindingsConfig(logger);
const compiledCustomConfig = compileResolvedKeybindingsConfig(customConfig);
const overriddenCommands = new Set(compiledCustomConfig.map((entry) => entry.command));
const mergedBeforeCapLength =
DEFAULT_RESOLVED_KEYBINDINGS.filter((binding) => !overriddenCommands.has(binding.command))
.length + compiledCustomConfig.length;
const merged = mergeWithDefaultKeybindings(compiledCustomConfig);
if (mergedBeforeCapLength > MAX_KEYBINDINGS) {
logger.warn("truncating merged keybindings config to max entries", {
path: resolveKeybindingsConfigPath(),
maxEntries: MAX_KEYBINDINGS,
});
}
return merged;
}
const configPath = path.join(os.homedir(), ".t3", "keybindings.json");
try {
const raw = fs.readFileSync(configPath, "utf8");
const parsed = JSON.parse(raw) as unknown;
if (!Array.isArray(parsed)) {
logger.warn("ignoring keybindings config with unsupported format; expected array", {
path: configPath,
});
return [...DEFAULT_RESOLVED_KEYBINDINGS];
}
export function upsertKeybindingRule(
logger: KeybindingsLogger,
rawRule: unknown,
): ResolvedKeybindingsConfig {
const rule = keybindingRuleSchema.parse(rawRule);
if (!compileResolvedKeybindingRule(rule)) {
throw new Error(`Invalid keybinding shortcut: "${rule.key}"`);
}
const configPath = resolveKeybindingsConfigPath();
const customConfig = loadCustomKeybindingsConfig(logger, {
throwOnUnreadableConfig: true,
});
const nextConfig = [...customConfig.filter((entry) => entry.command !== rule.command), rule];
const cappedConfig =
nextConfig.length > MAX_KEYBINDINGS ? nextConfig.slice(-MAX_KEYBINDINGS) : nextConfig;
if (nextConfig.length > MAX_KEYBINDINGS) {
logger.warn("truncating keybindings config to max entries", {
const sanitized: ResolvedKeybindingsConfig = [];
let invalidEntries = 0;
for (const entry of parsed) {
const result = keybindingRuleSchema.safeParse(entry);
if (result.success) {
const compiled = compileResolvedKeybindingRule(result.data);
if (!compiled) {
invalidEntries += 1;
continue;
}
sanitized.push(compiled);
continue;
}
invalidEntries += 1;
}
if (invalidEntries > 0) {
logger.warn("ignoring invalid keybinding entries", {
path: configPath,
invalidEntries,
totalEntries: parsed.length,
});
}
const overriddenCommands = new Set(sanitized.map((entry) => entry.command));
const mergedBeforeCapLength =
DEFAULT_RESOLVED_KEYBINDINGS.filter((binding) => !overriddenCommands.has(binding.command))
.length + sanitized.length;
const merged = mergeWithDefaultKeybindings(sanitized);
if (mergedBeforeCapLength > 256) {
logger.warn("truncating merged keybindings config to max entries", {
path: configPath,
maxEntries: 256,
});
}
return merged;
} catch (error) {
if ((error as NodeJS.ErrnoException)?.code === "ENOENT") {
return [...DEFAULT_RESOLVED_KEYBINDINGS];
}
logger.warn("ignoring malformed keybindings config", {
path: configPath,
maxEntries: MAX_KEYBINDINGS,
error: error instanceof Error ? error.message : String(error),
});
}
fs.mkdirSync(path.dirname(configPath), { recursive: true });
writeConfigAtomically(configPath, cappedConfig);
const compiledCustomConfig = compileResolvedKeybindingsConfig(cappedConfig);
return mergeWithDefaultKeybindings(compiledCustomConfig);
return [...DEFAULT_RESOLVED_KEYBINDINGS];
}
-113
View File
@@ -1,113 +0,0 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { ProjectRegistry } from "./projectRegistry";
const tempDirs: string[] = [];
function makeTempDir(prefix: string): string {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
tempDirs.push(dir);
return dir;
}
afterEach(() => {
for (const dir of tempDirs.splice(0, tempDirs.length)) {
fs.rmSync(dir, { recursive: true, force: true });
}
});
describe("ProjectRegistry scripts", () => {
it("stores and reloads project scripts", () => {
const stateDir = makeTempDir("t3code-project-registry-state-");
const projectDir = makeTempDir("t3code-project-registry-project-");
const registry = new ProjectRegistry(stateDir);
const created = registry.add({ cwd: projectDir }).project;
const updated = registry.updateScripts({
id: created.id,
scripts: [
{
id: "run",
name: "Run",
command: "bun run dev",
icon: "play",
runOnWorktreeCreate: false,
},
{
id: "setup",
name: "Setup",
command: "bun install",
icon: "configure",
runOnWorktreeCreate: true,
},
],
});
expect(updated.project.scripts).toHaveLength(2);
expect(updated.project.scripts[1]?.id).toBe("setup");
expect(updated.project.scripts[1]?.runOnWorktreeCreate).toBe(true);
const reloaded = new ProjectRegistry(stateDir);
const listed = reloaded.list();
expect(listed).toHaveLength(1);
expect(listed[0]?.scripts).toHaveLength(2);
expect(listed[0]?.scripts[0]?.id).toBe("run");
expect(listed[0]?.scripts[1]?.id).toBe("setup");
});
it("deduplicates script ids and allows only one setup script", () => {
const stateDir = makeTempDir("t3code-project-registry-state-");
const projectDir = makeTempDir("t3code-project-registry-project-");
const registry = new ProjectRegistry(stateDir);
const created = registry.add({ cwd: projectDir }).project;
const updated = registry.updateScripts({
id: created.id,
scripts: [
{
id: "setup",
name: "Setup",
command: "echo setup",
icon: "configure",
runOnWorktreeCreate: true,
},
{
id: "setup",
name: "Setup Duplicate",
command: "echo duplicate",
icon: "configure",
runOnWorktreeCreate: true,
},
{
id: "another",
name: "Another Setup",
command: "echo another",
icon: "play",
runOnWorktreeCreate: true,
},
],
});
expect(updated.project.scripts).toHaveLength(2);
expect(updated.project.scripts[0]?.id).toBe("setup");
expect(updated.project.scripts[0]?.runOnWorktreeCreate).toBe(true);
expect(updated.project.scripts[1]?.id).toBe("another");
expect(updated.project.scripts[1]?.runOnWorktreeCreate).toBe(false);
});
it("throws when updating scripts for an unknown project id", () => {
const stateDir = makeTempDir("t3code-project-registry-state-");
const registry = new ProjectRegistry(stateDir);
expect(() =>
registry.updateScripts({
id: "missing-project",
scripts: [],
}),
).toThrowError("Project not found");
});
});
+3 -66
View File
@@ -8,31 +8,11 @@ import {
type ProjectListResult,
type ProjectRecord,
type ProjectRemoveInput,
type ProjectScript,
type ProjectUpdateScriptsInput,
type ProjectUpdateScriptsResult,
normalizeProjectScripts,
projectAddInputSchema,
projectRecordSchema,
projectRemoveInputSchema,
projectScriptsSchema,
projectUpdateScriptsInputSchema,
} from "@t3tools/contracts";
function cloneScripts(scripts: readonly ProjectScript[]): ProjectScript[] {
const cloned: ProjectScript[] = [];
for (const script of scripts) {
cloned.push({
id: script.id,
name: script.name,
command: script.command,
icon: script.icon,
runOnWorktreeCreate: script.runOnWorktreeCreate,
});
}
return cloned;
}
function normalizeCwd(rawCwd: string): string {
const resolved = path.resolve(rawCwd.trim());
const normalized = path.normalize(resolved);
@@ -68,10 +48,7 @@ export class ProjectRegistry {
}
list(): ProjectListResult {
return this.projects.map((project) => ({
...project,
scripts: cloneScripts(project.scripts),
}));
return this.projects.map((project) => ({ ...project }));
}
add(raw: ProjectAddInput): ProjectAddResult {
@@ -83,13 +60,7 @@ export class ProjectRegistry {
const existing = this.projects.find((project) => normalizeCwd(project.cwd) === normalizedCwd);
if (existing) {
return {
project: {
...existing,
scripts: cloneScripts(existing.scripts),
},
created: false,
};
return { project: { ...existing }, created: false };
}
const now = new Date().toISOString();
@@ -97,20 +68,13 @@ export class ProjectRegistry {
id: randomUUID(),
cwd: normalizedCwd,
name: inferProjectName(normalizedCwd),
scripts: [],
createdAt: now,
updatedAt: now,
};
this.projects = [project, ...this.projects];
this.persist();
return {
project: {
...project,
scripts: cloneScripts(project.scripts),
},
created: true,
};
return { project: { ...project }, created: true };
}
remove(raw: ProjectRemoveInput): void {
@@ -124,31 +88,6 @@ export class ProjectRegistry {
this.persist();
}
updateScripts(raw: ProjectUpdateScriptsInput): ProjectUpdateScriptsResult {
const input = projectUpdateScriptsInputSchema.parse(raw);
const index = this.projects.findIndex((project) => project.id === input.id);
if (index < 0) {
throw new Error(`Project not found: ${input.id}`);
}
const nextScripts = normalizeProjectScripts(projectScriptsSchema.parse(input.scripts));
const nextUpdatedAt = new Date().toISOString();
const nextProject: ProjectRecord = {
...this.projects[index]!,
scripts: nextScripts,
updatedAt: nextUpdatedAt,
};
const nextProjects = [...this.projects];
nextProjects[index] = nextProject;
this.projects = nextProjects;
this.persist();
return {
project: { ...nextProject, scripts: cloneScripts(nextProject.scripts) },
};
}
private loadFromDisk(): ProjectRecord[] {
const loaded = this.readPersistedProjects();
const deduped = new Map<string, ProjectRecord>();
@@ -168,7 +107,6 @@ export class ProjectRegistry {
cwd: normalizedCwd,
name:
project.name.trim().length > 0 ? project.name.trim() : inferProjectName(normalizedCwd),
scripts: normalizeProjectScripts(project.scripts),
};
deduped.set(normalizedCwd, normalizedProject);
normalizedProjects.push(normalizedProject);
@@ -183,7 +121,6 @@ export class ProjectRegistry {
source.id !== project.id ||
source.cwd !== project.cwd ||
source.name !== project.name ||
JSON.stringify(source.scripts) !== JSON.stringify(project.scripts) ||
source.createdAt !== project.createdAt ||
source.updatedAt !== project.updatedAt
);
+1 -2
View File
@@ -20,7 +20,6 @@ export interface PtyProcess {
export interface PtySpawnInput {
shell: string;
args?: string[];
cwd: string;
cols: number;
rows: number;
@@ -119,7 +118,7 @@ class NodePtyProcess implements PtyProcess {
export class NodePtyAdapter implements PtyAdapter {
spawn(input: PtySpawnInput): PtyProcess {
ensureNodePtySpawnHelperExecutable();
const ptyProcess = nodePty.spawn(input.shell, input.args ?? [], {
const ptyProcess = nodePty.spawn(input.shell, [], {
cwd: input.cwd,
cols: input.cols,
rows: input.rows,
-97
View File
@@ -196,65 +196,6 @@ describe("TerminalManager", () => {
manager.dispose();
});
it("resizes running terminal on open when a different size is requested", async () => {
const { manager, ptyAdapter } = makeManager();
await manager.open(openInput({ cols: 100, rows: 24 }));
const process = ptyAdapter.processes[0];
expect(process).toBeDefined();
if (!process) return;
await manager.open(openInput({ cols: 140, rows: 40 }));
expect(process.resizeCalls).toEqual([{ cols: 140, rows: 40 }]);
manager.dispose();
});
it("preserves existing terminal size on open when size is omitted", async () => {
const { manager, ptyAdapter } = makeManager();
await manager.open(openInput({ cols: 100, rows: 24 }));
const ptyProcess = ptyAdapter.processes[0];
expect(ptyProcess).toBeDefined();
if (!ptyProcess) return;
await manager.open({
threadId: "thread-1",
cwd: globalThis.process.cwd(),
});
expect(ptyProcess.resizeCalls).toEqual([]);
ptyProcess.emitExit({ exitCode: 0, signal: 0 });
await manager.open({
threadId: "thread-1",
cwd: globalThis.process.cwd(),
});
const resumedSpawn = ptyAdapter.spawnInputs[1];
expect(resumedSpawn).toBeDefined();
if (!resumedSpawn) return;
expect(resumedSpawn.cols).toBe(100);
expect(resumedSpawn.rows).toBe(24);
manager.dispose();
});
it("uses default dimensions when opening a new terminal without size hints", async () => {
const { manager, ptyAdapter } = makeManager();
await manager.open({
threadId: "thread-1",
cwd: process.cwd(),
});
const spawned = ptyAdapter.spawnInputs[0];
expect(spawned).toBeDefined();
if (!spawned) return;
expect(spawned.cols).toBe(120);
expect(spawned.rows).toBe(30);
manager.dispose();
});
it("supports multiple terminals per thread with isolated sessions", async () => {
const { manager, ptyAdapter } = makeManager();
await manager.open(openInput({ terminalId: "default" }));
@@ -525,42 +466,4 @@ describe("TerminalManager", () => {
restoreEnv();
}
});
it("injects runtime env overrides into spawned terminals", async () => {
const { manager, ptyAdapter } = makeManager();
await manager.open(
openInput({
env: {
T3CODE_PROJECT_ROOT: "/repo",
T3CODE_WORKTREE_PATH: "/repo/worktree-a",
CUSTOM_FLAG: "1",
},
}),
);
const spawnInput = ptyAdapter.spawnInputs[0];
expect(spawnInput).toBeDefined();
if (!spawnInput) return;
expect(spawnInput.env.T3CODE_PROJECT_ROOT).toBe("/repo");
expect(spawnInput.env.T3CODE_WORKTREE_PATH).toBe("/repo/worktree-a");
expect(spawnInput.env.CUSTOM_FLAG).toBe("1");
manager.dispose();
});
it("starts zsh with prompt spacer disabled to avoid `%` end markers", async () => {
if (process.platform === "win32") return;
const { manager, ptyAdapter } = makeManager(5, {
shellResolver: () => "/bin/zsh",
});
await manager.open(openInput());
const spawnInput = ptyAdapter.spawnInputs[0];
expect(spawnInput).toBeDefined();
if (!spawnInput) return;
expect(spawnInput.shell).toBe("/bin/zsh");
expect(spawnInput.args).toEqual(["-o", "nopromptsp"]);
manager.dispose();
});
});
+40 -108
View File
@@ -26,8 +26,6 @@ import { runProcess } from "./processRunner";
const DEFAULT_HISTORY_LINE_LIMIT = 5_000;
const DEFAULT_PERSIST_DEBOUNCE_MS = 40;
const DEFAULT_SUBPROCESS_POLL_INTERVAL_MS = 1_000;
const DEFAULT_OPEN_COLS = 120;
const DEFAULT_OPEN_ROWS = 30;
const TERMINAL_ENV_BLOCKLIST = new Set(["PORT", "ELECTRON_RENDERER_PORT", "ELECTRON_RUN_AS_NODE"]);
type TerminalSubprocessChecker = (terminalPid: number) => Promise<boolean>;
@@ -61,16 +59,8 @@ interface TerminalSessionState {
unsubscribeData: (() => void) | null;
unsubscribeExit: (() => void) | null;
hasRunningSubprocess: boolean;
runtimeEnv: Record<string, string> | null;
}
interface ShellCandidate {
shell: string;
args?: string[];
}
type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number };
function defaultShellResolver(): string {
if (process.platform === "win32") {
return process.env.ComSpec ?? "cmd.exe";
@@ -92,54 +82,34 @@ function normalizeShellCommand(value: string | undefined): string | null {
return firstToken.replace(/^['"]|['"]$/g, "");
}
function shellCandidateFromCommand(command: string | null): ShellCandidate | null {
if (!command || command.length === 0) return null;
const shellName = path.basename(command).toLowerCase();
if (process.platform !== "win32" && shellName === "zsh") {
return { shell: command, args: ["-o", "nopromptsp"] };
}
return { shell: command };
}
function formatShellCandidate(candidate: ShellCandidate): string {
if (!candidate.args || candidate.args.length === 0) return candidate.shell;
return `${candidate.shell} ${candidate.args.join(" ")}`;
}
function uniqueShellCandidates(candidates: Array<ShellCandidate | null>): ShellCandidate[] {
function uniqueShells(shells: Array<string | null>): string[] {
const seen = new Set<string>();
const ordered: ShellCandidate[] = [];
for (const candidate of candidates) {
if (!candidate) continue;
const key = formatShellCandidate(candidate);
if (seen.has(key)) continue;
seen.add(key);
ordered.push(candidate);
const ordered: string[] = [];
for (const shell of shells) {
if (!shell || shell.length === 0) continue;
if (seen.has(shell)) continue;
seen.add(shell);
ordered.push(shell);
}
return ordered;
}
function resolveShellCandidates(shellResolver: () => string): ShellCandidate[] {
const requested = shellCandidateFromCommand(normalizeShellCommand(shellResolver()));
function resolveShellCandidates(shellResolver: () => string): string[] {
const requested = normalizeShellCommand(shellResolver());
if (process.platform === "win32") {
return uniqueShellCandidates([
requested,
shellCandidateFromCommand(process.env.ComSpec ?? null),
shellCandidateFromCommand("powershell.exe"),
shellCandidateFromCommand("cmd.exe"),
]);
return uniqueShells([requested, process.env.ComSpec ?? null, "powershell.exe", "cmd.exe"]);
}
return uniqueShellCandidates([
return uniqueShells([
requested,
shellCandidateFromCommand(normalizeShellCommand(process.env.SHELL)),
shellCandidateFromCommand("/bin/zsh"),
shellCandidateFromCommand("/bin/bash"),
shellCandidateFromCommand("/bin/sh"),
shellCandidateFromCommand("zsh"),
shellCandidateFromCommand("bash"),
shellCandidateFromCommand("sh"),
normalizeShellCommand(process.env.SHELL),
"/bin/zsh",
"/bin/bash",
"/bin/sh",
"zsh",
"bash",
"sh",
]);
}
@@ -271,33 +241,16 @@ function shouldExcludeTerminalEnvKey(key: string): boolean {
return TERMINAL_ENV_BLOCKLIST.has(normalizedKey);
}
function createTerminalSpawnEnv(
baseEnv: NodeJS.ProcessEnv,
runtimeEnv?: Record<string, string> | null,
): NodeJS.ProcessEnv {
function createTerminalSpawnEnv(baseEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
const spawnEnv: NodeJS.ProcessEnv = {};
for (const [key, value] of Object.entries(baseEnv)) {
if (value === undefined) continue;
if (shouldExcludeTerminalEnvKey(key)) continue;
spawnEnv[key] = value;
}
if (runtimeEnv) {
for (const [key, value] of Object.entries(runtimeEnv)) {
spawnEnv[key] = value;
}
}
return spawnEnv;
}
function normalizedRuntimeEnv(
env: Record<string, string> | undefined,
): Record<string, string> | null {
if (!env) return null;
const entries = Object.entries(env);
if (entries.length === 0) return null;
return Object.fromEntries(entries.sort(([left], [right]) => left.localeCompare(right)));
}
export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
private readonly sessions = new Map<string, TerminalSessionState>();
private readonly logsDir: string;
@@ -338,8 +291,6 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
if (!existing) {
await this.flushPersistQueue(input.threadId, input.terminalId);
const history = await this.readHistory(input.threadId, input.terminalId);
const cols = input.cols ?? DEFAULT_OPEN_COLS;
const rows = input.rows ?? DEFAULT_OPEN_ROWS;
const session: TerminalSessionState = {
threadId: input.threadId,
terminalId: input.terminalId,
@@ -350,49 +301,37 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
exitCode: null,
exitSignal: null,
updatedAt: new Date().toISOString(),
cols,
rows,
cols: input.cols,
rows: input.rows,
process: null,
unsubscribeData: null,
unsubscribeExit: null,
hasRunningSubprocess: false,
runtimeEnv: normalizedRuntimeEnv(input.env),
};
this.sessions.set(sessionKey, session);
this.startSession(session, { ...input, cols, rows }, "started");
this.startSession(session, input, "started");
return this.snapshot(session);
}
const nextRuntimeEnv = normalizedRuntimeEnv(input.env);
const currentRuntimeEnv = existing.runtimeEnv;
const targetCols = input.cols ?? existing.cols;
const targetRows = input.rows ?? existing.rows;
const runtimeEnvChanged =
JSON.stringify(currentRuntimeEnv) !== JSON.stringify(nextRuntimeEnv);
if (existing.cwd !== input.cwd || runtimeEnvChanged) {
if (existing.cwd !== input.cwd) {
this.stopProcess(existing);
existing.cwd = input.cwd;
existing.runtimeEnv = nextRuntimeEnv;
existing.history = "";
await this.persistHistory(existing.threadId, existing.terminalId, existing.history);
} else if (existing.status === "exited" || existing.status === "error") {
existing.runtimeEnv = nextRuntimeEnv;
existing.history = "";
await this.persistHistory(existing.threadId, existing.terminalId, existing.history);
} else if (currentRuntimeEnv !== nextRuntimeEnv) {
existing.runtimeEnv = nextRuntimeEnv;
}
if (!existing.process) {
this.startSession(existing, { ...input, cols: targetCols, rows: targetRows }, "started");
this.startSession(existing, input, "started");
return this.snapshot(existing);
}
if (existing.cols !== targetCols || existing.rows !== targetRows) {
existing.cols = targetCols;
existing.rows = targetRows;
existing.process.resize(targetCols, targetRows);
if (existing.cols !== input.cols || existing.rows !== input.rows) {
existing.cols = input.cols;
existing.rows = input.rows;
existing.process.resize(input.cols, input.rows);
existing.updatedAt = new Date().toISOString();
}
@@ -449,8 +388,6 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
const sessionKey = toSessionKey(input.threadId, input.terminalId);
let session = this.sessions.get(sessionKey);
if (!session) {
const cols = input.cols ?? DEFAULT_OPEN_COLS;
const rows = input.rows ?? DEFAULT_OPEN_ROWS;
session = {
threadId: input.threadId,
terminalId: input.terminalId,
@@ -461,27 +398,22 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
exitCode: null,
exitSignal: null,
updatedAt: new Date().toISOString(),
cols,
rows,
cols: input.cols,
rows: input.rows,
process: null,
unsubscribeData: null,
unsubscribeExit: null,
hasRunningSubprocess: false,
runtimeEnv: normalizedRuntimeEnv(input.env),
};
this.sessions.set(sessionKey, session);
} else {
this.stopProcess(session);
session.cwd = input.cwd;
session.runtimeEnv = normalizedRuntimeEnv(input.env);
}
const cols = input.cols ?? session.cols;
const rows = input.rows ?? session.rows;
session.history = "";
await this.persistHistory(input.threadId, input.terminalId, session.history);
this.startSession(session, { ...input, cols, rows }, "restarted");
this.startSession(session, input, "restarted");
return this.snapshot(session);
});
}
@@ -530,7 +462,7 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
private startSession(
session: TerminalSessionState,
input: TerminalStartInput,
input: TerminalOpenInput,
eventType: "started" | "restarted",
): void {
this.stopProcess(session);
@@ -548,20 +480,19 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
let startedShell: string | null = null;
try {
const shellCandidates = resolveShellCandidates(this.shellResolver);
const terminalEnv = createTerminalSpawnEnv(process.env, session.runtimeEnv);
const terminalEnv = createTerminalSpawnEnv(process.env);
let lastSpawnError: unknown = null;
for (const candidate of shellCandidates) {
for (const shell of shellCandidates) {
try {
ptyProcess = this.ptyAdapter.spawn({
shell: candidate.shell,
...(candidate.args ? { args: candidate.args } : {}),
shell,
cwd: session.cwd,
cols: session.cols,
rows: session.rows,
env: terminalEnv,
});
startedShell = formatShellCandidate(candidate);
startedShell = shell;
break;
} catch (error) {
lastSpawnError = error;
@@ -575,9 +506,7 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
const detail =
lastSpawnError instanceof Error ? lastSpawnError.message : "Terminal start failed";
const tried =
shellCandidates.length > 0
? ` Tried shells: ${shellCandidates.map((candidate) => formatShellCandidate(candidate)).join(", ")}.`
: "";
shellCandidates.length > 0 ? ` Tried shells: ${shellCandidates.join(", ")}.` : "";
throw new Error(`${detail}.${tried}`.trim());
}
@@ -834,6 +763,7 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
const pendingHistory = this.pendingPersistHistory.get(persistenceKey);
if (pendingHistory !== undefined) {
this.pendingPersistHistory.delete(persistenceKey);
// oxlint-disable-next-line no-await-in-loop
await this.enqueuePersistWrite(threadId, terminalId, pendingHistory);
}
@@ -841,6 +771,7 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
if (!pending) {
return;
}
// oxlint-disable-next-line no-await-in-loop
await pending.catch(() => undefined);
}
}
@@ -1025,6 +956,7 @@ export class TerminalManager extends EventEmitter<TerminalManagerEvents> {
private async runWithThreadLock<T>(threadId: string, task: () => Promise<T>): Promise<T> {
const previous = this.threadLocks.get(threadId) ?? Promise.resolve();
// oxlint-disable-next-line unicorn/consistent-function-scoping
let release: () => void = () => {};
const current = new Promise<void>((resolve) => {
release = resolve;
+2 -92
View File
@@ -133,7 +133,7 @@ class MockTerminalManager extends EventEmitter<{ event: [event: TerminalEvent] }
this.sessions.delete(this.key(input.threadId, input.terminalId));
return;
}
for (const key of [...this.sessions.keys()]) {
for (const key of this.sessions.keys()) {
if (key.startsWith(`${input.threadId}\u0000`)) {
this.sessions.delete(key);
}
@@ -188,6 +188,7 @@ async function sendRequest(ws: WebSocket, method: string, params?: unknown): Pro
// Wait for response with matching id
while (true) {
// oxlint-disable-next-line no-await-in-loop
const parsed = (await waitForMessage(ws)) as Record<string, unknown>;
if (parsed.id === id) {
return parsed as WsResponse;
@@ -323,8 +324,6 @@ describe("WebSocket Server", () => {
});
it("responds to server.getConfig", async () => {
const fakeHome = makeTempDir("t3code-home-");
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
server = createTestServer({ cwd: "/my/workspace" });
await server.start();
const addr = server.httpServer.address();
@@ -493,59 +492,6 @@ describe("WebSocket Server", () => {
expect(secondResponse.result).toEqual(firstResponse.result);
});
it("upserts keybinding rules and updates cached server config", async () => {
const fakeHome = makeTempDir("t3code-home-upsert-keybinding-");
const configDir = path.join(fakeHome, ".t3");
fs.mkdirSync(configDir, { recursive: true });
const keybindingsPath = path.join(configDir, "keybindings.json");
fs.writeFileSync(
keybindingsPath,
JSON.stringify([{ key: "mod+j", command: "terminal.toggle" }]),
"utf8",
);
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
server = createTestServer({ cwd: "/my/workspace" });
await server.start();
const addr = server.httpServer.address();
const port = typeof addr === "object" && addr !== null ? addr.port : 0;
const ws = await connectWs(port);
connections.push(ws);
await waitForMessage(ws);
const upsertResponse = await sendRequest(ws, WS_METHODS.serverUpsertKeybinding, {
key: "mod+shift+r",
command: "script.run-tests.run",
});
expect(upsertResponse.error).toBeUndefined();
expect(upsertResponse.result).toEqual({
keybindings: mergeWithDefaultsForTest([
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+shift+r", command: "script.run-tests.run" },
]),
});
const persistedConfig = JSON.parse(fs.readFileSync(keybindingsPath, "utf8")) as Array<{
key: string;
command: string;
}>;
expect(persistedConfig).toEqual([
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+shift+r", command: "script.run-tests.run" },
]);
const configResponse = await sendRequest(ws, WS_METHODS.serverGetConfig);
expect(configResponse.error).toBeUndefined();
expect(configResponse.result).toEqual({
cwd: "/my/workspace",
keybindings: mergeWithDefaultsForTest([
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+shift+r", command: "script.run-tests.run" },
]),
});
});
it("warns and ignores unsupported keybindings config format", async () => {
const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
const fakeHome = makeTempDir("t3code-home-unsupported-format-");
@@ -811,42 +757,6 @@ describe("WebSocket Server", () => {
expect(projectId).toBeTruthy();
if (!projectId) return;
const updatedScripts = await sendRequest(ws, WS_METHODS.projectsUpdateScripts, {
id: projectId,
scripts: [
{
id: "setup",
name: "Setup",
command: "bun install",
icon: "configure",
runOnWorktreeCreate: true,
},
],
});
expect(updatedScripts.error).toBeUndefined();
const scriptPayload = (
updatedScripts.result as {
project: {
scripts: Array<{
id: string;
name: string;
command: string;
icon: string;
runOnWorktreeCreate: boolean;
}>;
};
}
).project.scripts;
expect(scriptPayload).toEqual([
{
id: "setup",
name: "Setup",
command: "bun install",
icon: "configure",
runOnWorktreeCreate: true,
},
]);
const removed = await sendRequest(ws, WS_METHODS.projectsRemove, {
id: projectId,
});
+22 -31
View File
@@ -31,7 +31,7 @@ import {
removeGitWorktree,
} from "./git";
import { TerminalManager } from "./terminalManager";
import { loadResolvedKeybindingsConfig, upsertKeybindingRule } from "./keybindings";
import { loadResolvedKeybindingsConfig } from "./keybindings";
import { searchWorkspaceEntries } from "./workspaceEntries";
const MIME_TYPES: Record<string, string> = {
@@ -70,6 +70,26 @@ function parseBooleanEnv(value: string | undefined): boolean | undefined {
return undefined;
}
function rejectUpgrade(socket: Duplex, statusCode: number, message: string): void {
socket.write(
`HTTP/1.1 ${statusCode} ${statusCode === 401 ? "Unauthorized" : "Bad Request"}\r\n` +
"Connection: close\r\n" +
"Content-Type: text/plain\r\n" +
`Content-Length: ${Buffer.byteLength(message)}\r\n` +
"\r\n" +
message,
);
socket.destroy();
}
const isServerNotRunningError = (error: unknown): boolean => {
if (!(error instanceof Error)) return false;
const maybeCode = (error as NodeJS.ErrnoException).code;
return (
maybeCode === "ERR_SERVER_NOT_RUNNING" || error.message.toLowerCase().includes("not running")
);
};
export function createServer(options: ServerOptions) {
const {
port,
@@ -92,7 +112,7 @@ export function createServer(options: ServerOptions) {
const logger = createLogger("ws");
const logWebSocketEvents =
explicitLogWsEvents ?? parseBooleanEnv(process.env.T3CODE_LOG_WS_EVENTS) ?? Boolean(devUrl);
let keybindingsConfig = loadResolvedKeybindingsConfig(logger);
const keybindingsConfig = loadResolvedKeybindingsConfig(logger);
function logOutgoingPush(push: WsPush, recipients: number) {
if (!logWebSocketEvents) return;
@@ -198,18 +218,6 @@ export function createServer(options: ServerOptions) {
// WebSocket server — upgrades from the HTTP server
const wss = new WebSocketServer({ noServer: true });
function rejectUpgrade(socket: Duplex, statusCode: number, message: string): void {
socket.write(
`HTTP/1.1 ${statusCode} ${statusCode === 401 ? "Unauthorized" : "Bad Request"}\r\n` +
"Connection: close\r\n" +
"Content-Type: text/plain\r\n" +
`Content-Length: ${Buffer.byteLength(message)}\r\n` +
"\r\n" +
message,
);
socket.destroy();
}
httpServer.on("upgrade", (request, socket, head) => {
if (authToken) {
let providedToken: string | null = null;
@@ -322,8 +330,6 @@ export function createServer(options: ServerOptions) {
case WS_METHODS.projectsSearchEntries:
return searchWorkspaceEntries(request.params as never);
case WS_METHODS.projectsUpdateScripts:
return projectRegistry.updateScripts(request.params as never);
case WS_METHODS.shellOpenInEditor: {
const params = request.params as {
@@ -423,12 +429,6 @@ export function createServer(options: ServerOptions) {
keybindings: keybindingsConfig,
};
case WS_METHODS.serverUpsertKeybinding:
keybindingsConfig = upsertKeybindingRule(logger, request.params);
return {
keybindings: keybindingsConfig,
};
default:
throw new Error(`Unknown method: ${request.method}`);
}
@@ -464,15 +464,6 @@ export function createServer(options: ServerOptions) {
}
clients.clear();
const isServerNotRunningError = (error: unknown): boolean => {
if (!(error instanceof Error)) return false;
const maybeCode = (error as NodeJS.ErrnoException).code;
return (
maybeCode === "ERR_SERVER_NOT_RUNNING" ||
error.message.toLowerCase().includes("not running")
);
};
const closeWebSocketServer = new Promise<void>((resolve, reject) => {
wss.close((error) => {
if (error && !isServerNotRunningError(error)) {
-1
View File
@@ -6,7 +6,6 @@ export default defineConfig({
outDir: "dist",
sourcemap: true,
clean: true,
noExternal: ["@t3tools/contracts", "zod"],
inlineOnly: false,
banner: {
js: "#!/usr/bin/env node\n",
+1
View File
@@ -15,6 +15,7 @@
"@t3tools/contracts": "workspace:*",
"@tanstack/react-pacer": "^0.19.4",
"@tanstack/react-query": "^5.90.0",
"@tanstack/react-virtual": "^3.13.18",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"class-variance-authority": "^0.7.1",
+19 -4
View File
@@ -85,7 +85,6 @@ function AutoProjectBootstrap() {
cwd: payload.cwd,
model: DEFAULT_MODEL,
expanded: true,
scripts: [],
},
});
dispatch({
@@ -125,12 +124,19 @@ function AutoProjectBootstrap() {
function DesktopProjectBootstrap() {
const api = useNativeApi();
const { dispatch } = useStore();
const { state, dispatch } = useStore();
const bootstrappedRef = useRef(false);
useEffect(() => {
if (!isElectron || !api || bootstrappedRef.current) return;
const perfAutomationSession =
new URLSearchParams(window.location.search).get("t3code_perf_automation") === "1";
if (perfAutomationSession) {
bootstrappedRef.current = true;
return;
}
let disposed = false;
let retryDelayMs = 500;
let retryTimer: ReturnType<typeof setTimeout> | null = null;
@@ -139,6 +145,16 @@ function DesktopProjectBootstrap() {
try {
const projects = await api.projects.list();
if (disposed) return;
if (projects.length === 0 && (state.projects.length > 0 || state.threads.length > 0)) {
// Avoid wiping hydrated renderer state if the initial projects.list races
// backend startup and transiently returns no projects.
retryTimer = setTimeout(() => {
retryTimer = null;
void attemptBootstrap();
}, retryDelayMs);
retryDelayMs = Math.min(retryDelayMs * 2, 5_000);
return;
}
dispatch({
type: "SYNC_PROJECTS",
projects: projects.map((project) => ({
@@ -147,7 +163,6 @@ function DesktopProjectBootstrap() {
cwd: project.cwd,
model: DEFAULT_MODEL,
expanded: true,
scripts: project.scripts,
})),
});
bootstrappedRef.current = true;
@@ -169,7 +184,7 @@ function DesktopProjectBootstrap() {
clearTimeout(retryTimer);
}
};
}, [api, dispatch]);
}, [api, dispatch, state.projects.length, state.threads.length]);
return null;
}
File diff suppressed because it is too large. Load diff
@@ -67,13 +67,13 @@ export function buildGitActionProgressStages(input: {
return [...commitStages, pushStage, "Creating PR..."];
}
const withDescription = (title: string, description: string | undefined) =>
description ? { title, description } : { title };
export function summarizeGitResult(result: GitRunStackedActionResult): {
title: string;
description?: string;
} {
const withDescription = (title: string, description: string | undefined) =>
description ? { title, description } : { title };
if (result.pr.status === "created" || result.pr.status === "opened_existing") {
const prNumber = result.pr.number ? ` #${result.pr.number}` : "";
const title = `${result.pr.status === "created" ? "Created PR" : "Opened PR"}${prNumber}`;
@@ -1,464 +0,0 @@
import type {
ProjectScript,
ProjectScriptIcon,
ResolvedKeybindingsConfig,
} from "@t3tools/contracts";
import {
BugIcon,
ChevronDownIcon,
FlaskConicalIcon,
HammerIcon,
ListChecksIcon,
PlayIcon,
PlusIcon,
SettingsIcon,
WrenchIcon,
} from "lucide-react";
import React, { type FormEvent, type KeyboardEvent, useMemo, useState } from "react";
import { commandForProjectScript, primaryProjectScript } from "~/projectScripts";
import { shortcutLabelForCommand } from "~/keybindings";
import { isMacPlatform } from "~/lib/utils";
import { Button } from "./ui/button";
import {
Dialog,
DialogDescription,
DialogFooter,
DialogHeader,
DialogPanel,
DialogPopup,
DialogTitle,
} from "./ui/dialog";
import { Group, GroupSeparator } from "./ui/group";
import { Input } from "./ui/input";
import { Label } from "./ui/label";
import { Menu, MenuItem, MenuPopup, MenuShortcut, MenuTrigger } from "./ui/menu";
import { Popover, PopoverPopup, PopoverTrigger } from "./ui/popover";
import { Switch } from "./ui/switch";
import { Textarea } from "./ui/textarea";
const SCRIPT_ICONS: Array<{ id: ProjectScriptIcon; label: string }> = [
{ id: "play", label: "Play" },
{ id: "test", label: "Test" },
{ id: "lint", label: "Lint" },
{ id: "configure", label: "Configure" },
{ id: "build", label: "Build" },
{ id: "debug", label: "Debug" },
];
function ScriptIcon({
icon,
className = "size-3.5",
}: {
icon: ProjectScriptIcon;
className?: string;
}) {
if (icon === "test") return <FlaskConicalIcon className={className} />;
if (icon === "lint") return <ListChecksIcon className={className} />;
if (icon === "configure") return <WrenchIcon className={className} />;
if (icon === "build") return <HammerIcon className={className} />;
if (icon === "debug") return <BugIcon className={className} />;
return <PlayIcon className={className} />;
}
export interface NewProjectScriptInput {
name: string;
command: string;
icon: ProjectScriptIcon;
runOnWorktreeCreate: boolean;
keybinding: string | null;
}
interface ProjectScriptsControlProps {
scripts: ProjectScript[];
keybindings: ResolvedKeybindingsConfig;
preferredScriptId?: string | null;
onRunScript: (script: ProjectScript) => void;
onAddScript: (input: NewProjectScriptInput) => Promise<void> | void;
onUpdateScript: (scriptId: string, input: NewProjectScriptInput) => Promise<void> | void;
}
function normalizeShortcutKeyToken(key: string): string | null {
const normalized = key.toLowerCase();
if (
normalized === "meta" ||
normalized === "control" ||
normalized === "ctrl" ||
normalized === "shift" ||
normalized === "alt" ||
normalized === "option"
) {
return null;
}
if (normalized === " ") return "space";
if (normalized === "escape") return "esc";
if (normalized === "arrowup") return "arrowup";
if (normalized === "arrowdown") return "arrowdown";
if (normalized === "arrowleft") return "arrowleft";
if (normalized === "arrowright") return "arrowright";
if (normalized.length === 1) return normalized;
if (normalized.startsWith("f") && normalized.length <= 3) return normalized;
if (normalized === "enter" || normalized === "tab" || normalized === "backspace") {
return normalized;
}
if (normalized === "delete" || normalized === "home" || normalized === "end") {
return normalized;
}
if (normalized === "pageup" || normalized === "pagedown") return normalized;
return null;
}
function keybindingFromEvent(event: KeyboardEvent<HTMLInputElement>): string | null {
const keyToken = normalizeShortcutKeyToken(event.key);
if (!keyToken) return null;
const parts: string[] = [];
if (isMacPlatform(navigator.platform)) {
if (event.metaKey) parts.push("mod");
if (event.ctrlKey) parts.push("ctrl");
} else {
if (event.ctrlKey) parts.push("mod");
if (event.metaKey) parts.push("meta");
}
if (event.altKey) parts.push("alt");
if (event.shiftKey) parts.push("shift");
if (parts.length === 0) {
return null;
}
parts.push(keyToken);
return parts.join("+");
}
function keybindingValueForCommand(
keybindings: ResolvedKeybindingsConfig,
command: string,
): string | null {
for (let index = keybindings.length - 1; index >= 0; index -= 1) {
const binding = keybindings[index];
if (!binding || binding.command !== command) continue;
const parts: string[] = [];
if (binding.shortcut.modKey) parts.push("mod");
if (binding.shortcut.ctrlKey) parts.push("ctrl");
if (binding.shortcut.metaKey) parts.push("meta");
if (binding.shortcut.altKey) parts.push("alt");
if (binding.shortcut.shiftKey) parts.push("shift");
const keyToken =
binding.shortcut.key === " "
? "space"
: binding.shortcut.key === "escape"
? "esc"
: binding.shortcut.key;
parts.push(keyToken);
return parts.join("+");
}
return null;
}
export default function ProjectScriptsControl({
scripts,
keybindings,
preferredScriptId = null,
onRunScript,
onAddScript,
onUpdateScript,
}: ProjectScriptsControlProps) {
const addScriptFormId = React.useId();
const [editingScriptId, setEditingScriptId] = useState<string | null>(null);
const [dialogOpen, setDialogOpen] = useState(false);
const [name, setName] = useState("");
const [command, setCommand] = useState("");
const [icon, setIcon] = useState<ProjectScriptIcon>("play");
const [iconPickerOpen, setIconPickerOpen] = useState(false);
const [runOnWorktreeCreate, setRunOnWorktreeCreate] = useState(false);
const [keybinding, setKeybinding] = useState("");
const [validationError, setValidationError] = useState<string | null>(null);
const primaryScript = useMemo(() => {
if (preferredScriptId) {
const preferred = scripts.find((script) => script.id === preferredScriptId);
if (preferred) return preferred;
}
return primaryProjectScript(scripts);
}, [preferredScriptId, scripts]);
const isEditing = editingScriptId !== null;
const dropdownItemClassName =
"data-highlighted:bg-transparent data-highlighted:text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-highlighted:hover:bg-accent data-highlighted:hover:text-accent-foreground data-highlighted:focus-visible:bg-accent data-highlighted:focus-visible:text-accent-foreground";
const captureKeybinding = (event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === "Tab") return;
event.preventDefault();
if (event.key === "Backspace" || event.key === "Delete") {
setKeybinding("");
return;
}
const next = keybindingFromEvent(event);
if (!next) return;
setKeybinding(next);
};
const submitAddScript = async (event: FormEvent) => {
event.preventDefault();
const trimmedName = name.trim();
const trimmedCommand = command.trim();
if (trimmedName.length === 0) {
setValidationError("Name is required.");
return;
}
if (trimmedCommand.length === 0) {
setValidationError("Command is required.");
return;
}
setValidationError(null);
try {
const payload = {
name: trimmedName,
command: trimmedCommand,
icon,
runOnWorktreeCreate,
keybinding: keybinding.trim() || null,
} satisfies NewProjectScriptInput;
if (editingScriptId) {
await onUpdateScript(editingScriptId, payload);
} else {
await onAddScript(payload);
}
setDialogOpen(false);
setIconPickerOpen(false);
} catch (error) {
setValidationError(error instanceof Error ? error.message : "Failed to save action.");
}
};
const openAddDialog = () => {
setEditingScriptId(null);
setName("");
setCommand("");
setIcon("play");
setIconPickerOpen(false);
setRunOnWorktreeCreate(false);
setKeybinding("");
setValidationError(null);
setDialogOpen(true);
};
const openEditDialog = (script: ProjectScript) => {
setEditingScriptId(script.id);
setName(script.name);
setCommand(script.command);
setIcon(script.icon);
setIconPickerOpen(false);
setRunOnWorktreeCreate(script.runOnWorktreeCreate);
setKeybinding(keybindingValueForCommand(keybindings, commandForProjectScript(script.id)) ?? "");
setValidationError(null);
setDialogOpen(true);
};
return (
<>
{primaryScript ? (
<Group aria-label="Project scripts">
<Button
size="xs"
variant="outline"
onClick={() => onRunScript(primaryScript)}
title={`Run ${primaryScript.name}`}
>
<ScriptIcon icon={primaryScript.icon} />
<span className="ml-0.5">{primaryScript.name}</span>
</Button>
<GroupSeparator />
<Menu highlightItemOnHover={false}>
<MenuTrigger
render={<Button size="icon-xs" variant="outline" aria-label="Script actions" />}
>
<ChevronDownIcon className="size-4" />
</MenuTrigger>
<MenuPopup align="end">
{scripts.map((script) => {
const shortcutLabel = shortcutLabelForCommand(
keybindings,
commandForProjectScript(script.id),
);
return (
<MenuItem
key={script.id}
className={`group ${dropdownItemClassName}`}
onClick={() => onRunScript(script)}
>
<ScriptIcon icon={script.icon} className="size-4" />
<span className="truncate">
{script.runOnWorktreeCreate ? `${script.name} (setup)` : script.name}
</span>
<span className="relative ms-auto flex h-6 min-w-6 items-center justify-end">
{shortcutLabel && (
<MenuShortcut className="ms-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0">
{shortcutLabel}
</MenuShortcut>
)}
<Button
type="button"
variant="ghost"
size="icon-xs"
className="absolute right-0 top-1/2 size-6 -translate-y-1/2 opacity-0 pointer-events-none transition-opacity group-hover:opacity-100 group-hover:pointer-events-auto group-focus-visible:opacity-100 group-focus-visible:pointer-events-auto"
aria-label={`Edit ${script.name}`}
onPointerDown={(event) => {
event.preventDefault();
event.stopPropagation();
}}
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
openEditDialog(script);
}}
>
<SettingsIcon className="size-3.5" />
</Button>
</span>
</MenuItem>
);
})}
<MenuItem className={dropdownItemClassName} onClick={openAddDialog}>
<PlusIcon className="size-4" />
Add action
</MenuItem>
</MenuPopup>
</Menu>
</Group>
) : (
<Button size="xs" variant="outline" onClick={openAddDialog}>
<PlusIcon className="size-3.5" />
Add action
</Button>
)}
<Dialog
onOpenChange={(open) => {
setDialogOpen(open);
if (!open) {
setIconPickerOpen(false);
}
}}
onOpenChangeComplete={(open) => {
if (open) return;
setEditingScriptId(null);
setName("");
setCommand("");
setIcon("play");
setRunOnWorktreeCreate(false);
setKeybinding("");
setValidationError(null);
}}
open={dialogOpen}
>
<DialogPopup>
<DialogHeader>
<DialogTitle>{isEditing ? "Edit Action" : "Add Action"}</DialogTitle>
<DialogDescription>
Actions are project-scoped commands you can run from the top bar or keybindings.
</DialogDescription>
</DialogHeader>
<DialogPanel>
<form id={addScriptFormId} className="space-y-4" onSubmit={submitAddScript}>
<div className="space-y-1.5">
<Label htmlFor="script-name">Name</Label>
<div className="flex items-center gap-2">
<Popover onOpenChange={setIconPickerOpen} open={iconPickerOpen}>
<PopoverTrigger
render={
<Button
type="button"
variant="outline"
className="size-9 shrink-0 hover:bg-popover active:bg-popover data-pressed:bg-popover data-pressed:shadow-xs/5 data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)]"
aria-label="Choose icon"
/>
}
>
<ScriptIcon icon={icon} className="size-4.5" />
</PopoverTrigger>
<PopoverPopup align="start">
<div className="grid grid-cols-3 gap-2">
{SCRIPT_ICONS.map((entry) => {
const isSelected = entry.id === icon;
return (
<button
key={entry.id}
type="button"
className={`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs ${
isSelected
? "border-primary/70 bg-primary/10"
: "border-border/70 hover:bg-accent/60"
}`}
onClick={() => {
setIcon(entry.id);
setIconPickerOpen(false);
}}
>
<ScriptIcon icon={entry.id} className="size-4" />
<span>{entry.label}</span>
</button>
);
})}
</div>
</PopoverPopup>
</Popover>
<Input
id="script-name"
placeholder="Test"
value={name}
onChange={(event) => setName(event.target.value)}
/>
</div>
</div>
<div className="space-y-1.5">
<Label htmlFor="script-keybinding">Keybinding</Label>
<Input
id="script-keybinding"
placeholder="Press shortcut"
value={keybinding}
readOnly
onKeyDown={captureKeybinding}
/>
<p className="text-xs text-muted-foreground">
Press a shortcut. Use <code>Backspace</code> to clear.
</p>
</div>
<div className="space-y-1.5">
<Label htmlFor="script-command">Command</Label>
<Textarea
id="script-command"
placeholder="bun test"
value={command}
onChange={(event) => setCommand(event.target.value)}
/>
</div>
<label className="flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm">
<span>Run automatically on worktree creation</span>
<Switch
checked={runOnWorktreeCreate}
onCheckedChange={(checked) => setRunOnWorktreeCreate(Boolean(checked))}
/>
</label>
{validationError && <p className="text-sm text-destructive">{validationError}</p>}
</form>
</DialogPanel>
<DialogFooter>
<Button
type="button"
variant="outline"
onClick={() => {
setDialogOpen(false);
}}
>
Cancel
</Button>
<Button form={addScriptFormId} type="submit">
{isEditing ? "Save changes" : "Save action"}
</Button>
</DialogFooter>
</DialogPopup>
</Dialog>
</>
);
}
+1 -2
View File
@@ -214,7 +214,6 @@ export default function Sidebar() {
cwd: result.project.cwd,
model: DEFAULT_MODEL,
expanded: true,
scripts: result.project.scripts,
};
const existingById = state.projects.find((p) => p.id === project.id);
const existingByCwd = state.projects.find((p) => p.cwd === project.cwd);
@@ -242,7 +241,6 @@ export default function Sidebar() {
cwd,
model: DEFAULT_MODEL,
expanded: true,
scripts: [],
};
dispatch({ type: "ADD_PROJECT", project });
handleNewThread(project.id);
@@ -507,6 +505,7 @@ export default function Sidebar() {
<button
key={thread.id}
type="button"
data-perf-thread-id={thread.id}
className={`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors duration-150 ${
isActive
? "bg-accent text-foreground"
@@ -111,7 +111,6 @@ interface TerminalViewportProps {
threadId: string;
terminalId: string;
cwd: string;
runtimeEnv?: Record<string, string>;
focusRequestId: number;
autoFocus: boolean;
resizeEpoch: number;
@@ -123,7 +122,6 @@ function TerminalViewport({
threadId,
terminalId,
cwd,
runtimeEnv,
focusRequestId,
autoFocus,
resizeEpoch,
@@ -276,7 +274,6 @@ function TerminalViewport({
cwd,
cols: activeTerminal.cols,
rows: activeTerminal.rows,
...(runtimeEnv ? { env: runtimeEnv } : {}),
});
if (disposed) return;
activeTerminal.write("\u001bc");
@@ -372,7 +369,7 @@ function TerminalViewport({
fitAddonRef.current = null;
terminal.dispose();
};
}, [api, cwd, runtimeEnv, terminalId, threadId]);
}, [api, cwd, terminalId, threadId, autoFocus]);
useEffect(() => {
if (!autoFocus) return;
@@ -417,7 +414,6 @@ interface ThreadTerminalDrawerProps {
api: NativeApi;
threadId: string;
cwd: string;
runtimeEnv?: Record<string, string>;
height: number;
terminalIds: string[];
activeTerminalId: string;
@@ -467,7 +463,6 @@ export default function ThreadTerminalDrawer({
api,
threadId,
cwd,
runtimeEnv,
height,
terminalIds,
activeTerminalId,
@@ -783,7 +778,6 @@ export default function ThreadTerminalDrawer({
threadId={threadId}
terminalId={terminalId}
cwd={cwd}
{...(runtimeEnv ? { runtimeEnv } : {})}
focusRequestId={focusRequestId}
autoFocus={terminalId === resolvedActiveTerminalId}
resizeEpoch={resizeEpoch}
@@ -801,7 +795,6 @@ export default function ThreadTerminalDrawer({
threadId={threadId}
terminalId={resolvedActiveTerminalId}
cwd={cwd}
{...(runtimeEnv ? { runtimeEnv } : {})}
focusRequestId={focusRequestId}
autoFocus
resizeEpoch={resizeEpoch}
+4 -1
View File
@@ -133,7 +133,10 @@ function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Autoc
function CommandPanel({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
className="-mx-px not-has-[+[data-slot=command-footer]]:-mb-px relative min-h-0 rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl border border-b-0 bg-popover bg-clip-padding shadow-xs/5 [clip-path:inset(0_1px)] not-has-[+[data-slot=command-footer]]:[clip-path:inset(0_1px_1px_1px_round_0_0_calc(var(--radius-2xl)-1px)_calc(var(--radius-2xl)-1px))] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2"
className={cn(
"-mx-px not-has-[+[data-slot=command-footer]]:-mb-px relative min-h-0 rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl border border-b-0 bg-popover bg-clip-padding shadow-xs/5 [clip-path:inset(0_1px)] not-has-[+[data-slot=command-footer]]:[clip-path:inset(0_1px_1px_1px_round_0_0_calc(var(--radius-2xl)-1px)_calc(var(--radius-2xl)-1px))] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2",
className,
)}
{...props}
/>
);
+1
View File
@@ -49,6 +49,7 @@ function SheetViewport({
side === "left" && "flex justify-start",
side === "right" && "flex justify-end",
variant === "inset" && "sm:p-4",
className,
)}
data-slot="sheet-viewport"
{...props}
+1
View File
@@ -28,6 +28,7 @@ function applyTheme(theme: Theme, suppressTransitions = false) {
document.documentElement.classList.toggle("dark", isDark);
if (suppressTransitions) {
// Force a reflow so the no-transitions class takes effect before removal
// oxlint-disable-next-line no-unused-expressions
document.documentElement.offsetHeight;
requestAnimationFrame(() => {
document.documentElement.classList.remove("no-transitions");
-16
View File
@@ -16,7 +16,6 @@ import {
isTerminalNewShortcut,
isTerminalSplitShortcut,
isTerminalToggleShortcut,
resolveShortcutCommand,
shortcutLabelForCommand,
terminalNavigationShortcutData,
type ShortcutEventLike,
@@ -340,21 +339,6 @@ describe("cross-command precedence", () => {
});
});
describe("resolveShortcutCommand", () => {
it("returns dynamic script commands", () => {
const keybindings = compile([
{ shortcut: modShortcut("r"), command: "script.setup.run" },
]);
assert.strictEqual(
resolveShortcutCommand(event({ key: "r", ctrlKey: true }), keybindings, {
platform: "Linux",
}),
"script.setup.run",
);
});
});
describe("formatShortcutLabel", () => {
it("formats labels for macOS", () => {
assert.strictEqual(
+2 -2
View File
@@ -100,11 +100,11 @@ function matchesCommandShortcut(
return resolveShortcutCommand(event, keybindings, options) === command;
}
export function resolveShortcutCommand(
function resolveShortcutCommand(
event: ShortcutEventLike,
keybindings: ResolvedKeybindingsConfig,
options?: ShortcutMatchOptions,
): string | null {
): KeybindingCommand | null {
const platform = resolvePlatform(options);
const context = resolveContext(options);
-7
View File
@@ -20,7 +20,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.2-codex",
expanded: true,
scripts: [],
},
],
threads: [
@@ -70,7 +69,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: false,
scripts: [],
},
],
threads: [
@@ -121,7 +119,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: false,
scripts: [],
},
],
threads: [],
@@ -143,7 +140,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [
@@ -191,7 +187,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [
@@ -236,7 +231,6 @@ describe("hydratePersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [
@@ -319,7 +313,6 @@ describe("toPersistedState", () => {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [thread],
-3
View File
@@ -1,5 +1,4 @@
import { z } from "zod";
import { projectScriptSchema } from "@t3tools/contracts";
import { DEFAULT_MODEL, resolveModelSlug } from "./model-logic";
import {
@@ -20,7 +19,6 @@ const persistedProjectSchema = z.object({
cwd: z.string().min(1),
model: z.string().min(1),
expanded: z.boolean(),
scripts: z.array(projectScriptSchema).default([]),
});
const persistedMessageSchema = z.object({
@@ -142,7 +140,6 @@ function hydrateProject(
return {
...project,
model: resolveModelSlug(maybeMigrateLegacyModel(project.model, isLegacyPayload)),
scripts: project.scripts,
};
}
-73
View File
@@ -1,73 +0,0 @@
import { describe, expect, it } from "vitest";
import {
commandForProjectScript,
nextProjectScriptId,
primaryProjectScript,
projectScriptRuntimeEnv,
projectScriptIdFromCommand,
setupProjectScript,
} from "./projectScripts";
describe("projectScripts helpers", () => {
it("builds and parses script run commands", () => {
const command = commandForProjectScript("lint");
expect(command).toBe("script.lint.run");
expect(projectScriptIdFromCommand(command)).toBe("lint");
expect(projectScriptIdFromCommand("terminal.toggle")).toBeNull();
});
it("slugifies and dedupes project script ids", () => {
expect(nextProjectScriptId("Run Tests", [])).toBe("run-tests");
expect(nextProjectScriptId("Run Tests", ["run-tests"])).toBe("run-tests-2");
expect(nextProjectScriptId("!!!", [])).toBe("script");
});
it("resolves primary and setup scripts", () => {
const scripts = [
{
id: "setup",
name: "Setup",
command: "bun install",
icon: "configure" as const,
runOnWorktreeCreate: true,
},
{
id: "test",
name: "Test",
command: "bun test",
icon: "test" as const,
runOnWorktreeCreate: false,
},
];
expect(primaryProjectScript(scripts)?.id).toBe("test");
expect(setupProjectScript(scripts)?.id).toBe("setup");
});
it("builds default runtime env for scripts", () => {
const env = projectScriptRuntimeEnv({
project: { cwd: "/repo" },
worktreePath: "/repo/worktree-a",
});
expect(env).toMatchObject({
T3CODE_PROJECT_ROOT: "/repo",
T3CODE_WORKTREE_PATH: "/repo/worktree-a",
});
});
it("allows overriding runtime env values", () => {
const env = projectScriptRuntimeEnv({
project: { cwd: "/repo" },
extraEnv: {
T3CODE_PROJECT_ROOT: "/custom-root",
CUSTOM_FLAG: "1",
},
});
expect(env.T3CODE_PROJECT_ROOT).toBe("/custom-root");
expect(env.CUSTOM_FLAG).toBe("1");
expect(env.T3CODE_WORKTREE_PATH).toBeUndefined();
});
});
-80
View File
@@ -1,80 +0,0 @@
import type { ProjectScript } from "@t3tools/contracts";
const SCRIPT_RUN_COMMAND_PATTERN = /^script\.([a-z0-9][a-z0-9-]*)\.run$/;
const MAX_SCRIPT_ID_LENGTH = 64;
function normalizeScriptId(value: string): string {
const cleaned = value
.trim()
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "");
if (cleaned.length === 0) {
return "script";
}
if (cleaned.length <= MAX_SCRIPT_ID_LENGTH) {
return cleaned;
}
return cleaned.slice(0, MAX_SCRIPT_ID_LENGTH).replace(/-+$/g, "") || "script";
}
export function commandForProjectScript(scriptId: string): string {
return `script.${scriptId}.run`;
}
export function projectScriptIdFromCommand(command: string): string | null {
const match = SCRIPT_RUN_COMMAND_PATTERN.exec(command.trim());
return match?.[1] ?? null;
}
export function nextProjectScriptId(name: string, existingIds: Iterable<string>): string {
const taken = new Set(Array.from(existingIds));
const baseId = normalizeScriptId(name);
if (!taken.has(baseId)) return baseId;
let suffix = 2;
while (suffix < 10_000) {
const candidate = `${baseId}-${suffix}`;
const safeCandidate =
candidate.length <= MAX_SCRIPT_ID_LENGTH
? candidate
: `${baseId.slice(0, Math.max(1, MAX_SCRIPT_ID_LENGTH - String(suffix).length - 1))}-${suffix}`;
if (!taken.has(safeCandidate)) {
return safeCandidate;
}
suffix += 1;
}
// This last-resort fallback only triggers after exhausting thousands of suffixes.
return `${baseId}-${Date.now()}`.slice(0, MAX_SCRIPT_ID_LENGTH);
}
interface ProjectScriptRuntimeEnvInput {
project: {
cwd: string;
};
worktreePath?: string | null;
extraEnv?: Record<string, string>;
}
export function projectScriptRuntimeEnv(input: ProjectScriptRuntimeEnvInput): Record<string, string> {
const env: Record<string, string> = {
T3CODE_PROJECT_ROOT: input.project.cwd,
};
if (input.worktreePath) {
env.T3CODE_WORKTREE_PATH = input.worktreePath;
}
if (input.extraEnv) {
return { ...env, ...input.extraEnv };
}
return env;
}
export function primaryProjectScript(scripts: ProjectScript[]): ProjectScript | null {
const regular = scripts.find((script) => !script.runOnWorktreeCreate);
return regular ?? scripts[0] ?? null;
}
export function setupProjectScript(scripts: ProjectScript[]): ProjectScript | null {
return scripts.find((script) => script.runOnWorktreeCreate) ?? null;
}
-76
View File
@@ -74,7 +74,6 @@ function makeState(thread: Thread): AppState {
cwd: "/tmp/project",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [thread],
@@ -508,7 +507,6 @@ describe("store reducer thread continuity", () => {
cwd: "/tmp/a",
model: "gpt-5.3-codex",
expanded: false,
scripts: [],
},
{
id: "project-old-b",
@@ -516,7 +514,6 @@ describe("store reducer thread continuity", () => {
cwd: "/tmp/b",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [
@@ -543,7 +540,6 @@ describe("store reducer thread continuity", () => {
cwd: "/tmp/a",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
});
@@ -558,76 +554,6 @@ describe("store reducer thread continuity", () => {
expect(next.activeThreadId).toBe("thread-a");
});
it("treats empty scripts from sync as authoritative", () => {
const state: AppState = {
projects: [
{
id: "project-old-a",
name: "A",
cwd: "/tmp/a",
model: "gpt-5.3-codex",
expanded: true,
scripts: [
{
id: "test",
name: "Test",
command: "bun test",
icon: "test",
runOnWorktreeCreate: false,
},
],
},
],
threads: [makeThread({ id: "thread-a", projectId: "project-old-a" })],
activeThreadId: "thread-a",
runtimeMode: "full-access",
diffOpen: false,
};
const next = reducer(state, {
type: "SYNC_PROJECTS",
projects: [
{
id: "project-new-a",
name: "A",
cwd: "/tmp/a",
model: "gpt-5.3-codex",
expanded: false,
scripts: [],
},
],
});
expect(next.projects[0]?.scripts).toEqual([]);
});
it("updates project scripts", () => {
const state = makeState(makeThread());
const next = reducer(state, {
type: "SET_PROJECT_SCRIPTS",
projectId: "project-1",
scripts: [
{
id: "test",
name: "Test",
command: "bun test",
icon: "test",
runOnWorktreeCreate: false,
},
],
});
expect(next.projects[0]?.scripts).toEqual([
{
id: "test",
name: "Test",
command: "bun test",
icon: "test",
runOnWorktreeCreate: false,
},
]);
});
it("deletes a project and all of its threads", () => {
const state: AppState = {
projects: [
@@ -637,7 +563,6 @@ describe("store reducer thread continuity", () => {
cwd: "/tmp/one",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
{
id: "project-2",
@@ -645,7 +570,6 @@ describe("store reducer thread continuity", () => {
cwd: "/tmp/two",
model: "gpt-5.3-codex",
expanded: true,
scripts: [],
},
],
threads: [
+1 -17
View File
@@ -8,7 +8,7 @@ import {
useReducer,
} from "react";
import { type ProviderEvent, type ProviderSession, type TerminalEvent, normalizeProjectScripts } from "@t3tools/contracts";
import type { ProviderEvent, ProviderSession, TerminalEvent } from "@t3tools/contracts";
import { resolveModelSlug } from "./model-logic";
import { hydratePersistedState, toPersistedState } from "./persistenceSchema";
import { applyEventToMessages, asObject, asString, evolveSession } from "./session-logic";
@@ -17,7 +17,6 @@ import {
DEFAULT_THREAD_TERMINAL_ID,
DEFAULT_RUNTIME_MODE,
MAX_THREAD_TERMINAL_COUNT,
type ProjectScript,
type Project,
type RuntimeMode,
type Thread,
@@ -28,7 +27,6 @@ import {
type Action =
| { type: "ADD_PROJECT"; project: Project }
| { type: "SET_PROJECT_SCRIPTS"; projectId: string; scripts: ProjectScript[] }
| { type: "SYNC_PROJECTS"; projects: Project[] }
| { type: "TOGGLE_PROJECT"; projectId: string }
| { type: "DELETE_PROJECT"; projectId: string }
@@ -165,7 +163,6 @@ function normalizeRunningTerminalIds(
.filter((id) => id.length > 0 && validTerminalIdSet.has(id));
}
function normalizeTerminalGroupIds(terminalIds: string[]): string[] {
return [...new Set(terminalIds.map((id) => id.trim()).filter((id) => id.length > 0))];
}
@@ -429,33 +426,20 @@ export function reducer(state: AppState, action: Action): AppState {
{
...action.project,
model: resolveModelSlug(action.project.model),
scripts: normalizeProjectScripts(action.project.scripts),
},
],
};
case "SET_PROJECT_SCRIPTS":
return {
...state,
projects: state.projects.map((project) =>
project.id === action.projectId
? { ...project, scripts: normalizeProjectScripts(action.scripts) }
: project,
),
};
case "SYNC_PROJECTS": {
const previousByCwd = new Map(
state.projects.map((project) => [project.cwd, project] as const),
);
const nextProjects = action.projects.map((project) => {
const previous = previousByCwd.get(project.cwd);
const scripts = normalizeProjectScripts(project.scripts);
return {
...project,
model: resolveModelSlug(previous?.model ?? project.model),
expanded: previous?.expanded ?? project.expanded,
scripts,
};
});
const previousProjectById = new Map(
+1 -7
View File
@@ -1,8 +1,4 @@
import type {
ProjectScript as ContractProjectScript,
ProviderEvent,
ProviderSession,
} from "@t3tools/contracts";
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts";
export type SessionPhase = "disconnected" | "connecting" | "ready" | "running";
export type RuntimeMode = "approval-required" | "full-access";
@@ -10,7 +6,6 @@ export const DEFAULT_RUNTIME_MODE: RuntimeMode = "full-access";
export const DEFAULT_THREAD_TERMINAL_HEIGHT = 280;
export const DEFAULT_THREAD_TERMINAL_ID = "default";
export const MAX_THREAD_TERMINAL_COUNT = 4;
export type ProjectScript = ContractProjectScript;
export interface ThreadTerminalGroup {
id: string;
@@ -43,7 +38,6 @@ export interface Project {
cwd: string;
model: string;
expanded: boolean;
scripts: ProjectScript[];
}
export interface Thread {
-2
View File
@@ -99,7 +99,6 @@ export function createWsNativeApi(): NativeApi {
add: (input) => transport.request(WS_METHODS.projectsAdd, input),
remove: (input) => transport.request(WS_METHODS.projectsRemove, input),
searchEntries: (input) => transport.request(WS_METHODS.projectsSearchEntries, input),
updateScripts: (input) => transport.request(WS_METHODS.projectsUpdateScripts, input),
},
shell: {
openInEditor: (cwd, editor) =>
@@ -143,7 +142,6 @@ export function createWsNativeApi(): NativeApi {
},
server: {
getConfig: () => transport.request(WS_METHODS.serverGetConfig),
upsertKeybinding: (input) => transport.request(WS_METHODS.serverUpsertKeybinding, input),
},
};
+75 -124
View File
@@ -34,12 +34,12 @@
"t3": "./dist/index.mjs",
},
"dependencies": {
"@t3tools/contracts": "workspace:*",
"node-pty": "^1.1.0",
"open": "^10.1.0",
"ws": "^8.18.0",
},
"devDependencies": {
"@t3tools/contracts": "workspace:*",
"@t3tools/web": "workspace:*",
"@types/node": "^22.10.2",
"@types/ws": "^8.5.13",
@@ -55,6 +55,7 @@
"@t3tools/contracts": "workspace:*",
"@tanstack/react-pacer": "^0.19.4",
"@tanstack/react-query": "^5.90.0",
"@tanstack/react-virtual": "^3.13.18",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"class-variance-authority": "^0.7.1",
@@ -212,20 +213,10 @@
"@hapi/pinpoint": ["@hapi/[email protected]", "", {}, "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q=="],
"@hapi/tlds": ["@hapi/[email protected].5", "", {}, "sha512-Vq/1gnIIsvFUpKlDdfrPd/ssHDpAyBP/baVukh3u2KSG2xoNjsnRNjQiPmuyPPGqsn1cqVWWhtZHfOBaLizFRQ=="],
"@hapi/tlds": ["@hapi/[email protected].6", "", {}, "sha512-xdi7A/4NZokvV0ewovme3aUO5kQhW9pQ2YD1hRqZGhhSi5rBv4usHYidVocXSi9eihYsznZxLtAiEYYUL6VBGw=="],
"@hapi/topo": ["@hapi/[email protected]", "", { "dependencies": { "@hapi/hoek": "^11.0.2" } }, "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg=="],
"@inquirer/ansi": ["@inquirer/[email protected]", "", {}, "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ=="],
"@inquirer/confirm": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^10.3.2", "@inquirer/type": "^3.0.10" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ=="],
"@inquirer/core": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/ansi": "^1.0.2", "@inquirer/figures": "^1.0.15", "@inquirer/type": "^3.0.10", "cli-width": "^4.1.0", "mute-stream": "^2.0.0", "signal-exit": "^4.1.0", "wrap-ansi": "^6.2.0", "yoctocolors-cjs": "^2.1.3" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A=="],
"@inquirer/figures": ["@inquirer/[email protected]", "", {}, "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g=="],
"@inquirer/type": ["@inquirer/[email protected]", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA=="],
"@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
"@jridgewell/remapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
@@ -236,17 +227,9 @@
"@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
"@mswjs/interceptors": ["@mswjs/[email protected]", "", { "dependencies": { "@open-draft/deferred-promise": "^2.2.0", "@open-draft/logger": "^0.3.0", "@open-draft/until": "^2.0.0", "is-node-process": "^1.2.0", "outvariant": "^1.4.3", "strict-event-emitter": "^0.5.1" } }, "sha512-cXu86tF4VQVfwz8W1SPbhoRyHJkti6mjH/XJIxp40jhO4j2k1m4KYrEykxqWPkFF3vrK4rgQppBh//AwyGSXPA=="],
"@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" } }, "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A=="],
"@open-draft/deferred-promise": ["@open-draft/[email protected]", "", {}, "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA=="],
"@open-draft/logger": ["@open-draft/[email protected]", "", { "dependencies": { "is-node-process": "^1.2.0", "outvariant": "^1.4.0" } }, "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ=="],
"@open-draft/until": ["@open-draft/[email protected]", "", {}, "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg=="],
"@oxc-project/runtime": ["@oxc-project/[email protected]", "", {}, "sha512-4vYtWXMnXM6EaweCxbJ6bISAhkNHeN33SihvuX3wrpqaSJA4ZEoW35i9mSvE74+GDf1yTeVE+aEHA+WBpjDk/g=="],
"@oxc-project/runtime": ["@oxc-project/[email protected]", "", {}, "sha512-apRWH/gXeAsl/sQiblIZnLu7f8P/C9S2fJIicuHV9KOK9J7Hv1JPyTwB8WAcOrDBfjs+cbzjMOGe9UR2ue4ZQg=="],
"@oxc-project/types": ["@oxc-project/[email protected]", "", {}, "sha512-m6RebKHIRsax2iCwVpYW2ErQwa4ywHJrE4sCK3/8JK8ZZAWOKXaRJFl/uP51gaVyyXlaS4+chU1nSCdzYf6QqQ=="],
@@ -266,43 +249,43 @@
"@oxfmt/win32-x64": ["@oxfmt/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-4+S2j4OxOIyo8dz5osm5dZuL0yVmxXvtmNdHB5xyGwAWVvyWNvf7tCaQD7w2fdSsAXQLOvK7KFQrHFe33nJUCA=="],
"@oxlint/binding-android-arm-eabi": ["@oxlint/[email protected]6.0", "", { "os": "android", "cpu": "arm" }, "sha512-vLPcE+HcZ/W/0cVA1KLuAnoUSejGougDH/fDjBFf0Q+rbBIyBNLevOhgx3AnBNAt3hcIGY7U05ISbJCKZeVa3w=="],
"@oxlint/binding-android-arm-eabi": ["@oxlint/[email protected]8.0", "", { "os": "android", "cpu": "arm" }, "sha512-1Pz/stJvveO9ZO7ll4ZoEY3f6j2FiUgBLBcCRCiW6ylId9L9UKs+gn3X28m3eTnoiFCkhKwmJJ+VO6vwsu7Qtg=="],
"@oxlint/binding-android-arm64": ["@oxlint/[email protected]6.0", "", { "os": "android", "cpu": "arm64" }, "sha512-b8IqCczUsirdtJ3R/be4cRm64I5pMPafMO/9xyTAZvc+R/FxZHMQuhw0iNT9hQwRn+Uo5rNAoA8QS7QurG2QeA=="],
"@oxlint/binding-android-arm64": ["@oxlint/[email protected]8.0", "", { "os": "android", "cpu": "arm64" }, "sha512-Zc42RWGE8huo6Ht0lXKjd0NH2lWNmimQHUmD0JFcvShLOuwN+RSEE/kRakc2/0LIgOUuU/R7PaDMCOdQlPgNUQ=="],
"@oxlint/binding-darwin-arm64": ["@oxlint/[email protected]6.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-CfC/KGnNMhI01dkfCMjquKnW4zby3kqD5o/9XA7+pgo9I4b+Nipm+JVFyZPWMNwKqLXNmi35GTLWjs9svPxlew=="],
"@oxlint/binding-darwin-arm64": ["@oxlint/[email protected]8.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-jgZs563/4vaG5jH2RSt2TSh8A2jwsFdmhLXrElMdm3Mmto0HPf85FgInLSNi9HcwzQFvkYV8JofcoUg2GH1HTA=="],
"@oxlint/binding-darwin-x64": ["@oxlint/[email protected]6.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-m38mKPsV3rBdWOJ4TAGZiUjWU8RGrBxsmdSeMQ0bPr/8O6CUOm/RJkPBf0GAfPms2WRVcbkfEXvIiPshAeFkeA=="],
"@oxlint/binding-darwin-x64": ["@oxlint/[email protected]8.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-kvo87BujEUjCJREuWDC4aPh1WoXCRFFWE4C7uF6wuoMw2f6N2hypA/cHHcYn9DdL8R2RrgUZPefC8JExyeIMKA=="],
"@oxlint/binding-freebsd-x64": ["@oxlint/[email protected]6.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-YaFRKslSAfuMwn7ejS1/wo9jENqQigpGBjjThX+mrpmEROLYGky+zIC5xSVGRng28U92VEDVbSNJ/sguz3dUAA=="],
"@oxlint/binding-freebsd-x64": ["@oxlint/[email protected]8.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-eyzzPaHQKn0RIM+ueDfgfJF2RU//Wp4oaKs2JVoVYcM5HjbCL36+O0S3wO5Xe1NWpcZIG3cEHc/SuOCDRqZDSg=="],
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Nlw+5mSZQtkg1Oj0N8ulxzG8ATpmSDz5V2DNaGhaYAVlcdR8NYSm/xTOnweOXc/UOOv3LwkPPYzqcfPhu2lEkA=="],
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "arm" }, "sha512-p3kSloztK7GRO7FyO3u38UCjZxQTl92VaLDsMQAq0eGoiNmeeEF1KPeE4+Fr+LSkQhF8WvJKSuls6TwOlurdPA=="],
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "arm" }, "sha512-d3Y5y4ukMqAGnWLMKpwqj8ftNUaac7pA0NrId4AZ77JvHzezmxEcm2gswaBw2HW8y1pnq6KDB0vEPPvpTfDLrA=="],
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "arm" }, "sha512-uWM+wiTqLW/V0ZmY/eyTWs8ykhIkzU+K2tz/8m35YepYEzohiUGRbnkpAFXj2ioXpQL+GUe5vmM3SLH6ozlfFw=="],
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jkjx+XSOPuFR+C458prQmehO+v0VK19/3Hj2mOYDF4hHUf3CzmtA4fTmQUtkITZiGHnky7Oao6JeJX24mrX7WQ=="],
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-OhQNPjs/OICaYqxYJjKKMaIY7p3nJ9IirXcFoHKD+CQE1BZFCeUUAknMzUeLclDCfudH9Vb/UgjFm8+ZM5puAg=="],
"@oxlint/binding-linux-arm64-musl": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-X/aPB1rpJUdykjWSeeGIbjk6qbD8VDulgLuTSMWgr/t6m1ljcAjqHb1g49pVG9bZl55zjECgzvlpPLWnfb4FMQ=="],
"@oxlint/binding-linux-arm64-musl": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-adu5txuwGvQ4C4fjYHJD+vnY+OCwCixBzn7J3KF3iWlVHBBImcosSv+Ye+fbMMJui4HGjifNXzonjKm9pXmOiw=="],
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-AymyOxGWwKY2KJa8b+h8iLrYJZbWKYCjqctSc2q6uIAkYPrCsxcWlge1JP6XZ14Sa80DVMwI/QvktbytSV+xVw=="],
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-inlQQRUnHCny/7b7wA6NjEoJSSZPNea4qnDhWyeqBYWx8ukf2kzNDSiamfhOw6bfAYPm/PVlkVRYaNXQbkLeTQ=="],
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "none" }, "sha512-PkeVdPKCDA59rlMuucsel2LjlNEpslQN5AhkMMorIJZItbbqi/0JSuACCzaiIcXYv0oNfbeQ8rbOBikv+aT6cg=="],
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "none" }, "sha512-YiJx6sW6bYebQDZRVWLKm/Drswx/hcjIgbLIhULSn0rRcBKc7d9V6mkqPjKDbhcxJgQD5Zi0yVccJiOdF40AWA=="],
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "none" }, "sha512-snQaRLO/X+Ry/CxX1px1g8GUbmXzymdRs+/RkP2bySHWZFhFDtbLm2hA1ujX/jKlTLMJDZn4hYzFGLDwG/Rh2w=="],
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "none" }, "sha512-zwSqxMgmb2ITamNfDv9Q9EKBc/4ZhCBP9gkg2hhcgR6sEVGPUDl1AKPC89CBKMxkmPUi3685C38EvqtZn5OtHw=="],
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-kZhDMwUe/sgDTluGao9c0Dqc1JzV6wPzfGo0l/FLQdh5Zmp39Yg1FbBsCgsJfVKmKl1fNqsHyFLTShWMOlOEhA=="],
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-c/+2oUWAOsQB5JTem0rW8ODlZllF6pAtGSGXoLSvPTonKI1vAwaKhD9Qw1X36jRbcI3Etkpu/9z/RRjMba8vFQ=="],
"@oxlint/binding-linux-x64-gnu": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "x64" }, "sha512-n5a7VtQTxHZ13cNAKQc3ziARv5bE1Fx868v/tnhZNVUjaRNYe5uiUrRJ/LZghdAzOxVuQGarjjq/q4QM2+9OPA=="],
"@oxlint/binding-linux-x64-gnu": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "x64" }, "sha512-PhauDqeFW5DGed6QxCY5lXZYKSlcBdCXJnH03ZNU6QmDZ0BFM/zSy1oPT2MNb1Afx1G6yOOVk8ErjWsQ7c59ng=="],
"@oxlint/binding-linux-x64-musl": ["@oxlint/[email protected]6.0", "", { "os": "linux", "cpu": "x64" }, "sha512-KpsDU/BhdVn3iKCLxMXAOZIpO8fS0jEA5iluRoK1rhHPwKtpzEm/OCwERsu/vboMSZm66qnoTUVXRPJ8M+iKVQ=="],
"@oxlint/binding-linux-x64-musl": ["@oxlint/[email protected]8.0", "", { "os": "linux", "cpu": "x64" }, "sha512-6d7LIFFZGiavbHndhf1cK9kG9qmy2Dmr37sV9Ep7j3H+ciFdKSuOzdLh85mEUYMih+b+esMDlF5DU0WQRZPQjw=="],
"@oxlint/binding-openharmony-arm64": ["@oxlint/[email protected]6.0", "", { "os": "none", "cpu": "arm64" }, "sha512-jtbqUyEXlsDlRmMtTZqNbw49+1V/WxqNAR5l0S3OEkdat9diI5I+eqq9IT+jb5cSDdszTGcXpn7S3+gUYSydxQ=="],
"@oxlint/binding-openharmony-arm64": ["@oxlint/[email protected]8.0", "", { "os": "none", "cpu": "arm64" }, "sha512-r+0KK9lK6vFp3tXAgDMOW32o12dxvKS3B9La1uYMGdWAMoSeu2RzG34KmzSpXu6MyLDl4aSVyZLFM8KGdEjwaw=="],
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/[email protected]6.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-EE8NjpqEZPwHQVigNvdyJ11dZwWIfsfn4VeBAuiJeAdrnY4HFX27mIjJINJgP5ZdBYEFV1OWH/eb9fURCYel8w=="],
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/[email protected]8.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-Nkw/MocyT3HSp0OJsKPXrcbxZqSPMTYnLLfsqsoiFKoL1ppVNL65MFa7vuTxJehPlBkjy+95gUgacZtuNMECrg=="],
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/[email protected]6.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-BHyk3H/HRdXs+uImGZ/2+qCET+B8lwGHOm7m54JiJEEUWf3zYCFX/Df1SPqtozWWmnBvioxoTG1J3mPRAr8KUA=="],
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/[email protected]8.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-reO1SpefvRmeZSP+WeyWkQd1ArxxDD1MyKgMUKuB8lNuUoxk9QEohYtKnsfsxJuFwMT0JTr7p9wZjouA85GzGQ=="],
"@oxlint/binding-win32-x64-msvc": ["@oxlint/[email protected]6.0", "", { "os": "win32", "cpu": "x64" }, "sha512-DJbQsSJUr4KSi9uU0QqOgI7PX2C+fKGZX+YDprt3vM2sC0dWZsgVTLoN2vtkNyEWJSY2mnvRFUshWXT3bmo0Ug=="],
"@oxlint/binding-win32-x64-msvc": ["@oxlint/[email protected]8.0", "", { "os": "win32", "cpu": "x64" }, "sha512-T6zwhfcsrorqAybkOglZdPkTLlEwipbtdO1qjE+flbawvwOMsISoyiuaa7vM7zEyfq1hmDvMq1ndvkYFioranA=="],
"@quansync/fs": ["@quansync/[email protected]", "", { "dependencies": { "quansync": "^1.0.0" } }, "sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ=="],
@@ -438,8 +421,12 @@
"@tanstack/react-store": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/store": "0.8.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-XItJt+rG8c5Wn/2L/bnxys85rBpm0BfMbhb4zmPVLXAKY9POrp1xd6IbU4PKoOI+jSEGc3vntPRfLGSgXfE2Ig=="],
"@tanstack/react-virtual": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/virtual-core": "3.13.18" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-dZkhyfahpvlaV0rIKnvQiVoWPyURppl6w4m9IwMDpuIjcJ1sD9YGWrt0wISvgU7ewACXx2Ct46WPgI6qAD4v6A=="],
"@tanstack/store": ["@tanstack/[email protected]", "", {}, "sha512-PtOisLjUZPz5VyPRSCGjNOlwTvabdTBQ2K80DpVL1chGVr35WRxfeavAPdNq6pm/t7F8GhoR2qtmkkqtCEtHYw=="],
"@tanstack/virtual-core": ["@tanstack/[email protected]", "", {}, "sha512-Mx86Hqu1k39icq2Zusq+Ey2J6dDWTjDvEv43PJtRCoEYTLyfaPnxIQ6iy7YAOK0NV/qOEmZQ/uCufrppZxTgcg=="],
"@tybys/wasm-util": ["@tybys/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
"@types/babel__core": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
@@ -482,8 +469,6 @@
"@types/responselike": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw=="],
"@types/statuses": ["@types/[email protected]", "", {}, "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA=="],
"@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
"@types/ws": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
@@ -512,8 +497,6 @@
"@xterm/xterm": ["@xterm/[email protected]", "", {}, "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg=="],
"ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
"ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
"ansis": ["[email protected]", "", {}, "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig=="],
@@ -552,7 +535,7 @@
"call-bind-apply-helpers": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
"caniuse-lite": ["[email protected]69", "", {}, "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg=="],
"caniuse-lite": ["[email protected]70", "", {}, "sha512-x/2CLQ1jHENRbHg5PSId2sXq1CIO1CISvwWAj027ltMVG2UNgW+w9oH2+HzgEIRFembL8bUlXtfbBHR1fCg2xw=="],
"ccount": ["[email protected]", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="],
@@ -570,10 +553,6 @@
"class-variance-authority": ["[email protected]", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],
"cli-width": ["[email protected]", "", {}, "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ=="],
"cliui": ["[email protected]", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
"clone-response": ["[email protected]", "", { "dependencies": { "mimic-response": "^1.0.0" } }, "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA=="],
"clsx": ["[email protected]", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
@@ -588,8 +567,6 @@
"convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
"cookie": ["[email protected]", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="],
"csstype": ["[email protected]", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
"debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
@@ -632,8 +609,6 @@
"electronmon": ["[email protected]", "", { "dependencies": { "chalk": "^3.0.0", "import-from": "^3.0.0", "runtime-required": "^1.1.0", "watchboy": "^0.4.3" }, "bin": { "electronmon": "bin/cli.js" } }, "sha512-u6eDrvUbqa+wsnMrhG2vHmo5neL1owLg2e5i1avGWcOb4rHsUf9lSfbs0FvfPsBNpLxxlPO98nrMhAGV+zw/fQ=="],
"emoji-regex": ["[email protected]", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
"empathic": ["[email protected]", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="],
"end-of-stream": ["[email protected]", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
@@ -688,8 +663,6 @@
"gensync": ["[email protected]", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
"get-caller-file": ["[email protected]", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
"get-intrinsic": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"get-proto": ["[email protected]", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
@@ -708,8 +681,6 @@
"graceful-fs": ["[email protected]", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
"graphql": ["[email protected]", "", {}, "sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ=="],
"has-flag": ["[email protected]", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
"has-property-descriptors": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
@@ -728,8 +699,6 @@
"hast-util-whitespace": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw=="],
"headers-polyfill": ["[email protected]", "", {}, "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ=="],
"highlight.js": ["[email protected]", "", {}, "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w=="],
"hookable": ["[email protected]", "", {}, "sha512-uKGyY8BuzN/a5gvzvA+3FVWo0+wUjgtfSdnmjtrOVwQCZPHpHDH2WRO3VZSOeluYrHoDCiXFffZXs8Dj1ULWtw=="],
@@ -754,19 +723,15 @@
"is-docker": ["[email protected]", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="],
"is-fullwidth-code-point": ["[email protected]", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
"is-hexadecimal": ["[email protected]", "", {}, "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg=="],
"is-inside-container": ["[email protected]", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="],
"is-node-process": ["[email protected]", "", {}, "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw=="],
"is-number": ["[email protected]", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
"is-plain-obj": ["[email protected]", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="],
"is-wsl": ["[email protected].0", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw=="],
"is-wsl": ["[email protected].1", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="],
"jiti": ["[email protected]", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="],
@@ -930,10 +895,6 @@
"ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
"msw": ["[email protected]", "", { "dependencies": { "@inquirer/confirm": "^5.0.0", "@mswjs/interceptors": "^0.41.2", "@open-draft/deferred-promise": "^2.2.0", "@types/statuses": "^2.0.6", "cookie": "^1.0.2", "graphql": "^16.12.0", "headers-polyfill": "^4.0.2", "is-node-process": "^1.2.0", "outvariant": "^1.4.3", "path-to-regexp": "^6.3.0", "picocolors": "^1.1.1", "rettime": "^0.10.1", "statuses": "^2.0.2", "strict-event-emitter": "^0.5.1", "tough-cookie": "^6.0.0", "type-fest": "^5.2.0", "until-async": "^3.0.2", "yargs": "^17.7.2" }, "peerDependencies": { "typescript": ">= 4.8.x" }, "optionalPeers": ["typescript"], "bin": { "msw": "cli/index.js" } }, "sha512-G3VUymSE0/iegFnuipujpwyTM2GuZAKXNeerUSrG2+Eg391wW63xFs5ixWsK9MWzr1AGoSkYGmyAzNgbR3+urw=="],
"mute-stream": ["[email protected]", "", {}, "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA=="],
"nanoid": ["[email protected]", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"node-addon-api": ["[email protected]", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="],
@@ -954,18 +915,14 @@
"open": ["[email protected]", "", { "dependencies": { "default-browser": "^5.2.1", "define-lazy-prop": "^3.0.0", "is-inside-container": "^1.0.0", "wsl-utils": "^0.1.0" } }, "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA=="],
"outvariant": ["[email protected]", "", {}, "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA=="],
"oxfmt": ["[email protected]", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/darwin-arm64": "0.28.0", "@oxfmt/darwin-x64": "0.28.0", "@oxfmt/linux-arm64-gnu": "0.28.0", "@oxfmt/linux-arm64-musl": "0.28.0", "@oxfmt/linux-x64-gnu": "0.28.0", "@oxfmt/linux-x64-musl": "0.28.0", "@oxfmt/win32-arm64": "0.28.0", "@oxfmt/win32-x64": "0.28.0" }, "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-3+hhBqPE6Kp22KfJmnstrZbl+KdOVSEu1V0ABaFIg1rYLtrMgrupx9znnHgHLqKxAVHebjTdiCJDk30CXOt6cw=="],
"oxlint": ["[email protected]6.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.46.0", "@oxlint/binding-android-arm64": "1.46.0", "@oxlint/binding-darwin-arm64": "1.46.0", "@oxlint/binding-darwin-x64": "1.46.0", "@oxlint/binding-freebsd-x64": "1.46.0", "@oxlint/binding-linux-arm-gnueabihf": "1.46.0", "@oxlint/binding-linux-arm-musleabihf": "1.46.0", "@oxlint/binding-linux-arm64-gnu": "1.46.0", "@oxlint/binding-linux-arm64-musl": "1.46.0", "@oxlint/binding-linux-ppc64-gnu": "1.46.0", "@oxlint/binding-linux-riscv64-gnu": "1.46.0", "@oxlint/binding-linux-riscv64-musl": "1.46.0", "@oxlint/binding-linux-s390x-gnu": "1.46.0", "@oxlint/binding-linux-x64-gnu": "1.46.0", "@oxlint/binding-linux-x64-musl": "1.46.0", "@oxlint/binding-openharmony-arm64": "1.46.0", "@oxlint/binding-win32-arm64-msvc": "1.46.0", "@oxlint/binding-win32-ia32-msvc": "1.46.0", "@oxlint/binding-win32-x64-msvc": "1.46.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.11.2" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-I9h42QDtAVsRwoueJ4PL/7qN5jFzIUXvbO4Z5ddtII92ZCiD7uiS/JW2V4viBSfGLsbZkQp3YEs6Ls4I8q+8tA=="],
"oxlint": ["[email protected]8.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.48.0", "@oxlint/binding-android-arm64": "1.48.0", "@oxlint/binding-darwin-arm64": "1.48.0", "@oxlint/binding-darwin-x64": "1.48.0", "@oxlint/binding-freebsd-x64": "1.48.0", "@oxlint/binding-linux-arm-gnueabihf": "1.48.0", "@oxlint/binding-linux-arm-musleabihf": "1.48.0", "@oxlint/binding-linux-arm64-gnu": "1.48.0", "@oxlint/binding-linux-arm64-musl": "1.48.0", "@oxlint/binding-linux-ppc64-gnu": "1.48.0", "@oxlint/binding-linux-riscv64-gnu": "1.48.0", "@oxlint/binding-linux-riscv64-musl": "1.48.0", "@oxlint/binding-linux-s390x-gnu": "1.48.0", "@oxlint/binding-linux-x64-gnu": "1.48.0", "@oxlint/binding-linux-x64-musl": "1.48.0", "@oxlint/binding-openharmony-arm64": "1.48.0", "@oxlint/binding-win32-arm64-msvc": "1.48.0", "@oxlint/binding-win32-ia32-msvc": "1.48.0", "@oxlint/binding-win32-x64-msvc": "1.48.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.12.2" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-m5vyVBgPtPhVCJc3xI//8je9lRc8bYuYB4R/1PH3VPGOjA4vjVhkHtyJukdEjYEjwrw4Qf1eIf+pP9xvfhfMow=="],
"p-cancelable": ["[email protected]", "", {}, "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg=="],
"parse-entities": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw=="],
"path-to-regexp": ["[email protected]", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="],
"pathe": ["[email protected]", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
"pend": ["[email protected]", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="],
@@ -1010,8 +967,6 @@
"remove-trailing-separator": ["[email protected]", "", {}, "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw=="],
"require-directory": ["[email protected]", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="],
"reselect": ["[email protected]", "", {}, "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w=="],
"resolve-alpn": ["[email protected]", "", {}, "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="],
@@ -1022,8 +977,6 @@
"responselike": ["[email protected]", "", { "dependencies": { "lowercase-keys": "^2.0.0" } }, "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw=="],
"rettime": ["[email protected]", "", {}, "sha512-uyDrIlUEH37cinabq0AX4QbgV4HbFZ/gqoiunWQ1UqBtRvTTytwhNYjE++pO/MjPTZL5KQCf2bEoJ/BJNVQ5Kw=="],
"roarr": ["[email protected]", "", { "dependencies": { "boolean": "^3.0.1", "detect-node": "^2.0.4", "globalthis": "^1.0.1", "json-stringify-safe": "^5.0.1", "semver-compare": "^1.0.0", "sprintf-js": "^1.1.2" } }, "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A=="],
"rolldown": ["[email protected]", "", { "dependencies": { "@oxc-project/types": "=0.112.0", "@rolldown/pluginutils": "1.0.0-rc.3" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.3", "@rolldown/binding-darwin-arm64": "1.0.0-rc.3", "@rolldown/binding-darwin-x64": "1.0.0-rc.3", "@rolldown/binding-freebsd-x64": "1.0.0-rc.3", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.3", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.3", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.3", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.3", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.3", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.3", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.3", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.3", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.3" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-Po/YZECDOqVXjIXrtC5h++a5NLvKAQNrd9ggrIG3sbDfGO5BqTUsrI6l8zdniKRp3r5Tp/2JTrXqx4GIguFCMw=="],
@@ -1048,8 +1001,6 @@
"siginfo": ["[email protected]", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
"signal-exit": ["[email protected]", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],
"source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
"space-separated-tokens": ["[email protected]", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="],
@@ -1058,18 +1009,10 @@
"stackback": ["[email protected]", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
"statuses": ["[email protected]", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
"std-env": ["[email protected]", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="],
"strict-event-emitter": ["[email protected]", "", {}, "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ=="],
"string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
"stringify-entities": ["[email protected]", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="],
"strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
"style-to-js": ["[email protected]", "", { "dependencies": { "style-to-object": "1.0.14" } }, "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ=="],
"style-to-object": ["[email protected]", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="],
@@ -1082,9 +1025,7 @@
"tabbable": ["[email protected]", "", {}, "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg=="],
"tagged-tag": ["[email protected]", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="],
"tailwind-merge": ["[email protected]", "", {}, "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g=="],
"tailwind-merge": ["[email protected]", "", {}, "sha512-2OA0rFqWOkITEAOFWSBSApYkDeH9t2B3XSJuI4YztKBzK3mX0737A2qtxDZ7xkw9Zfh0bWl+r34sF3HXV+Ig7Q=="],
"tailwindcss": ["[email protected]", "", {}, "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw=="],
@@ -1100,14 +1041,8 @@
"tinyrainbow": ["[email protected]", "", {}, "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q=="],
"tldts": ["[email protected]", "", { "dependencies": { "tldts-core": "^7.0.23" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw=="],
"tldts-core": ["[email protected]", "", {}, "sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ=="],
"to-regex-range": ["[email protected]", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
"tough-cookie": ["[email protected]", "", { "dependencies": { "tldts": "^7.0.5" } }, "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w=="],
"tree-kill": ["[email protected]", "", { "bin": { "tree-kill": "cli.js" } }, "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="],
"trim-lines": ["[email protected]", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="],
@@ -1118,25 +1053,25 @@
"tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"turbo": ["[email protected].7", "", { "optionalDependencies": { "turbo-darwin-64": "2.8.7", "turbo-darwin-arm64": "2.8.7", "turbo-linux-64": "2.8.7", "turbo-linux-arm64": "2.8.7", "turbo-windows-64": "2.8.7", "turbo-windows-arm64": "2.8.7" }, "bin": { "turbo": "bin/turbo" } }, "sha512-RBLh5caMAu1kFdTK1jgH2gH/z+jFsvX5rGbhgJ9nlIAWXSvxlzwId05uDlBA1+pBd3wO/UaKYzaQZQBXDd7kcA=="],
"turbo": ["[email protected].9", "", { "optionalDependencies": { "turbo-darwin-64": "2.8.9", "turbo-darwin-arm64": "2.8.9", "turbo-linux-64": "2.8.9", "turbo-linux-arm64": "2.8.9", "turbo-windows-64": "2.8.9", "turbo-windows-arm64": "2.8.9" }, "bin": { "turbo": "bin/turbo" } }, "sha512-G+Mq8VVQAlpz/0HTsxiNNk/xywaHGl+dk1oiBREgOEVCCDjXInDlONWUn5srRnC9s5tdHTFD1bx1N19eR4hI+g=="],
"turbo-darwin-64": ["[email protected].7", "", { "os": "darwin", "cpu": "x64" }, "sha512-Xr4TO/oDDwoozbDtBvunb66g//WK8uHRygl72vUthuwzmiw48pil4IuoG/QbMHd9RE8aBnVmzC0WZEWk/WWt3A=="],
"turbo-darwin-64": ["[email protected].9", "", { "os": "darwin", "cpu": "x64" }, "sha512-KnCw1ZI9KTnEAhdI9avZrnZ/z4wsM++flMA1w8s8PKOqi5daGpFV36qoPafg4S8TmYMe52JPWEoFr0L+lQ5JIw=="],
"turbo-darwin-arm64": ["[email protected].7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-p8Xbmb9kZEY/NoshQUcFmQdO80s2PCGoLYj5DbpxjZr3diknipXxzOK7pcmT7l2gNHaMCpFVWLkiFY9nO3EU5w=="],
"turbo-darwin-arm64": ["[email protected].9", "", { "os": "darwin", "cpu": "arm64" }, "sha512-CbD5Y2NKJKBXTOZ7z7Cc7vGlFPZkYjApA7ri9lH4iFwKV1X7MoZswh9gyRLetXYWImVX1BqIvP8KftulJg/wIA=="],
"turbo-linux-64": ["[email protected].7", "", { "os": "linux", "cpu": "x64" }, "sha512-nwfEPAH3m5y/nJeYly3j1YJNYU2EG5+2ysZUxvBNM+VBV2LjQaLxB9CsEIpIOKuWKCjnFHKIADTSDPZ3D12J5Q=="],
"turbo-linux-64": ["[email protected].9", "", { "os": "linux", "cpu": "x64" }, "sha512-OXC9HdCtsHvyH+5KUoH8ds+p5WU13vdif0OPbsFzZca4cUXMwKA3HWwUuCgQetk0iAE4cscXpi/t8A263n3VTg=="],
"turbo-linux-arm64": ["[email protected].7", "", { "os": "linux", "cpu": "arm64" }, "sha512-mgA/M6xiJzyxtXV70TtWGDPh+I6acOKmeQGtOzbFQZYEf794pu5jax26bCk5skAp1gqZu3vacPr6jhYHoHU9IQ=="],
"turbo-linux-arm64": ["[email protected].9", "", { "os": "linux", "cpu": "arm64" }, "sha512-yI5n8jNXiFA6+CxnXG0gO7h5ZF1+19K8uO3/kXPQmyl37AdiA7ehKJQOvf9OPAnmkGDHcF2HSCPltabERNRmug=="],
"turbo-windows-64": ["[email protected].7", "", { "os": "win32", "cpu": "x64" }, "sha512-sHTYMaXuCcyHnGUQgfUUt7S8407TWoP14zc/4N2tsM0wZNK6V9h4H2t5jQPtqKEb6Fg8313kygdDgEwuM4vsHg=="],
"turbo-windows-64": ["[email protected].9", "", { "os": "win32", "cpu": "x64" }, "sha512-/OztzeGftJAg258M/9vK2ZCkUKUzqrWXJIikiD2pm8TlqHcIYUmepDbyZSDfOiUjMy6NzrLFahpNLnY7b5vNgg=="],
"turbo-windows-arm64": ["[email protected].7", "", { "os": "win32", "cpu": "arm64" }, "sha512-WyGiOI2Zp3AhuzVagzQN+T+iq0fWx0oGxDfAWT3ZiLEd4U0cDUkwUZDKVGb3rKqPjDL6lWnuxKKu73ge5xtovQ=="],
"turbo-windows-arm64": ["[email protected].9", "", { "os": "win32", "cpu": "arm64" }, "sha512-xZ2VTwVTjIqpFZKN4UBxDHCPM3oJ2J5cpRzCBSmRpJ/Pn33wpiYjs+9FB2E03svKaD04/lSSLlEUej0UYsugfg=="],
"type-fest": ["type-fest@5.4.4", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw=="],
"type-fest": ["type-fest@0.13.1", "", {}, "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg=="],
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
"unconfig-core": ["unconfig-core@7.4.2", "", { "dependencies": { "@quansync/fs": "^1.0.0", "quansync": "^1.0.0" } }, "sha512-VgPCvLWugINbXvMQDf8Jh0mlbvNjNC6eSUziHsBCMpxR05OPrNrvDnyatdMjRgcHaaNsCqz+wjNXxNw1kRLHUg=="],
"unconfig-core": ["unconfig-core@7.5.0", "", { "dependencies": { "@quansync/fs": "^1.0.0", "quansync": "^1.0.0" } }, "sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w=="],
"undici-types": ["[email protected]", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
@@ -1160,8 +1095,6 @@
"unrun": ["[email protected]", "", { "dependencies": { "rolldown": "1.0.0-rc.3" }, "peerDependencies": { "synckit": "^0.11.11" }, "optionalPeers": ["synckit"], "bin": { "unrun": "dist/cli.mjs" } }, "sha512-Mmur1UJpIbfxasLOhPRvox/QS4xBiDii71hMP7smfRthGcwFL2OAmYRgduLANOAU4LUkvVamuP+02U+c90jlrw=="],
"until-async": ["[email protected]", "", {}, "sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw=="],
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
"use-sync-external-store": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],
@@ -1170,7 +1103,7 @@
"vfile-message": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw=="],
"vite": ["[email protected]3", "", { "dependencies": { "@oxc-project/runtime": "0.112.0", "fdir": "^6.5.0", "lightningcss": "^1.31.1", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rolldown": "1.0.0-rc.3", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.0.0-alpha.24", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-7s/rfpYOAo7WUHh9irzaGjhhKb12hGv0BpDegAMV5A391wdyvM45WtX6VMV7hvEtZF2j/QtpDpR6ldXI3GgARQ=="],
"vite": ["[email protected]4", "", { "dependencies": { "@oxc-project/runtime": "0.113.0", "fdir": "^6.5.0", "lightningcss": "^1.31.1", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rolldown": "1.0.0-rc.4", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.0.0-alpha.31", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-oLW66oi8tZcoxu6+1HFXb+5hLHco3OnEVu2Awmj5NqEo7vxaqybjBM0BXHcq+jAFhzkMGXJl8xcO5qDBczgKLg=="],
"vitest": ["[email protected]", "", { "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", "@vitest/pretty-format": "4.0.18", "@vitest/runner": "4.0.18", "@vitest/snapshot": "4.0.18", "@vitest/spy": "4.0.18", "@vitest/utils": "4.0.18", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^3.10.0", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.0.3", "vite": "^6.0.0 || ^7.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.0.18", "@vitest/browser-preview": "4.0.18", "@vitest/browser-webdriverio": "4.0.18", "@vitest/ui": "4.0.18", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ=="],
@@ -1180,26 +1113,16 @@
"why-is-node-running": ["[email protected]", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
"wrap-ansi": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="],
"wrappy": ["[email protected]", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
"ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg=="],
"wsl-utils": ["[email protected]", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="],
"y18n": ["[email protected]", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="],
"yallist": ["[email protected]", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
"yargs": ["[email protected]", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="],
"yargs-parser": ["[email protected]", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="],
"yauzl": ["[email protected]", "", { "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g=="],
"yoctocolors-cjs": ["[email protected]", "", {}, "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw=="],
"zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
"zwitch": ["[email protected]", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="],
@@ -1252,8 +1175,6 @@
"@vitejs/plugin-react/vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA=="],
"cliui/wrap-ansi": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
"clone-response/mimic-response": ["[email protected]", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="],
"electron/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-Rs1bVAIdBs5gbTIKza/tgpMuG1k3U/UMJLWecIMxNdJFDMzcM5LOiLVRYh3PilWEYDIeUDv7bpiHPLPsbydGcw=="],
@@ -1266,13 +1187,13 @@
"rolldown-plugin-dts/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.1", "@babel/helper-validator-identifier": "^8.0.0-rc.1" } }, "sha512-ubmJ6TShyaD69VE9DQrlXcdkvJbmwWPB8qYj0H2kaJi29O7vJT9ajSdBd2W8CG34pwL9pYA74fi7RHC1qbLoVQ=="],
"serialize-error/type-fest": ["[email protected]", "", {}, "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg=="],
"vite/rolldown": ["[email protected]", "", { "dependencies": { "@oxc-project/types": "=0.113.0", "@rolldown/pluginutils": "1.0.0-rc.4" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.4", "@rolldown/binding-darwin-arm64": "1.0.0-rc.4", "@rolldown/binding-darwin-x64": "1.0.0-rc.4", "@rolldown/binding-freebsd-x64": "1.0.0-rc.4", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.4", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.4", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.4", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.4", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.4", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.4", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.4", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.4", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.4" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-V2tPDUrY3WSevrvU2E41ijZlpF+5PbZu4giH+VpNraaadsJGHa4fR6IFwsocVwEXDoAdIv5qgPPxgrvKAOIPtA=="],
"vitest/vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA=="],
"@babel/generator/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].1", "", {}, "sha512-vi/pfmbrOtQmqgfboaBhaCU50G7mcySVu69VU8z+lYoPPB6WzI9VgV7WQfL908M4oeSH5fDkmoupIqoE0SdApw=="],
"@babel/generator/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="],
"@babel/parser/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].1", "", {}, "sha512-vi/pfmbrOtQmqgfboaBhaCU50G7mcySVu69VU8z+lYoPPB6WzI9VgV7WQfL908M4oeSH5fDkmoupIqoE0SdApw=="],
"@babel/parser/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="],
"@tailwindcss/node/lightningcss/lightningcss-android-arm64": ["[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A=="],
@@ -1296,6 +1217,36 @@
"@tailwindcss/node/lightningcss/lightningcss-win32-x64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw=="],
"rolldown-plugin-dts/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].1", "", {}, "sha512-vi/pfmbrOtQmqgfboaBhaCU50G7mcySVu69VU8z+lYoPPB6WzI9VgV7WQfL908M4oeSH5fDkmoupIqoE0SdApw=="],
"rolldown-plugin-dts/@babel/types/@babel/helper-string-parser": ["@babel/[email protected].2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="],
"vite/rolldown/@oxc-project/types": ["@oxc-project/[email protected]", "", {}, "sha512-Tp3XmgxwNQ9pEN9vxgJBAqdRamHibi76iowQ38O2I4PMpcvNRQNVsU2n1x1nv9yh0XoTrGFzf7cZSGxmixxrhA=="],
"vite/rolldown/@rolldown/binding-android-arm64": ["@rolldown/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-vRq9f4NzvbdZavhQbjkJBx7rRebDKYR9zHfO/Wg486+I7bSecdUapzCm5cyXoK+LHokTxgSq7A5baAXUZkIz0w=="],
"vite/rolldown/@rolldown/binding-darwin-arm64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-kFgEvkWLqt3YCgKB5re9RlIrx9bRsvyVUnaTakEpOPuLGzLpLapYxE9BufJNvPg8GjT6mB1alN4yN1NjzoeM8Q=="],
"vite/rolldown/@rolldown/binding-darwin-x64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-JXmaOJGsL/+rsmMfutcDjxWM2fTaVgCHGoXS7nE8Z3c9NAYjGqHvXrAhMUZvMpHS/k7Mg+X7n/MVKb7NYWKKww=="],
"vite/rolldown/@rolldown/binding-freebsd-x64": ["@rolldown/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-ep3Catd6sPnHTM0P4hNEvIv5arnDvk01PfyJIJ+J3wVCG1eEaPo09tvFqdtcaTrkwQy0VWR24uz+cb4IsK53Qw=="],
"vite/rolldown/@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-LwA5ayKIpnsgXJEwWc3h8wPiS33NMIHd9BhsV92T8VetVAbGe2qXlJwNVDGHN5cOQ22R9uYvbrQir2AB+ntT2w=="],
"vite/rolldown/@rolldown/binding-linux-arm64-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-AC1WsGdlV1MtGay/OQ4J9T7GRadVnpYRzTcygV1hKnypbYN20Yh4t6O1Sa2qRBMqv1etulUknqXjc3CTIsBu6A=="],
"vite/rolldown/@rolldown/binding-linux-arm64-musl": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-lU+6rgXXViO61B4EudxtVMXSOfiZONR29Sys5VGSetUY7X8mg9FCKIIjcPPj8xNDeYzKl+H8F/qSKOBVFJChCQ=="],
"vite/rolldown/@rolldown/binding-linux-x64-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-DZaN1f0PGp/bSvKhtw50pPsnln4T13ycDq1FrDWRiHmWt1JeW+UtYg9touPFf8yt993p8tS2QjybpzKNTxYEwg=="],
"vite/rolldown/@rolldown/binding-linux-x64-musl": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-RnGxwZLN7fhMMAItnD6dZ7lvy+TI7ba+2V54UF4dhaWa/p8I/ys1E73KO6HmPmgz92ZkfD8TXS1IMV8+uhbR9g=="],
"vite/rolldown/@rolldown/binding-openharmony-arm64": ["@rolldown/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-6lcI79+X8klGiGd8yHuTgQRjuuJYNggmEml+RsyN596P23l/zf9FVmJ7K0KVKkFAeYEdg0iMUKyIxiV5vebDNQ=="],
"vite/rolldown/@rolldown/binding-wasm32-wasi": ["@rolldown/[email protected]", "", { "dependencies": { "@napi-rs/wasm-runtime": "^1.1.1" }, "cpu": "none" }, "sha512-wz7ohsKCAIWy91blZ/1FlpPdqrsm1xpcEOQVveWoL6+aSPKL4VUcoYmmzuLTssyZxRpEwzuIxL/GDsvpjaBtOw=="],
"vite/rolldown/@rolldown/binding-win32-arm64-msvc": ["@rolldown/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-cfiMrfuWCIgsFmcVG0IPuO6qTRHvF7NuG3wngX1RZzc6dU8FuBFb+J3MIR5WrdTNozlumfgL4cvz+R4ozBCvsQ=="],
"vite/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-p6UeR9y7ht82AH57qwGuFYn69S6CZ7LLKdCKy/8T3zS9VTrJei2/CGsTUV45Da4Z9Rbhc7G4gyWQ/Ioamqn09g=="],
"vite/rolldown/@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-1BrrmTu0TWfOP1riA8uakjFc9bpIUGzVKETsOtzY39pPga8zELGDl8eu1Dx7/gjM5CAz14UknsUMpBO8L+YntQ=="],
}
}
+2
View File
@@ -18,6 +18,8 @@
"lint": "oxlint --report-unused-disable-directives",
"test": "turbo run test",
"test:desktop-smoke": "turbo run smoke-test --filter=@t3tools/desktop",
"test:desktop-perf": "node scripts/desktop-perf-trace.mjs",
"test:desktop-perf:post": "node scripts/desktop-perf-trace.mjs --post-pr",
"fmt": "oxfmt",
"build:contracts": "turbo run build --filter=@t3tools/contracts",
"clean": "rm -rf node_modules apps/*/node_modules packages/*/node_modules apps/*/dist apps/*/dist-electron packages/*/dist .turbo apps/*/.turbo packages/*/.turbo",
-5
View File
@@ -32,8 +32,6 @@ import type {
ProjectSearchEntriesInput,
ProjectSearchEntriesResult,
ProjectRemoveInput,
ProjectUpdateScriptsInput,
ProjectUpdateScriptsResult,
} from "./project";
import type { ServerConfig } from "./server";
import type {
@@ -46,7 +44,6 @@ import type {
TerminalWriteInput,
} from "./terminal";
import type { NewTodoInput, Todo } from "./todo";
import type { ServerUpsertKeybindingInput, ServerUpsertKeybindingResult } from "./server";
export const EDITORS = [
{ id: "cursor", label: "Cursor", command: "cursor" },
@@ -96,7 +93,6 @@ export interface NativeApi {
add: (input: ProjectAddInput) => Promise<ProjectAddResult>;
remove: (input: ProjectRemoveInput) => Promise<void>;
searchEntries: (input: ProjectSearchEntriesInput) => Promise<ProjectSearchEntriesResult>;
updateScripts: (input: ProjectUpdateScriptsInput) => Promise<ProjectUpdateScriptsResult>;
};
shell: {
openInEditor: (cwd: string, editor: EditorId) => Promise<void>;
@@ -123,6 +119,5 @@ export interface NativeApi {
};
server: {
getConfig: () => Promise<ServerConfig>;
upsertKeybinding: (input: ServerUpsertKeybindingInput) => Promise<ServerUpsertKeybindingResult>;
};
}
+1 -9
View File
@@ -32,19 +32,11 @@ describe("keybindings contracts", () => {
assert.throws(() =>
keybindingRuleSchema.parse({
key: "mod+j",
command: "script.Test.run",
command: "invalid.command",
}),
);
});
it("accepts dynamic script run commands", () => {
const parsed = keybindingRuleSchema.parse({
key: "mod+r",
command: "script.setup.run",
});
assert.strictEqual(parsed.command, "script.setup.run");
});
it("parses keybindings array payload", () => {
const parsed = keybindingsConfigSchema.parse([
{ key: "mod+j", command: "terminal.toggle" },
+1 -11
View File
@@ -1,6 +1,6 @@
import { z } from "zod";
export const STATIC_KEYBINDING_COMMANDS = [
export const keybindingCommandSchema = z.enum([
"terminal.toggle",
"terminal.split",
"terminal.new",
@@ -8,16 +8,6 @@ export const STATIC_KEYBINDING_COMMANDS = [
"chat.new",
"chat.newLocal",
"editor.openFavorite",
] as const;
export const keybindingCommandSchema = z.union([
z.enum(STATIC_KEYBINDING_COMMANDS),
z
.string()
.trim()
.min(1)
.max(96)
.regex(/^script\.[a-z0-9][a-z0-9-]*\.run$/),
]);
const keybindingValueSchema = z.string().trim().min(1).max(64);
-62
View File
@@ -7,8 +7,6 @@ import {
projectSearchEntriesResultSchema,
projectListResultSchema,
projectRemoveInputSchema,
projectUpdateScriptsInputSchema,
projectUpdateScriptsResultSchema,
} from "./project";
describe("project contracts", () => {
@@ -18,7 +16,6 @@ describe("project contracts", () => {
id: "project-1",
cwd: "/tmp/project",
name: "project",
scripts: [],
createdAt: "2026-02-10T00:00:00.000Z",
updatedAt: "2026-02-10T00:00:00.000Z",
},
@@ -39,7 +36,6 @@ describe("project contracts", () => {
id: "project-1",
cwd: "/tmp/project",
name: "project",
scripts: [],
createdAt: "2026-02-10T00:00:00.000Z",
updatedAt: "2026-02-10T00:00:00.000Z",
},
@@ -86,62 +82,4 @@ describe("project contracts", () => {
expect(parsed.entries).toHaveLength(2);
expect(parsed.entries[0]?.kind).toBe("directory");
});
it("parses update scripts input", () => {
const parsed = projectUpdateScriptsInputSchema.parse({
id: "project-1",
scripts: [
{
id: "test",
name: "Test",
command: "bun test",
icon: "test",
runOnWorktreeCreate: false,
},
],
});
expect(parsed.scripts).toHaveLength(1);
expect(parsed.scripts[0]?.id).toBe("test");
});
it("parses debug icon in scripts", () => {
const parsed = projectUpdateScriptsInputSchema.parse({
id: "project-1",
scripts: [
{
id: "debug",
name: "Debug",
command: "bun --inspect test",
icon: "debug",
runOnWorktreeCreate: false,
},
],
});
expect(parsed.scripts[0]?.icon).toBe("debug");
});
it("parses update scripts result", () => {
const parsed = projectUpdateScriptsResultSchema.parse({
project: {
id: "project-1",
cwd: "/tmp/project",
name: "project",
scripts: [
{
id: "setup",
name: "Setup",
command: "bun install",
icon: "configure",
runOnWorktreeCreate: true,
},
],
createdAt: "2026-02-10T00:00:00.000Z",
updatedAt: "2026-02-10T00:00:00.000Z",
},
});
expect(parsed.project.scripts[0]?.id).toBe("setup");
});
});
-79
View File
@@ -1,38 +1,9 @@
import { z } from "zod";
export const PROJECT_SCRIPT_ICON_VALUES = [
"play",
"test",
"lint",
"configure",
"build",
"debug",
] as const;
export const projectScriptIconSchema = z.enum(PROJECT_SCRIPT_ICON_VALUES);
export const projectScriptSchema = z
.object({
id: z
.string()
.trim()
.min(1)
.max(64)
.regex(/^[a-z0-9][a-z0-9-]*$/),
name: z.string().trim().min(1).max(64),
command: z.string().trim().min(1).max(10_000),
icon: projectScriptIconSchema,
runOnWorktreeCreate: z.boolean().default(false),
})
.strict();
export const projectScriptsSchema = z.array(projectScriptSchema).max(64);
export const projectRecordSchema = z.object({
id: z.string().min(1),
cwd: z.string().min(1),
name: z.string().min(1),
scripts: projectScriptsSchema.default([]),
createdAt: z.string().datetime(),
updatedAt: z.string().datetime(),
});
@@ -73,54 +44,6 @@ export const projectSearchEntriesResultSchema = z.object({
truncated: z.boolean(),
});
export const projectUpdateScriptsInputSchema = z.object({
id: z.string().min(1),
scripts: projectScriptsSchema,
});
export const projectUpdateScriptsResultSchema = z.object({
project: projectRecordSchema,
});
export type ProjectScriptIcon = z.infer<typeof projectScriptIconSchema>;
export type ProjectScript = z.infer<typeof projectScriptSchema>;
/**
* Deduplicate scripts by ID and enforce at most one `runOnWorktreeCreate: true`
* flag (the first one wins). Fields are trimmed defensively so this is safe to
* call on data that hasn't been through Zod parsing.
*/
export function normalizeProjectScripts(scripts: readonly ProjectScript[]): ProjectScript[] {
const seenIds = new Set<string>();
const deduped: ProjectScript[] = [];
for (const script of scripts) {
const id = script.id.trim();
if (id.length === 0 || seenIds.has(id)) continue;
seenIds.add(id);
deduped.push({
...script,
id,
name: script.name.trim(),
command: script.command.trim(),
});
}
let setupAssigned = false;
const normalized: ProjectScript[] = [];
for (const script of deduped) {
if (!script.runOnWorktreeCreate) {
normalized.push(script);
continue;
}
if (!setupAssigned) {
setupAssigned = true;
normalized.push(script);
continue;
}
normalized.push({ ...script, runOnWorktreeCreate: false });
}
return normalized;
}
export type ProjectRecord = z.infer<typeof projectRecordSchema>;
export type ProjectListResult = z.infer<typeof projectListResultSchema>;
export type ProjectAddInput = z.input<typeof projectAddInputSchema>;
@@ -130,5 +53,3 @@ export type ProjectSearchEntriesInput = z.input<typeof projectSearchEntriesInput
export type ProjectEntryKind = z.infer<typeof projectEntryKindSchema>;
export type ProjectEntry = z.infer<typeof projectEntrySchema>;
export type ProjectSearchEntriesResult = z.infer<typeof projectSearchEntriesResultSchema>;
export type ProjectUpdateScriptsInput = z.input<typeof projectUpdateScriptsInputSchema>;
export type ProjectUpdateScriptsResult = z.infer<typeof projectUpdateScriptsResultSchema>;
+1 -9
View File
@@ -1,17 +1,9 @@
import { z } from "zod";
import { keybindingRuleSchema, resolvedKeybindingsConfigSchema } from "./keybindings";
import { resolvedKeybindingsConfigSchema } from "./keybindings";
export const serverConfigSchema = z.object({
cwd: z.string().min(1),
keybindings: resolvedKeybindingsConfigSchema.default([]),
});
export const serverUpsertKeybindingInputSchema = keybindingRuleSchema;
export const serverUpsertKeybindingResultSchema = z.object({
keybindings: resolvedKeybindingsConfigSchema.default([]),
});
export type ServerConfig = z.infer<typeof serverConfigSchema>;
export type ServerUpsertKeybindingInput = z.infer<typeof serverUpsertKeybindingInputSchema>;
export type ServerUpsertKeybindingResult = z.infer<typeof serverUpsertKeybindingResultSchema>;
-30
View File
@@ -42,36 +42,6 @@ describe("terminalOpenInputSchema", () => {
});
expect(parsed.terminalId).toBe(DEFAULT_TERMINAL_ID);
});
it("accepts optional env overrides", () => {
const parsed = terminalOpenInputSchema.parse({
threadId: "thread-1",
cwd: "/tmp/project",
cols: 100,
rows: 24,
env: {
T3CODE_PROJECT_ROOT: "/tmp/project",
CUSTOM_FLAG: "1",
},
});
expect(parsed.env).toMatchObject({
T3CODE_PROJECT_ROOT: "/tmp/project",
CUSTOM_FLAG: "1",
});
});
it("rejects invalid env keys", () => {
const result = terminalOpenInputSchema.safeParse({
threadId: "thread-1",
cwd: "/tmp/project",
cols: 100,
rows: 24,
env: {
"bad-key": "1",
},
});
expect(result.success).toBe(false);
});
});
describe("terminalWriteInputSchema", () => {
+2 -8
View File
@@ -5,11 +5,6 @@ export const DEFAULT_TERMINAL_ID = "default";
const terminalColsSchema = z.number().int().min(20).max(400);
const terminalRowsSchema = z.number().int().min(5).max(200);
const terminalIdSchema = z.string().trim().min(1).max(128);
const terminalEnvKeySchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128);
const terminalEnvValueSchema = z.string().max(8_192);
const terminalEnvSchema = z
.record(terminalEnvKeySchema, terminalEnvValueSchema)
.refine((env) => Object.keys(env).length <= 128, "Too many terminal env vars");
export const terminalThreadInputSchema = z.object({
threadId: z.string().trim().min(1),
@@ -21,9 +16,8 @@ export const terminalSessionInputSchema = terminalThreadInputSchema.extend({
export const terminalOpenInputSchema = terminalSessionInputSchema.extend({
cwd: z.string().trim().min(1),
cols: terminalColsSchema.optional(),
rows: terminalRowsSchema.optional(),
env: terminalEnvSchema.optional(),
cols: terminalColsSchema,
rows: terminalRowsSchema,
});
export const terminalWriteInputSchema = terminalSessionInputSchema.extend({
-2
View File
@@ -16,7 +16,6 @@ export const WS_METHODS = {
projectsAdd: "projects.add",
projectsRemove: "projects.remove",
projectsSearchEntries: "projects.searchEntries",
projectsUpdateScripts: "projects.updateScripts",
// Shell methods
shellOpenInEditor: "shell.openInEditor",
@@ -42,7 +41,6 @@ export const WS_METHODS = {
// Server meta
serverGetConfig: "server.getConfig",
serverUpsertKeybinding: "server.upsertKeybinding",
} as const;
// ── Push Event Channels ──────────────────────────────────────────────
+887
View File
@@ -0,0 +1,887 @@
import { spawn, execFileSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
const repoRoot = path.resolve(import.meta.dirname, "..");
const marker = "<!-- desktop-perf-trace-summary -->";
const defaultSeedRelativePath = "apps/desktop/scripts/perf-seed.json";
const defaultPerfProjects = [
{
id: "perf-project-1",
cwd: "/tmp/perf/codething-mvp",
name: "codething-mvp",
},
{
id: "perf-project-2",
cwd: "/tmp/perf/contracts-bench",
name: "contracts-bench",
},
];
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function parseArgs(argv) {
let postPr = false;
let seedPath = null;
for (let index = 2; index < argv.length; index += 1) {
const arg = argv[index];
if (arg === "--post-pr") {
postPr = true;
continue;
}
if (arg === "--seed") {
const value = argv[index + 1];
if (!value || value.startsWith("--")) {
throw new Error("--seed requires a file path");
}
seedPath = value;
index += 1;
continue;
}
if (arg.startsWith("--seed=")) {
const value = arg.slice("--seed=".length).trim();
if (value.length === 0) {
throw new Error("--seed= requires a non-empty path");
}
seedPath = value;
continue;
}
throw new Error(`Unknown argument: ${arg}`);
}
return {
postPr,
seedPath,
};
}
function toMs(us) {
return us / 1000;
}
function round(n, digits = 3) {
return Number(n.toFixed(digits));
}
function mb(bytes) {
return bytes / (1024 * 1024);
}
function parseNumericEnv({ name, value, predicate, expectation, fallback }) {
if (typeof value !== "string") {
return null;
}
const raw = value.trim();
if (raw.length === 0) {
console.warn(
`[desktop-perf] invalid ${name}="${value}" (expected ${expectation}); using ${fallback}`,
);
return null;
}
const parsed = Number(raw);
if (Number.isFinite(parsed) && predicate(parsed)) {
return {
parsed,
raw,
};
}
console.warn(
`[desktop-perf] invalid ${name}="${value}" (expected ${expectation}); using ${fallback}`,
);
return null;
}
function resolveNonNegativeNumberEnv({ name, value, fallback }) {
const resolved = parseNumericEnv({
name,
value,
predicate: (parsed) => parsed >= 0,
expectation: "non-negative number",
fallback,
});
return resolved?.parsed ?? fallback;
}
function resolveNonNegativeIntegerEnv({ name, value, fallback }) {
const resolved = parseNumericEnv({
name,
value,
predicate: (parsed) => parsed >= 0,
expectation: "non-negative number",
fallback,
});
if (!resolved) {
return fallback;
}
const normalized = Math.trunc(resolved.parsed);
if (normalized !== resolved.parsed) {
console.warn(
`[desktop-perf] non-integer ${name}="${resolved.raw}" truncated to ${normalized} for consistency`,
);
}
return normalized;
}
function resolvePositiveIntegerEnv({ name, value, fallback }) {
const resolved = parseNumericEnv({
name,
value,
predicate: (parsed) => parsed > 0,
expectation: "positive number",
fallback,
});
if (!resolved) {
return fallback;
}
const normalized = Math.trunc(resolved.parsed);
if (normalized !== resolved.parsed) {
console.warn(
`[desktop-perf] non-integer ${name}="${resolved.raw}" truncated to ${normalized} for consistency`,
);
}
return normalized;
}
function summarizeTrace(tracePath) {
const payload = JSON.parse(fs.readFileSync(tracePath, "utf8"));
const events = payload.traceEvents;
const durationByName = new Map();
const dispatchRows = [];
const functionRows = [];
const userTiming = new Map();
const updateCounters = [];
for (const event of events) {
if (event.name === "UpdateCounters" && event.args?.data) {
const heap = event.args.data.jsHeapSizeUsed;
if (typeof heap === "number") {
updateCounters.push(heap);
}
}
if (event.cat === "blink.user_timing" && typeof event.name === "string") {
userTiming.set(event.name, (userTiming.get(event.name) ?? 0) + 1);
}
if (event.ph !== "X" || typeof event.dur !== "number" || typeof event.name !== "string") {
continue;
}
const byName = durationByName.get(event.name) ?? { count: 0, dur: 0, max: 0 };
byName.count += 1;
byName.dur += event.dur;
byName.max = Math.max(byName.max, event.dur);
durationByName.set(event.name, byName);
if (event.name === "EventDispatch") {
const type = event.args?.data?.type ?? "";
dispatchRows.push({ type, dur: event.dur });
}
if (event.name === "FunctionCall") {
const functionName = event.args?.data?.functionName ?? "(unknown)";
functionRows.push({ functionName, dur: event.dur });
}
}
const aggregateDispatchType = (type) => {
const rows = dispatchRows.filter((row) => row.type === type);
if (rows.length === 0) {
return {
count: 0,
totalMs: 0,
avgMs: 0,
maxMs: 0,
};
}
const totalDur = rows.reduce((sum, row) => sum + row.dur, 0);
const maxDur = rows.reduce((max, row) => Math.max(max, row.dur), 0);
return {
count: rows.length,
totalMs: round(toMs(totalDur)),
avgMs: round(toMs(totalDur / rows.length)),
maxMs: round(toMs(maxDur)),
};
};
const aggregateFunction = (name) => {
const rows = functionRows.filter((row) => row.functionName === name);
if (rows.length === 0) {
return {
count: 0,
totalMs: 0,
avgMs: 0,
maxMs: 0,
};
}
const totalDur = rows.reduce((sum, row) => sum + row.dur, 0);
const maxDur = rows.reduce((max, row) => Math.max(max, row.dur), 0);
return {
count: rows.length,
totalMs: round(toMs(totalDur)),
avgMs: round(toMs(totalDur / rows.length)),
maxMs: round(toMs(maxDur)),
};
};
const topUserTiming = [...userTiming.entries()]
.toSorted((a, b) => b[1] - a[1])
.slice(0, 10)
.map(([name, count]) => ({ name, count }));
const topDurationEvents = [...durationByName.entries()]
.map(([name, value]) => ({
name,
count: value.count,
totalMs: round(toMs(value.dur), 2),
avgMs: round(toMs(value.dur / value.count)),
maxMs: round(toMs(value.max)),
}))
.toSorted((a, b) => b.totalMs - a.totalMs)
.slice(0, 10);
const heap = (() => {
if (updateCounters.length === 0) return null;
const first = updateCounters[0];
const last = updateCounters[updateCounters.length - 1];
const min = Math.min(...updateCounters);
const max = Math.max(...updateCounters);
return {
firstMb: round(mb(first), 1),
lastMb: round(mb(last), 1),
minMb: round(mb(min), 1),
maxMb: round(mb(max), 1),
deltaMb: round(mb(last - first), 1),
};
})();
const longDispatchCount = dispatchRows.filter((row) => row.dur >= 50_000).length;
return {
keypress: aggregateDispatchType("keypress"),
textInput: aggregateDispatchType("textInput"),
input: aggregateDispatchType("input"),
keydown: aggregateDispatchType("keydown"),
dispatchDiscreteEvent: aggregateFunction("dispatchDiscreteEvent"),
performWorkUntilDeadline: aggregateFunction("performWorkUntilDeadline"),
longDispatchCount,
heap,
topUserTiming,
topDurationEvents,
};
}
const pad = (value, width) => String(value).padEnd(width, " ");
function evaluateThresholds(summary, thresholds) {
const checks = [
{
label: "keypress avg",
actual: summary.keypress.avgMs,
threshold: thresholds.maxKeypressAvgMs,
ok: summary.keypress.avgMs <= thresholds.maxKeypressAvgMs,
},
{
label: "keypress max",
actual: summary.keypress.maxMs,
threshold: thresholds.maxKeypressMaxMs,
ok: summary.keypress.maxMs <= thresholds.maxKeypressMaxMs,
},
{
label: "long EventDispatch spikes",
actual: summary.longDispatchCount,
threshold: thresholds.maxLongDispatchCount,
ok: summary.longDispatchCount <= thresholds.maxLongDispatchCount,
},
];
const failures = checks
.filter((check) => !check.ok)
.map((check) => `${check.label} ${check.actual} exceeds ${check.threshold}`);
return {
checks,
failures,
passed: failures.length === 0,
};
}
function createMarkdownSummary({ tracePath, donePayload, summary, thresholds, thresholdCheck }) {
const THREAD_COL_WIDTH = 8;
const TITLE_COL_WIDTH = 15;
const largeThreadRenderStats = Array.isArray(donePayload.interactions?.largeThreadRenderStats)
? donePayload.interactions.largeThreadRenderStats
: [];
const formatThreadRenderRow = (stat) => {
const threadShort =
typeof stat.threadId === "string" ? stat.threadId.slice(0, THREAD_COL_WIDTH) : "n/a";
const titleShort =
typeof stat.threadTitleShort === "string"
? stat.threadTitleShort
: typeof stat.threadId === "string"
? stat.threadId.slice(0, 15)
: "n/a";
const firstRenderMs =
typeof stat.firstRenderMs === "number"
? stat.firstRenderMs
: typeof stat.renderMs === "number"
? stat.renderMs
: "n/a";
const followUpRenderMs =
typeof stat.followUpRenderMs === "number" ? stat.followUpRenderMs : "n/a";
const followUpMinMs = typeof stat.followUpMinMs === "number" ? stat.followUpMinMs : "n/a";
const followUpMaxMs = typeof stat.followUpMaxMs === "number" ? stat.followUpMaxMs : "n/a";
const followUpSampleCount =
typeof stat.followUpSampleCount === "number" ? stat.followUpSampleCount : "n/a";
const deltaMs = typeof stat.deltaMs === "number" ? stat.deltaMs : "n/a";
const deltaPct = typeof stat.deltaPct === "number" ? stat.deltaPct : "n/a";
const followUpRange =
typeof followUpMinMs === "number" && typeof followUpMaxMs === "number"
? `${followUpMinMs}-${followUpMaxMs} (${followUpSampleCount}x)`
: "n/a";
return `| ${pad(threadShort, THREAD_COL_WIDTH)} | ${pad(titleShort, TITLE_COL_WIDTH)} | ${stat.messageCount} | ${firstRenderMs} | ${followUpRenderMs} | ${followUpRange} | ${deltaMs} | ${deltaPct}% |`;
};
const benchmarkThreadIds = Array.isArray(donePayload.interactions?.benchmarkThreadIds)
? donePayload.interactions.benchmarkThreadIds
: [];
const seedSource =
donePayload.seed?.source === "file"
? `file (\`${donePayload.seed?.path ?? "unknown"}\`)`
: (donePayload.seed?.source ?? "generated");
const topDurationHead = summary.topDurationEvents.slice(0, 3);
const topDurationSummary =
topDurationHead.length === 0
? "none"
: topDurationHead.map((entry) => `${entry.name} (${entry.totalMs}ms total)`).join(", ");
const actionLines = thresholdCheck.passed
? [
"- Action: no threshold regressions detected in this run.",
"- Follow-up: keep watching top duration events for drift in future traces.",
]
: [
"- Action: threshold regression detected; profile and optimize the failing path(s) before merge.",
...thresholdCheck.failures.map((failure) => `- Failing metric: ${failure}`),
];
const lines = [
marker,
"## Desktop Dev Perf Trace",
"",
`- Status: ${thresholdCheck.passed ? "PASS" : "FAIL"}`,
`- Thresholds: keypress avg ${summary.keypress.avgMs}/${thresholds.maxKeypressAvgMs}ms, keypress max ${summary.keypress.maxMs}/${thresholds.maxKeypressMaxMs}ms, long dispatch spikes ${summary.longDispatchCount}/${thresholds.maxLongDispatchCount}`,
`- Coverage: seed=${seedSource}; projects=${donePayload.seed?.projectCount ?? "n/a"}; threads=${donePayload.seed?.threadCount ?? "n/a"}; benchmark threads exercised=${benchmarkThreadIds.length}`,
`- Interaction volume: thread clicks=${donePayload.interactions?.threadClicks ?? "n/a"}, typed chars=${donePayload.interactions?.typedChars ?? "n/a"}`,
`- Top hotspots: ${topDurationSummary}`,
"",
...actionLines,
"",
"<details>",
"<summary>Detailed trace metrics and diagnostics</summary>",
"",
"### Run Metadata",
"",
`- Command: \`bun dev:desktop\``,
`- Trace: \`${tracePath}\``,
`- Started: ${donePayload.startedAt ?? "n/a"}`,
`- Completed: ${donePayload.completedAt ?? "n/a"}`,
`- Duration: ${donePayload.durationMs ?? "n/a"} ms`,
"",
"### Interaction Run",
"",
`- Thread clicks: ${donePayload.interactions?.threadClicks ?? "n/a"}`,
`- Typed chars: ${donePayload.interactions?.typedChars ?? "n/a"}`,
`- Benchmark thread ids exercised: ${benchmarkThreadIds.length > 0 ? benchmarkThreadIds.join(", ") : "none"}`,
`- Model selected: ${donePayload.interactions?.selectedModel ?? "n/a"}`,
`- Terminal opened by shortcut: ${donePayload.interactions?.terminal?.openedByShortcut ?? "n/a"}`,
`- Terminal shortcut modifier: ${donePayload.interactions?.terminal?.modifierUsed ?? "n/a"}`,
`- Terminal splits: ${donePayload.interactions?.terminal?.splitCount ?? "n/a"}`,
`- Terminal command executed: ${donePayload.interactions?.terminal?.commandFileTouched ?? "n/a"}`,
`- Terminal output observed: ${donePayload.interactions?.terminal?.commandEchoObserved ?? "n/a"}`,
`- Terminal marker: ${donePayload.interactions?.terminal?.commandMarker ?? "n/a"}`,
`- Terminal interactions enabled: ${donePayload.config?.runTerminalInteractions ?? "n/a"}`,
`- Optional renderer interactions enabled: ${donePayload.config?.runOptionalRendererInteractions ?? "n/a"}`,
`- Benchmark sweep enabled: ${donePayload.config?.runBenchmarkThreadSweep ?? "n/a"}`,
`- Benchmark follow-up pass count: ${donePayload.config?.benchmarkFollowUpPassCount ?? "n/a"}`,
"",
"### Threshold Config",
"",
`- keypress avg max: ${thresholds.maxKeypressAvgMs}ms`,
`- keypress max max: ${thresholds.maxKeypressMaxMs}ms`,
`- long EventDispatch spike cap: ${thresholds.maxLongDispatchCount}`,
"",
"### Benchmark Thread Render",
"",
"| Thread | Title (15) | Messages | First Nav (ms) | Follow-up Median (ms) | Follow-up Range | Delta (ms) | Delta (%) |",
"| --- | --- | ---: | ---: | ---: | --- | ---: | ---: |",
...(largeThreadRenderStats.length > 0
? largeThreadRenderStats.map((stat) => formatThreadRenderRow(stat))
: ["| n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |"]),
"",
"### Input Event Metrics",
"",
"| Event | Count | Avg (ms) | Max (ms) | Total (ms) |",
"| --- | ---: | ---: | ---: | ---: |",
`| keypress | ${summary.keypress.count} | ${summary.keypress.avgMs} | ${summary.keypress.maxMs} | ${summary.keypress.totalMs} |`,
`| textInput | ${summary.textInput.count} | ${summary.textInput.avgMs} | ${summary.textInput.maxMs} | ${summary.textInput.totalMs} |`,
`| input | ${summary.input.count} | ${summary.input.avgMs} | ${summary.input.maxMs} | ${summary.input.totalMs} |`,
`| keydown | ${summary.keydown.count} | ${summary.keydown.avgMs} | ${summary.keydown.maxMs} | ${summary.keydown.totalMs} |`,
"",
"### Scheduler/Event Hotspots",
"",
`- dispatchDiscreteEvent: ${summary.dispatchDiscreteEvent.totalMs}ms total (${summary.dispatchDiscreteEvent.count} calls)`,
`- performWorkUntilDeadline: ${summary.performWorkUntilDeadline.totalMs}ms total (${summary.performWorkUntilDeadline.count} calls)`,
`- EventDispatch spikes >= 50ms: ${summary.longDispatchCount}`,
"",
"### Threshold Check",
"",
...thresholdCheck.checks.map(
(check) =>
`- ${check.label} <= ${check.threshold}: ${check.ok ? "pass" : `fail (actual ${check.actual})`}`,
),
"",
];
if (summary.heap) {
lines.push("### Heap Counters", "");
lines.push(
`- first=${summary.heap.firstMb}MB, last=${summary.heap.lastMb}MB, min=${summary.heap.minMb}MB, max=${summary.heap.maxMb}MB, delta=${summary.heap.deltaMb}MB`,
"",
);
}
lines.push("### Top User Timing Marks", "");
for (const entry of summary.topUserTiming) {
lines.push(`- ${entry.count}x ${entry.name}`);
}
lines.push("", "### Top Duration Events", "");
for (const entry of summary.topDurationEvents) {
lines.push(
`- ${entry.name}: total=${entry.totalMs}ms, avg=${entry.avgMs}ms, max=${entry.maxMs}ms, count=${entry.count}`,
);
}
lines.push("", "</details>", "");
return lines.join("\n");
}
async function waitForDoneFile(donePath, child, timeoutMs) {
const startedAt = Date.now();
while (Date.now() - startedAt < timeoutMs) {
if (fs.existsSync(donePath)) {
return JSON.parse(fs.readFileSync(donePath, "utf8"));
}
if (child.exitCode !== null) {
throw new Error(`desktop dev process exited early (code ${child.exitCode})`);
}
// oxlint-disable-next-line no-await-in-loop
await sleep(500);
}
throw new Error(`Timed out waiting for done marker at ${donePath}`);
}
function tailLogText(logChunks, lineCount = 120) {
const lines = logChunks.join("").split(/\r?\n/);
return lines.slice(-lineCount).join("\n").trim();
}
function inferDesktopPerfTimeoutHint(logChunks) {
const joined = logChunks.join("");
const lowered = joined.toLowerCase();
if (lowered.includes("waiting for bundles") && lowered.includes("outdated:")) {
return "Desktop bundles were present but older than desktop source files; dev bundler did not refresh outputs in time.";
}
if (lowered.includes("waiting for bundles") && lowered.includes("stale:")) {
return "Desktop bundles were detected as stale by startup freshness checks.";
}
if (lowered.includes("error while loading shared libraries")) {
return "Electron failed to start due missing Linux shared libraries.";
}
if (lowered.includes("setuid_sandbox_host.cc") || lowered.includes("chrome-sandbox")) {
return "Electron sandbox setup failed on Linux CI (setuid sandbox helper).";
}
if (lowered.includes("no usable sandbox")) {
return "Electron sandbox failed to initialize in CI.";
}
if (lowered.includes("port is already in use")) {
return "Dev server port collision prevented Electron from loading the renderer.";
}
if (!joined.includes("[desktop-perf]")) {
return "Desktop perf automation never started; Electron likely did not boot successfully.";
}
if (joined.includes("[desktop-perf]") && !joined.includes("[desktop-perf] trace recorded")) {
return "Desktop perf automation started but did not complete trace recording.";
}
return "Desktop perf automation timed out before writing the done marker.";
}
async function terminateProcessTree(child) {
if (child.exitCode !== null) return;
if (process.platform === "win32") {
try {
execFileSync("taskkill", ["/pid", String(child.pid), "/T", "/F"], { stdio: "ignore" });
} catch {
child.kill("SIGTERM");
}
return;
}
try {
process.kill(-child.pid, "SIGTERM");
} catch {
child.kill("SIGTERM");
}
await sleep(1_500);
if (child.exitCode === null) {
try {
process.kill(-child.pid, "SIGKILL");
} catch {
child.kill("SIGKILL");
}
}
}
function detectPrNumber() {
const githubRef = process.env.GITHUB_REF ?? "";
const match = githubRef.match(/refs\/pull\/(\d+)\//);
if (match?.[1]) {
return match[1];
}
return execFileSync("gh", ["pr", "view", "--json", "number", "--jq", ".number"], {
cwd: repoRoot,
encoding: "utf8",
}).trim();
}
function postSummaryToPr(summaryPath) {
const prNumber = detectPrNumber();
execFileSync(
"gh",
["pr", "comment", prNumber, "--body-file", summaryPath, "--edit-last", "--create-if-none"],
{
cwd: repoRoot,
stdio: "inherit",
},
);
}
function prepareDesktopPerfState(stateDir, perfProjects = defaultPerfProjects) {
fs.mkdirSync(stateDir, { recursive: true });
for (const project of perfProjects) {
try {
fs.mkdirSync(project.cwd, { recursive: true });
} catch {
// Some seeded paths may point to unavailable locations in CI; registry entries still work.
}
}
const now = new Date().toISOString();
fs.writeFileSync(
path.join(stateDir, "projects.json"),
JSON.stringify(
{
version: 1,
projects: perfProjects.map((project) => ({
id: project.id,
cwd: project.cwd,
name: project.name,
createdAt: now,
updatedAt: now,
})),
},
null,
2,
),
);
}
function resolveSeedPath(seedPathArg) {
const candidateArg = seedPathArg ?? process.env.T3CODE_DESKTOP_PERF_SEED_PATH ?? "";
if (!candidateArg || candidateArg.trim().length === 0) {
const resolvedDefault = path.resolve(repoRoot, defaultSeedRelativePath);
if (!fs.existsSync(resolvedDefault)) {
throw new Error(
`Default desktop perf seed file is required but missing: ${resolvedDefault}. Pass --seed to override.`,
);
}
return resolvedDefault;
}
const resolved = path.isAbsolute(candidateArg)
? candidateArg
: path.resolve(repoRoot, candidateArg);
if (!fs.existsSync(resolved)) {
throw new Error(`Seed file not found: ${resolved}`);
}
return resolved;
}
function normalizeProjectPathForRuntime(rawCwd, projectName, projectId, projectIndex) {
const attemptedPath = path.resolve(rawCwd);
try {
fs.mkdirSync(attemptedPath, { recursive: true });
return attemptedPath;
} catch {
const safeName = (projectName || projectId || `project-${projectIndex + 1}`)
.toLowerCase()
.replace(/[^a-z0-9._-]+/g, "-")
.replace(/^-+|-+$/g, "")
.slice(0, 48);
const fallbackPath = path.join(
os.tmpdir(),
"t3code-desktop-perf-seed-projects",
`${String(projectIndex + 1).padStart(2, "0")}-${safeName || "project"}`,
);
fs.mkdirSync(fallbackPath, { recursive: true });
return fallbackPath;
}
}
function materializeRuntimeSeed(seedPath, artifactsDir) {
const raw = JSON.parse(fs.readFileSync(seedPath, "utf8"));
if (!raw || typeof raw !== "object" || !Array.isArray(raw.projects)) {
return { runtimeSeedPath: seedPath, projects: null };
}
const rewrittenProjects = [];
let rewroteAnyProject = false;
for (let index = 0; index < raw.projects.length; index += 1) {
const project = raw.projects[index];
if (!project || typeof project !== "object") {
rewrittenProjects.push(project);
continue;
}
const id = typeof project.id === "string" ? project.id : "";
const name = typeof project.name === "string" ? project.name : "";
const cwd = typeof project.cwd === "string" ? project.cwd : "";
if (id.length === 0 || name.length === 0 || cwd.length === 0) {
rewrittenProjects.push(project);
continue;
}
const runtimeCwd = normalizeProjectPathForRuntime(cwd, name, id, index);
if (runtimeCwd !== cwd) {
rewroteAnyProject = true;
}
rewrittenProjects.push({
...project,
cwd: runtimeCwd,
});
}
if (!rewroteAnyProject) {
const projects = rewrittenProjects
.map((project) => {
if (!project || typeof project !== "object") return null;
const id = typeof project.id === "string" ? project.id : "";
const cwd = typeof project.cwd === "string" ? project.cwd : "";
const name = typeof project.name === "string" ? project.name : "";
if (id.length === 0 || cwd.length === 0 || name.length === 0) return null;
return { id, cwd, name };
})
.filter((project) => project !== null);
return {
runtimeSeedPath: seedPath,
projects: projects.length > 0 ? projects : null,
};
}
const runtimeSeedPath = path.join(artifactsDir, "perf-seed.runtime.json");
fs.writeFileSync(
runtimeSeedPath,
JSON.stringify(
{
...raw,
projects: rewrittenProjects,
},
null,
2,
),
);
const projects = rewrittenProjects
.map((project) => {
if (!project || typeof project !== "object") return null;
const id = typeof project.id === "string" ? project.id : "";
const cwd = typeof project.cwd === "string" ? project.cwd : "";
const name = typeof project.name === "string" ? project.name : "";
if (id.length === 0 || cwd.length === 0 || name.length === 0) return null;
return { id, cwd, name };
})
.filter((project) => project !== null);
return {
runtimeSeedPath,
projects: projects.length > 0 ? projects : null,
};
}
async function main() {
const args = parseArgs(process.argv);
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
const artifactsDir = path.join(os.tmpdir(), "t3code-perf-artifacts", `desktop-dev-${timestamp}`);
fs.mkdirSync(artifactsDir, { recursive: true });
const tracePath = path.join(artifactsDir, "trace.json");
const donePath = path.join(artifactsDir, "done.json");
const summaryPath = path.join(artifactsDir, "summary.md");
const logPath = path.join(artifactsDir, "run.log");
const stateDir = path.join(artifactsDir, "state");
const seedPath = resolveSeedPath(args.seedPath);
const materializedSeed = seedPath ? materializeRuntimeSeed(seedPath, artifactsDir) : null;
const runtimeSeedPath = materializedSeed?.runtimeSeedPath ?? seedPath;
const seedProjects = materializedSeed?.projects ?? null;
if (seedPath && runtimeSeedPath && runtimeSeedPath !== seedPath) {
console.log(
`[desktop-perf] rewrote seed project cwd paths for runtime compatibility: ${runtimeSeedPath}`,
);
}
prepareDesktopPerfState(stateDir, seedProjects ?? defaultPerfProjects);
const maxKeypressAvgMs = resolveNonNegativeNumberEnv({
name: "T3CODE_PERF_MAX_KEYPRESS_AVG_MS",
value: process.env.T3CODE_PERF_MAX_KEYPRESS_AVG_MS,
fallback: 12,
});
const maxKeypressMaxMs = resolveNonNegativeNumberEnv({
name: "T3CODE_PERF_MAX_KEYPRESS_MAX_MS",
value: process.env.T3CODE_PERF_MAX_KEYPRESS_MAX_MS,
fallback: 24,
});
const maxLongDispatchCount = resolveNonNegativeIntegerEnv({
name: "T3CODE_PERF_MAX_LONG_DISPATCH_COUNT",
value: process.env.T3CODE_PERF_MAX_LONG_DISPATCH_COUNT,
fallback: 0,
});
const timeoutMs = resolvePositiveIntegerEnv({
name: "T3CODE_PERF_TIMEOUT_MS",
value: process.env.T3CODE_PERF_TIMEOUT_MS,
fallback: 420000,
});
console.log(
`[desktop-perf] thresholds: keypressAvg<=${maxKeypressAvgMs}ms, keypressMax<=${maxKeypressMaxMs}ms, longDispatch<=${maxLongDispatchCount}, timeoutMs=${timeoutMs}`,
);
const child = spawn("bun", ["dev:desktop"], {
cwd: repoRoot,
detached: process.platform !== "win32",
env: {
...process.env,
T3CODE_DESKTOP_PERF_AUTOMATION: "1",
T3CODE_DESKTOP_PERF_TRACE_OUT: tracePath,
T3CODE_DESKTOP_PERF_DONE_OUT: donePath,
...(runtimeSeedPath ? { T3CODE_DESKTOP_PERF_SEED_PATH: runtimeSeedPath } : {}),
T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP:
process.env.T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP ?? "1",
T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES:
process.env.T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES ?? "1",
T3CODE_DEV_INSTANCE: `desktop-perf-${timestamp}`,
T3CODE_LOG_WS_EVENTS: "0",
T3CODE_STATE_DIR: stateDir,
},
stdio: ["ignore", "pipe", "pipe"],
});
const logs = [];
const appendLog = (chunk) => {
const text = chunk.toString();
logs.push(text);
if (logs.length > 1200) {
logs.splice(0, logs.length - 1200);
}
fs.appendFileSync(logPath, text);
process.stdout.write(text);
};
child.stdout.on("data", appendLog);
child.stderr.on("data", appendLog);
let donePayload;
try {
donePayload = await waitForDoneFile(donePath, child, timeoutMs);
} catch (error) {
const baseMessage = error instanceof Error ? error.message : String(error);
const hint = inferDesktopPerfTimeoutHint(logs);
const logTail = tailLogText(logs);
throw new Error(
[
baseMessage,
`Hint: ${hint}`,
`Artifacts dir: ${artifactsDir}`,
`Run log: ${logPath}`,
logTail.length > 0 ? `Recent log tail:\n${logTail}` : "Recent log tail: <empty>",
].join("\n"),
{ cause: error },
);
} finally {
await terminateProcessTree(child);
}
if (!donePayload || donePayload.status !== "ok") {
throw new Error(
`Desktop perf automation failed. ${donePayload?.error ?? "No completion payload written."}`,
);
}
const interactionChecks = [];
const threadClicks = Number(donePayload.interactions?.threadClicks ?? 0);
const typedChars = Number(donePayload.interactions?.typedChars ?? 0);
if (threadClicks <= 0) {
interactionChecks.push("thread clicks");
}
if (typedChars <= 0) {
interactionChecks.push("typed chars");
}
if (interactionChecks.length > 0) {
throw new Error(
`Desktop perf automation completed without required scripted interactions: ${interactionChecks.join(", ")}`,
);
}
const summary = summarizeTrace(tracePath);
const thresholdCheck = evaluateThresholds(summary, {
maxKeypressAvgMs,
maxKeypressMaxMs,
maxLongDispatchCount,
});
const markdown = createMarkdownSummary({
tracePath,
donePayload,
summary,
thresholds: {
maxKeypressAvgMs,
maxKeypressMaxMs,
maxLongDispatchCount,
},
thresholdCheck,
});
fs.writeFileSync(summaryPath, markdown);
console.log(`\nPerf summary written to ${summaryPath}\n`);
console.log(markdown);
if (args.postPr) {
postSummaryToPr(summaryPath);
}
if (!thresholdCheck.passed) {
throw new Error(`Performance thresholds failed:\n- ${thresholdCheck.failures.join("\n- ")}`);
}
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
console.error("\nDesktop perf trace test failed:\n" + message);
process.exit(1);
});
+7 -1
View File
@@ -5,13 +5,19 @@
"VITE_WS_URL",
"VITE_DEV_SERVER_URL",
"ELECTRON_RENDERER_PORT",
"ELECTRON_DISABLE_SANDBOX",
"T3CODE_LOG_WS_EVENTS",
"T3CODE_MODE",
"T3CODE_PORT",
"T3CODE_NO_BROWSER",
"T3CODE_STATE_DIR",
"T3CODE_AUTH_TOKEN",
"T3CODE_DESKTOP_WS_URL"
"T3CODE_DESKTOP_WS_URL",
"T3CODE_DESKTOP_PERF_AUTOMATION",
"T3CODE_DESKTOP_PERF_TRACE_OUT",
"T3CODE_DESKTOP_PERF_DONE_OUT",
"T3CODE_DESKTOP_PERF_SEED_PATH",
"T3CODE_ELECTRON_STARTUP_TIMEOUT_MS"
],
"tasks": {
"build": {