Skip to content

Commit 4c62473

Browse files
committed
Merge remote-tracking branch 'github/main' into fix/stop-start-acceptance-race
2 parents bac7165 + 6577c6b commit 4c62473

36 files changed

Lines changed: 602 additions & 163 deletions

‎.github/SECURITY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security policy
22

33
Report security vulnerabilities affecting T3 Code or T3 Tools-operated infrastructure to
4-
[security@ping.gg](mailto:security@ping.gg). Please do not disclose them publicly until we have had
4+
[security@t3.codes](mailto:security@t3.codes). Please do not disclose them publicly until we have had
55
a reasonable opportunity to investigate and remediate them.
66

77
See the [full security policy](https://t3.codes/security-policy) for reporting details, scope,

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ runs:
123123
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124124

125125
# A filtered install that started from the current full store adds nothing
126-
# worth a second copy of it.
126+
# worth a second copy of it. A stacked PR, based on a branch other than the
127+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
127128
- name: Save pnpm store
128129
if: >-
129130
inputs.install == 'true' &&
131+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
130132
steps.pnpm_cache.outputs.cache-hit != 'true' &&
131133
(steps.pnpm_store.outputs.namespace == 'full' ||
132134
steps.pnpm_cache.outputs.cache-matched-key != format('pnpm-full-v1-{0}-{1}-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json')))

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,27 @@ jobs:
7373
# Public T3 Connect identifiers (Clerk publishable key, relay URL).
7474
cp .env.example .env
7575
76-
- uses: ./.github/actions/setup-apt-mirrors
76+
# PR heads from before build:desktop:bundle use the full build, which
77+
# compiles the Linux browser secret helper and needs libsecret.
78+
- name: Check bundle-only build support
79+
id: bundle_build
80+
run: |
81+
script="$(node -p "require('./package.json').scripts['build:desktop:bundle'] ? 'build:desktop:bundle' : 'build:desktop'")"
82+
echo "script=$script" >> "$GITHUB_OUTPUT"
83+
84+
- if: steps.bundle_build.outputs.script == 'build:desktop'
85+
uses: ./.github/actions/setup-apt-mirrors
7786

7887
- name: Install browser secret helper build libraries
88+
if: steps.bundle_build.outputs.script == 'build:desktop'
7989
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
8090

81-
# desktop-macos-preview-publish.yml packages this bundle as the preview channel.
91+
# desktop-macos-preview-publish.yml packages this bundle as the preview
92+
# channel. The Linux browser secret helper is not part of a macOS app.
8293
- name: Build JS bundle
8394
env:
8495
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && 'preview' || 'dev' }}
85-
run: vp run build:desktop
96+
run: vp run ${{ steps.bundle_build.outputs.script }}
8697

