Skip to content

Commit d71ab9c

Browse files
authored
Merge branch 'main' into fix/agents-panel-resume-reopen
2 parents 58970ab + eb8ed80 commit d71ab9c

1,301 files changed

Lines changed: 105729 additions & 28105 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# git autocrlf=true converts LF to CRLF on Windows, causing issues with oxfmt
22
* text=auto eol=lf
3+
# Batch files need CRLF for cmd.exe to parse them reliably.
4+
*.cmd text eol=crlf
5+
*.bat text eol=crlf

‎.github/VOUCHED.td‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,28 @@
1212
github:0x4bs3nt
1313
github:Adamulek123
1414
github:adityavardhansharma
15+
github:aoright
1516
github:arhxam
1617
github:bil0000
1718
github:binbandit
1819
github:Brechard
20+
github:btsouth
1921
github:chrisdeeming
2022
github:chuks-qua
2123
github:cursoragent
2224
github:D3OXY
25+
github:dbalders
2326
github:eggfriedrice24
2427
github:extoci
28+
github:flamboh
29+
github:FllipEis
2530
github:gbarros-dev
2631
github:gfsaaser24
2732
github:github-actions[bot]
2833
github:gsimone
2934
github:GuilhermeVieiraDev
3035
github:hwanseoc
36+
github:inayayousfi
3137
github:ipanasenko
3238
github:jakeleventhal
3339
github:jamesx0416
@@ -36,13 +42,18 @@ github:jasonLaster
3642
github:JoeEverest
3743
github:justsomelegs
3844
github:kridaydave
45+
github:lgwacker
3946
github:lnieuwenhuis
4047
github:Lucenx9
4148
github:mackinleysmith
4249
github:maria-rcks
50+
github:MatthewFeroz
4351
github:maxwellyoung
4452
github:mwolson
53+
github:myacoub91
54+
github:naMqe-h
4555
github:nateEc
56+
github:naveed949
4657
github:nmggithub
4758
github:Noojuno
4859
github:notkainoa
@@ -64,6 +75,7 @@ github:tarik02
6475
github:tris203
6576
github:tsouth89
6677
github:UtkarshUsername
78+
github:vitalyiegorov
6779
github:Yash-Singh1
6880
github:yashranaway
6981
github:Ymit24
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Setup APT mirrors
2+
description: Configure Ubuntu package downloads with automatic mirror failover.
3+
runs:
4+
using: composite
5+
steps:
6+
- shell: bash
7+
run: |
8+
# Replace the existing Blacksmith mirror list as well as direct sources.
9+
printf '%s\tpriority:%s\n' \
10+
https://archive.ubuntu.com/ubuntu 1 \
11+
https://mirrors.edge.kernel.org/ubuntu 2 \
12+
https://mirror.math.princeton.edu/pub/ubuntu 3 \
13+
| sudo tee /etc/apt/blacksmith-ubuntu-mirrors.txt > /dev/null
14+
15+
# APT's mirror transport retries each file against the next server.
16+
sudo find /etc/apt -maxdepth 2 -type f \( -name '*.list' -o -name '*.sources' \) \
17+
-exec sed -i -E \
18+
's#https?://(([^/]+\.)?archive|security)\.ubuntu\.com/ubuntu/?#mirror+file:/etc/apt/blacksmith-ubuntu-mirrors.txt#g' {} +
19+
20+
# Move on to a fallback before an unreachable server exhausts the job.
21+
printf '%s\n' 'Acquire::http::Timeout "15";' 'Acquire::https::Timeout "15";' \
22+
| sudo tee /etc/apt/apt.conf.d/80-mirror-timeouts > /dev/null
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const MINIMUM_RELEASE_GAP_MS = 6 * 60 * 60 * 1000;
2+
3+
// Runs after the workflow acquires the nightly concurrency lock.
4+
async function shouldReleaseNightly({ github, context, core, now = Date.now() }) {
5+
const releases = await github.paginate(github.rest.repos.listReleases, {
6+
...context.repo,
7+
per_page: 100,
8+
});
9+
const lastNightly = releases
10+
.filter(
11+
(release) =>
12+
!release.draft &&
13+
release.published_at &&
14+
(/^v.*-nightly\./.test(release.tag_name) || release.tag_name.startsWith("nightly-v")),
15+
)
16+
.sort((a, b) => Date.parse(b.published_at) - Date.parse(a.published_at))[0];
17+
18+
if (!lastNightly) {
19+
core.info("No published nightly found. Proceeding with release.");
20+
return true;
21+
}
22+
23+
if (now - Date.parse(lastNightly.published_at) < MINIMUM_RELEASE_GAP_MS) {
24+
core.info(`Nightly ${lastNightly.tag_name} was published less than six hours ago. Skipping.`);
25+
return false;
26+
}
27+
28+
const { data: comparison } = await github.rest.repos.compareCommitsWithBasehead({
29+
...context.repo,
30+
basehead: `${lastNightly.tag_name}...${context.sha}`,
31+
per_page: 1,
32+
});
33+
if (comparison.status !== "ahead") {
34+
core.info(
35+
`Candidate commit is ${comparison.status} relative to ${lastNightly.tag_name}. Skipping.`,
36+
);
37+
return false;
38+
}
39+
40+
core.info(`New commits since ${lastNightly.tag_name}, and the six-hour gap has passed.`);
41+
return true;
42+
}
43+
44+
module.exports = { shouldReleaseNightly };
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
const assert = require("node:assert/strict");
2+
const test = require("node:test");
3+
const { shouldReleaseNightly } = require("./check-nightly-release.cjs");
4+
5+
const now = Date.parse("2026-09-05T12:00:00Z");
6+
const hour = 60 * 60 * 1000;
7+
const nightly = (hoursAgo, overrides = {}) => ({
8+
tag_name: "v1.0.1-nightly.20260905.123",
9+
draft: false,
10+
published_at: new Date(now - hoursAgo * hour).toISOString(),
11+
...overrides,
12+
});
13+
14+
function fixture({ releases = [nightly(7)], comparisonStatus = "ahead" } = {}) {
15+
const calls = [];
16+
return {
17+
calls,
18+
options: {
19+
now,
20+
context: { repo: { owner: "example", repo: "app" }, sha: "new" },
21+
core: { info() {} },
22+
github: {
23+
rest: {
24+
repos: {
25+
listReleases() {},
26+
async compareCommitsWithBasehead(params) {
27+
calls.push(params);
28+
return { data: { status: comparisonStatus } };
29+
},
30+
},
31+
},
32+
async paginate() {
33+
return releases;
34+
},
35+
},
36+
},
37+
};
38+
}
39+
40+
test("releases the first nightly when no nightly is published", async () => {
41+
const { options } = fixture({
42+
releases: [nightly(0, { tag_name: "v1.0.0" }), nightly(0, { draft: true })],
43+
});
44+
assert.equal(await shouldReleaseNightly(options), true);
45+
});
46+
47+
test("waits six hours after publication, including manual nightlies", async () => {
48+
for (const age of [0, 3, 6 - 1 / 3600]) {
49+
const { options, calls } = fixture({ releases: [nightly(age)] });
50+
assert.equal(await shouldReleaseNightly(options), false);
51+
assert.equal(calls.length, 0);
52+
}
53+
});
54+
55+
test("releases new commits at six hours and after an idle period", async () => {
56+
for (const age of [6, 7, 24]) {
57+
const { options } = fixture({ releases: [nightly(age)] });
58+
assert.equal(await shouldReleaseNightly(options), true);
59+
}
60+
});
61+
62+
test("skips unchanged commits after the gap", async () => {
63+
const { options } = fixture({ comparisonStatus: "identical" });
64+
assert.equal(await shouldReleaseNightly(options), false);
65+
});
66+
67+
test("uses publication time, not release order or the tagged commit date", async () => {
68+
const { options } = fixture({
69+
releases: [nightly(10), nightly(1), nightly(20, { tag_name: "nightly-v0.9.0" })],
70+
});
71+
assert.equal(await shouldReleaseNightly(options), false);
72+
});
73+
74+
test("ignores stable releases and drafts when checking the gap", async () => {
75+
const { options } = fixture({
76+
releases: [nightly(0, { tag_name: "v1.0.0" }), nightly(0, { draft: true }), nightly(7)],
77+
});
78+
assert.equal(await shouldReleaseNightly(options), true);
79+
});
80+
81+
test("compares against the published tag, including legacy nightly tags", async () => {
82+
const tag = "nightly-v0.9.0";
83+
const { options, calls } = fixture({ releases: [nightly(7, { tag_name: tag })] });
84+
assert.equal(await shouldReleaseNightly(options), true);
85+
assert.equal(calls[0].basehead, `${tag}...new`);
86+
});
87+
88+
test("fails instead of releasing when GitHub cannot supply release state", async () => {
89+
const { options } = fixture();
90+
options.github.paginate = async () => {
91+
throw new Error("GitHub unavailable");
92+
};
93+
await assert.rejects(shouldReleaseNightly(options), /GitHub unavailable/);
94+
});
95+
96+
for (const status of ["behind", "diverged"]) {
97+
test(`skips a candidate commit that is ${status} relative to the last nightly`, async () => {
98+
const { options } = fixture({ comparisonStatus: status });
99+
assert.equal(await shouldReleaseNightly(options), false);
100+
});
101+
}

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,23 @@ jobs:
4545
- name: Ensure Electron runtime is installed
4646
run: vp run --filter @t3tools/desktop ensure:electron
4747

