The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
feat(website): /app on a computer shows the code to scan and the stores (#1256)
Jacob Phame571699475af
diff --git a/website/package-lock.json b/website/package-lock.jsonindex 01d37e48a..9b5113773 100644--- a/website/package-lock.json+++ b/website/package-lock.json@@ -10,6 +10,7 @@"dependencies": {"lucide-react": "^0.562.0","next": "16.1.1",+ "qrcode-generator": "^2.0.4","react": "19.2.3","react-dom": "19.2.3"},@@ -6329,6 +6330,12 @@"node": ">=6"}},+ "node_modules/qrcode-generator": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-2.0.4.tgz",+ "integrity": "sha512-mZSiP6RnbHl4xL2Ap5HfkjLnmxfKcPWpWe/c+5XxCuetEenqmNFf1FH/ftXPCtFG5/TDobjsjz6sSNL0Sr8Z9g==",+ "license": "MIT"+ },"node_modules/queue-microtask": {"version": "1.2.3","resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",diff --git a/website/package.json b/website/package.jsonindex c4cf0942b..41d96df8f 100644--- a/website/package.json+++ b/website/package.json@@ -16,6 +16,7 @@"dependencies": {"lucide-react": "^0.562.0","next": "16.1.1",+ "qrcode-generator": "^2.0.4","react": "19.2.3","react-dom": "19.2.3"},diff --git a/website/src/app/app/QrCode.tsx b/website/src/app/app/QrCode.tsxnew file mode 100644index 000000000..595fa00eb--- /dev/null+++ b/website/src/app/app/QrCode.tsx@@ -0,0 +1,29 @@+import qrcode from "qrcode-generator";+import styles from "./page.module.css";++/** One path of every dark module, so the code draws as a single crisp shape at any size. */+function modulesPath(value: string): { size: number; path: string } {+ // High correction: the Harness mark covers the centre and the code must still read.+ const qr = qrcode(0, "H");+ qr.addData(value);+ qr.make();+ const size = qr.getModuleCount();+ let path = "";+ for (let row = 0; row < size; row++)+ for (let col = 0; col < size; col++) if (qr.isDark(row, col)) path += `M${col} ${row}h1v1h-1z`;+ return { size, path };+}++/** A QR code for [value], rendered on the server with no script, the Harness mark at its centre. */+export function QrCode({ value, label }: { value: string; label: string }) {+ const { size, path } = modulesPath(value);+ return (+ <div className={styles.qr}>+ <svg viewBox={`0 0 ${size} ${size}`} role="img" aria-label={label} shapeRendering="crispEdges">+ <path d={path} fill="currentColor" />+ </svg>+ {/* eslint-disable-next-line @next/next/no-img-element -- a fixed 18% of the code, never optimised. */}+ <img className={styles.qrMark} src="/icon.svg?v=5" alt="" />+ </div>+ );+}diff --git a/website/src/app/app/StoreBadges.tsx b/website/src/app/app/StoreBadges.tsxnew file mode 100644index 000000000..0f1437f5d--- /dev/null+++ b/website/src/app/app/StoreBadges.tsx@@ -0,0 +1,30 @@+import { APP_STORE_URL, GOOGLE_PLAY_URL } from "@/lib/phoneApp";+import styles from "./page.module.css";++// The stores' own marks (Simple Icons, 24×24), drawn inline so the badges need no request.+const appleMark = "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701";+const playMark = "M22.018 13.298l-3.919 2.218-3.515-3.493 3.543-3.521 3.891 2.202a1.49 1.49 0 0 1 0 2.594zM1.337.924a1.486 1.486 0 0 0-.112.568v21.017c0 .217.045.419.124.6l11.155-11.087L1.337.924zm12.207 10.065l3.258-3.238L3.45.195a1.466 1.466 0 0 0-.946-.179l11.04 10.973zm0 2.067l-11 10.933c.298.036.612-.016.906-.183l13.324-7.54-3.23-3.21z";++const stores = [+ { href: APP_STORE_URL, mark: appleMark, kicker: "Download on the", name: "App Store" },+ { href: GOOGLE_PLAY_URL, mark: playMark, kicker: "Get it on", name: "Google Play" },+] as const;++/** The two store buttons, in the stores' own black-badge shape. */+export function StoreBadges() {+ return (+ <div className={styles.badges}>+ {stores.map(({ href, mark, kicker, name }) => (+ <a key={name} className={styles.store} href={href} aria-label={`${kicker} ${name}`}>+ <svg className={styles.storeMark} viewBox="0 0 24 24" aria-hidden="true">+ <path d={mark} fill="currentColor" />+ </svg>+ <span className={styles.storeText}>+ <span className={styles.storeKicker}>{kicker}</span>+ <span className={styles.storeName}>{name}</span>+ </span>+ </a>+ ))}+ </div>+ );+}diff --git a/website/src/app/app/page.module.css b/website/src/app/app/page.module.cssnew file mode 100644index 000000000..b76d30596--- /dev/null+++ b/website/src/app/app/page.module.css@@ -0,0 +1,265 @@+/* /app on a computer: the phone app's code to scan, and both stores. Phones never see it — they are+ redirected to their store — so it is laid out for a desk first and stacks on a narrow window. */++.page {+ position: relative;+ min-height: 100vh;+ display: grid;+ place-items: center;+ padding: 64px 32px;+ overflow: hidden;+ background: var(--bg-base);+ color: var(--text-primary);+ font-family: var(--font-sans);+}++/* Two slow lights behind the glass: warm from the top left, a cooler one under the code. */+.glow {+ position: absolute;+ inset: -20%;+ pointer-events: none;+ background:+ radial-gradient(38% 42% at 22% 28%, rgba(255, 159, 10, 0.20), transparent 70%),+ radial-gradient(34% 40% at 78% 70%, rgba(232, 146, 124, 0.14), transparent 70%),+ radial-gradient(30% 30% at 70% 20%, rgba(10, 132, 255, 0.08), transparent 70%);+ filter: blur(20px);+ animation: drift 18s ease-in-out infinite alternate;+}++@keyframes drift {+ from { transform: translate3d(-2%, -1%, 0) scale(1); }+ to { transform: translate3d(2%, 2%, 0) scale(1.06); }+}++.hero {+ position: relative;+ width: min(1080px, 100%);+ display: grid;+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);+ align-items: center;+ gap: 72px;+ animation: rise 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;+}++@keyframes rise {+ from { opacity: 0; transform: translateY(12px); }+ to { opacity: 1; transform: none; }+}++.copy {+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ gap: 22px;+}++.brand {+ display: inline-flex;+ align-items: center;+ gap: 10px;+ margin: 0 0 6px;+ font-size: 17px;+ font-weight: 600;+ letter-spacing: -0.01em;+}++.brand img {+ width: 30px;+ height: 30px;+ border-radius: 8px;+}++.eyebrow {+ margin: 0;+ padding: 6px 12px;+ border: 1px solid var(--border-strong);+ border-radius: 999px;+ background: rgba(255, 250, 240, 0.04);+ color: var(--text-secondary);+ font-size: 13px;+ font-weight: 500;+ letter-spacing: 0.01em;+}++.title {+ margin: 0;+ font-size: clamp(40px, 5.4vw, 64px);+ line-height: 1.04;+ font-weight: 650;+ letter-spacing: -0.035em;+}++.accent {+ display: block;+ background: linear-gradient(100deg, var(--accent-primary) 0%, var(--accent-warm) 60%, var(--accent-gold) 100%);+ -webkit-background-clip: text;+ background-clip: text;+ color: transparent;+}++.lede {+ margin: 0;+ max-width: 30rem;+ color: var(--text-secondary);+ font-size: 18px;+ line-height: 1.6;+}++.badges {+ display: flex;+ flex-wrap: wrap;+ gap: 12px;+ margin-top: 6px;+}++.store {+ display: inline-flex;+ align-items: center;+ gap: 12px;+ min-height: 56px;+ padding: 0 22px 0 18px;+ border: 1px solid var(--border-strong);+ border-radius: 14px;+ background: #000;+ color: #fff;+ text-decoration: none;+ transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;+}++.store:hover {+ transform: translateY(-1px);+ border-color: rgba(255, 250, 240, 0.32);+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);+}++.store:focus-visible {+ outline: 2px solid var(--accent-primary);+ outline-offset: 3px;+}++.storeMark {+ width: 26px;+ height: 26px;+ flex: none;+}++.storeText {+ display: flex;+ flex-direction: column;+ line-height: 1.1;+}++.storeKicker {+ font-size: 11px;+ letter-spacing: 0.02em;+ opacity: 0.85;+}++.storeName {+ font-size: 19px;+ font-weight: 600;+ letter-spacing: -0.01em;+}++/* The glass card the code sits in. */+.scan {+ justify-self: end;+ width: min(380px, 100%);+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 10px;+ padding: 32px 32px 28px;+ border: 1px solid rgba(255, 250, 240, 0.14);+ border-radius: 32px;+ background: linear-gradient(160deg, rgba(255, 250, 240, 0.09), rgba(255, 250, 240, 0.02));+ -webkit-backdrop-filter: blur(28px) saturate(150%);+ backdrop-filter: blur(28px) saturate(150%);+ box-shadow:+ inset 0 1px 0 rgba(255, 255, 255, 0.10),+ 0 30px 80px rgba(0, 0, 0, 0.45);+ text-align: center;+}++.qr {+ position: relative;+ width: 100%;+ aspect-ratio: 1;+ margin-bottom: 14px;+ padding: 18px;+ border-radius: 22px;+ background: #fff;+ color: #141413;+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);+}++.qr svg {+ display: block;+ width: 100%;+ height: 100%;+}++/* High error correction leaves room for the mark; a white ring keeps its edge off the modules. */+.qrMark {+ position: absolute;+ top: 50%;+ left: 50%;+ width: 18%;+ height: 18%;+ transform: translate(-50%, -50%);+ border-radius: 22%;+ box-shadow: 0 0 0 5px #fff;+}++.scanTitle {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ margin: 0;+ font-size: 16px;+ font-weight: 600;+}++.scanNote {+ margin: 0;+ color: var(--text-muted);+ font-size: 14px;+ line-height: 1.5;+}++@media (max-width: 880px) {+ .page {+ padding: 48px 16px;+ }++ .hero {+ grid-template-columns: minmax(0, 1fr);+ gap: 40px;+ }++ .scan {+ justify-self: start;+ width: min(340px, 100%);+ }+}++@media (max-width: 480px) {+ .lede {+ font-size: 16px;+ }++ .store {+ flex: 1 1 100%;+ }+}++@media (prefers-reduced-motion: reduce) {+ .glow,+ .hero {+ animation: none;+ }++ .store {+ transition: none;+ }+}diff --git a/website/src/app/app/page.spec.tsx b/website/src/app/app/page.spec.tsxindex dbfac61be..7e0ad0567 100644--- a/website/src/app/app/page.spec.tsx+++ b/website/src/app/app/page.spec.tsx@@ -18,12 +18,13 @@ describe("/app — the phone app's download code", () => {await expect(AppPage()).rejects.toThrow(`redirect ${GOOGLE_PLAY_URL}`);});- it("offers a computer both stores instead of a dead end", async () => {+ it("offers a computer this page's code to scan and both stores, instead of a dead end", async () => {mocks.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)";render(await AppPage());expect(mocks.redirect).not.toHaveBeenCalled();- expect(screen.getByRole("heading", { name: "Get Harness on your phone" })).toBeInTheDocument();- expect(screen.getByRole("link", { name: "App Store" })).toHaveAttribute("href", APP_STORE_URL);- expect(screen.getByRole("link", { name: "Google Play" })).toHaveAttribute("href", GOOGLE_PLAY_URL);+ expect(screen.getByRole("heading", { name: "Run your fleet from your phone." })).toBeInTheDocument();+ expect(screen.getByRole("img", { name: "QR code for harness.autonomous.ai/app" })).toBeInTheDocument();+ expect(screen.getByRole("link", { name: "Download on the App Store" })).toHaveAttribute("href", APP_STORE_URL);+ expect(screen.getByRole("link", { name: "Get it on Google Play" })).toHaveAttribute("href", GOOGLE_PLAY_URL);});});diff --git a/website/src/app/app/page.tsx b/website/src/app/app/page.tsxindex 2e56643a4..987c2f48f 100644--- a/website/src/app/app/page.tsx+++ b/website/src/app/app/page.tsx@@ -1,9 +1,10 @@-import { Smartphone } from "lucide-react";+import { Camera } from "lucide-react";import { headers } from "next/headers";import { redirect } from "next/navigation";-import { APP_STORE_URL, GOOGLE_PLAY_URL, phoneStoreUrl } from "@/lib/phoneApp";-import cardStyles from "../pair/page.module.css";-import buttonStyles from "../desktop/page.module.css";+import { APP_PAGE_URL, phoneStoreUrl } from "@/lib/phoneApp";+import { QrCode } from "./QrCode";+import { StoreBadges } from "./StoreBadges";+import styles from "./page.module.css";export const dynamic = "force-dynamic";@@ -11,24 +12,38 @@ export const dynamic = "force-dynamic";* `harness.autonomous.ai/app` — the download code for the phone app. A phone's camera opens it, and* the server sends it straight to its store by user agent: an iPhone to the App Store, an Android* phone to Google Play, each of which opens in the store app. Anything else — a computer, or an iPad- * asking for the desktop site — gets both stores to choose from rather than a dead end.+ * asking for the desktop site — lands here: this page's own code to scan, and both stores.*/export default async function AppPage() {const store = phoneStoreUrl((await headers()).get("user-agent"));if (store) redirect(store);return (- <main className={cardStyles.wrap}>- <section className={cardStyles.card}>- <div className={cardStyles.badge}>- <Smartphone size={20} strokeWidth={2} />+ <main className={styles.page}>+ <div className={styles.glow} aria-hidden="true" />+ <section className={styles.hero}>+ <div className={styles.copy}>+ <p className={styles.brand}>+ {/* eslint-disable-next-line @next/next/no-img-element -- the site icon, already cached. */}+ <img src="/icon.svg?v=5" alt="" />+ Harness+ </p>+ <p className={styles.eyebrow}>For iPhone and Android</p>+ <h1 className={styles.title}>+ Run your fleet <span className={styles.accent}>from your phone.</span>+ </h1>+ <p className={styles.lede}>+ At the beach. In a taxi. Away from your desk. Your agents keep working — check progress, answer+ questions, and give them their next task, right from your phone.+ </p>+ <StoreBadges /></div>- <h1 className={cardStyles.title}>Get Harness on your phone</h1>- <p className={cardStyles.sub}>- Open <strong>harness.autonomous.ai/app</strong> on your iPhone or Android phone, or choose its store here.- </p>- <div className={buttonStyles.downloads}>- <a className={buttonStyles.download} href={APP_STORE_URL}>App Store</a>- <a className={buttonStyles.download} href={GOOGLE_PLAY_URL}>Google Play</a>+ <div className={styles.scan}>+ <QrCode value={APP_PAGE_URL} label="QR code for harness.autonomous.ai/app" />+ <p className={styles.scanTitle}>+ <Camera size={18} aria-hidden="true" />+ Scan with your phone's camera+ </p>+ <p className={styles.scanNote}>Opens the App Store or Google Play.</p></div></section></main>diff --git a/website/src/lib/phoneApp.ts b/website/src/lib/phoneApp.tsindex be06ceb67..b86e2f62e 100644--- a/website/src/lib/phoneApp.ts+++ b/website/src/lib/phoneApp.ts@@ -7,6 +7,9 @@export const APP_STORE_URL = "https://apps.apple.com/us/app/harness-like-a-boss/id6812264068";export const GOOGLE_PLAY_URL = "https://play.google.com/store/apps/details?id=ai.autonomous.harness.android";+/** This page's own address: what its code encodes, so a phone that scans it is sent to its store. */+export const APP_PAGE_URL = "https://harness.autonomous.ai/app";+/*** The store for this user agent, or null for anything that is not a phone or tablet it can name.* iPadOS Safari asks for desktop sites by default and reports itself as a Mac, which a server cannot