8798
# Same layout as release.yml's js-bundle so release-desktop.yml can
8899
# package it unchanged.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ jobs:
449449
name: cli-${{ inputs.platform }}-${{ inputs.arch }}
450450
path: release-cli/*
451451
if-no-files-found: error
452+
# The archive is already gzip or zip; deflating it again saves under 2%.
453+
compression-level: 0
452454

453455
- name: Install Linux desktop build libraries
454456
if: inputs.platform == 'linux'
@@ -761,6 +763,8 @@ jobs:
761763
name: desktop-${{ inputs.platform }}-${{ inputs.arch }}
762764
path: release-publish/*
763765
if-no-files-found: error
766+
# Installers, zips and blockmaps are already compressed; deflating them again saves under 0.3%.
767+
compression-level: 0
764768

765769
- name: Upload resource monitor
766770
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7

‎.github/workflows/release.yml‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -565,22 +565,32 @@ jobs:
565565
- name: Align package versions to release version
566566
run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
567567

568-
- uses: ./.github/actions/setup-apt-mirrors
568+
# Older release refs lack build:desktop:bundle and use the full build,
569+
# which compiles the Linux browser secret helper and needs libsecret.
570+
- name: Check bundle-only build support
571+
id: bundle_build
572+
run: |
573+
script="$(node -p "require('./package.json').scripts['build:desktop:bundle'] ? 'build:desktop:bundle' : 'build:desktop'")"
574+
echo "script=$script" >> "$GITHUB_OUTPUT"
575+
576+
- if: steps.bundle_build.outputs.script == 'build:desktop'
577+
uses: ./.github/actions/setup-apt-mirrors
569578

570-
# @t3tools/desktop#build compiles the Linux browser secret helper on a
571-
# Linux host before packing, and that needs libsecret headers.
572579
- name: Install browser secret helper build libraries
580+
if: steps.bundle_build.outputs.script == 'build:desktop'
573581
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
574582

575-
# Runs t3#build (which depends on @t3tools/web#build) and
576-
# @t3tools/desktop#build, so apps/server/dist holds the server bundle
577-
# plus the web client and apps/desktop/dist-electron the Electron main.
583+
# Runs t3#build (which depends on @t3tools/web#build) and the desktop
584+
# bundle, so apps/server/dist holds the server bundle plus the web client
585+
# and apps/desktop/dist-electron the Electron main. build:desktop:bundle
586+
# skips the Linux browser secret helper, which this artifact does not
587+
# carry; each Linux package job compiles its own per arch.
578588
# The release channel is already stable, nightly, or preview. Builds in
579589
# other repositories report "dev" telemetry.
580590
- name: Build JS bundle
581591
env:
582592
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && needs.preflight.outputs.release_channel || 'dev' }}
583-
run: vp run build:desktop
593+
run: vp run ${{ steps.bundle_build.outputs.script }}
584594

585595
# Two paths under apps/ so the artifact root is apps/; consumers download
586596
# into `apps` to restore both at their original locations.

‎apps/desktop/vite.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ export default defineConfig({
2525
dependsOn: ["t3#build"],
2626
cache: false,
2727
},
28+
// CI bundle jobs skip the Linux browser secret helper; packaging stages one per arch.
29+
"build:bundle": {
30+
command: "node scripts/build-preview-annotation-css.mjs && vp pack",
31+
dependsOn: ["t3#build"],
32+
cache: false,
33+
},
2834
dev: {
2935
command:
3036
"node scripts/build-browser-secret.mjs && node scripts/build-preview-annotation-css.mjs && cross-env T3CODE_DESKTOP_DEV=1 vp pack --watch",

‎apps/marketing/astro.config.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ delete process.env.VP_RUN_NODE_CLIENT_PATH;
88

99
export default defineConfig({
1010
site: "https://t3.codes",
11+
// Vercel 308s `/path/` to `/path` (see vercel.ts), so every internal link and canonical uses one form.
12+
trailingSlash: "never",
1113
server: {
1214
port: Number(process.env.PORT ?? 4173),
1315
},

‎apps/marketing/public/robots.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://t3.codes/sitemap.xml

‎apps/marketing/src/layouts/Layout.astro‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,25 @@ import {
99
IOS_APP_STORE_URL,
1010
MARKETING_STATS,
1111
} from "../lib/site";
12+
import { type JsonLd, jsonLdGraph, organizationJsonLd, websiteJsonLd } from "../lib/seo";
1213
1314
interface Props {
1415
title?: string;
1516
description?: string;
1617
pageClass?: string;
18+
/** Page-specific schema.org nodes. Organization and WebSite are always included. */
19+
jsonLd?: ReadonlyArray<JsonLd>;
20+
noindex?: boolean;
1721
}
1822
1923
const {
2024
title = "T3 Code",
2125
description = "T3 Code. The open-source control plane for coding agents.",
2226
pageClass,
27+
jsonLd = [],
28+
noindex = false,
2329
} = Astro.props;
30+
const structuredData = jsonLdGraph([organizationJsonLd(), websiteJsonLd(), ...jsonLd]);
2431
2532
// Link unfurlers require a 1200x630 JPG/PNG at an absolute URL.
2633
const socialImage = await getImage({
@@ -41,7 +48,7 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
4148
<meta charset="UTF-8" />
4249
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
4350
<meta name="description" content={description} />
44-
<link rel="canonical" href={canonicalUrl} />
51+
{noindex ? <meta name="robots" content="noindex" /> : <link rel="canonical" href={canonicalUrl} />}
4552
<meta property="og:type" content="website" />
4653
<meta property="og:site_name" content="T3 Code" />
4754
<meta property="og:url" content={canonicalUrl} />
@@ -61,7 +68,9 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
6168
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" />
6269
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16" />
6370
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
71+
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
6472
<title>{title}</title>
73+
<script is:inline type="application/ld+json" set:html={structuredData} />
6574
</head>
6675
<body>
6776
<div class:list={["page", pageClass]}>

‎apps/marketing/src/lib/seo.ts‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { ANDROID_PLAY_STORE_URL, GITHUB_REPOSITORY_URL, IOS_APP_STORE_URL } from "./site";
2+
3+
export const SITE_ORIGIN = "https://t3.codes";
4+
export const SITE_NAME = "T3 Code";
5+
export const SITE_TAGLINE = "The open-source control plane for coding agents";
6+
7+
// The canonical set of official properties. Search engines and AI answer engines read `sameAs`
8+
// to tie an entity to its real homes, which is the signal a look-alike domain cannot copy.
9+
export const OFFICIAL_PROFILES = [
10+
GITHUB_REPOSITORY_URL,
11+
IOS_APP_STORE_URL,
12+
ANDROID_PLAY_STORE_URL,
13+
"https://discord.gg/jn4EGJjrvv",
14+
] as const;
15+
16+
export type JsonLd = Record<string, unknown>;
17+
18+
const ORGANIZATION_ID = `${SITE_ORIGIN}/#organization`;
19+
const WEBSITE_ID = `${SITE_ORIGIN}/#website`;
20+
const SOFTWARE_ID = `${SITE_ORIGIN}/#software`;
21+
22+
export const absoluteUrl = (pathname: string): string => new URL(pathname, SITE_ORIGIN).href;
23+
24+
export const organizationJsonLd = (): JsonLd => ({
25+
"@type": "Organization",
26+
"@id": ORGANIZATION_ID,
27+
name: "T3 Tools Inc",
28+
url: SITE_ORIGIN,
29+
logo: absoluteUrl("/apple-touch-icon.png"),
30+
sameAs: ["https://github.com/pingdotgg"],
31+
});
32+
33+
export const websiteJsonLd = (): JsonLd => ({
34+
"@type": "WebSite",
35+
"@id": WEBSITE_ID,
36+
name: SITE_NAME,
37+
url: SITE_ORIGIN,
38+
publisher: { "@id": ORGANIZATION_ID },
39+
});
40+
41+
export const softwareJsonLd = (): JsonLd => ({
42+
"@type": "SoftwareApplication",
43+
"@id": SOFTWARE_ID,
44+
name: SITE_NAME,
45+
description: `${SITE_NAME}. ${SITE_TAGLINE}.`,
46+
url: SITE_ORIGIN,
47+
downloadUrl: absoluteUrl("/download"),
48+
applicationCategory: "DeveloperApplication",
49+
operatingSystem: "macOS, Windows, Linux, iOS, Android",
50+
license: "https://opensource.org/license/mit",
51+
isAccessibleForFree: true,
52+
offers: { "@type": "Offer", price: "0", priceCurrency: "USD" },
53+
publisher: { "@id": ORGANIZATION_ID },
54+
sameAs: [...OFFICIAL_PROFILES],
55+
});
56+
57+
export const breadcrumbJsonLd = (items: ReadonlyArray<{ name: string; path: string }>): JsonLd => ({
58+
"@type": "BreadcrumbList",
59+
itemListElement: items.map((item, index) => ({
60+
"@type": "ListItem",
61+
position: index + 1,
62+
name: item.name,
63+
item: absoluteUrl(item.path),
64+
})),
65+
});
66+
67+
export const jsonLdGraph = (nodes: ReadonlyArray<JsonLd>): string =>
68+
// `<` is escaped so page text inside the graph can never close the script tag.
69+
JSON.stringify({ "@context": "https://schema.org", "@graph": nodes }).replace(/</g, "\\u003c");
70+
71+
// Indexable static pages. The 404 (noindex) and the /95 easter egg stay out of the sitemap.
72+
export const STATIC_PAGES = [
73+
{ path: "/", priority: "1.0" },
74+
{ path: "/download", priority: "0.9" },
75+
{ path: "/legal", priority: "0.3" },
76+
{ path: "/privacy-policy", priority: "0.3" },
77+
{ path: "/security-policy", priority: "0.3" },
78+
{ path: "/terms-of-service", priority: "0.3" },
79+
] as const;

0 commit comments

Comments
 (0)