48+
# Files/dependencies are repo-wide; export checks cover clean workspaces only.
49+
- name: Check unused code
50+
run: vp run knip:check
51+
4852
- name: Check
4953
run: vp check
5054

5155
- name: Typecheck
5256
run: vpr typecheck
5357

58+
- uses: ./.github/actions/setup-apt-mirrors
59+
60+
- name: Install browser secret helper build libraries
61+
run: |
62+
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
63+
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
64+
5465
- name: Build desktop pipeline
5566
run: vp run build:desktop
5667

@@ -85,6 +96,16 @@ jobs:
8596
- name: Ensure Electron runtime is installed
8697
run: vp run --filter @t3tools/desktop ensure:electron
8798

99+
- uses: ./.github/actions/setup-apt-mirrors
100+
101+
- name: Install browser secret helper build libraries
102+
run: |
103+
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
104+
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
105+
106+
- name: Test nightly release checks
107+
run: node --test .github/scripts/check-nightly-release.test.cjs
108+
88109
- name: Test
89110
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
90111

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Forward to Cursor hygiene
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, reopened, ready_for_review]
8+
issues:
9+
types: [opened, closed, reopened]
10+
discussion:
11+
types: [created, closed, reopened]
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
forward:
18+
name: POST to Cursor
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: POST to Cursor
22+
env:
23+
URL: ${{ secrets.CURSOR_T3CODE_WEBHOOK_URL }}
24+
AUTH: ${{ secrets.CURSOR_T3CODE_WEBHOOK_AUTH }}
25+
run: |
26+
set -euo pipefail
27+
if [ -z "${URL:-}" ] || [ -z "${AUTH:-}" ]; then
28+
echo "Missing CURSOR_T3CODE_WEBHOOK_URL or CURSOR_T3CODE_WEBHOOK_AUTH — skipping."
29+
exit 0
30+
fi
31+
curl -fsS --max-time 60 -X POST "$URL" \
32+
-H "Authorization: $AUTH" \
33+
-H "Content-Type: application/json" \
34+
-H "X-GitHub-Event: ${{ github.event_name }}" \
35+
-H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \
36+
--data-binary @"${{ github.event_path }}"

0 commit comments

Comments
 (0)