Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

feat(website): Mercury Journal blog, rich embeds, Mermaid diagrams, mobile menu fix

Salman Qureshif3722e1f5a96
diff --git a/website/blog/2026-10-09-asks-before-it-acts/cover.jpg b/website/blog/2026-10-09-asks-before-it-acts/cover.jpg
new file mode 100644
index 00000000..0e2b3ce6
Binary files /dev/null and b/website/blog/2026-10-09-asks-before-it-acts/cover.jpg differ
diff --git a/website/blog/2026-10-09-asks-before-it-acts/index.md b/website/blog/2026-10-09-asks-before-it-acts/index.md
new file mode 100644
index 00000000..b0e8b713
--- /dev/null
+++ b/website/blog/2026-10-09-asks-before-it-acts/index.md
@@ -0,0 +1,90 @@
+---
+slug: asks-before-it-acts
+title: "Asks before it acts: how Mercury's permission model works"
+description: "An agent with a shell, a file system and network access is only useful if you can trust what it will do with them. A tour of the layers between the model and your machine: scopes, approvals, a blocklist nothing can override, an SSRF guard, and tiers for unattended bots."
+authors: [mercury-eng]
+tags: [product, security]
+image: ./cover.jpg
+keywords: [ai agent permissions, ai agent security, sandbox ai agent, ssrf protection, human in the loop, llm tool safety, self-hosted agent]
+---
+
+Giving a language model a shell is easy. Giving it a shell and still being able to sleep at night is the actual product.
+
+Mercury can read and write files, run commands, push to git, call the GitHub API and fetch web pages. Every one of those goes through the same question first: is this allowed, and if it isn't obviously allowed, has a person said yes? This post explains the layers that answer it, in the order a request hits them.
+
+{/* truncate */}
+
+## The rule underneath everything
+
+The model never decides what it's allowed to do. It can ask to run `npm test` or write a file, but the decision happens in ordinary code, outside the model, before anything touches your machine. Prompt injection can change what the model *asks* for. It can't change the code that answers.
+
+Everything below is that code.
+
+## Layer 1: a blocklist nothing can override
+
+Some commands are never run, no matter which mode you're in, who's asking or what you approved earlier. `sudo` is one. Recursive deletes of the root or home directory are another, in every spelling we've seen: `rm -rf /`, `rm -fr ~`, `rm -rf /*`, and their PowerShell equivalents like `Remove-Item -Recurse -Force C:\` with the flags in any order.
+
+The list is matched against each segment of a command. Mercury splits pipelines, chains and command substitutions apart first, and anything it can't fully decompose is treated as needing approval, so wrapping a blocked command in `$( )` or chaining it after `&&` doesn't hide it. It's deliberately short. A blocklist can't make an agent safe on its own. What it can do is make sure the handful of truly unrecoverable commands are off the table even in the most permissive configuration.
+
+## Layer 2: scopes
+
+File access is scoped to folders, and each scope is either read-only or read-write. Out of the box Mercury can read and write in the directory it's working in, and nothing else. If a task needs another folder, Mercury asks, and you can grant it for that one request or permanently.
+
+A short list of read-only commands runs without a prompt, because asking every time someone types `ls` trains people to click *Allow* without reading: things like `ls`, `cat`, `pwd`, `git status`, `git diff` and `git log`, plus `npm test` and `npm run`.
+
+Scopes apply to shell commands too. If a command writes to a path outside your granted scopes, Mercury treats it the same as a file write outside them.
+
+Scopes are per channel and per role. If you share a Telegram group with Mercury in it, members can talk to the agent, but they can't install skills or widen what it's allowed to touch. Those decisions stay with admins.
+
+## Layer 3: asking
+
+When something isn't covered by a scope, Mercury asks. In the terminal you get an arrow-key prompt. On Telegram you get buttons. In the web dashboard you get a card with *Allow*, *Always allow* and *Deny*. The prompt says exactly what will happen: the command, the file path, the folder being requested.
+
+You choose the default per session:
+
+- **Ask Me** prompts for every write and every command outside your scopes. Even when a scope already covers a folder, writes in Ask Me mode still prompt.
+- **Allow All** runs without prompting, inside the blocklist.
+
+One detail we're careful about: Allow All applies to the session where you turned it on. A request that arrives from a different channel doesn't inherit your permissive setting. If you said "allow all" in your terminal, a message from a Telegram group is still checked as a Telegram message.
+
+## Layer 4: the network
+
+`fetch_url` is how Mercury reads the web, and it's a classic way to attack a self-hosted service: ask the agent to fetch `http://192.168.1.1/admin`, or a public URL that redirects to one, and it becomes a proxy into your home network.
+
+So every fetch is checked before it connects:
+
+- Only `http` and `https`.
+- The hostname is resolved, and if any address in the answer is private, loopback or link-local, the request is refused. A resolver that returns one public and one private address doesn't get the benefit of the doubt.
+- The connection is pinned to the address that was checked. A hostile DNS server can't hand Mercury a public address for the check and a private one for the actual request.
+- Redirects are followed manually and each hop is checked again, up to five.
+
+Responses are also size-capped, so a page can't flood the model's context.
+
+## Layer 5: bots that can't ask
+
+Mercury Bots run unattended. A bot working at 3 a.m. has nobody to ask, so for bots the rule flips: **anything not explicitly granted is denied.** A missing permission isn't a question, it's a no.
+
+When you create a bot you pick a tier:
+
+| Tier | What it can do |
+|---|---|
+| **Read-only** (the default) | Browse, search, read files, message other bots. No commands, no writes. |
+| **Builder** | Also create and edit files inside its granted folders. Still no shell. |
+| **Operator** | Also run commands, restricted to its granted folders. The blocklist still applies. |
+| **Full access** | Everything, including deleting files. Meant for automation you fully trust. |
+
+Each bot also has its own folder scopes, its own daily token budget, and its own memory. A bot's tier is a ceiling: a crew member can't do more than the permissions it was given, regardless of what its lead asks it to do.
+
+## Layer 6: secrets stay out of the conversation
+
+API keys live in `~/.mercury/.env`, not in the main config file, and the logger redacts anything that looks like a key or token before it's written. The web dashboard binds to `127.0.0.1` only, and its first password is randomly generated and shown once, so there's no default credential from the public source code that works on every install.
+
+## What this doesn't protect you from
+
+It's worth being direct about the limits.
+
+If you choose Allow All and give Mercury write access to your home folder, it can do a lot of damage inside the blocklist, because you told it it could. Skills from the community registry are not audited, and a skill's instructions become part of what the model reads, so review them before installing. And no permission system makes a model's judgement correct. Mercury can still decide to do the wrong thing. The permission layers decide whether it's allowed to, and give you the chance to say no.
+
+## Where to read more
+
+The [permissions reference](/docs/reference/permissions) documents every setting. If you find a way around any of this, please report it privately through our [security policy](https://github.com/cosmicstack-labs/mercury-agent/security/policy). Reports from the community have already closed real issues in this area, and we credit everyone who sends one.
diff --git a/website/blog/2026-10-12-mercury-1-3/cover.jpg b/website/blog/2026-10-12-mercury-1-3/cover.jpg
new file mode 100644
index 00000000..2d48a6a5
Binary files /dev/null and b/website/blog/2026-10-12-mercury-1-3/cover.jpg differ
diff --git a/website/blog/2026-10-12-mercury-1-3/index.md b/website/blog/2026-10-12-mercury-1-3/index.md
new file mode 100644
index 00000000..456d42b3
--- /dev/null
+++ b/website/blog/2026-10-12-mercury-1-3/index.md
@@ -0,0 +1,73 @@
+---
+slug: mercury-1-3
+title: "Mercury 1.3: an agent you can actually leave running"
+description: "One background runtime that every terminal attaches to, bots that deliver real files and stay online, and a fleet you can run from Telegram. What changed in the 1.3 line and why."
+authors: [salman]
+tags: [news, releases, runtime]
+image: ./cover.jpg
+keywords: [mercury agent, ai agent release, self-hosted ai agent, mercury 1.3, mercury bots, telegram ai agent]
+---
+
+Mercury 1.3 is the release where we stopped adding things and started making the existing things trustworthy. Most of the work is invisible when it goes right: your terminal opens instantly, your bots are still running tomorrow morning, and closing the laptop doesn't kill anything. This post walks through what changed, and the reasoning behind the bigger decisions.
+
+{/* truncate */}
+
+If you want the full list, the [release notes](/docs/releases/1.3.1) have every item. This is the version with opinions.
+
+## One runtime, and the terminal is just a window
+
+Until 1.3, typing `mercury` in a terminal could start a full copy of the agent in that terminal, even when a background copy was already running. That sounds harmless. It wasn't. Two copies meant two Telegram pollers fighting over one bot token, two schedulers firing the same routines, and bot work running on the same thread that draws your keystrokes. We wrote up the details in [We were running Mercury twice and didn't know it](/blog/we-were-running-mercury-twice).
+
+Now there is exactly one process that owns your channels, your bots and the web dashboard. It runs as a login service on macOS, Linux and Windows. When you type `mercury`, the terminal attaches to that process. Close the terminal and nothing stops. Open it again and you're back in under a second.
+
+Two smaller changes make this hold up in practice:
+
+- **The login service follows the install.** If you move from npm to the standalone binary, or from stable to the dev channel, Mercury notices that the service still points at the old install and re-points it. Before this, an old daemon could keep resurrecting itself on every login and hold the web port.
+- **Lag is now a number.** `/api/health` reports how long the event loop has stalled in the last ten seconds, and stalls over 250 ms are logged. "It feels slow" turns into something we can actually look at.
+
+## Bots that do work instead of writing about work
+
+Mercury Bots shipped in 1.3.0. After a couple of weeks of running a real fleet we looked at the journals and didn't love what we saw: routines that produced status notes about other status notes, turns that read 750,000 tokens of context to decide nothing needed doing, and finished output buried somewhere under `~/.mercury`.
+
+So 1.3 judges a bot run by what it did, not by what it said. Every run gets an outcome computed from the tool trace: it delivered a file, it took an action, it delegated, it replied, or it did nothing. A scheduled routine that does nothing three times in a row cools down for a few hours and then resumes by itself. Bots stay online. They just stop burning tokens on busywork.
+
+Finished work goes somewhere you can find it: `~/Documents/Mercury/<Bot name>/`, with final results at the top and work in progress under `work/`. There's a daily token budget per bot (5M by default) and per fleet, with a warning at 80%.
+
+Fleets got real coordination too. A lead bot can hand typed tasks to several crew members at once and gets woken up once, with a summary, when they're all done. A lead's standard job can be written down as a pipeline in `bot.yaml`, so "research, draft, fact-check, package" runs without the lead having to babysit each step.
+
+## Your fleet in your pocket
+
+A lot of you run Mercury on a home server and talk to it from Telegram, so 1.3 makes Telegram a first-class control surface. `/bots` shows the roster with Stop, Start and Run buttons for each bot. When a bot finishes a task you asked for from your phone, the result arrives as an attached file, not a path on a machine you can't see. You can create a bot from Telegram too: describe its persona in a message, then pick its permissions, whether it works alone or leads a crew, and its budget, all with buttons.
+
+## Node 22 and a patched terminal renderer
+
+The npm package now requires Node.js 22. The standalone binaries carry their own runtime, so if you installed with the one-line installer, nothing changes for you. If you're on npm, `mercury upgrade` checks your Node version before it touches anything, and the package refuses to install on an older Node with a readable message instead of installing something that won't start.
+
+We also moved the terminal UI to Ink 8 with four patches of our own. The most visible one fixes a problem where long replies stamped copies of themselves into your scrollback on every repaint. The patches live in a public fork and we're working on getting them upstream.
+
+## The hotfixes, and what we learned from them
+
+The 1.3 line had more point releases than we'd like, from 1.3.2 to 1.3.8 in three days. Each one fixed something real: the first-run setup could quit at its first menu, `/code` didn't work from the default launch, the Windows installer failed on stock PowerShell 5.1, and the Linux binary crashed on CPUs without AVX2. The Windows and AVX2 reports came from people who took the time to dig in and tell us exactly what they saw. Thank you.
+
+Every one of those now has a test that would have caught it: the setup wizard runs under a real pseudo-terminal in CI, the Windows installer runs under PowerShell 5.1, and the Linux installer is tested on a CPU that pretends to lack AVX2.
+
+## Upgrading
+
+```bash
+# standalone binary (macOS / Linux)
+curl -fsSL https://mercuryagent.sh/install.sh | sh
+
+# npm, on Node.js 22+
+npm i -g @cosmicstack/mercury-agent
+```
+
+Or just run `mercury upgrade`. If you're already on the latest version it now tells you so and does nothing, which is how it should have worked from the start.
+
+Your `~/.mercury` folder (config, memory, bots, Telegram pairing) carries over untouched. On first start, Mercury moves old bot outputs into `~/Documents/Mercury/` and re-points your login service if it needs to.
+
+If something breaks, open an issue or find us on [Discord](https://discord.gg/5emMpMJy5J). We read everything.
+
+The code, the issue tracker and every release live here:
+
+https://github.com/cosmicstack-labs/mercury-agent
+
diff --git a/website/blog/2026-10-14-we-were-running-mercury-twice/cover.jpg b/website/blog/2026-10-14-we-were-running-mercury-twice/cover.jpg
new file mode 100644
index 00000000..1c761a14
Binary files /dev/null and b/website/blog/2026-10-14-we-were-running-mercury-twice/cover.jpg differ
diff --git a/website/blog/2026-10-14-we-were-running-mercury-twice/index.md b/website/blog/2026-10-14-we-were-running-mercury-twice/index.md
new file mode 100644
index 00000000..4d8b5964
--- /dev/null
+++ b/website/blog/2026-10-14-we-were-running-mercury-twice/index.md
@@ -0,0 +1,80 @@
+---
+slug: we-were-running-mercury-twice
+title: "We were running Mercury twice and didn't know it"
+description: "Typing felt sluggish on every machine, and the terminal renderer took the blame. The real cause was a second full copy of the agent, started quietly by the launcher. How we found it, and why the fix was an architecture change rather than a performance tweak."
+authors: [salman]
+tags: [engineering, postmortem, runtime]
+image: ./cover.jpg
+keywords: [ai agent architecture, daemon attach, node event loop lag, telegram 409 conflict, terminal ui performance, postmortem]
+---
+
+A few days after shipping the always-on bots, I noticed Mercury felt heavy when I typed. Not broken. Just a beat behind, the way a remote shell feels on bad Wi-Fi. Then people started saying the same thing about the dev build on their own machines, which ruled out my laptop as the problem.
+
+The obvious suspect was the terminal UI. We had just moved to a new version of Ink, our renderer, and added our own patches on top. Renderers are where input lag usually lives. So that's where I started, and that's where I was wrong.
+
+{/* truncate */}
+
+## Measuring before guessing
+
+The first thing I did was take the renderer out of the argument. I wrote a benchmark that mounts the real terminal UI in a virtual terminal, loads a 100-message conversation and a 14-bot roster, and types 60 characters, timing each one from key press to the frame that shows it.
+
+The median was about 3 ms per keystroke. The worst was around 20 ms. Each frame wrote roughly 74 bytes to the terminal. Then I ran it again with a bot streaming its reasoning into the UI a hundred times a second, and it barely moved: about 6 ms.
+
+That's not a renderer you can feel. Whatever was eating the latency, it wasn't drawing the screen.
+
+## The process list told the story
+
+So I stopped benchmarking and looked at what was actually running.
+
+There were two Mercury processes doing real work. One was the background daemon I expected. The other was the terminal session itself, and it had used about four times as much CPU as the daemon. A terminal client should use almost nothing. This one was doing a lot.
+
+The daemon's error log had the second clue: nine copies of the same Telegram error in a single day.
+
+```
+409 Conflict: terminated by other getUpdates request
+```
+
+Telegram returns that when two programs poll the same bot token at once. There is no way to get it with one process.
+
+## How we ended up with two
+
+The launcher had a branch that looked reasonable in isolation. When you typed `mercury` and no background daemon was running, it did two things in a row: start the daemon, then start the agent in the foreground.
+
+```ts
+autoDaemonize();
+await runAgent();
+```
+
+The intent was to make sure Mercury kept running after you closed the terminal, while still giving you a chat right away. The effect was two complete runtimes. Both built a bot manager on the same queue. Both connected to Telegram. Both registered the same scheduled routines. And the foreground copy ran every bot turn, every tool call and every context compaction on the same thread that renders your keystrokes.
+
+For months this didn't matter much, because bots were mostly idle. Then we made them always-on. The foreground copy suddenly had real work to do, on the worst possible thread, and typing started to lag on every machine that took that path. Which was every machine, because it ran on the first `mercury` after any reboot.
+
+On my own laptop it was worse. An old install from npm was still registered as the login service and held the web port. Every launch failed to connect to the new daemon, decided the runtime was unhealthy, and took the "start everything" path again.
+
+## Why we didn't just make it faster
+
+You can imagine a smaller fix: keep the second copy but stop it from polling Telegram, or move bot work to a worker thread. Each of those would have removed one symptom and left the actual problem in place, which is that two programs both believed they were Mercury.
+
+The fix we shipped is a rule instead: **one process owns the runtime, and the terminal attaches to it.**
+
+- Launching `mercury` starts the daemon if needed and then attaches to it. The terminal never becomes a second runtime unless no daemon can run on that platform (Android under Termux is the one case).
+- If a foreground process does start beside a live daemon, for example to open Mercury Code, it runs as a terminal for the main agent only. It doesn't register channels, doesn't create a bot manager, doesn't bind the web port, and doesn't replay scheduled work.
+- Attaching is instant. The daemon now binds its web listener first, before channels and bots finish starting, and answers a lightweight health check with its process ID. If something else owns the port, you get one sentence saying which process it is instead of a 30-second wait followed by a pointless restart.
+
+## Making lag measurable
+
+The part I'm happiest with is small. Mercury now measures its own event loop. `/api/health` reports the 99th-percentile and worst stall over the last ten seconds, and any stall longer than 250 ms is logged with a warning.
+
+We spent days on this bug partly because "it feels slow" isn't evidence. Now it is. If a bot turn ever does something synchronous that holds the main thread, the daemon's log will say so, with a number.
+
+## What we got wrong, and what we changed
+
+The honest version: the double runtime existed for a long time and we never noticed, because nothing measured it and the symptom only appeared once the workload changed. The tests passed because each runtime, on its own, worked.
+
+So the fix came with a few guards that would have caught it:
+
+- A contract test asserts the launcher never starts the daemon and then a second runtime.
+- The login service is checked against the running install on every launch and re-pointed if it drifted.
+- Merges now wait for the entire CI run, not just the checks that happen to have reported so far.
+
+If you're building something that runs in the background and has a terminal front end, the takeaway is the same one we learned: decide which process is the program, and make everything else a client. It's much easier than working out, later, which of two programs is the real one.
diff --git a/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/cover.jpg b/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/cover.jpg
new file mode 100644
index 00000000..bab4734c
Binary files /dev/null and b/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/cover.jpg differ
diff --git a/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/index.md b/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/index.md
new file mode 100644
index 00000000..4c1b5370
--- /dev/null
+++ b/website/blog/2026-10-15-the-wizard-that-quit-at-the-menu/index.md
@@ -0,0 +1,106 @@
+---
+slug: the-wizard-that-quit-at-the-menu
+title: "The setup wizard that quit at the first menu"
+description: "For six releases, a brand-new Mercury install asked for your name, showed one menu, and exited without an error. A walkthrough of a one-tick race between two readers of the same terminal, and the test that now keeps it from coming back."
+authors: [mercury-eng]
+tags: [engineering, postmortem]
+image: ./cover.jpg
+keywords: [node readline, stdin pause, raw mode, cli setup wizard, pseudo terminal test, postmortem, node.js bug]
+---
+
+Here's what a new user saw, from first install, on any platform, between versions 1.3.1 and 1.3.6:
+
+```text
+ Your name: Ada
+ Agent name [Mercury]:
+
+ Choose your mode
+ Use the arrow keys, then press Enter.
+
+ ● Mercury Cloud (hosted, no API keys needed)
+ · Offline / BYOK (bring your own keys)
+
+$
+```
+
+That `$` is the shell prompt. Mercury didn't crash and didn't print an error. It drew a menu and then simply wasn't running anymore. The exit code was 0.
+
+{/* truncate */}
+
+This is a write-up of what happened, because the bug is a good example of a class of problem that's easy to create in any Node.js CLI that mixes line prompts with key-by-key menus.
+
+## Two ways to read a terminal
+
+Mercury's setup wizard uses two kinds of input.
+
+The name questions use Node's `readline` interface: you type a line, press Enter, and get a string back. The mode menu reads individual key presses, so it can move the highlight with the arrow keys. That needs the terminal in raw mode and a `keypress` listener on `process.stdin`.
+
+Both read from the same stream, so they have to take turns. The question reader has to let go of stdin before the menu takes over.
+
+## The change that introduced it
+
+In October we fixed an older bug where pressing Ctrl+D during setup made the wizard exit silently. Part of that fix was to share one `readline` interface across all the consecutive questions, so an end-of-input during any of them would be caught and reported.
+
+Sharing the interface raised a question: when do you close it? You don't want to close and reopen it between two questions that follow each other immediately. So after each answer, the code scheduled the close for the next turn of the event loop:
+
+```ts
+iface.question(prompt, (answer) => {
+ pending = null;
+ scheduleRelease(); // setImmediate(() => close())
+ resolve(answer.trim());
+});
+```
+
+If another question came along before then, it cancelled the scheduled close and reused the interface. That's a sensible design for a sequence of questions. The problem is what happens when the next consumer isn't a question.
+
+## The race
+
+Here is the exact order of events after you type your agent's name:
+
+1. The answer resolves. A close is scheduled for the next tick.
+2. The wizard moves on and opens the arrow-key menu. The menu puts the terminal in raw mode, calls `stdin.resume()`, and attaches its key listener.
+3. The next tick arrives and the scheduled close runs. `readline`'s `close()` pauses its input stream, which is `process.stdin`.
+
+Step 3 undid step 2. The menu was waiting for key presses on a stream that was no longer flowing. Nothing else was keeping Node's event loop busy at that moment: no timers, no open sockets, no pending promises tied to I/O. When the event loop has no work left, Node exits. Cleanly. With status 0.
+
+That's why there was no error. Nothing failed. The process just ran out of things to do.
+
+## Why it survived six releases
+
+Every test we had passed, and that's the uncomfortable part.
+
+The unit tests for the question reader passed because, in isolation, it did exactly what it should. The wizard's tests mocked the menu. The binary smoke test in CI ran `mercury --version`, which never reaches the wizard. And anyone on the team who already had a config file never saw the first-run path at all.
+
+None of those tests had a real terminal in them, and this bug only exists when two readers share one.
+
+## The fix
+
+The fix is one line. The menu releases the shared reader synchronously, before it takes over stdin:
+
+```ts
+export async function selectWithArrowKeys(title, options, config = {}) {
+ // Release the question reader now: its deferred close would otherwise
+ // pause stdin after we resume it.
+ closeAsk();
+ readline.emitKeypressEvents(process.stdin);
+ // ...raw mode, resume, keypress listener
+}
+```
+
+`closeAsk()` cancels the scheduled close and closes the interface immediately. By the time the menu calls `resume()`, nothing is left that could pause the stream behind its back.
+
+## The test that would have caught it
+
+The part worth copying is the test. CI now runs the compiled binary through the real first-run wizard inside a pseudo-terminal. It types a name, answers the agent name prompt, waits for the mode menu, and then checks one thing: is the process still alive? Then it presses the down arrow and Enter and expects the provider question.
+
+Run against 1.3.6, it fails at the menu. Run against 1.3.7, it passes. It runs on every pull request on Linux and macOS.
+
+There's also a regression test at the unit level that fails if a deferred release can pause the input after an explicit close.
+
+## Takeaways
+
+- **If two parts of your CLI read stdin, decide the hand-off explicitly.** Don't rely on whoever closes last.
+- **"Exited with code 0" can be a bug.** In Node, a process that runs out of work exits quietly. When an interactive program exits without being asked to, look for a stream that stopped flowing.
+- **Test interactive paths with a real terminal.** Mocks hide the exact class of bug where two components step on each other. A pseudo-terminal test is maybe forty lines of Python and it's the only thing that would have caught this.
+
+We're sorry to everyone whose first impression of Mercury was a menu that vanished. If you bounced off it, the current release gets you through setup, and we'd love for you to try again.
diff --git a/website/blog/2026-10-16-mercury-bots/cover.jpg b/website/blog/2026-10-16-mercury-bots/cover.jpg
new file mode 100644
index 00000000..71a0034e
Binary files /dev/null and b/website/blog/2026-10-16-mercury-bots/cover.jpg differ
diff --git a/website/blog/2026-10-16-mercury-bots/index.md b/website/blog/2026-10-16-mercury-bots/index.md
new file mode 100644
index 00000000..2502c8b5
--- /dev/null
+++ b/website/blog/2026-10-16-mercury-bots/index.md
@@ -0,0 +1,273 @@
+---
+slug: mercury-bots
+title: "Mercury Bots: an agent fleet that runs on your machine"
+description: "Always-on agents shipped everywhere this autumn. How Mercury Bots work, what we measured, how they compare with Grok Bot, OpenAI dots, Meta Muse, OpenClaw and Hermes Agent, and the commits behind it."
+authors: [salman]
+tags: [product, engineering, runtime]
+image: ./cover.jpg
+featured: true
+keywords: [mercury bots, always-on ai agents, ai agent fleet, self-hosted ai agent, openclaw alternative, hermes agent comparison, grok bot, openai dots, meta muse]
+---
+
+Between August 11 and September 29, three of the largest AI companies launched always-on agents. xAI shipped Grok Bot, Meta shipped Muse and OpenAI shipped dots. Each one keeps working after you close the app. The two big open-source projects in this space, OpenClaw and Hermes Agent, have about 646,000 GitHub stars between them.
+
+Mercury Bots is our answer to the same question: what should an agent that runs without you actually look like? Our answer differs from the others in four places. It runs as a fleet on your own machine. It never asks for permission in the middle of a run. It has spending limits that are on before you configure anything. And it judges every run by what it did, not by what it said.
+
+{/* truncate */}
+
+This post explains how that works, shows the code, and compares Mercury Bots honestly with the five products above, including the places where they are ahead of us. Every claim about another product links to its own documentation or to reporting about it. We checked all of them on October 16, 2026.
+
+## What a Mercury bot is
+
+A bot is a folder. Each one lives at `~/.mercury/bots/<id>/` and holds four files:
+
+- **`bot.yaml`** sets its identity, model, schedules and fleet position.
+- **`persona.md`** holds its character and standing instructions.
+- **`permissions.yaml`** is the only file that decides what it may touch.
+- **`.env`** holds credentials that only this bot can read.
+
+Bots form fleets. A lead bot owns a goal and has a crew of specialists, and crews can have their own crews. A typical fleet is a lead that plans a weekly report, a researcher, a writer and a fact-checker. Each one can run on a different model from a different provider, because the model is a per-bot setting.
+
+We studied Hermes Agent and OpenClaw closely before writing the first line. Our design notes credit both, and you can read them in [`BOTS-ARCHITECTURE.md`](https://github.com/cosmicstack-labs/mercury-agent/blob/main/BOTS-ARCHITECTURE.md). The first runtime landed on September 16:
+
+https://github.com/cosmicstack-labs/mercury-agent/commit/69417f08d0bfcdc3f21a6ee2e3e9057921c5cd3b
+
+## One process, many bots
+
+The whole fleet runs inside the Mercury daemon, the background service that starts when you log in. There is no process per bot and no thread per bot. A bot turn is asynchronous work in the same Node.js process, scheduled through one lane with a concurrency cap. That choice comes from the hardware our users run Mercury on: a Raspberry Pi, a small VPS, or a phone under Termux. A separate Node.js process costs tens of megabytes before it does anything, and a fleet of fifteen bots should not need fifteen of them.
+
+```mermaid
+%% title: One process, many bots
+%% caption: Everything here runs inside the Mercury daemon on your machine. The terminal, the web dashboard and Telegram only attach to it.
+flowchart TB
+ You["You<br/><small>Telegram · dashboard · API</small>"]
+ Bot["Another bot<br/><small>a typed task</small>"]
+ Sch["Schedule<br/><small>a routine tick</small>"]
+ G{{"Routine gate<br/><small>busy · too soon · cooling down</small>"}}:::warm
+ Q[("Durable queue<br/><small>saved before it is acknowledged</small>")]
+ M["BotManager<br/><small>one lane · capped concurrency</small>"]
+ T["One governed turn<br/><small>fail-closed permissions · the bot's own model<br/>300k tokens or 20 minutes, whichever comes first</small>"]:::lead
+ O{{"Outcome from the tool trace"}}:::accent
+ F["Deliverables folder<br/><small>~/Documents/Mercury/Bot name/</small>"]:::ok
+ J["Journal + transcript<br/><small>for every run</small>"]:::muted
+ Sch --> G --> Q
+ You --> Q
+ Bot --> Q
+ Q --> M --> T --> O
+ O -->|"deliverable"| F
+ O -->|"always"| J
+```
+
+Work is written to the queue before the trigger is acknowledged, so a crash between "accepted" and "running" loses nothing. Jobs are claimed on a lease. If the daemon dies mid-turn, the lease expires and the job runs again. Failures are typed. A provider timeout is retried with backoff, and a permission denial goes straight to a dead-letter queue you can inspect and replay. The queue uses SQLite when the platform has it and falls back to a JSON file store when it doesn't, so it works on the same devices as the rest of Mercury.
+
+We learned the hard way that "one process" has to mean exactly one. Until a fix earlier this month, the launcher could start a second full copy of the runtime, and both copies ran the fleet. We wrote that story up in [We were running Mercury twice and didn't know it](/blog/we-were-running-mercury-twice).
+
+## Bots never ask, they fail closed
+
+An agent that runs at 3 a.m. can't wait for you to tap "Allow". Most products in this space solve that with approval prompts that time out, or with a second model that reviews actions. We chose a stricter rule. A bot has no ask handler at all. Anything granted in its `permissions.yaml` runs without a prompt, and everything else is denied and written to the journal:
+
+https://github.com/cosmicstack-labs/mercury-agent/blob/705f6c017874f734743206781e788ecfe898d8c3/src/bots/registry-factory.ts#L114-L123
+
+Three details matter here:
+
+- **No allow-all for bots.** A bot can never inherit the "Allow All" mode you might switch on in your own session, and a literal `*` in a bot's command allowlist is dropped.
+- **The deny list wins.** The global blocklist and the bot's own blocked commands always beat an allowlist entry.
+- **The workspace is the default.** Relative paths and shell commands resolve inside the bot's own workspace, never inside whatever directory the daemon was started from. We added that after a bot with a wide grant wrote its sandbox files into a real repository.
+
+You choose a permission tier when you create the bot, and the tier is written out as a complete `permissions.yaml`. If a bot keeps getting denied, the journal shows you exactly which action was refused, and you widen the grant on purpose.
+
+## Budgets are on before you set anything
+
+In early October we audited two real fleets that had been running for eleven days. The numbers were bad enough that we published them in the decision record:
+
+<Stats
+ items={[
+ { value: '13', label: 'Bots across two fleets' },
+ { value: '≈1,150', label: 'Runs in eleven days' },
+ { value: '617M', label: 'Input tokens' },
+ { value: '38%', label: 'Lead runs that failed' },
+ ]}
+ source="Source: ADR-020 in DECISIONS.md, an audit of two production fleets before turn governance shipped."
+/>
+
+The median bot turn read 750,000 tokens of context, and one turn read 6.6 million. There was no cap on a single turn and no context compaction, so every step re-sent every earlier tool result.
+
+<BarChart
+ title="Tokens in a single bot turn, before governance"
+ subtitle="Measured across the same two fleets. The dashed line is the per-turn cap that ships today."
+ unit="tokens"
+ data={[
+ { label: 'Median turn', value: 750000, note: 'Half of all turns read more context than this.' },
+ { label: 'Largest turn', value: 6600000, tone: 'warm', note: 'One run, with no per-turn cap and no compaction.' },
+ ]}
+ reference={{ value: 300000, label: 'Cap per turn now' }}
+ source="Source: ADR-020, DECISIONS.md. The cap is DEFAULT_TURN_LIMITS in src/bots/bot-turn.ts."
+/>
+
+The fix went in as hard limits, at three levels:
+
+https://github.com/cosmicstack-labs/mercury-agent/blob/fad01f23e550812dc53545a7d85f51d2f5419652/src/bots/bot-turn.ts#L70-L76
+
+- **Per turn:** 300,000 tokens or 20 minutes, whichever comes first. Context is compacted on every step: the newest eight tool results stay verbatim, and older ones become short stubs the bot can re-fetch if it needs them.
+- **Per bot, per day:** 5 million tokens by default. You get a warning at 80%. Setting the budget to `0` is the only way to make a bot unlimited.
+- **Per fleet, per day:** 20 million tokens by default. Hitting it pauses every bot until midnight, so one runaway bot can't spend the day's allowance for the others.
+
+All three are pauses, not failures. A bot that hits its daily cap picks up its queued work the next day. `/bots cost` shows where the tokens went, by fleet and by bot. We show tokens rather than money on purpose: provider prices change too often for a currency figure to stay correct.
+
+https://github.com/cosmicstack-labs/mercury-agent/commit/705f6c017874f734743206781e788ecfe898d8c3
+
+## Every run is judged by what it did
+
+The same audit found a subtler problem. Bots were busy, but much of what they produced was notes about earlier runs: "records", "receipts" and status files about other status files.
+
+<BarChart
+ title="Files in the fleet-shared folder after eleven days"
+ subtitle="637 files in total"
+ unit="files"
+ data={[
+ { label: 'Notes about earlier runs', value: 372, tone: 'warm', note: 'Records, receipts and status files, not finished work.' },
+ { label: 'Everything else', value: 265, tone: 'muted', note: 'Data and drafts other bots actually consumed.' },
+ ]}
+ source="Source: ADR-020, DECISIONS.md."
+/>
+
+A model that is told to report its progress will report progress. So Mercury no longer asks the model whether it did anything. It reads the tool trace of the run and decides:
+
+https://github.com/cosmicstack-labs/mercury-agent/blob/fad01f23e550812dc53545a7d85f51d2f5419652/src/bots/bot-turn.ts#L639-L657
+
+A run produced a **deliverable** if it handed over a finished file, or an **action** if it changed something outside its own sandbox or ran a command that isn't read-only. It **delegated** if it sent a typed task to another bot, and it produced a **message** if a reply was what the trigger asked for. Anything else is **none**. Writing notes into its own sandbox doesn't count, and the journal flags any reply that claims work the trace doesn't show.
+
+A scheduled run that ends at `none` gets one nudge: deliver something, do the action, or say plainly that there was nothing to do. If a routine comes back empty three times in a row, it cools down for six hours, then twelve, up to a day, and then resumes by itself. Routine ticks also pass through a gate before they cost anything:
+
+https://github.com/cosmicstack-labs/mercury-agent/blob/8b2078b8e238a3e15bf2823794c0394526bc1d5d/src/bots/bot-manager.ts#L404-L425
+
+```mermaid
+%% title: The life of a scheduled routine
+%% caption: A tick is an opportunity, not an order. Skipped ticks cost no tokens, and a cooled-down routine resumes by itself.
+flowchart TB
+ tick(["Schedule fires"])
+ gate{{"Busy, too soon or cooling down?"}}:::warm
+ skip["Skipped<br/><small>no tokens spent</small>"]:::muted
+ run["Run the turn"]:::lead
+ out{{"What does the tool trace show?"}}:::accent
+ done["Done<br/><small>empty streak resets</small>"]:::ok
+ nudge["One nudge<br/><small>deliver, act, or say why not</small>"]:::warm
+ streak["Empty streak + 1"]
+ cool["Cooldown<br/><small>6h, doubling up to 24h</small>"]:::violet
+ tick --> gate
+ gate -->|"yes"| skip
+ gate -->|"no"| run --> out
+ out -->|"deliverable · action · delegated"| done
+ out -->|"nothing"| nudge --> streak
+ streak -->|"3 in a row"| cool
+```
+
+The point is that the bot stays alive. "Always-on" doesn't mean calling a model all day. It means idle between runs, never silently dead, and never spending money to tell you it had nothing to do.
+
+## Fleets work in typed tasks, and leads wake once
+
+When a lead delegated to five crew members, it used to get five free-text emails and run five full turns to read them. Now delegation is data. A task has a goal, acceptance criteria, an assignee, a status and a typed result. Tasks travel in batches with a wake policy and a deadline, and the lead is woken once, with a digest, when the batch is done:
+
+```mermaid
+%% title: A lead delegates a batch and wakes up once
+%% caption: The crew works in parallel. The lead spends one turn to dispatch and one to synthesise, however many crew members there are.
+sequenceDiagram
+ participant You as You
+ participant Lead as Lead bot
+ participant Tasks as Task store
+ participant R as Researcher
+ participant W as Writer
+ You->>Lead: Weekly competitor brief
+ Lead->>Tasks: Batch of 2 tasks<br/>wake when all done
+ par In parallel
+ Tasks->>R: Collect release notes
+ Tasks->>W: Draft the outline
+ end
+ R-->>Tasks: File + summary
+ W-->>Tasks: File + summary
+ Tasks->>Lead: One digest
+ Lead->>You: Final brief as a file
+```
+
+A fleet's standard job can be written down as a pipeline in `bot.yaml`. Stages chain themselves, each one gets the previous stage's result, and the lead isn't woken between stages at all. A five-member crew now costs the lead one turn to dispatch and one to synthesise.
+
+Bots also remember, without writing status files. Every prompt carries the bot's last five journal rows and its own short working note. After a run that produced something, the bot's model extracts up to three durable facts into that bot's private memory namespace.
+
+https://github.com/cosmicstack-labs/mercury-agent/commit/fad01f23e550812dc53545a7d85f51d2f5419652
+
+## Results are files you own, and the fleet fits in your pocket
+
+Finished work goes to `~/Documents/Mercury/<Bot name>/`, with final results at the top and crew work under `work/`. It's a normal folder in your Documents directory, not a hidden one under `~/.mercury`, and nothing in it is deleted automatically.
+
+Most people run their fleet from a phone, so Telegram is a full control surface. `/bots` shows the roster with Stop, Start and Run buttons. A task you start from your phone comes back as an attached file, because a path on a computer you can't see is useless. A button tap is turned into the same slash command you'd have typed, so it goes through exactly the same routing and permission checks.
+
+https://github.com/cosmicstack-labs/mercury-agent/commit/9975db46c5a7f4862b56c8a55bb0de2395fc4e0b
+
+## How Mercury Bots compares
+
+Here is the same set of questions asked of all six products. Where a vendor hasn't published an answer, we say so instead of guessing. Facts come from each project's own docs, repository or announcement, listed under [Sources](#sources), and were checked on October 16, 2026.
+
+<Compare highlight={2} caption="Checked October 16, 2026. Closed products change quickly; follow the sources for current terms.">
+
+| | Mercury Bots | Grok Bot | OpenAI dots | Meta Muse | OpenClaw | Hermes Agent |
+|---|---|---|---|---|---|---|
+| Where it runs | Your machine: macOS, Linux, Windows or Termux, in one background process | One xAI cloud computer per user, shared by all your Bots, hosted in the US | A cloud computer per dot, run by OpenAI | A Meta-hosted Linux VM per user ("Muse Secure VM") | Your machine, in one Gateway process | Your machine or server, with seven terminal backends |
+| Source code | ✓ MIT | ✕ Closed | ✕ Closed | ✕ Closed | ✓ MIT | ✓ MIT |
+| Choose your model | ✓ Per bot, any configured provider, your own keys | ✕ "No customer-facing model picker" | ? Runs on GPT-6 Astra; no choice documented | ? Runs on Muse Spark; no choice documented | ✓ About 75 providers, your own keys | ✓ 40+ providers, your own keys |
+| Several named agents | ✓ Fleets: lead bots with crews, nested | ✓ Named Bots, often a "chief of staff" over specialists | ◐ One dot today; teams of dots announced | ◐ One Muse per user, with internal sub-agents | ✓ Isolated agents per channel binding, plus sub-agents | ✓ Profiles, plus up to 10 parallel sub-agents |
+| Delegation that reports back | ✓ Typed tasks in batches; lead woken once with a digest | ◐ Hand-offs in shared threads | ◐ Can hand work to Codex | ? Not exposed to users | ✓ Sub-agents announce results to the parent | ✓ Sub-agent summaries return to the parent |
+| Runs on a schedule | ✓ Routines, gated when busy or too recent | ✓ Routines on a schedule or an event | ✓ Scheduled tasks | ✓ Schedules and events | ✓ Heartbeat every 30 min by default, plus automations | ✓ Cron inside the gateway |
+| Unattended approval model | Fail closed: only what `permissions.yaml` grants runs, the rest is denied and journaled | Allow once, Always allow or Deny; unattended approvals expire after about 10 minutes | Custom Rules decide what needs your approval; admin policy overrides | A separate component, Sentinel, approves connector actions and network access; confirms before email, messages and purchases | Exec modes from deny to full; sandbox off by default | `smart` mode: a second model approves low-risk commands; unattended runs deny dangerous ones |
+| Built-in spend limits | ✓ On by default: per turn, per bot per day, per fleet per day | ✕ "A separate Grok Bot spend cap is not available today" | ? Usage terms not yet published | ◐ Weekly token allowance set by plan | ◐ Optional token budget per goal | ◐ Optional time budget; turn limit unlimited by default |
+| Where results land | Files in a folder you own, and as Telegram attachments | Thread messages, drafts, files and actions in your apps | The dot's conversation and profile, Slack or Teams | Chat messages and artifacts, with an activity log | Replies in the chat channel, or a webhook | The originating chat, files or platform targets |
+| Chat channels | Terminal, web, Telegram with buttons, Discord, Slack, Signal | Desktop and mobile apps; Slack for Team Bots | ChatGPT apps; Slack and Teams when an admin enables them | Muse app, web and WhatsApp | 33 listed in the docs | 20+ listed in the gateway docs |
+| Price | Free; you pay your model provider | Included in SuperGrok and Cursor plans | One dot included with Pro or Business Premium | Free tier, $20 or $100 a month | Free; no paid tier | Free; optional Nous Portal subscription |
+| GitHub stars | 3,421 | Not open source | Not open source | Not open source | 392,171 | 254,339 |
+
+</Compare>
+
+### Where the others are ahead
+
+Honesty cuts both ways, so here is where each of them beats us today.
+
+- **A computer of their own.** Grok Bot, dots and Muse give your agents a cloud computer with a real browser they can drive, which you can watch and take over. The work continues with your laptop closed. A Mercury fleet runs where you install it. If that machine sleeps, the fleet sleeps, which is why many of our users run it on a home server or a small VPS.
+- **Reach.** OpenClaw lists 33 chat channels and Hermes lists more than 20. Our tappable fleet controls exist on Telegram today. Discord and Slack get the same commands as text.
+- **Scale.** OpenClaw and Hermes have far larger communities, a larger skills ecosystem and many more people finding their edge cases.
+- **Consumer polish.** Muse pays for things with single-use cards and asks before each purchase. dots connects to a much larger catalogue of apps than we do.
+
+Every project in this table is candid about the same unsolved problem. Meta writes that "prompt injection remains an open problem in the industry." The system card for GPT-6 Astra, the model behind dots, reports test runs in which the agent overstepped its authorisation. Hermes Agent's own security policy says that "the only security boundary against an adversarial LLM is the operating system." OpenClaw's skills registry had a wave of malicious uploads in February. Our answer isn't that Mercury is immune. It's that a bot can only do what one file says it may, that it spends inside a budget it can't raise, and that every run leaves a record you can read.
+
+## The commits
+
+Mercury is MIT-licensed, and all of this is in the open. The work above landed in these commits on `main`:
+
+| Commit | Date | What it did |
+|---|---|---|
+| [`69417f0`](https://github.com/cosmicstack-labs/mercury-agent/commit/69417f08d0bfcdc3f21a6ee2e3e9057921c5cd3b) | 2026-09-16 | The first persistent, persona-scoped bot runtime |
+| [`82eb5a4`](https://github.com/cosmicstack-labs/mercury-agent/commit/82eb5a42b77664106293f6ac71541aea313938c0) | 2026-09-22 | Fleets: lead bots and crews |
+| [`9b71f23`](https://github.com/cosmicstack-labs/mercury-agent/commit/9b71f235951edb01126bf064347a3ec72d8f93e2) | 2026-10-10 | The governed turn: caps, compaction, failure classes, outcome gate |
+| [`705f6c0`](https://github.com/cosmicstack-labs/mercury-agent/commit/705f6c017874f734743206781e788ecfe898d8c3) | 2026-10-10 | Budgets by default, routine gate, deliverables folder (ADR-020) |
+| [`fad01f2`](https://github.com/cosmicstack-labs/mercury-agent/commit/fad01f23e550812dc53545a7d85f51d2f5419652) | 2026-10-10 | Typed tasks with fan-in, pipelines, memory (ADR-021) |
+| [`918a852`](https://github.com/cosmicstack-labs/mercury-agent/commit/918a852b2a4281b1be785ddcddafbf7471ed1224) | 2026-10-10 | Cost view, run viewer, kill switch (ADR-022) |
+| [`acfe89b`](https://github.com/cosmicstack-labs/mercury-agent/commit/acfe89bcf80f9980dbccc372dacc8518a5fca51a) | 2026-10-10 | The liveness contract: idle, never dead |
+| [`9975db4`](https://github.com/cosmicstack-labs/mercury-agent/commit/9975db46c5a7f4862b56c8a55bb0de2395fc4e0b) | 2026-10-10 | Fleet control from Telegram (ADR-023) |
+
+To try it, install Mercury and run `/bots onboard`. It walks you through the persona, the model, the permission tier, the schedule and the budget, and names the folder where the bot's work will land. The [Mercury Bots guide](/docs/integrations/mercury-bots) covers fleets, pipelines and every `/bots` command.
+
+```bash
+curl -fsSL https://mercuryagent.sh/install.sh | sh
+```
+
+https://github.com/cosmicstack-labs/mercury-agent
+
+## Sources
+
+All checked on October 16, 2026.
+
+- **Grok Bot:** [Introducing Grok Bot](https://x.ai/news/introducing-grok-bot) (Aug 11, 2026), [more plans](https://x.ai/news/grok-bot-more-plans), [Team Bots](https://x.ai/news/team-bots), [FAQ](https://docs.x.ai/grok-bot/faq), [approvals and security](https://docs.x.ai/grok-bot/approvals-security-and-privacy), [teams and enterprises](https://docs.x.ai/grok-bot/teams-and-enterprises), [security](https://cursor.com/docs/grok-bot/security).
+- **OpenAI dots:** [Introducing dots](https://openai.com/index/introducing-dots/) (Sep 29, 2026), [getting started](https://help.openai.com/en/articles/20001530-getting-started-with-your-dot), [privacy, security and safety](https://help.openai.com/en/articles/20001529-dots-privacy-security-and-safety-faqs), [GPT-6 Astra system card](https://deploymentsafety.openai.com/gpt-6-astra).
+- **Meta Muse:** [Introducing Muse](https://about.fb.com/news/2026/09/introducing-muse-personal-ai-agent/) (Sep 8, 2026), [plans](https://www.meta.com/help/subscriptions/1021145227643680/), [security and safety](https://research.meta.ai/blog/security-and-safety-for-ai-agents-our-approach-with-muse), [AI training controls](https://www.meta.com/help/artificial-intelligence/1047255454427887/).
+- **OpenClaw:** [repository](https://github.com/openclaw/openclaw), [docs](https://docs.openclaw.ai), [Bitdefender on ClawHub skills](https://www.bitdefender.com/en-us/blog/labs/helpful-skills-or-hidden-payloads-bitdefender-labs-dives-deep-into-the-openclaw-malicious-skill-trap) (Feb 5, 2026).
+- **Hermes Agent:** [repository](https://github.com/NousResearch/hermes-agent), including its `SECURITY.md` and `website/docs`.
+- **Mercury:** [`DECISIONS.md`](https://github.com/cosmicstack-labs/mercury-agent/blob/main/DECISIONS.md) (ADR-020 to ADR-024) and [`BOTS-ARCHITECTURE.md`](https://github.com/cosmicstack-labs/mercury-agent/blob/main/BOTS-ARCHITECTURE.md).
+- **Star counts:** the GitHub API on October 16, 2026.
diff --git a/website/blog/AGENTS.md b/website/blog/AGENTS.md
new file mode 100644
index 00000000..e77adf2a
--- /dev/null
+++ b/website/blog/AGENTS.md
@@ -0,0 +1,105 @@
+# Instructions for AI agents writing Mercury Journal posts
+
+You are writing for the engineering blog at https://mercuryagent.sh/blog. Its readers are developers who run Mercury, an open-source AI agent, or are evaluating it. They notice vague claims and AI-sounding prose, and either one costs us their trust.
+
+[README.md](./README.md) is the full reference for formatting, embeds, images and code. This file holds the rules. When the two disagree, this file wins.
+
+## Where things go
+
+- **One folder per post.** Create `website/blog/YYYY-MM-DD-<slug>/index.md`, starting from `_template/`: `cp -r website/blog/_template website/blog/2026-11-03-<slug>`.
+- **Images live in the post's folder.** Reference them relatively, as `./name.png`. Never put post images in `static/`.
+- **Generate a cover** with `python3 website/blog/_tools/make-cover.py <slug> website/blog/<folder>/cover.jpg`. It needs Pillow. Pick a `--style` that suits the topic.
+- **Don't create posts anywhere else.** Not under `docs/` (the deployed site, overwritten by builds) and not under `website/docs/` (product documentation).
+- **Drafts.** Set `draft: true` while working, or keep notes in a folder whose name starts with `_`, which the build ignores.
+
+## Files you may change
+
+| Change | Allowed? |
+|---|---|
+| Your post's folder | Yes |
+| `authors.yml` | Only to add an author the user named, with their real GitHub avatar |
+| `tags.yml` | Only to add a topic the user asked for |
+| `README.md`, `AGENTS.md` | Only when asked to update the guides |
+| `src/`, `plugins/`, `docusaurus.config.ts`, other posts | No, unless the task is explicitly about the blog's code |
+
+## Front matter
+
+Required fields are `slug`, `title`, `description`, `authors` and `tags`. Add `image: ./cover.jpg` and `keywords` too.
+
+- **Slug.** It matches the folder name without the date: lowercase words joined by hyphens.
+- **Title.** Under about 60 characters. It's a statement, not clickbait.
+- **Description.** 120 to 160 characters saying concretely what the reader will learn. It's used for search and every share preview.
+- **Authors.** Use only keys that exist in `authors.yml`. Use `mercury-eng` unless the user tells you who the author is. Never invent a person.
+- **Tags.** Use only keys from `tags.yml`. The first tag is the category: `news`, `engineering`, `product`, `releases`, `security`, `postmortem`, `runtime` or `cloud`. An unknown tag fails the build.
+- **Featured.** Don't set `featured: true` unless asked. Only one post holds it.
+
+## Accuracy comes first
+
+- **Check every claim against the source.** Before you write a version number, default value, flag, command, file path, limit or behaviour, find it in the Mercury code (`src/`), the release notes (`website/docs/releases/`), `CHANGELOG.md` or `DECISIONS.md`. If you can't confirm something, leave it out or ask.
+- **Don't invent numbers.** Benchmarks, user counts, stars, quotes and dates must come from a real source the user gave you or that you checked. Leave out what you can't check.
+- **Don't fabricate embeds.** Every embedded tweet, video or issue must be a real URL you were given or verified. Never guess a post ID.
+- **Link to the evidence.** Link the pull request, the docs page or the release notes for each important claim.
+
+## Voice
+
+Write like a senior engineer explaining something to a colleague who's sharp but busy.
+
+- **Lead with the point.** The first paragraph says what happened or what changed.
+- **Be specific and concrete.** Use real error messages, real numbers and the real code path.
+- **Use the first person, and admit mistakes plainly.**
+- **Keep sentences short.** Use plain words and active voice.
+
+Never use any of these:
+
+- **Em dashes.** Use a full stop, a comma or a colon instead.
+- **Stock openers and closers.** "In today's world", "Let's dive in", "In conclusion", "It's worth noting", "At the end of the day".
+- **Contrast clichés.** "It's not just X, it's Y", or "X isn't about Y. It's about Z."
+- **Marketing words.** "seamless", "robust", "revolutionary", "game-changer", "unlock", "empower", "leverage", "cutting-edge", "supercharge".
+- **Filler structure.** A closing paragraph that summarises the post, a row of three adjectives, or a rhetorical question used as a heading.
+- **Decoration.** Emoji in headings or body text.
+
+Length: news posts run 500 to 900 words, and engineering posts and postmortems 900 to 1,800. Use `##` headings for real sections, at least three in a long post, because they build the table of contents.
+
+## Markdown rules that break the build if ignored
+
+The file is compiled as MDX:
+
+- Put `{/* truncate */}` on its own line after the opening paragraph or two. Never use `<!-- -->` comments.
+- Wrap `{`, `}` and `<` in backticks when they're used in prose, or escape them.
+- Always give fenced code blocks a language: `ts`, `bash`, `json`, `yaml`, `diff`, or `text` for output. Add `title="path/to/file.ts"` when the code comes from a real file.
+
+## Links and previews
+
+- **Ordinary link.** Use `[descriptive text](url)`. For pages on this site, use a relative path such as `/docs/...` or `/blog/<slug>`.
+- **Rich preview.** Put the bare URL alone on its own line, with blank lines around it. This works for X, YouTube, Instagram, GitHub, Bluesky, TikTok, Vimeo, Spotify, Loom, CodePen, Mastodon, and any site with Open Graph tags. Use previews only where seeing the thing adds something, such as the issue that started a fix, a demo video, or the repo at the end of a release post. Two or three per post at most.
+- **No preview.** If a URL must appear without a preview, give it link text.
+
+## Check your work
+
+Run these from `website/`:
+
+```bash
+npx docusaurus build # must print [SUCCESS], with no broken links
+npx docusaurus serve # open http://localhost:3000/blog/<slug>
+```
+
+Then confirm:
+
+- [ ] The post appears on `/blog` under the right category, and the search box finds it.
+- [ ] `build/img/og/blog/<slug>.jpg` exists, and the title fits in three lines or fewer.
+- [ ] `build/blog/<slug>.md` exists and reads cleanly.
+- [ ] `grep -n "—" index.md` finds nothing.
+- [ ] Every embed renders as a card, not as a plain URL.
+
+**Never run `npm run build:prod`.** It overwrites the deployed site in `docs/`.
+
+## Git
+
+- Work on a branch and leave the push to the user. Don't push, publish or release unless the user says so for this specific post.
+- Commit with the user's own git identity. End the commit message with exactly this trailer and no other attribution:
+
+ ```
+ Co-Authored-By: Mercury <[email protected]>
+ ```
+
+- Remove any unlisted test posts before the branch is merged.
diff --git a/website/blog/CLAUDE.md b/website/blog/CLAUDE.md
new file mode 100644
index 00000000..43c994c2
--- /dev/null
+++ b/website/blog/CLAUDE.md
@@ -0,0 +1 @@
diff --git a/website/blog/README.md b/website/blog/README.md
new file mode 100644
index 00000000..a26ce621
--- /dev/null
+++ b/website/blog/README.md
@@ -0,0 +1,330 @@
+# Writing for the Mercury Journal
+
+This is the guide for anyone writing a post for [mercuryagent.sh/blog](https://mercuryagent.sh/blog), whether you're a person or an AI agent. Agents should also read [AGENTS.md](./AGENTS.md).
+
+Every post is one folder in this directory, holding one Markdown file and its images. You don't need to touch any code. Social cards, search metadata, feeds and the Markdown copies for AI tools are all generated when the site builds.
+
+## Contents
+
+1. [Quick start](#quick-start)
+2. [Front matter](#front-matter)
+3. [Authors and tags](#authors-and-tags)
+4. [Writing the post](#writing-the-post)
+5. [Links and rich previews](#links-and-rich-previews)
+6. [Images](#images)
+7. [Code](#code)
+8. [Callouts, tables and other formatting](#callouts-tables-and-other-formatting)
+9. [Previewing locally](#previewing-locally)
+10. [Before you open a pull request](#before-you-open-a-pull-request)
+11. [What the build generates](#what-the-build-generates)
+
+## Quick start
+
+```bash
+cd website/blog
+cp -r _template 2026-11-03-your-post-name # date first, then a short name
+```
+
+Then:
+
+1. Edit `2026-11-03-your-post-name/index.md`.
+2. Replace `cover.jpg` with your cover image, or delete the `image:` line.
+3. Preview the post locally (see [Previewing locally](#previewing-locally)).
+4. Open a pull request.
+
+The folder layout looks like this:
+
+```text
+website/blog/
+├── 2026-11-03-your-post-name/
+│ ├── index.md ← the post
+│ ├── cover.jpg ← banner and social card art
+│ └── diagram.png ← any other images the post uses
+├── authors.yml ← who can be listed as an author
+├── tags.yml ← the allowed topics
+├── _template/ ← copy this to start a post (never published)
+├── README.md ← this guide (never published)
+└── AGENTS.md ← rules for AI agents (never published)
+```
+
+The date in the folder name is the publish date. Anything whose name starts with `_` is ignored by the build, so `_drafts/` or `_notes.md` are safe places for work in progress.
+
+## Front matter
+
+Every post starts with a YAML block:
+
+```yaml
+---
+slug: your-post-name
+title: "What happened, said plainly"
+description: "One or two sentences, 120 to 160 characters. This is the text people see in Google, on X, in Slack and on WhatsApp, so make it say why the post is worth reading."
+authors: [salman]
+tags: [engineering, runtime]
+image: ./cover.jpg
+keywords: [node.js event loop, ai agent architecture, postmortem]
+---
+```
+
+| Field | Required | What it does |
+|---|---|---|
+| `slug` | yes | The URL becomes `/blog/<slug>`. Use lowercase words joined by hyphens, and never change it after publishing. |
+| `title` | yes | The page title and headline. Under about 60 characters fits search results and previews without being cut off. |
+| `description` | yes | The search snippet, the line under the headline, and every share preview. |
+| `authors` | yes | Keys from `authors.yml`. List more than one as `[salman, mercury-eng]`. |
+| `tags` | yes | Keys from `tags.yml`. **The first tag is the category** shown on cards and in the post header. |
+| `image` | recommended | The cover. It's shown as the banner on the post and drawn onto the generated social card. |
+| `keywords` | recommended | Three to seven phrases people would actually search for. |
+| `featured` | no | `true` pins the post to the large slot at the top of the journal home. Only one post should have it. |
+| `social_image` | no | A path like `/img/og/custom.jpg` that replaces the generated social card. Use it only for a hand-designed card. |
+| `hide_table_of_contents` | no | `true` hides the sidebar contents. It's hidden automatically when a post has fewer than three headings. |
+| `draft` | no | `true` shows the post only in local development, never in the built site. |
+| `unlisted` | no | `true` builds the page but keeps it out of the journal list, search engines, feeds and the sitemap. Use it to share a link for review. |
+
+## Authors and tags
+
+**Authors** are defined once in `authors.yml`:
+
+```yaml
+jane:
+ name: Jane Doe
+ title: Engineer, Cosmic Stack
+ description: One line about what Jane writes about.
+ url: https://github.com/janedoe
+ image_url: https://github.com/janedoe.png # GitHub avatar, always current
+ page: true # gives Jane an archive page
+ socials:
+ github: janedoe
+ x: janedoe # fills twitter:creator on her posts
+```
+
+Use the GitHub avatar URL for `image_url`, so a new profile picture shows up without any change here. Posts from the team as a whole use `mercury-eng`.
+
+**Tags** must already exist in `tags.yml`, or the build fails on purpose. These are the current ones:
+
+| Key | Use it for |
+|---|---|
+| `news` | Announcements and release stories |
+| `engineering` | How something works or was built |
+| `product` | Features and design decisions, from the user's side |
+| `releases` | Version-specific notes |
+| `security` | Permissions, sandboxing, vulnerabilities |
+| `postmortem` | Something broke, and here is why |
+| `runtime` | The daemon, attach, performance |
+| `cloud` | Mercury Cloud |
+
+To add a topic, add it to `tags.yml` with a `label`, `permalink` and `description`. The description appears on the topic's page and its social card.
+
+## Writing the post
+
+Readers are developers who run Mercury or are deciding whether to. Write the way a good engineer explains something to a colleague.
+
+- **Open with what happened or what changed.** Put the thesis in the first paragraph, not after a warm-up.
+- **Be specific.** Prefer measured numbers, real error messages, the actual code path and the actual fix. "About 3 ms per keystroke" beats "fast".
+- **Say what went wrong.** Postmortems that admit the mistake are the posts people trust and share.
+- **Keep it plain.** Use short sentences and the first person ("I", "we"). Avoid marketing words like "seamless", "revolutionary" or "game-changer".
+- **Skip the AI tells.** No em dashes, no "In today's fast-paced world", no "Let's dive in", no "It's not just X, it's Y", and no closing paragraph that repeats the post.
+- **Use headings for real sections.** Use `##` for sections and `###` sparingly. They build the table of contents and the reading-progress tracker.
+
+Put the excerpt marker after the first paragraph or two. Everything above it appears on the journal home and in feeds:
+
+```md
+The opening paragraph that makes someone want to read the rest.
+
+{/* truncate */}
+
+## The first section
+```
+
+Posts are compiled as MDX, so a few characters behave differently from plain Markdown:
+
+| Instead of | Write | Why |
+|---|---|---|
+| `<!-- comment -->` | `{/* comment */}` | HTML comments break the build. |
+| A bare `{` or `}` in text | `` `{}` `` in backticks, or `\{` | Braces start JavaScript expressions. |
+| A bare `<` in text, like `a <b` | `&lt;` or backticks | `<` starts a component. |
+
+Code inside backticks and fenced blocks is always safe.
+
+## Links and rich previews
+
+There are three ways to link. Choose by what you want the reader to see.
+
+### 1. An ordinary link
+
+Write a Markdown link, with text, anywhere in a sentence:
+
+```md
+The fix landed in [pull request #189](https://github.com/cosmicstack-labs/mercury-agent/pull/189).
+```
+
+Use relative paths for pages on our own site:
+
+```md
+See the [permissions reference](/docs/reference/permissions) or [our last postmortem](/blog/we-were-running-mercury-twice).
+```
+
+A bare URL inside a sentence also stays an ordinary link: `Install it from https://mercuryagent.sh today.`
+
+### 2. A rich preview (embed)
+
+Paste the URL **on its own line**, with a blank line above and below and nothing else in the paragraph:
+
+```md
+Here's the report that started it:
+
+https://x.com/someone/status/1234567890
+
+The second paragraph continues here.
+```
+
+That URL becomes a native preview. The build fetches the title, text and stats ahead of time, so the preview works for search engines and without JavaScript. In the browser, it upgrades to the platform's own widget where one exists.
+
+| Platform | URLs that work | What readers see |
+|---|---|---|
+| **X / Twitter** | `x.com/<user>/status/<id>`, `twitter.com/...` | The real post widget, matching light or dark theme |
+| **YouTube** | `youtube.com/watch?v=<id>`, `youtu.be/<id>`, `youtube.com/shorts/<id>`, `?t=90` for a start time | A thumbnail with a play button. The player loads on click, from YouTube's privacy-enhanced domain. Shorts are shown vertical. |
+| **Instagram** | `instagram.com/p/<id>/`, `/reel/<id>/` | Instagram's own embed, with caption |
+| **GitHub repository** | `github.com/<owner>/<repo>` | A repo card with description, topics, language, stars, forks and license |
+| **GitHub issue or PR** | `github.com/<owner>/<repo>/issues/<n>`, `/pull/<n>` | Title, open, closed or merged state, labels, author, comments, and lines changed for PRs |
+| **GitHub release** | `github.com/<owner>/<repo>/releases/tag/<tag>` | Tag, release name, date and the start of the notes |
+| **GitHub profile** | `github.com/<user>` | Avatar, name, bio, followers and repositories |
+| **GitHub gist** | `gist.github.com/<user>/<id>` | File name, description and the first lines of code |
+| **Other GitHub pages** | commits, files, discussions | GitHub's own social card image |
+| **Bluesky** | `bsky.app/profile/<handle>/post/<id>` | Bluesky's own post widget |
+| **TikTok** | `tiktok.com/@<user>/video/<id>` | TikTok's own player |
+| **Vimeo** | `vimeo.com/<id>` | A thumbnail, then the player on click |
+| **Spotify** | `open.spotify.com/` followed by `track`, `album`, `playlist`, `episode` or `show`, then `/<id>` | Spotify's player |
+| **Loom** | `loom.com/share/<id>` | The Loom player |
+| **CodePen** | `codepen.io/<user>/pen/<id>` | A live pen, matching the theme |
+| **Mastodon** | `https://<server>/@<user>/<id>` | The post from its own server |
+| **Anything else** | any `https://` page | A link card with the page's title, description, image and site icon |
+
+A few things to know:
+
+- **Leave the link text empty.** A Markdown link with its own text, like `[text](url)`, is always an ordinary link. To show a link without a preview, give it text.
+- **Previews are cached.** The build keeps fetched data for a week. To refresh one sooner, delete `website/node_modules/.cache/mercury-embeds.json` and rebuild.
+- **A failed fetch never breaks the build.** If a site can't be reached, the post gets a plainer card and the build log names the URL.
+- **Embeds can go anywhere.** They work inside lists and block quotes as well as at the top level.
+- **Many GitHub links?** Build with a `GITHUB_TOKEN` environment variable set to lift GitHub's anonymous rate limit.
+
+### 3. A call-to-action link
+
+Write an ordinary link and bold it:
+
+```md
+**[Read the release notes →](/docs/releases/1.3.1)**
+```
+
+## Images
+
+Put images in the post's folder and reference them relatively:
+
+```md
+![The attach handshake: the terminal asks the daemon for its PID before opening a session](./attach-flow.png)
+```
+
+- **Always write alt text** that says what the image shows. It helps screen readers and search engines.
+- **Keep the size down.** Use PNG for screenshots and diagrams and JPEG for photos, each under about 300 KB. The build fingerprints and caches them automatically.
+- **Add a caption** by putting an italic line directly under the image: `*Median keystroke latency, before and after.*`
+- **Prefer dark screenshots.** Most readers use the dark theme, and one well-cropped dark screenshot reads fine in both themes.
+
+**The cover** (`cover.jpg`) should be 1600×900 pixels, under 150 KB, and work cropped into a wide banner and into a tall panel. Abstract art works better than text, because the post title is drawn onto the social card for you. The existing covers are soft gradients with thin rings or grids in the site's teal, amber and violet.
+
+## Code
+
+Use fenced blocks with a language. The language appears as a label on the block:
+
+````md
+```ts
+const health = await fetch(`http://127.0.0.1:${port}/api/health`);
+```
+````
+
+**Add a file name** with `title`, which replaces the language label:
+
+````md
+```ts title="src/core/attach.ts"
+export async function attach(port: number) { /* ... */ }
+```
+````
+
+**Highlight lines** with a range after the language, or with a `highlight-next-line` comment inside the code:
+
+````md
+```ts {2}
+autoDaemonize();
+await runAgent();
+```
+
+```ts
+autoDaemonize();
+// highlight-next-line
+await runAgent();
+```
+````
+
+**Add line numbers** with `showLineNumbers` after the language.
+
+These languages are coloured: `ts`, `tsx`, `js`, `jsx`, `json`, `bash` (also `sh` and `shell`), `yaml`, `toml`, `ini`, `diff`, `python`, `go`, `rust`, `powershell`, `docker`, `sql`, `graphql`, `markdown`, `css` and `html`. Use `text` for terminal output. It's labelled "Output" and isn't coloured.
+
+Every block gets a copy button on hover. Keep lines under about 90 characters, because longer ones scroll sideways on phones. Use single backticks for commands, file names, flags and identifiers in a sentence, like `` `mercury upgrade` ``.
+
+## Callouts, tables and other formatting
+
+**Callouts** for the occasional warning or aside:
+
+```md
+:::note
+The npm package needs Node.js 22. The standalone binary carries its own runtime.
+:::
+
+:::warning[Breaking change]
+`--legacy-attach` was removed in 1.3.
+:::
+```
+
+The available types are `note`, `tip`, `info`, `warning` and `danger`. Use them rarely, because a post full of boxes reads like documentation.
+
+**Tables** use standard Markdown pipes with a header row. **Pull quotes** use `>` and appear in the large serif face. Save them for one sentence worth repeating.
+
+**Footnotes** are written as `Text with a note.[^1]` in the body and `[^1]: The note.` at the end of the post.
+
+## Previewing locally
+
+```bash
+cd website
+npm install # first time only, needs Node.js 22
+npx docusaurus start # live preview at http://localhost:3000/blog
+```
+
+`start` reloads as you type and shows drafts. Social cards, `llms.txt` and the Markdown copies only exist in a production build:
+
+```bash
+npx docusaurus build && npx docusaurus serve # http://localhost:3000/blog
+```
+
+**Never run `npm run build:prod` locally.** It replaces the deployed site in `docs/`.
+
+## Before you open a pull request
+
+- [ ] The folder is named `YYYY-MM-DD-short-name`, and `slug` matches the short name.
+- [ ] `title`, `description`, `authors` and `tags` are filled in, and the first tag is the right category.
+- [ ] `{/* truncate */}` comes after the opening.
+- [ ] Every claim about Mercury matches the code or the release notes. Version numbers, defaults, flags and file paths have been checked.
+- [ ] Every image has alt text and is under about 300 KB.
+- [ ] `npx docusaurus build` finishes with `[SUCCESS]` and no broken-link warnings.
+- [ ] You read the post once in light mode and once in dark mode, in a phone-width window.
+- [ ] Any unlisted test or draft post you don't intend to publish is removed.
+
+## What the build generates
+
+You don't create any of these. They're listed so you know they exist:
+
+| Output | Where | Used by |
+|---|---|---|
+| Social card, 1200×630 JPEG | `/img/og/blog/<slug>.jpg`, plus topic, author and home cards | X, LinkedIn, Facebook, WhatsApp, Slack, Discord and Telegram previews |
+| Markdown copy | `/blog/<slug>.md` | The "Copy as Markdown" button, AI tools, readers who prefer plain text |
+| `llms.txt`, `llms-full.txt` | site root | AI assistants and crawlers following the llmstxt.org convention |
+| RSS, Atom, JSON Feed | `/blog/rss.xml`, `/blog/atom.xml`, `/blog/feed.json` | Feed readers |
+| Sitemap entries and structured data | `/sitemap.xml`, inside each page | Search engines |
+| Search index | built in | The site search box and the journal search |
diff --git a/website/blog/_template/cover.jpg b/website/blog/_template/cover.jpg
new file mode 100644
index 00000000..8d2601a0
Binary files /dev/null and b/website/blog/_template/cover.jpg differ
diff --git a/website/blog/_template/index.md b/website/blog/_template/index.md
new file mode 100644
index 00000000..970e9910
--- /dev/null
+++ b/website/blog/_template/index.md
@@ -0,0 +1,32 @@
+---
+slug: your-post-name
+title: "A plain statement of what happened or changed"
+description: "One or two sentences, 120 to 160 characters, saying concretely what the reader will learn. Used for search results and every share preview."
+authors: [mercury-eng]
+tags: [engineering]
+image: ./cover.jpg
+keywords: [three to seven, phrases people search for]
+draft: true
+---
+
+Open with the point: what happened, what changed, or what you found. One or two short paragraphs. This part is the excerpt on the journal home and in feeds.
+
+{/* truncate */}
+
+## The first real section
+
+Explain with specifics: the error message, the measurement, the code path. Link the evidence, such as [the pull request](https://github.com/cosmicstack-labs/mercury-agent/pulls) or [the docs](/docs).
+
+```ts title="src/path/to/file.ts"
+// Real code from the repository, trimmed to what matters.
+```
+
+## What we changed
+
+To show a rich preview, paste a URL alone on its own line:
+
+https://github.com/cosmicstack-labs/mercury-agent
+
+## What it means for you
+
+What the reader should do, upgrade, or watch for. Then stop. No summary paragraph.
diff --git a/website/blog/_tools/make-cover.py b/website/blog/_tools/make-cover.py
new file mode 100644
index 00000000..b0f06d0b
--- /dev/null
+++ b/website/blog/_tools/make-cover.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python3
+"""Generate an abstract cover for a Mercury Journal post.
+
+ python3 make-cover.py <seed> <out.jpg> [--style rings|orbit|grid|aurora] [--tone dark|light]
+
+The seed (use the post slug) picks colours and positions, so the same slug
+always gives the same image and different posts look different. Output is
+1600x900 JPEG, ~50-80 KB, in the site palette (teal, amber, violet).
+Needs Pillow: pip install pillow
+"""
+import argparse
+import hashlib
+import random
+
+from PIL import Image, ImageDraw, ImageFilter
+
+W, H = 1600, 900
+TEAL = (64, 170, 200)
+CYAN = (125, 211, 224)
+AMBER = (240, 178, 106)
+VIOLET = (124, 92, 214)
+DARK = (11, 14, 18)
+LIGHT = (240, 238, 232)
+
+
+def blob(img, xy, radius, color, alpha, blur):
+ layer = Image.new('RGBA', img.size, (0, 0, 0, 0))
+ d = ImageDraw.Draw(layer)
+ x, y = xy
+ d.ellipse((x - radius, y - radius, x + radius, y + radius), fill=(*color, alpha))
+ img.alpha_composite(layer.filter(ImageFilter.GaussianBlur(blur)))
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument('seed')
+ ap.add_argument('out')
+ ap.add_argument('--style', choices=['rings', 'orbit', 'grid', 'aurora'])
+ ap.add_argument('--tone', choices=['dark', 'light'])
+ a = ap.parse_args()
+
+ rnd = random.Random(int(hashlib.sha256(a.seed.encode()).hexdigest(), 16))
+ style = a.style or rnd.choice(['rings', 'orbit', 'grid', 'aurora'])
+ tone = a.tone or rnd.choice(['dark', 'light'])
+ base = DARK if tone == 'dark' else LIGHT
+ line = (255, 255, 255, 34) if tone == 'dark' else (40, 50, 60, 70)
+ palette = rnd.sample([TEAL, CYAN, AMBER, VIOLET], 3)
+
+ img = Image.new('RGBA', (W, H), (*base, 255))
+ for i, c in enumerate(palette):
+ blob(img, (rnd.randint(200, W - 200), rnd.randint(150, H - 150)), rnd.randint(260, 460), c, 210 - i * 40, 150)
+
+ overlay = Image.new('RGBA', img.size, (0, 0, 0, 0))
+ d = ImageDraw.Draw(overlay)
+ cx, cy = rnd.randint(500, 1100), rnd.randint(330, 570)
+ if style == 'rings':
+ for r in range(90, 900, rnd.choice([54, 70, 90])):
+ d.ellipse((cx - r, cy - r, cx + r, cy + r), outline=line, width=2)
+ elif style == 'orbit':
+ r = rnd.randint(220, 300)
+ gap = rnd.randint(140, 220)
+ for dx in (-gap // 2, gap // 2):
+ d.ellipse((cx + dx - r, cy - r, cx + dx + r, cy + r), outline=line, width=2)
+ elif style == 'grid':
+ step = rnd.choice([60, 80, 100])
+ for x in range(0, W, step):
+ d.line((x, 0, x, H), fill=line, width=1)
+ for y in range(0, H, step):
+ d.line((0, y, W, y), fill=line, width=1)
+ else: # aurora: wide arcs rising from below the frame
+ ay = H + rnd.randint(150, 420)
+ for r in range(520, 1500, rnd.choice([48, 64])):
+ d.ellipse((cx - r, ay - r, cx + r, ay + r), outline=line, width=2)
+
+ img.alpha_composite(overlay)
+ noise = Image.effect_noise((W, H), 10).convert('RGBA')
+ noise.putalpha(10)
+ img.alpha_composite(noise)
+ img.convert('RGB').save(a.out, quality=84, optimize=True, progressive=True)
+ print(f'{a.out}: {style}, {tone}')
+
+
+if __name__ == '__main__':
+ main()
diff --git a/website/blog/authors.yml b/website/blog/authors.yml
new file mode 100644
index 00000000..c9cf2edc
--- /dev/null
+++ b/website/blog/authors.yml
@@ -0,0 +1,19 @@
+salman:
+ name: Salman Qureshi
+ title: Founder, Cosmic Stack
+ description: Builds Mercury. Writes about agent runtimes, terminal UIs and shipping open source.
+ url: https://github.com/hotheadhacker
+ image_url: https://github.com/hotheadhacker.png
+ page: true
+ socials:
+ github: hotheadhacker
+
+mercury-eng:
+ name: Mercury Engineering
+ title: The team behind Mercury
+ description: Postmortems, design notes and the reasoning behind how Mercury works.
+ url: https://github.com/cosmicstack-labs/mercury-agent
+ image_url: /img/avatar-mercury.png
+ page: true
+ socials:
+ github: cosmicstack-labs
diff --git a/website/blog/tags.yml b/website/blog/tags.yml
new file mode 100644
index 00000000..3ddc92b0
--- /dev/null
+++ b/website/blog/tags.yml
@@ -0,0 +1,32 @@
+news:
+ label: News
+ permalink: /news
+ description: Releases, announcements and what changed for people running Mercury.
+engineering:
+ label: Engineering
+ permalink: /engineering
+ description: How Mercury is built, what broke, and what we changed so it does not break again.
+product:
+ label: Product
+ permalink: /product
+ description: How Mercury's features work and why they work that way.
+releases:
+ label: Releases
+ permalink: /releases
+ description: Notes on each Mercury release.
+security:
+ label: Security
+ permalink: /security
+ description: Permissions, sandboxing and how Mercury keeps an agent with real tools safe to run.
+postmortem:
+ label: Postmortem
+ permalink: /postmortem
+ description: Incidents and bugs, written up honestly.
+runtime:
+ label: Runtime
+ permalink: /runtime
+ description: The daemon, the attach client and everything that keeps Mercury running.
+cloud:
+ label: Mercury Cloud
+ permalink: /cloud
+ description: News and notes about Mercury Cloud.
diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts
index a5da82a0..4907fa9c 100644
--- a/website/docusaurus.config.ts
+++ b/website/docusaurus.config.ts
@@ -58,13 +58,17 @@ const config: Config = {
{ src: '/js/plausible-init.js' },
],
+ // ```mermaid blocks render through src/theme/Mermaid (site palette, expand, mobile scroll).
+ markdown: { mermaid: true },
themes: [
+ '@docusaurus/theme-mermaid',
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
language: ['en'],
- indexBlog: false,
+ indexBlog: true,
+ blogRouteBasePath: '/blog',
docsRouteBasePath: '/docs',
highlightSearchTermsOnTargetPage: true,
},
@@ -79,7 +83,34 @@ const config: Config = {
sidebarPath: './sidebars.ts',
editUrl: 'https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/',
},
- blog: false,
+ blog: {
+ routeBasePath: 'blog',
+ path: 'blog',
+ blogTitle: 'Mercury Journal',
+ blogDescription: 'News, engineering notes and field reports from the team building Mercury, the open-source AI agent you can leave running.',
+ // The journal home shows every post: search, filters and sorting run client-side.
+ postsPerPage: 'ALL',
+ blogSidebarCount: 'ALL',
+ blogSidebarTitle: 'All posts',
+ showReadingTime: true,
+ authorsMapPath: 'authors.yml',
+ tags: 'tags.yml',
+ onInlineTags: 'throw',
+ onInlineAuthors: 'throw',
+ onUntruncatedBlogPosts: 'ignore',
+ // Docusaurus defaults, plus the guides that live in blog/ for authors and agents.
+ exclude: ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**', '**/README.md', '**/AGENTS.md', '**/CLAUDE.md'],
+ // Bare links on their own line become rich previews (X, YouTube, GitHub, Instagram…).
+ remarkPlugins: [require('./plugins/remark-social-embeds.cjs')],
+ editUrl: 'https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/',
+ feedOptions: {
+ type: 'all',
+ title: 'Mercury Journal',
+ description: 'News, engineering notes and field reports from the team building Mercury.',
+ copyright: `© ${new Date().getFullYear()} Cosmic Stack`,
+ limit: 50,
+ },
+ },
theme: {
customCss: './src/css/custom.css',
},
@@ -87,6 +118,8 @@ const config: Config = {
],
],
+ plugins: ['./plugins/llms-txt.cjs', './plugins/blog-social-cards.cjs'],
+
themeConfig: {
image: 'img/og/home.png',
metadata: [
@@ -120,6 +153,7 @@ const config: Config = {
{to: '/docs/integrations/mercury-bots', label: 'Bots', position: 'left'},
{to: '/cloud', label: 'Cloud', position: 'left'},
{href: 'https://skills.mercuryagent.sh', label: 'Skills', position: 'left'},
+ {to: '/blog', label: 'Blog', position: 'left'},
{to: '/docs/releases', label: 'Changelog', position: 'left'},
{
href: 'https://github.com/cosmicstack-labs/mercury-agent',
@@ -140,6 +174,7 @@ const config: Config = {
{label: 'Mercury Code', to: '/docs/integrations/coding-workspace'},
{label: 'Mercury Bots', to: '/docs/integrations/mercury-bots'},
{label: 'Mercury Cloud', to: '/cloud'},
+ {label: 'Blog', to: '/blog'},
{label: 'Changelog', to: '/docs/releases'},
],
},
@@ -176,6 +211,7 @@ const config: Config = {
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
+ additionalLanguages: ['bash', 'diff', 'toml', 'powershell', 'ini', 'docker'],
},
} satisfies Preset.ThemeConfig,
};
diff --git a/website/package-lock.json b/website/package-lock.json
index ca9de836..da97e3c2 100644
--- a/website/package-lock.json
+++ b/website/package-lock.json
@@ -11,6 +11,7 @@
"@docusaurus/core": "3.10.0",
"@docusaurus/faster": "3.10.0",
"@docusaurus/preset-classic": "3.10.0",
+ "@docusaurus/theme-mermaid": "^3.10.0",
"@easyops-cn/docusaurus-search-local": "^0.55.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
@@ -24,6 +25,8 @@
"@docusaurus/types": "3.10.0",
"@resvg/resvg-js": "^2.6.2",
"@types/react": "^19.0.0",
+ "jpeg-js": "^0.4.4",
+ "satori": "^0.12.2",
"typescript": "~6.0.2"
},
"engines": {
@@ -263,6 +266,19 @@
"node": ">= 14.0.0"
}
},
+ "node_modules/@antfu/install-pkg": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-2.1.0.tgz",
+ "integrity": "sha512-sdg9NxU3zR4Mnawfbc/x6GB5Wf17WYud5qOuEuxXjaKpYpMkISSJEjItGebXJ2bQ4DIcly4NYH23mtkGJjvKUw==",
+ "license": "MIT",
+ "dependencies": {
+ "package-manager-detector": "^1.8.0",
+ "tinyexec": "^1.3.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
"node_modules/@babel/code-frame": {
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
@@ -1964,6 +1980,49 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@braintree/sanitize-url": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz",
+ "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",
+ "license": "MIT"
+ },
+ "node_modules/@chevrotain/cst-dts-gen": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-13.2.0.tgz",
+ "integrity": "sha512-bA9dvWlhAUcHkNwU+8w9yiUxJPlj/Lm3VqS7MD+NbIR/7LmpNLuK/AWNFdCo/T3SK5ND0/UHf3IJvl/Jn/i6yg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@chevrotain/gast": "13.2.0",
+ "@chevrotain/types": "13.2.0"
+ }
+ },
+ "node_modules/@chevrotain/gast": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-13.2.0.tgz",
+ "integrity": "sha512-bCARdAsG+eEbOveSXcOAC7pVxA04I1ionzeMOwIYf5NX7SaS7zgn4Dgug2BSqoL+iyKeMNSorQjsFSHJHsCNwg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@chevrotain/types": "13.2.0"
+ }
+ },
+ "node_modules/@chevrotain/regexp-to-ast": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-13.2.0.tgz",
+ "integrity": "sha512-kxpUkLtiaK09ph+dib+Yvm+3sWSnuwlo25gqfKRgTPNmF6H7uW4gVkMjaRdtnN783S9sM6vUNWh9CsxYX4QwKw==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@chevrotain/types": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-13.2.0.tgz",
+ "integrity": "sha512-7qrYHRlKfWf2AvBfJi5eVOrKAkbxvMFsy/iIHTGIiApNcEecCaVIdR+mIQhyCBsTDJxBz4JWXHMo6krbhR9hVg==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@chevrotain/utils": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-13.2.0.tgz",
+ "integrity": "sha512-SzKYY68rseOrb9KILVzPsl6SjkQtdWw01SRGB5aCVI5kFcHltQsOYV3JB0Ffst72DgkvHCyDQ0NLwxtmCCf97Q==",
+ "license": "Apache-2.0"
+ },
"node_modules/@colors/colors": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
@@ -3967,6 +4026,34 @@
"react-dom": "^18.0.0 || ^19.0.0"
}
},
+ "node_modules/@docusaurus/theme-mermaid": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/@docusaurus/theme-mermaid/-/theme-mermaid-3.10.0.tgz",
+ "integrity": "sha512-Y2xrlwhIJ80oOZIO3PXL6A7J869splfcMI87E3NKpYsy3zJxOyV+BP1QMtGi59ajKgU868HPuyyn6J+6BZGOBg==",
+ "license": "MIT",
+ "dependencies": {
+ "@docusaurus/core": "3.10.0",
+ "@docusaurus/module-type-aliases": "3.10.0",
+ "@docusaurus/theme-common": "3.10.0",
+ "@docusaurus/types": "3.10.0",
+ "@docusaurus/utils-validation": "3.10.0",
+ "mermaid": ">=11.6.0",
+ "tslib": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0"
+ },
+ "peerDependencies": {
+ "@mermaid-js/layout-elk": "^0.1.9",
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@mermaid-js/layout-elk": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@docusaurus/theme-search-algolia": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.10.0.tgz",
@@ -4284,6 +4371,23 @@
"@hapi/hoek": "^9.0.0"
}
},
+ "node_modules/@iconify/types": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
+ "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
+ "license": "MIT"
+ },
+ "node_modules/@iconify/utils": {
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.7.tgz",
+ "integrity": "sha512-JZHlwdID+dy+lTgbYC8NEC4zeugqeYsc6jewvzb4c58kHauJn+X7rNwQjxz5p2qSjqaEeQoLkCIQ9v/H4PK0/w==",
+ "license": "MIT",
+ "dependencies": {
+ "@antfu/install-pkg": "^2.0.1",
+ "@iconify/types": "^2.0.0",
+ "import-meta-resolve": "^4.2.0"
+ }
+ },
"node_modules/@jest/schemas": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
@@ -4837,6 +4941,18 @@
"react": ">=16"
}
},
+ "node_modules/@mermaid-js/parser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-2.0.1.tgz",
+ "integrity": "sha512-j37dj/h6p6pots1L7pLPPNuABEEu9WP4OYg9pW1g+nYG331j0+3canE9OagtYdytYvdSAMG+2fKU5cxep6LgjA==",
+ "license": "MIT",
+ "dependencies": {
+ "@chevrotain/types": "~13.2.0"
+ },
+ "engines": {
+ "node": ">=22.12.0"
+ }
+ },
"node_modules/@module-federation/error-codes": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/@module-federation/error-codes/-/error-codes-0.22.0.tgz",
@@ -5813,6 +5929,23 @@
"integrity": "sha512-E2B0JhYFmVAwdDiG14+DW0Di4Ze4Jg10Pc4/lILUrd5DRCaklduz2OvJ5HYQ6G+hd+WTzqQb3QnDNfK4yvAFYw==",
"license": "MIT"
},
+ "node_modules/@shuding/opentype.js": {
+ "version": "1.4.0-beta.0",
+ "resolved": "https://registry.npmjs.org/@shuding/opentype.js/-/opentype.js-1.4.0-beta.0.tgz",
+ "integrity": "sha512-3NgmNyH3l/Hv6EvsWJbsvpcpUba6R8IREQ83nH83cyakCw7uM1arZKNfHwv1Wz6jgqrF/j4x5ELvR6PnK9nTcA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fflate": "^0.7.3",
+ "string.prototype.codepointat": "^0.2.1"
+ },
+ "bin": {
+ "ot": "bin/ot"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
"node_modules/@sideway/address": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz",
@@ -6645,6 +6778,259 @@
"@types/node": "*"
}
},
+ "node_modules/@types/d3": {
+ "version": "7.4.3",
+ "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz",
+ "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-array": "*",
+ "@types/d3-axis": "*",
+ "@types/d3-brush": "*",
+ "@types/d3-chord": "*",
+ "@types/d3-color": "*",
+ "@types/d3-contour": "*",
+ "@types/d3-delaunay": "*",
+ "@types/d3-dispatch": "*",
+ "@types/d3-drag": "*",
+ "@types/d3-dsv": "*",
+ "@types/d3-ease": "*",
+ "@types/d3-fetch": "*",
+ "@types/d3-force": "*",
+ "@types/d3-format": "*",
+ "@types/d3-geo": "*",
+ "@types/d3-hierarchy": "*",
+ "@types/d3-interpolate": "*",
+ "@types/d3-path": "*",
+ "@types/d3-polygon": "*",
+ "@types/d3-quadtree": "*",
+ "@types/d3-random": "*",
+ "@types/d3-scale": "*",
+ "@types/d3-scale-chromatic": "*",
+ "@types/d3-selection": "*",
+ "@types/d3-shape": "*",
+ "@types/d3-time": "*",
+ "@types/d3-time-format": "*",
+ "@types/d3-timer": "*",
+ "@types/d3-transition": "*",
+ "@types/d3-zoom": "*"
+ }
+ },
+ "node_modules/@types/d3-array": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
+ "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-axis": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz",
+ "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-selection": "*"
+ }
+ },
+ "node_modules/@types/d3-brush": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz",
+ "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-selection": "*"
+ }
+ },
+ "node_modules/@types/d3-chord": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz",
+ "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-color": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",
+ "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-contour": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz",
+ "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-array": "*",
+ "@types/geojson": "*"
+ }
+ },
+ "node_modules/@types/d3-delaunay": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
+ "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-dispatch": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz",
+ "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-drag": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz",
+ "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-selection": "*"
+ }
+ },
+ "node_modules/@types/d3-dsv": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz",
+ "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-ease": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",
+ "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-fetch": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz",
+ "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-dsv": "*"
+ }
+ },
+ "node_modules/@types/d3-force": {
+ "version": "3.0.10",
+ "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz",
+ "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-format": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz",
+ "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-geo": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.1.tgz",
+ "integrity": "sha512-65Emv9fQiQQqphLlRkuQ5ypPsOmWPhtBGCMv61JDPEPMvsx+gzhGf74yw1a78xFKPj6zw4AgQICJoQv0vK9M2w==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
+ "node_modules/@types/d3-hierarchy": {
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz",
+ "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-interpolate": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",
+ "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-color": "*"
+ }
+ },
+ "node_modules/@types/d3-path": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",
+ "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-polygon": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz",
+ "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-quadtree": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz",
+ "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-random": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.4.tgz",
+ "integrity": "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-scale": {
+ "version": "4.0.9",
+ "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",
+ "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-time": "*"
+ }
+ },
+ "node_modules/@types/d3-scale-chromatic": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
+ "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-selection": {
+ "version": "3.0.12",
+ "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.12.tgz",
+ "integrity": "sha512-Qe/KWYhEiIIxGs7HrAAjMfShxKldx19SJtr5zu53f3afPsdZNz7HHtdTLXo/kqeiWNXVycI24kSnfzBYkTzpgw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-shape": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.2.0.tgz",
+ "integrity": "sha512-kVd74ta9eof3eJOvbNd1vGKS/XERRyQbT26Og63hIsvDO84cjD5gEOhsXf26w3FSoNlPVz84DOFcKv/oou+fMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-path": "*"
+ }
+ },
+ "node_modules/@types/d3-time": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",
+ "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-time-format": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz",
+ "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-timer": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",
+ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-transition": {
+ "version": "3.0.9",
+ "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz",
+ "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-selection": "*"
+ }
+ },
+ "node_modules/@types/d3-zoom": {
+ "version": "3.0.9",
+ "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.9.tgz",
+ "integrity": "sha512-0sE1406XBYJGiqD3AusTl9ZqC//2mIXix51tbom25gDCA8ri4xnSZg28CaSE8Srl6FClqABUKfsn0qghgdepMA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-interpolate": "*",
+ "@types/d3-selection": "*"
+ }
+ },
"node_modules/@types/debug": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
@@ -6713,6 +7099,12 @@
"@types/send": "*"
}
},
+ "node_modules/@types/geojson": {
+ "version": "7946.0.16",
+ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
+ "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
+ "license": "MIT"
+ },
"node_modules/@types/gtag.js": {
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.20.tgz",
@@ -6949,6 +7341,13 @@
"@types/node": "*"
}
},
+ "node_modules/@types/trusted-types": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
+ "license": "MIT",
+ "optional": true
+ },
"node_modules/@types/unist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
@@ -6985,6 +7384,16 @@
"integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
"license": "ISC"
},
+ "node_modules/@upsetjs/venn.js": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz",
+ "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==",
+ "license": "MIT",
+ "optionalDependencies": {
+ "d3-selection": "^3.0.0",
+ "d3-transition": "^3.0.1"
+ }
+ },
"node_modules/@webassemblyjs/ast": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",
@@ -7616,6 +8025,16 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
+ "node_modules/base64-js": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
+ "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/baseline-browser-mapping": {
"version": "2.10.24",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.24.tgz",
@@ -7955,6 +8374,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/camelize": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz",
+ "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/caniuse-api": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz",
@@ -8100,6 +8529,22 @@
"url": "https://github.com/sponsors/fb55"
}
},
+ "node_modules/chevrotain": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-13.2.0.tgz",
+ "integrity": "sha512-GTouk5YzgBxlTPCaDn5q0q2EJKkrYmnPF+HmF8v0Qo4r3iyPG7HJivkN1wthCXZcm3sIcZFpGTRovLPNdJNRCA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@chevrotain/cst-dts-gen": "13.2.0",
+ "@chevrotain/gast": "13.2.0",
+ "@chevrotain/regexp-to-ast": "13.2.0",
+ "@chevrotain/types": "13.2.0",
+ "@chevrotain/utils": "13.2.0"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
@@ -8598,6 +9043,15 @@
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"license": "MIT"
},
+ "node_modules/cose-base": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz",
+ "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==",
+ "license": "MIT",
+ "dependencies": {
+ "layout-base": "^1.0.0"
+ }
+ },
"node_modules/cosmiconfig": {
"version": "8.3.6",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz",
@@ -8665,6 +9119,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/css-background-parser": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/css-background-parser/-/css-background-parser-0.1.0.tgz",
+ "integrity": "sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/css-blank-pseudo": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/css-blank-pseudo/-/css-blank-pseudo-7.0.1.tgz",
@@ -8703,6 +9164,23 @@
"node": ">=4"
}
},
+ "node_modules/css-box-shadow": {
+ "version": "1.0.0-3",
+ "resolved": "https://registry.npmjs.org/css-box-shadow/-/css-box-shadow-1.0.0-3.tgz",
+ "integrity": "sha512-9jaqR6e7Ohds+aWwmhe6wILJ99xYQbfmK9QQB9CcMjDbTxPZjwEmUQpU91OG05Xgm8BahT5fW+svbsQGjS/zPg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/css-color-keywords": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz",
+ "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/css-declaration-sorter": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.4.0.tgz",
@@ -8715,6 +9193,16 @@
"postcss": "^8.0.9"
}
},
+ "node_modules/css-gradient-parser": {
+ "version": "0.0.16",
+ "resolved": "https://registry.npmjs.org/css-gradient-parser/-/css-gradient-parser-0.0.16.tgz",
+ "integrity": "sha512-3O5QdqgFRUbXvK1x5INf1YkBz1UKSWqrd63vWsum8MNHDBYD5urm3QtxZbKU259OrEXNM26lP/MPY3d1IGkBgA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16"
+ }
+ },
"node_modules/css-has-pseudo": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/css-has-pseudo/-/css-has-pseudo-7.0.3.tgz",
@@ -8894,6 +9382,18 @@
"url": "https://github.com/sponsors/fb55"
}
},
+ "node_modules/css-to-react-native": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
+ "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "camelize": "^1.0.0",
+ "css-color-keywords": "^1.0.0",
+ "postcss-value-parser": "^4.0.2"
+ }
+ },
"node_modules/css-tree": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
@@ -8982,105 +9482,631 @@
"postcss-zindex": "^6.0.2"
},
"engines": {
- "node": "^14 || ^16 || >=18.0"
- },
- "peerDependencies": {
- "postcss": "^8.4.31"
+ "node": "^14 || ^16 || >=18.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4.31"
+ }
+ },
+ "node_modules/cssnano-preset-default": {
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz",
+ "integrity": "sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==",
+ "license": "MIT",
+ "dependencies": {
+ "browserslist": "^4.23.0",
+ "css-declaration-sorter": "^7.2.0",
+ "cssnano-utils": "^4.0.2",
+ "postcss-calc": "^9.0.1",
+ "postcss-colormin": "^6.1.0",
+ "postcss-convert-values": "^6.1.0",
+ "postcss-discard-comments": "^6.0.2",
+ "postcss-discard-duplicates": "^6.0.3",
+ "postcss-discard-empty": "^6.0.3",
+ "postcss-discard-overridden": "^6.0.2",
+ "postcss-merge-longhand": "^6.0.5",
+ "postcss-merge-rules": "^6.1.1",
+ "postcss-minify-font-values": "^6.1.0",
+ "postcss-minify-gradients": "^6.0.3",
+ "postcss-minify-params": "^6.1.0",
+ "postcss-minify-selectors": "^6.0.4",
+ "postcss-normalize-charset": "^6.0.2",
+ "postcss-normalize-display-values": "^6.0.2",
+ "postcss-normalize-positions": "^6.0.2",
+ "postcss-normalize-repeat-style": "^6.0.2",
+ "postcss-normalize-string": "^6.0.2",
+ "postcss-normalize-timing-functions": "^6.0.2",
+ "postcss-normalize-unicode": "^6.1.0",
+ "postcss-normalize-url": "^6.0.2",
+ "postcss-normalize-whitespace": "^6.0.2",
+ "postcss-ordered-values": "^6.0.2",
+ "postcss-reduce-initial": "^6.1.0",
+ "postcss-reduce-transforms": "^6.0.2",
+ "postcss-svgo": "^6.0.3",
+ "postcss-unique-selectors": "^6.0.4"
+ },
+ "engines": {
+ "node": "^14 || ^16 || >=18.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4.31"
+ }
+ },
+ "node_modules/cssnano-utils": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.2.tgz",
+ "integrity": "sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14 || ^16 || >=18.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4.31"
+ }
+ },
+ "node_modules/csso": {
+ "version": "5.0.5",
+ "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz",
+ "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==",
+ "license": "MIT",
+ "dependencies": {
+ "css-tree": "~2.2.0"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0",
+ "npm": ">=7.0.0"
+ }
+ },
+ "node_modules/csso/node_modules/css-tree": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz",
+ "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==",
+ "license": "MIT",
+ "dependencies": {
+ "mdn-data": "2.0.28",
+ "source-map-js": "^1.0.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0",
+ "npm": ">=7.0.0"
+ }
+ },
+ "node_modules/csso/node_modules/mdn-data": {
+ "version": "2.0.28",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz",
+ "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==",
+ "license": "CC0-1.0"
+ },
+ "node_modules/csstype": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "license": "MIT"
+ },
+ "node_modules/cytoscape": {
+ "version": "3.34.4",
+ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.4.tgz",
+ "integrity": "sha512-msY99tMY8iWTg+sIPGfSqDcPNOt4xcj+v/K/7qUFaCUxxlqnMkUYLBjRUzn9W5CU/R2hrmtJa5+UtovrEM2ctg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/cytoscape-cose-bilkent": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz",
+ "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==",
+ "license": "MIT",
+ "dependencies": {
+ "cose-base": "^1.0.0"
+ },
+ "peerDependencies": {
+ "cytoscape": "^3.2.0"
+ }
+ },
+ "node_modules/cytoscape-fcose": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz",
+ "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "cose-base": "^2.2.0"
+ },
+ "peerDependencies": {
+ "cytoscape": "^3.2.0"
+ }
+ },
+ "node_modules/cytoscape-fcose/node_modules/cose-base": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz",
+ "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==",
+ "license": "MIT",
+ "dependencies": {
+ "layout-base": "^2.0.0"
+ }
+ },
+ "node_modules/cytoscape-fcose/node_modules/layout-base": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz",
+ "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==",
+ "license": "MIT"
+ },
+ "node_modules/d3": {
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz",
+ "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "3",
+ "d3-axis": "3",
+ "d3-brush": "3",
+ "d3-chord": "3",
+ "d3-color": "3",
+ "d3-contour": "4",
+ "d3-delaunay": "6",
+ "d3-dispatch": "3",
+ "d3-drag": "3",
+ "d3-dsv": "3",
+ "d3-ease": "3",
+ "d3-fetch": "3",
+ "d3-force": "3",
+ "d3-format": "3",
+ "d3-geo": "3",
+ "d3-hierarchy": "3",
+ "d3-interpolate": "3",
+ "d3-path": "3",
+ "d3-polygon": "3",
+ "d3-quadtree": "3",
+ "d3-random": "3",
+ "d3-scale": "4",
+ "d3-scale-chromatic": "3",
+ "d3-selection": "3",
+ "d3-shape": "3",
+ "d3-time": "3",
+ "d3-time-format": "4",
+ "d3-timer": "3",
+ "d3-transition": "3",
+ "d3-zoom": "3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-array": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
+ "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
+ "license": "ISC",
+ "dependencies": {
+ "internmap": "1 - 2"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-axis": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz",
+ "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-brush": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz",
+ "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-dispatch": "1 - 3",
+ "d3-drag": "2 - 3",
+ "d3-interpolate": "1 - 3",
+ "d3-selection": "3",
+ "d3-transition": "3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-chord": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz",
+ "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-path": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-color": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
+ "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-contour": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz",
+ "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "^3.2.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-delaunay": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
+ "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",
+ "license": "ISC",
+ "dependencies": {
+ "delaunator": "5"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-dispatch": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
+ "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-drag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
+ "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-dispatch": "1 - 3",
+ "d3-selection": "3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-dsv": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz",
+ "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
+ "license": "ISC",
+ "dependencies": {
+ "commander": "7",
+ "iconv-lite": "0.6",
+ "rw": "1"
+ },
+ "bin": {
+ "csv2json": "bin/dsv2json.js",
+ "csv2tsv": "bin/dsv2dsv.js",
+ "dsv2dsv": "bin/dsv2dsv.js",
+ "dsv2json": "bin/dsv2json.js",
+ "json2csv": "bin/json2dsv.js",
+ "json2dsv": "bin/json2dsv.js",
+ "json2tsv": "bin/json2dsv.js",
+ "tsv2csv": "bin/dsv2dsv.js",
+ "tsv2json": "bin/dsv2json.js"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-dsv/node_modules/commander": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
+ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/d3-dsv/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/d3-ease": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
+ "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-fetch": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz",
+ "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-dsv": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-force": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",
+ "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-dispatch": "1 - 3",
+ "d3-quadtree": "1 - 3",
+ "d3-timer": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-format": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
+ "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-geo": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz",
+ "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "2.5.0 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-hierarchy": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
+ "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-interpolate": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
+ "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-color": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-path": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
+ "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-polygon": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz",
+ "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-quadtree": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
+ "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-random": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz",
+ "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-sankey": {
+ "version": "0.12.3",
+ "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz",
+ "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "d3-array": "1 - 2",
+ "d3-shape": "^1.2.0"
+ }
+ },
+ "node_modules/d3-sankey/node_modules/d3-array": {
+ "version": "2.12.1",
+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz",
+ "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "internmap": "^1.0.0"
+ }
+ },
+ "node_modules/d3-sankey/node_modules/d3-path": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz",
+ "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/d3-sankey/node_modules/d3-shape": {
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",
+ "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "d3-path": "1"
+ }
+ },
+ "node_modules/d3-sankey/node_modules/internmap": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz",
+ "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==",
+ "license": "ISC"
+ },
+ "node_modules/d3-scale": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
+ "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "2.10.0 - 3",
+ "d3-format": "1 - 3",
+ "d3-interpolate": "1.2.0 - 3",
+ "d3-time": "2.1.1 - 3",
+ "d3-time-format": "2 - 4"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-scale-chromatic": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
+ "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-color": "1 - 3",
+ "d3-interpolate": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-selection": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
+ "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-shape": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
+ "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-path": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-time": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
+ "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "2 - 3"
+ },
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/cssnano-preset-default": {
- "version": "6.1.2",
- "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz",
- "integrity": "sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==",
- "license": "MIT",
+ "node_modules/d3-time-format": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
+ "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
+ "license": "ISC",
"dependencies": {
- "browserslist": "^4.23.0",
- "css-declaration-sorter": "^7.2.0",
- "cssnano-utils": "^4.0.2",
- "postcss-calc": "^9.0.1",
- "postcss-colormin": "^6.1.0",
- "postcss-convert-values": "^6.1.0",
- "postcss-discard-comments": "^6.0.2",
- "postcss-discard-duplicates": "^6.0.3",
- "postcss-discard-empty": "^6.0.3",
- "postcss-discard-overridden": "^6.0.2",
- "postcss-merge-longhand": "^6.0.5",
- "postcss-merge-rules": "^6.1.1",
- "postcss-minify-font-values": "^6.1.0",
- "postcss-minify-gradients": "^6.0.3",
- "postcss-minify-params": "^6.1.0",
- "postcss-minify-selectors": "^6.0.4",
- "postcss-normalize-charset": "^6.0.2",
- "postcss-normalize-display-values": "^6.0.2",
- "postcss-normalize-positions": "^6.0.2",
- "postcss-normalize-repeat-style": "^6.0.2",
- "postcss-normalize-string": "^6.0.2",
- "postcss-normalize-timing-functions": "^6.0.2",
- "postcss-normalize-unicode": "^6.1.0",
- "postcss-normalize-url": "^6.0.2",
- "postcss-normalize-whitespace": "^6.0.2",
- "postcss-ordered-values": "^6.0.2",
- "postcss-reduce-initial": "^6.1.0",
- "postcss-reduce-transforms": "^6.0.2",
- "postcss-svgo": "^6.0.3",
- "postcss-unique-selectors": "^6.0.4"
+ "d3-time": "1 - 3"
},
"engines": {
- "node": "^14 || ^16 || >=18.0"
- },
- "peerDependencies": {
- "postcss": "^8.4.31"
+ "node": ">=12"
}
},
- "node_modules/cssnano-utils": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.2.tgz",
- "integrity": "sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==",
- "license": "MIT",
+ "node_modules/d3-timer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
+ "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
+ "license": "ISC",
"engines": {
- "node": "^14 || ^16 || >=18.0"
- },
- "peerDependencies": {
- "postcss": "^8.4.31"
+ "node": ">=12"
}
},
- "node_modules/csso": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz",
- "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==",
- "license": "MIT",
+ "node_modules/d3-transition": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
+ "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
+ "license": "ISC",
"dependencies": {
- "css-tree": "~2.2.0"
+ "d3-color": "1 - 3",
+ "d3-dispatch": "1 - 3",
+ "d3-ease": "1 - 3",
+ "d3-interpolate": "1 - 3",
+ "d3-timer": "1 - 3"
},
"engines": {
- "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0",
- "npm": ">=7.0.0"
+ "node": ">=12"
+ },
+ "peerDependencies": {
+ "d3-selection": "2 - 3"
}
},
- "node_modules/csso/node_modules/css-tree": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz",
- "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==",
- "license": "MIT",
+ "node_modules/d3-zoom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
+ "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
+ "license": "ISC",
"dependencies": {
- "mdn-data": "2.0.28",
- "source-map-js": "^1.0.1"
+ "d3-dispatch": "1 - 3",
+ "d3-drag": "2 - 3",
+ "d3-interpolate": "1 - 3",
+ "d3-selection": "2 - 3",
+ "d3-transition": "2 - 3"
},
"engines": {
- "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0",
- "npm": ">=7.0.0"
+ "node": ">=12"
}
},
- "node_modules/csso/node_modules/mdn-data": {
- "version": "2.0.28",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz",
- "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==",
- "license": "CC0-1.0"
+ "node_modules/dagre-d3-es": {
+ "version": "7.0.14",
+ "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.14.tgz",
+ "integrity": "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==",
+ "license": "MIT",
+ "dependencies": {
+ "d3": "^7.9.0",
+ "lodash-es": "^4.17.21"
+ }
},
- "node_modules/csstype": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
- "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "node_modules/dayjs": {
+ "version": "1.11.23",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.23.tgz",
+ "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==",
"license": "MIT"
},
"node_modules/debounce": {
@@ -9244,6 +10270,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/delaunator": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz",
+ "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==",
+ "license": "ISC",
+ "dependencies": {
+ "robust-predicates": "^3.0.2"
+ }
+ },
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -9391,6 +10426,15 @@
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
+ "node_modules/dompurify": {
+ "version": "3.4.17",
+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz",
+ "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==",
+ "license": "(MPL-2.0 OR Apache-2.0)",
+ "optionalDependencies": {
+ "@types/trusted-types": "^2.0.7"
+ }
+ },
"node_modules/domutils": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
@@ -9477,6 +10521,12 @@
"integrity": "sha512-4MxfbmNDm+KPh066EZy+eUnkcDPcZ35wNmOWzFuh/ijvHsve6kbLTLURy88uCNK5FbpN+yk2nQY6BYh1GEt+wg==",
"license": "ISC"
},
+ "node_modules/elkjs": {
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.9.3.tgz",
+ "integrity": "sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==",
+ "license": "EPL-2.0"
+ },
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
@@ -9612,6 +10662,18 @@
"node": ">= 0.4"
}
},
+ "node_modules/es-toolkit": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz",
+ "integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==",
+ "license": "MIT",
+ "workspaces": [
+ "docs",
+ "benchmarks",
+ "tests/types",
+ "tests/browser-compat"
+ ]
+ },
"node_modules/esast-util-from-estree": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz",
@@ -10118,6 +11180,13 @@
"node": ">=0.4.0"
}
},
+ "node_modules/fflate": {
+ "version": "0.7.5",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.5.tgz",
+ "integrity": "sha512-QieYf//cis6ywHNi5qW1+PXPQ4bC+XVJAtS4AXIML8P76GroEiOxm/oQtn1f02UkJY1+KsXMJcC+R2v/Eg4G3g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/figures": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
@@ -10648,6 +11717,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/hachure-fill": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz",
+ "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==",
+ "license": "MIT"
+ },
"node_modules/handle-thing": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
@@ -10882,6 +11957,19 @@
"he": "bin/he"
}
},
+ "node_modules/hex-rgb": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/hex-rgb/-/hex-rgb-4.3.0.tgz",
+ "integrity": "sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/history": {
"version": "4.10.1",
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
@@ -11287,6 +12375,16 @@
"node": ">=8"
}
},
+ "node_modules/import-meta-resolve": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",
+ "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -11335,6 +12433,15 @@
"integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==",
"license": "MIT"
},
+ "node_modules/internmap": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
+ "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
@@ -11758,6 +12865,13 @@
"@sideway/pinpoint": "^2.0.0"
}
},
+ "node_modules/jpeg-js": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz",
+ "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==",
+ "dev": true,
+ "license": "BSD-3-Clause"
+ },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -11830,6 +12944,31 @@
"graceful-fs": "^4.1.6"
}
},
+ "node_modules/katex": {
+ "version": "0.18.10",
+ "resolved": "https://registry.npmjs.org/katex/-/katex-0.18.10.tgz",
+ "integrity": "sha512-/B6p9eY9DX7aHBfpkHdpirDTZ5QH9xTwL9y837PWuzuv41O5jFdqNQwVQEQsimY0/iVNkwBY4+4hMfhQ7d4Dbw==",
+ "funding": [
+ "https://opencollective.com/katex",
+ "https://github.com/sponsors/katex"
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "commander": "^15.0.0"
+ },
+ "bin": {
+ "katex": "cli.js"
+ }
+ },
+ "node_modules/katex/node_modules/commander": {
+ "version": "15.0.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz",
+ "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=22.12.0"
+ }
+ },
"node_modules/keyv": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@@ -11839,6 +12978,11 @@
"json-buffer": "3.0.1"
}
},
+ "node_modules/khroma": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz",
+ "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="
+ },
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -11891,6 +13035,12 @@
"shell-quote": "^1.8.3"
}
},
+ "node_modules/layout-base": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz",
+ "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==",
+ "license": "MIT"
+ },
"node_modules/leven": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
@@ -12161,6 +13311,17 @@
"url": "https://github.com/sponsors/antonk52"
}
},
+ "node_modules/linebreak": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/linebreak/-/linebreak-1.1.0.tgz",
+ "integrity": "sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "0.0.8",
+ "unicode-trie": "^2.0.0"
+ }
+ },
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
@@ -12215,6 +13376,12 @@
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
},
+ "node_modules/lodash-es": {
+ "version": "4.18.1",
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
+ "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
+ "license": "MIT"
+ },
"node_modules/lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
@@ -12325,6 +13492,18 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/marked": {
+ "version": "16.4.2",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz",
+ "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==",
+ "license": "MIT",
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 20"
+ }
+ },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -12804,6 +13983,53 @@
"node": ">= 8"
}
},
+ "node_modules/mermaid": {
+ "version": "12.2.0",
+ "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-12.2.0.tgz",
+ "integrity": "sha512-w7nr/SFrLO7BaVTs3dQTvYSV6nYSBj0Yy9DjBhsIJtAcHqRzXSq4Pg32ujHZ/AdWsAMNEvvhbm5dt9E2tOiHzw==",
+ "license": "MIT",
+ "dependencies": {
+ "@braintree/sanitize-url": "^7.1.2",
+ "@iconify/utils": "^3.0.2",
+ "@mermaid-js/parser": "^2.0.1",
+ "@types/d3": "^7.4.3",
+ "@upsetjs/venn.js": "^2.0.0",
+ "chevrotain": "~13.2.0",
+ "cytoscape": "^3.34.0",
+ "cytoscape-cose-bilkent": "^4.1.0",
+ "cytoscape-fcose": "^2.2.0",
+ "d3": "^7.9.0",
+ "d3-sankey": "^0.12.3",
+ "dagre-d3-es": "7.0.14",
+ "dayjs": "^1.11.21",
+ "dompurify": "^3.4.12",
+ "elkjs": "^0.9.3",
+ "es-toolkit": "^1.45.1",
+ "katex": "^0.18.0",
+ "khroma": "^2.1.0",
+ "marked": "^16.3.0",
+ "roughjs": "^4.6.6",
+ "stylis": "^4.3.6",
+ "ts-dedent": "^2.2.0",
+ "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0"
+ },
+ "engines": {
+ "node": ">=22.12.0"
+ }
+ },
+ "node_modules/mermaid/node_modules/uuid": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz",
+ "integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist-node/bin/uuid"
+ }
+ },
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
@@ -15167,6 +16393,19 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/package-manager-detector": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.9.0.tgz",
+ "integrity": "sha512-zAMfbta9nPA8AKkA4WdmNAT8R8s6Dk0/xwPsqNnRidMFcLo1YkLuPDTgs2f64XdzS8vbLNnoJ+uUIkgbz7oRHA==",
+ "license": "MIT"
+ },
+ "node_modules/pako": {
+ "version": "0.2.9",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
+ "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/param-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
@@ -15189,6 +16428,17 @@
"node": ">=6"
}
},
+ "node_modules/parse-css-color": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/parse-css-color/-/parse-css-color-0.2.1.tgz",
+ "integrity": "sha512-bwS/GGIFV3b6KS4uwpzCFj4w297Yl3uqnSgIPsoQkx7GMLROXfMnWvxfNkL0oh8HVhZA4hvJoEoEIqonfJ3BWg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "^1.1.4",
+ "hex-rgb": "^4.1.0"
+ }
+ },
"node_modules/parse-entities": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz",
@@ -15306,6 +16556,12 @@
"tslib": "^2.0.3"
}
},
+ "node_modules/path-data-parser": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
+ "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==",
+ "license": "MIT"
+ },
"node_modules/path-exists": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
@@ -15404,6 +16660,22 @@
"node": ">=16.0.0"
}
},
+ "node_modules/points-on-curve": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
+ "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==",
+ "license": "MIT"
+ },
+ "node_modules/points-on-path": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz",
+ "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==",
+ "license": "MIT",
+ "dependencies": {
+ "path-data-parser": "0.1.0",
+ "points-on-curve": "0.2.0"
+ }
+ },
"node_modules/postcss": {
"version": "8.5.12",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.12.tgz",
@@ -17834,6 +19106,24 @@
"node": ">=0.10.0"
}
},
+ "node_modules/robust-predicates": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz",
+ "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==",
+ "license": "Unlicense"
+ },
+ "node_modules/roughjs": {
+ "version": "4.6.6",
+ "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",
+ "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==",
+ "license": "MIT",
+ "dependencies": {
+ "hachure-fill": "^0.5.2",
+ "path-data-parser": "^0.1.0",
+ "points-on-curve": "^0.2.0",
+ "points-on-path": "^0.2.1"
+ }
+ },
"node_modules/rtlcss": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-4.3.0.tgz",
@@ -17887,6 +19177,12 @@
"queue-microtask": "^1.2.2"
}
},
+ "node_modules/rw": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
+ "license": "BSD-3-Clause"
+ },
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@@ -17913,6 +19209,36 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
+ "node_modules/satori": {
+ "version": "0.12.2",
+ "resolved": "https://registry.npmjs.org/satori/-/satori-0.12.2.tgz",
+ "integrity": "sha512-3C/laIeE6UUe9A+iQ0A48ywPVCCMKCNSTU5Os101Vhgsjd3AAxGNjyq0uAA8kulMPK5n0csn8JlxPN9riXEjLA==",
+ "dev": true,
+ "license": "MPL-2.0",
+ "dependencies": {
+ "@shuding/opentype.js": "1.4.0-beta.0",
+ "css-background-parser": "^0.1.0",
+ "css-box-shadow": "1.0.0-3",
+ "css-gradient-parser": "^0.0.16",
+ "css-to-react-native": "^3.0.0",
+ "emoji-regex": "^10.2.1",
+ "escape-html": "^1.0.3",
+ "linebreak": "^1.1.0",
+ "parse-css-color": "^0.2.1",
+ "postcss-value-parser": "^4.2.0",
+ "yoga-wasm-web": "^0.3.3"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/satori/node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/sax": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz",
@@ -18615,6 +19941,13 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
+ "node_modules/string.prototype.codepointat": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
+ "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/stringify-entities": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
@@ -18719,6 +20052,12 @@
"postcss": "^8.4.31"
}
},
+ "node_modules/stylis": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz",
+ "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==",
+ "license": "MIT"
+ },
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -18917,6 +20256,13 @@
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
"license": "MIT"
},
+ "node_modules/tiny-inflate": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
+ "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/tiny-invariant": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
@@ -18929,6 +20275,15 @@
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
"license": "MIT"
},
+ "node_modules/tinyexec": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",
+ "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/tinypool": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
@@ -19004,6 +20359,15 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/ts-dedent": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz",
+ "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.10"
+ }
+ },
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
@@ -19161,6 +20525,17 @@
"node": ">=4"
}
},
+ "node_modules/unicode-trie": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz",
+ "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "pako": "^0.2.5",
+ "tiny-inflate": "^1.0.0"
+ }
+ },
"node_modules/unified": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
@@ -20243,6 +21618,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/yoga-wasm-web": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/yoga-wasm-web/-/yoga-wasm-web-0.3.3.tgz",
+ "integrity": "sha512-N+d4UJSJbt/R3wqY7Coqs5pcV0aUj2j9IaQ3rNj9bVCLld8tTGKRa2USARjnvZJWVx1NDmQev8EknoczaOQDOA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/zwitch": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
diff --git a/website/package.json b/website/package.json
index 3b91f185..09812b0d 100644
--- a/website/package.json
+++ b/website/package.json
@@ -21,6 +21,7 @@
"@docusaurus/core": "3.10.0",
"@docusaurus/faster": "3.10.0",
"@docusaurus/preset-classic": "3.10.0",
+ "@docusaurus/theme-mermaid": "^3.10.0",
"@easyops-cn/docusaurus-search-local": "^0.55.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
@@ -34,6 +35,8 @@
"@docusaurus/types": "3.10.0",
"@resvg/resvg-js": "^2.6.2",
"@types/react": "^19.0.0",
+ "jpeg-js": "^0.4.4",
+ "satori": "^0.12.2",
"typescript": "~6.0.2"
},
"browserslist": {
diff --git a/website/plugins/blog-social-cards.cjs b/website/plugins/blog-social-cards.cjs
new file mode 100644
index 00000000..c9e00c0e
--- /dev/null
+++ b/website/plugins/blog-social-cards.cjs
@@ -0,0 +1,249 @@
+/**
+ * Social cards for the Mercury Journal, rendered after every build.
+ *
+ * Every journal page gets its own 1200x630 JPEG at /img/og<permalink>.jpg:
+ *
+ * /img/og/blog.jpg the journal home
+ * /img/og/blog/<slug>.jpg each post: title, category, author,
+ * date, reading time and its cover art
+ * /img/og/blog/tags/<tag>.jpg each topic archive
+ * /img/og/blog/authors/<key>.jpg each author archive
+ *
+ * The theme components point og:image / twitter:image at the same paths, so
+ * a page and its card can never drift. A post can opt out with
+ * `social_image: /img/whatever.jpg` in its front matter.
+ *
+ * Why these choices:
+ * - 1200x630 (1.91:1) is the size X, Facebook, LinkedIn, WhatsApp, Slack,
+ * Discord and Telegram all render without cropping the long edge.
+ * - JPEG, not PNG: WhatsApp drops preview images above roughly 300 KB, and
+ * the gradient covers compress far better as JPEG. Cards land ~60-120 KB.
+ * - Text stays inside a 64px safe margin and the title is large enough to
+ * read in a 500px-wide chat bubble.
+ */
+const fs = require('node:fs');
+const path = require('node:path');
+
+const W = 1200;
+const H = 630;
+const INK = '#0b0e12';
+const DIM = 'rgba(232, 238, 245, 0.62)';
+const ACCENT = '#7dd3e0';
+
+/** Minimal element factory for satori (it takes React-like objects). */
+function h(type, style, ...children) {
+ const kids = children.flat().filter((c) => c !== null && c !== undefined && c !== false);
+ return { type, props: { style: { display: 'flex', ...style }, children: kids.length === 1 ? kids[0] : kids } };
+}
+function img(src, style) {
+ return { type: 'img', props: { src, style } };
+}
+
+function dataUri(file) {
+ const ext = path.extname(file).slice(1).toLowerCase();
+ const mime = ext === 'jpg' || ext === 'jpeg' ? 'image/jpeg' : ext === 'svg' ? 'image/svg+xml' : `image/${ext}`;
+ return `data:${mime};base64,${fs.readFileSync(file).toString('base64')}`;
+}
+
+const remoteCache = new Map();
+async function remoteDataUri(url) {
+ if (remoteCache.has(url)) return remoteCache.get(url);
+ let out = null;
+ try {
+ const res = await fetch(url, { redirect: 'follow', signal: AbortSignal.timeout(8000) });
+ if (res.ok) {
+ const type = res.headers.get('content-type') ?? 'image/png';
+ out = `data:${type.split(';')[0]};base64,${Buffer.from(await res.arrayBuffer()).toString('base64')}`;
+ }
+ } catch {
+ out = null;
+ }
+ remoteCache.set(url, out);
+ return out;
+}
+
+function formatDate(d) {
+ return new Date(d).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' });
+}
+
+function titleSize(title) {
+ const n = title.length;
+ if (n <= 32) return 76;
+ if (n <= 52) return 66;
+ if (n <= 72) return 58;
+ return 50;
+}
+
+module.exports = function blogSocialCardsPlugin(context) {
+ const { siteDir } = context;
+ const staticImg = (p) => path.join(siteDir, 'static', p.replace(/^\//, ''));
+
+ return {
+ name: 'mercury-blog-social-cards',
+ async postBuild({ outDir, plugins }) {
+ const blog = plugins?.find((p) => p.name === 'docusaurus-plugin-content-blog');
+ const content = blog?.content;
+ if (!content?.blogPosts) return;
+
+ const { default: satori } = await import('satori');
+ const { Resvg } = require('@resvg/resvg-js');
+ const jpeg = require('jpeg-js');
+
+ const fontDir = path.join(__dirname, 'og-fonts');
+ const font = (name, file, weight) => ({ name, data: fs.readFileSync(path.join(fontDir, file)), weight, style: 'normal' });
+ const fonts = [
+ font('Serif', 'InstrumentSerif-Regular.ttf', 400),
+ font('Sans', 'Geist-Regular.ttf', 400),
+ font('Sans', 'Geist-Medium.ttf', 500),
+ font('Sans', 'Geist-SemiBold.ttf', 600),
+ font('Mono', 'GeistMono-Medium.ttf', 500),
+ ];
+ const logo = dataUri(staticImg('img/logo-dark.png'));
+ const houseAvatar = dataUri(staticImg('img/avatar-mercury.png'));
+
+ async function avatarFor(author) {
+ const url = author?.imageURL;
+ if (!url) return houseAvatar;
+ if (/^https?:/.test(url)) {
+ const sized = /github\.com\/[^/]+\.png$/.test(url) ? `${url}?size=160` : url;
+ return (await remoteDataUri(sized)) ?? houseAvatar;
+ }
+ const local = staticImg(url);
+ return fs.existsSync(local) ? dataUri(local) : houseAvatar;
+ }
+
+ async function render(tree, permalink) {
+ const svg = await satori(tree, { width: W, height: H, fonts });
+ const { pixels, width, height } = new Resvg(svg, { fitTo: { mode: 'width', value: W } }).render();
+ const out = jpeg.encode({ data: pixels, width, height }, 86).data;
+ const file = path.join(outDir, 'img', 'og', `${permalink.replace(/^\//, '')}.jpg`);
+ fs.mkdirSync(path.dirname(file), { recursive: true });
+ fs.writeFileSync(file, out);
+ return out.length;
+ }
+
+ /* Shared frame: brand row, body, footer row, optional right panel. */
+ function frame({ eyebrow, title, dek, footer, panel }) {
+ const size = titleSize(title);
+ return h(
+ 'div',
+ { width: W, height: H, backgroundColor: INK, color: '#f2f5f8', fontFamily: 'Sans', position: 'relative' },
+ h('div', {
+ position: 'absolute', left: -160, top: -220, width: 760, height: 760, borderRadius: 760,
+ backgroundImage: 'radial-gradient(circle, rgba(64,170,200,0.20), rgba(11,14,18,0) 70%)',
+ }),
+ h(
+ 'div',
+ { flexDirection: 'column', justifyContent: 'space-between', padding: '56px 0 56px 64px', width: panel ? 700 : W - 128, height: H },
+ h(
+ 'div',
+ { alignItems: 'center', gap: 14 },
+ img(logo, { width: 40, height: 40 }),
+ h('div', { fontSize: 24, fontWeight: 600, letterSpacing: -0.3 }, 'Mercury Journal'),
+ eyebrow ? h('div', { fontFamily: 'Mono', fontSize: 17, color: ACCENT, letterSpacing: 2.4, textTransform: 'uppercase', marginLeft: 10, padding: '6px 14px', border: '1.5px solid rgba(125,211,224,0.45)', borderRadius: 999 }, eyebrow) : null,
+ ),
+ h(
+ 'div',
+ { flexDirection: 'column', gap: 18 },
+ h('div', { fontFamily: 'Serif', fontSize: size, lineHeight: 1.04, letterSpacing: -1.2, lineClamp: 3 }, title),
+ dek ? h('div', { fontSize: 24, lineHeight: 1.4, color: DIM, lineClamp: 2 }, dek) : null,
+ ),
+ footer,
+ ),
+ panel
+ ? h('div', { position: 'absolute', right: 56, top: 56, width: 380, height: H - 112, borderRadius: 28, overflow: 'hidden', border: '1px solid rgba(255,255,255,0.10)' }, panel)
+ : null,
+ );
+ }
+
+ function byline(avatar, name, meta) {
+ return h(
+ 'div',
+ { alignItems: 'center', gap: 16 },
+ img(avatar, { width: 52, height: 52, borderRadius: 52, border: '2px solid rgba(255,255,255,0.18)' }),
+ h('div', { flexDirection: 'column', gap: 4 },
+ h('div', { fontSize: 22, fontWeight: 600 }, name),
+ h('div', { fontSize: 19, color: DIM }, meta)),
+ );
+ }
+
+ const siteRow = (left) => h('div', { alignItems: 'center', justifyContent: 'space-between', width: '100%' },
+ left, h('div', { fontFamily: 'Mono', fontSize: 18, color: DIM }, 'mercuryagent.sh/blog'));
+
+ const coverPanel = (src) => img(src, { width: 380, height: H - 112, objectFit: 'cover' });
+ const markPanel = (src, round) => h('div', {
+ width: 380, height: H - 112, alignItems: 'center', justifyContent: 'center',
+ backgroundImage: 'radial-gradient(circle at 50% 42%, rgba(64,170,200,0.45), rgba(20,26,34,1) 72%)',
+ }, img(src, { width: round ? 200 : 230, height: round ? 200 : 230, borderRadius: round ? 200 : 0 }));
+
+ const written = [];
+ const posts = content.blogPosts.filter((p) => !p.metadata.unlisted || p.metadata.frontMatter?.social_card === true);
+
+ for (const post of posts) {
+ const m = post.metadata;
+ if (m.frontMatter?.social_image) continue;
+ const srcDir = path.dirname(path.join(siteDir, m.source.replace(/^@site\//, '')));
+ const coverRel = m.frontMatter?.image;
+ const coverFile = typeof coverRel === 'string' && !/^https?:/.test(coverRel)
+ ? (coverRel.startsWith('/') ? staticImg(coverRel) : path.join(srcDir, coverRel))
+ : null;
+ const cover = coverFile && fs.existsSync(coverFile) ? dataUri(coverFile) : null;
+ const lead = m.authors[0];
+ const names = m.authors.map((a) => a.name).join(' & ');
+ const minutes = Math.max(1, Math.round(m.readingTime ?? 1));
+ const tree = frame({
+ eyebrow: m.tags[0]?.label,
+ title: m.title,
+ dek: null,
+ footer: siteRow(byline(await avatarFor(lead), names || 'Mercury', `${formatDate(m.date)} · ${minutes} min read`)),
+ panel: cover ? coverPanel(cover) : markPanel(logo),
+ });
+ written.push([m.permalink, await render(tree, m.permalink)]);
+ }
+
+ // Journal home.
+ const listed = posts.filter((p) => !p.metadata.unlisted);
+ written.push(['/blog', await render(frame({
+ eyebrow: null,
+ title: 'News, engineering notes and field reports',
+ dek: 'From the people building Mercury, the open-source AI agent you can leave running.',
+ footer: siteRow(h('div', { fontSize: 20, color: DIM }, `${listed.length} posts · RSS · llms.txt`)),
+ panel: markPanel(logo),
+ }), '/blog')]);
+
+ // Topic archives.
+ for (const tag of Object.values(content.blogTags ?? {})) {
+ if (tag.unlisted) continue;
+ const count = tag.items?.length ?? 0;
+ written.push([tag.permalink, await render(frame({
+ eyebrow: 'Topic',
+ title: tag.label,
+ dek: tag.description ?? null,
+ footer: siteRow(h('div', { fontSize: 20, color: DIM }, `${count} ${count === 1 ? 'post' : 'posts'}`)),
+ panel: markPanel(logo),
+ }), tag.permalink)]);
+ }
+
+ // Author archives.
+ const authors = new Map();
+ for (const p of listed) for (const a of p.metadata.authors) if (a.page?.permalink) {
+ const cur = authors.get(a.page.permalink) ?? { author: a, count: 0 };
+ cur.count += 1;
+ authors.set(a.page.permalink, cur);
+ }
+ for (const [permalink, { author, count }] of authors) {
+ const avatar = await avatarFor(author);
+ written.push([permalink, await render(frame({
+ eyebrow: 'Author',
+ title: author.name,
+ dek: author.description ?? author.title ?? null,
+ footer: siteRow(h('div', { fontSize: 20, color: DIM }, `${author.title ? `${author.title} · ` : ''}${count} ${count === 1 ? 'post' : 'posts'}`)),
+ panel: markPanel(avatar, true),
+ }), permalink)]);
+ }
+
+ const kb = written.map(([, n]) => n / 1024);
+ console.log(`[mercury-blog-social-cards] ${written.length} cards, ${Math.round(Math.min(...kb))}-${Math.round(Math.max(...kb))} KB`);
+ },
+ };
+};
diff --git a/website/plugins/llms-txt.cjs b/website/plugins/llms-txt.cjs
new file mode 100644
index 00000000..28b0ed6d
--- /dev/null
+++ b/website/plugins/llms-txt.cjs
@@ -0,0 +1,121 @@
+/**
+ * LLM-ready output for mercuryagent.sh, written after every build:
+ *
+ * /llms.txt an index in the llmstxt.org format: what Mercury is,
+ * where the docs are, and every journal post with a
+ * one-line summary and a link to its Markdown copy
+ * /llms-full.txt the full text of every journal post, concatenated
+ * /blog/<slug>.md each post as clean Markdown (front matter reduced to
+ * title/date/authors/tags/canonical URL, MDX stripped),
+ * linked from the article page and its <head>
+ *
+ * Posts are read from website/blog/<folder>/index.md(x). The slug comes
+ * from the post's `slug` front matter, or the folder name minus the date.
+ */
+const fs = require('node:fs');
+const path = require('node:path');
+const matter = require('gray-matter');
+const yaml = require('js-yaml');
+
+const SITE = 'https://mercuryagent.sh';
+
+function readPosts(blogDir) {
+ if (!fs.existsSync(blogDir)) return [];
+ const authors = fs.existsSync(path.join(blogDir, 'authors.yml'))
+ ? yaml.load(fs.readFileSync(path.join(blogDir, 'authors.yml'), 'utf8')) ?? {}
+ : {};
+ const posts = [];
+ for (const entry of fs.readdirSync(blogDir, { withFileTypes: true })) {
+ if (!entry.isDirectory()) continue;
+ const dir = path.join(blogDir, entry.name);
+ const file = ['index.mdx', 'index.md'].map((f) => path.join(dir, f)).find((f) => fs.existsSync(f));
+ if (!file) continue;
+ const { data, content } = matter(fs.readFileSync(file, 'utf8'));
+ if (data.draft === true || data.unlisted === true) continue;
+ const dated = entry.name.match(/^(\d{4}-\d{2}-\d{2})-(.+)$/);
+ const slug = String(data.slug ?? (dated ? dated[2] : entry.name)).replace(/^\/+/, '');
+ const date = data.date ? new Date(data.date).toISOString().slice(0, 10) : dated?.[1] ?? '';
+ const names = [].concat(data.authors ?? []).map((k) => (typeof k === 'string' ? authors[k]?.name ?? k : k.name));
+ posts.push({
+ slug,
+ title: String(data.title ?? slug),
+ description: String(data.description ?? ''),
+ date,
+ authors: names,
+ tags: [].concat(data.tags ?? []).map(String),
+ url: `${SITE}/blog/${slug}`,
+ body: toPlainMarkdown(content),
+ });
+ }
+ return posts.sort((a, b) => b.date.localeCompare(a.date));
+}
+
+/** Drop MDX-only syntax so the copy reads as ordinary Markdown. */
+function toPlainMarkdown(src) {
+ return src
+ .replace(/^\s*import\s.+?;?\s*$/gm, '')
+ .replace(/^\s*export\s.+?;?\s*$/gm, '')
+ .replace(/<!--\s*truncate\s*-->/g, '')
+ .replace(/\{\/\*[\s\S]*?\*\/\}/g, '')
+ .replace(/^\s*<\/?Compare\b[^>]*>\s*$/gm, '')
+ .replace(/\n{3,}/g, '\n\n')
+ .trim();
+}
+
+function postMarkdown(p) {
+ return [
+ `# ${p.title}`,
+ '',
+ p.description ? `> ${p.description}` : null,
+ p.description ? '' : null,
+ `Published ${p.date}${p.authors.length ? ` by ${p.authors.join(', ')}` : ''}. Tags: ${p.tags.join(', ') || 'none'}.`,
+ `Canonical: ${p.url}`,
+ '',
+ p.body,
+ '',
+ ].filter((l) => l !== null).join('\n');
+}
+
+module.exports = function llmsTxtPlugin(context) {
+ return {
+ name: 'mercury-llms-txt',
+ async postBuild({ outDir }) {
+ const posts = readPosts(path.join(context.siteDir, 'blog'));
+ const blogOut = path.join(outDir, 'blog');
+ fs.mkdirSync(blogOut, { recursive: true });
+ for (const p of posts) fs.writeFileSync(path.join(blogOut, `${p.slug}.md`), postMarkdown(p));
+
+ const index = [
+ '# Mercury Agent',
+ '',
+ '> Mercury is an open-source, soul-driven AI agent that runs on your own machine. It reaches you from the terminal, Telegram, Discord, Slack, Signal and a local web dashboard, keeps a local long-term memory, asks before it acts through a permission system, stays inside a daily token budget, and keeps running as a background service. It ships Mercury Code (a coding environment) and Mercury Bots (persistent specialist agents).',
+ '',
+ `Install: \`curl -fsSL ${SITE}/install.sh | sh\` (macOS/Linux), \`irm ${SITE}/install.ps1 | iex\` (Windows), or \`npm i -g @cosmicstack/mercury-agent\` on Node.js 22+. Source: https://github.com/cosmicstack-labs/mercury-agent (MIT).`,
+ '',
+ '## Docs',
+ '',
+ `- [Getting started](${SITE}/docs): install, first run, channels`,
+ `- [CLI commands](${SITE}/docs/cli-commands/cli-commands): every \`mercury\` command`,
+ `- [Permissions model](${SITE}/docs/reference/permissions): scopes, approvals, blocklist`,
+ `- [Second Brain memory](${SITE}/docs/reference/second-brain): how memory is extracted and recalled`,
+ `- [Mercury Code](${SITE}/docs/integrations/coding-workspace): the coding environment`,
+ `- [Mercury Bots](${SITE}/docs/integrations/mercury-bots): persistent bots and fleets`,
+ `- [Release notes](${SITE}/docs/releases)`,
+ '',
+ '## Journal',
+ '',
+ ...posts.map((p) => `- [${p.title}](${SITE}/blog/${p.slug}.md) (${p.date}): ${p.description}`),
+ '',
+ '## Optional',
+ '',
+ `- [All journal posts, full text](${SITE}/llms-full.txt)`,
+ `- [RSS feed](${SITE}/blog/rss.xml)`,
+ '',
+ ].join('\n');
+ fs.writeFileSync(path.join(outDir, 'llms.txt'), index);
+ fs.writeFileSync(path.join(outDir, 'llms-full.txt'), posts.map(postMarkdown).join('\n\n---\n\n'));
+ },
+ };
+};
+
+module.exports.readPosts = readPosts;
diff --git a/website/plugins/og-fonts/Geist-Medium.ttf b/website/plugins/og-fonts/Geist-Medium.ttf
new file mode 100644
index 00000000..8b295ed1
Binary files /dev/null and b/website/plugins/og-fonts/Geist-Medium.ttf differ
diff --git a/website/plugins/og-fonts/Geist-Regular.ttf b/website/plugins/og-fonts/Geist-Regular.ttf
new file mode 100644
index 00000000..67e69925
Binary files /dev/null and b/website/plugins/og-fonts/Geist-Regular.ttf differ
diff --git a/website/plugins/og-fonts/Geist-SemiBold.ttf b/website/plugins/og-fonts/Geist-SemiBold.ttf
new file mode 100644
index 00000000..30519703
Binary files /dev/null and b/website/plugins/og-fonts/Geist-SemiBold.ttf differ
diff --git a/website/plugins/og-fonts/GeistMono-Medium.ttf b/website/plugins/og-fonts/GeistMono-Medium.ttf
new file mode 100644
index 00000000..b04672b3
Binary files /dev/null and b/website/plugins/og-fonts/GeistMono-Medium.ttf differ
diff --git a/website/plugins/og-fonts/InstrumentSerif-Regular.ttf b/website/plugins/og-fonts/InstrumentSerif-Regular.ttf
new file mode 100644
index 00000000..8794c695
Binary files /dev/null and b/website/plugins/og-fonts/InstrumentSerif-Regular.ttf differ
diff --git a/website/plugins/remark-social-embeds.cjs b/website/plugins/remark-social-embeds.cjs
new file mode 100644
index 00000000..3b5174ed
--- /dev/null
+++ b/website/plugins/remark-social-embeds.cjs
@@ -0,0 +1,372 @@
+/**
+ * Bare links become rich previews.
+ *
+ * A URL pasted on its own line in a journal post, with no link text:
+ *
+ * https://x.com/someone/status/1234567890
+ *
+ * is replaced at build time with <SocialEmbed url=… provider=… data=…/>,
+ * rendered by src/components/Journal/SocialEmbed.tsx. A Markdown link with
+ * its own text ([like this](https://…)) or a URL inside a sentence is left
+ * alone.
+ *
+ * Supported: X/Twitter, YouTube (incl. Shorts), Instagram, GitHub (repos,
+ * issues, pull requests, releases, users, gists, any other page), Bluesky,
+ * TikTok, Vimeo, Spotify, Loom, CodePen, Mastodon, and any other site
+ * through its Open Graph tags.
+ *
+ * Metadata (titles, tweet text, repo stats…) is fetched once at build time
+ * and cached for a week in node_modules/.cache/mercury-embeds.json, so the
+ * HTML carries a readable preview for search engines, feed readers and
+ * no-JS visitors; the browser upgrades it to the platform's own widget where
+ * one exists. Set GITHUB_TOKEN to lift GitHub's anonymous rate limit. A
+ * failed fetch never fails the build: the post just gets a plainer card.
+ */
+const fs = require('node:fs');
+const path = require('node:path');
+
+const CACHE_FILE = path.join(__dirname, '..', 'node_modules', '.cache', 'mercury-embeds.json');
+const TTL = 7 * 24 * 3600 * 1000;
+const UA = 'MercuryJournalBot/1.0 (+https://mercuryagent.sh/blog)';
+
+let cache = null;
+function loadCache() {
+ if (cache) return cache;
+ try {
+ cache = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));
+ } catch {
+ cache = {};
+ }
+ return cache;
+}
+function saveCache() {
+ try {
+ fs.mkdirSync(path.dirname(CACHE_FILE), { recursive: true });
+ fs.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 1));
+ } catch {
+ /* cache is an optimisation */
+ }
+}
+
+/* ── provider detection ──────────────────────────────────────────────── */
+
+function detect(raw) {
+ let u;
+ try {
+ u = new URL(raw);
+ } catch {
+ return null;
+ }
+ if (!/^https?:$/.test(u.protocol)) return null;
+ const host = u.hostname.replace(/^(www|m|mobile)\./, '');
+ const parts = u.pathname.split('/').filter(Boolean);
+
+ if (host === 'x.com' || host === 'twitter.com') {
+ const i = parts.indexOf('status');
+ if (i > 0 && /^\d+$/.test(parts[i + 1] ?? '')) return { provider: 'x', id: parts[i + 1], handle: parts[0] };
+ }
+ if (host === 'youtube.com' || host === 'youtu.be' || host === 'youtube-nocookie.com') {
+ let id = null;
+ let short = false;
+ if (host === 'youtu.be') id = parts[0];
+ else if (u.pathname === '/watch') id = u.searchParams.get('v');
+ else if (['shorts', 'embed', 'live', 'v'].includes(parts[0])) {
+ id = parts[1];
+ short = parts[0] === 'shorts';
+ }
+ const t = u.searchParams.get('t') ?? u.searchParams.get('start');
+ const start = t ? (/^\d+$/.test(t) ? Number(t) : toSeconds(t)) : 0;
+ if (id && /^[\w-]{11}$/.test(id)) return { provider: 'youtube', id, short, start };
+ }
+ if (host === 'instagram.com' && ['p', 'reel', 'tv'].includes(parts[0]) && /^[\w-]+$/.test(parts[1] ?? '')) {
+ return { provider: 'instagram', id: parts[1], kind: parts[0] };
+ }
+ if (host === 'github.com' && parts.length >= 1) return { provider: 'github', parts, hash: u.hash };
+ if (host === 'gist.github.com' && parts.length >= 2 && /^[0-9a-f]+$/i.test(parts[1])) return { provider: 'gist', id: parts[1], owner: parts[0] };
+ if (host === 'bsky.app' && parts[0] === 'profile' && parts[2] === 'post') return { provider: 'bluesky', handle: parts[1], rkey: parts[3] };
+ if (host === 'tiktok.com' && parts[1] === 'video' && /^\d+$/.test(parts[2] ?? '')) return { provider: 'tiktok', id: parts[2], handle: parts[0] };
+ if (host === 'vimeo.com' && /^\d+$/.test(parts[0] ?? '')) return { provider: 'vimeo', id: parts[0] };
+ if (host === 'open.spotify.com' && ['track', 'album', 'playlist', 'episode', 'show', 'artist'].includes(parts[0]) && parts[1]) {
+ return { provider: 'spotify', kind: parts[0], id: parts[1] };
+ }
+ if (host === 'loom.com' && ['share', 'embed'].includes(parts[0]) && /^[\w]+$/.test(parts[1] ?? '')) return { provider: 'loom', id: parts[1] };
+ if (host === 'codepen.io' && parts[1] === 'pen' && parts[2]) return { provider: 'codepen', user: parts[0], id: parts[2] };
+ if (/^@[\w.]+$/.test(parts[0] ?? '') && /^\d{6,}$/.test(parts[1] ?? '') && parts.length === 2) {
+ return { provider: 'mastodon', origin: u.origin };
+ }
+ return { provider: 'link' };
+}
+
+function toSeconds(t) {
+ const m = String(t).match(/(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?/);
+ return m ? Number(m[1] ?? 0) * 3600 + Number(m[2] ?? 0) * 60 + Number(m[3] ?? 0) : 0;
+}
+
+/* ── fetching ────────────────────────────────────────────────────────── */
+
+async function get(url, { json = true, headers = {} } = {}) {
+ const res = await fetch(url, { headers: { 'user-agent': UA, ...headers }, redirect: 'follow', signal: AbortSignal.timeout(8000) });
+ if (!res.ok) throw new Error(`${res.status} ${url}`);
+ if (json) return res.json();
+ const text = await res.text();
+ return { text: text.slice(0, 1_000_000), finalUrl: res.url };
+}
+
+function gh(pathname) {
+ const headers = { accept: 'application/vnd.github+json' };
+ if (process.env.GITHUB_TOKEN) headers.authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
+ return get(`https://api.github.com${pathname}`, { headers });
+}
+
+const ENTITIES = { amp: '&', lt: '<', gt: '>', quot: '"', apos: "'", nbsp: ' ', mdash: '—', ndash: '–', hellip: '…' };
+function decode(s) {
+ return String(s ?? '')
+ .replace(/&#x([0-9a-f]+);/gi, (_, h) => String.fromCodePoint(parseInt(h, 16)))
+ .replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(Number(d)))
+ .replace(/&([a-z]+);/gi, (m, n) => ENTITIES[n.toLowerCase()] ?? m);
+}
+function stripTags(html) {
+ return decode(String(html).replace(/<br\s*\/?>/gi, '\n').replace(/<[^>]+>/g, '')).replace(/[ \t]+/g, ' ').trim();
+}
+function clip(s, n) {
+ const t = String(s ?? '').trim();
+ return t.length > n ? `${t.slice(0, n - 1).trimEnd()}…` : t;
+}
+function safeUrl(s, base) {
+ try {
+ const u = new URL(s, base);
+ return /^https?:$/.test(u.protocol) ? u.href : undefined;
+ } catch {
+ return undefined;
+ }
+}
+
+function metaTags(html) {
+ const out = {};
+ for (const m of html.matchAll(/<meta\s+[^>]*>/gi)) {
+ const tag = m[0];
+ const key = (tag.match(/(?:property|name)\s*=\s*["']([^"']+)["']/i) ?? [])[1];
+ const val = (tag.match(/content\s*=\s*["']([^"']*)["']/i) ?? [])[1];
+ if (key && val !== undefined && !(key.toLowerCase() in out)) out[key.toLowerCase()] = decode(val);
+ }
+ return out;
+}
+
+async function unfurl(url) {
+ const { text, finalUrl } = await get(url, { json: false, headers: { accept: 'text/html' } });
+ const m = metaTags(text);
+ const title = m['og:title'] ?? m['twitter:title'] ?? stripTags((text.match(/<title[^>]*>([\s\S]*?)<\/title>/i) ?? [])[1] ?? '');
+ const icon = (text.match(/<link[^>]+rel=["'](?:shortcut )?icon["'][^>]*>/i) ?? [])[0];
+ const iconHref = icon && (icon.match(/href=["']([^"']+)["']/i) ?? [])[1];
+ return {
+ title: clip(title, 140),
+ description: clip(m['og:description'] ?? m['twitter:description'] ?? m.description, 260),
+ image: safeUrl(m['og:image'] ?? m['twitter:image'] ?? m['twitter:image:src'], finalUrl),
+ siteName: clip(m['og:site_name'], 60),
+ icon: safeUrl(iconHref ?? '/favicon.ico', finalUrl),
+ };
+}
+
+async function fetchData(url, d) {
+ switch (d.provider) {
+ case 'x': {
+ const o = await get(`https://publish.twitter.com/oembed?url=${encodeURIComponent(url)}&omit_script=1&dnt=true`);
+ const html = String(o.html ?? '');
+ const text = stripTags((html.match(/<p[^>]*>([\s\S]*?)<\/p>/i) ?? [])[1] ?? '');
+ const links = [...html.matchAll(/<a[^>]*>([\s\S]*?)<\/a>/gi)];
+ return { author: clip(o.author_name, 80), authorUrl: safeUrl(o.author_url), text: clip(text, 600), date: stripTags(links.at(-1)?.[1] ?? '') };
+ }
+ case 'youtube': {
+ const o = await get(`https://www.youtube.com/oembed?url=${encodeURIComponent(url)}&format=json`);
+ return { title: clip(o.title, 160), author: clip(o.author_name, 80) };
+ }
+ case 'vimeo': {
+ const o = await get(`https://vimeo.com/api/oembed.json?url=${encodeURIComponent(url)}`);
+ return { title: clip(o.title, 160), author: clip(o.author_name, 80), thumbnail: safeUrl(o.thumbnail_url) };
+ }
+ case 'tiktok': {
+ const o = await get(`https://www.tiktok.com/oembed?url=${encodeURIComponent(url)}`);
+ return { title: clip(o.title, 200), author: clip(o.author_name, 80), thumbnail: safeUrl(o.thumbnail_url) };
+ }
+ case 'bluesky': {
+ const o = await get(`https://embed.bsky.app/oembed?url=${encodeURIComponent(url)}`);
+ const html = String(o.html ?? '');
+ const uri = (html.match(/data-bluesky-uri="(at:\/\/[^"]+)"/) ?? [])[1];
+ const cid = (html.match(/data-bluesky-cid="([a-z0-9]+)"/) ?? [])[1];
+ const text = stripTags((html.match(/<p[^>]*>([\s\S]*?)<\/p>/i) ?? [])[1] ?? '');
+ return { uri, cid, author: clip(o.author_name, 80), text: clip(text, 600) };
+ }
+ case 'gist': {
+ const g = await gh(`/gists/${d.id}`);
+ const file = Object.values(g.files ?? {})[0] ?? {};
+ return {
+ description: clip(g.description, 200),
+ owner: g.owner?.login,
+ avatar: safeUrl(g.owner?.avatar_url),
+ filename: file.filename,
+ language: file.language,
+ files: Object.keys(g.files ?? {}).length,
+ code: String(file.content ?? '').split('\n').slice(0, 14).join('\n'),
+ };
+ }
+ case 'github':
+ return fetchGitHub(url, d.parts, d.hash);
+ case 'link':
+ return unfurl(url);
+ default:
+ return {};
+ }
+}
+
+const EXT_LANG = {
+ ts: 'typescript', tsx: 'tsx', js: 'javascript', jsx: 'jsx', mjs: 'javascript', cjs: 'javascript', py: 'python', go: 'go',
+ rs: 'rust', json: 'json', yml: 'yaml', yaml: 'yaml', md: 'markdown', mdx: 'markdown', sh: 'bash', bash: 'bash', zsh: 'bash',
+ css: 'css', html: 'markup', toml: 'toml', sql: 'sql', diff: 'diff', ps1: 'powershell', dockerfile: 'docker',
+};
+
+/** A file permalink becomes the real code: ...blob/<ref>/<path>#L10-L40 → those lines at that ref. */
+async function fetchCode(owner, repo, ref, filePath, hash) {
+ const raw = await get(`https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${filePath}`, { json: false });
+ const lines = raw.text.replace(/\r\n/g, '\n').split('\n');
+ const m = String(hash ?? '').match(/^#L(\d+)(?:-L(\d+))?/);
+ let start = m ? Number(m[1]) : 1;
+ let end = m ? Number(m[2] ?? m[1]) : Math.min(lines.length, 30);
+ if (end < start) [start, end] = [end, start];
+ end = Math.min(end, start + 79, lines.length);
+ const slice = lines.slice(start - 1, end);
+ // Remove the common indentation so a method body does not start 4 levels deep.
+ const indent = Math.min(...slice.filter((l) => l.trim()).map((l) => l.match(/^\s*/)[0].length));
+ const code = slice.map((l) => l.slice(Number.isFinite(indent) ? indent : 0)).join('\n');
+ const base = filePath.split('/').pop().toLowerCase();
+ const ext = base === 'dockerfile' ? 'dockerfile' : base.split('.').pop();
+ const out = { kind: 'code', repo: `${owner}/${repo}`, ref, path: filePath, start, end, total: lines.length, language: EXT_LANG[ext] ?? 'text', code };
+ if (/^[0-9a-f]{7,40}$/i.test(ref)) {
+ const c = await gh(`/repos/${owner}/${repo}/commits/${ref}`).catch(() => null);
+ if (c) Object.assign(out, { sha: c.sha, commitTitle: clip(String(c.commit?.message ?? '').split('\n')[0], 120), commitDate: c.commit?.committer?.date });
+ }
+ return out;
+}
+
+async function fetchCommit(owner, repo, sha) {
+ const c = await gh(`/repos/${owner}/${repo}/commits/${sha}`);
+ const [title, ...body] = String(c.commit?.message ?? '').split('\n');
+ const files = (c.files ?? []).slice().sort((a, b) => (b.changes ?? 0) - (a.changes ?? 0));
+ return {
+ kind: 'commit', repo: `${owner}/${repo}`, sha: c.sha, title: clip(title, 200),
+ body: clip(body.join(' ').replace(/Co-Authored-By:.*$/gim, '').replace(/\s+/g, ' ').trim(), 280),
+ author: c.author?.login ?? c.commit?.author?.name, avatar: safeUrl(c.author?.avatar_url), date: c.commit?.author?.date,
+ additions: c.stats?.additions, deletions: c.stats?.deletions, fileCount: (c.files ?? []).length,
+ files: files.slice(0, 5).map((f) => ({ name: f.filename, additions: f.additions, deletions: f.deletions })),
+ };
+}
+
+async function fetchGitHub(url, parts, hash) {
+ const [owner, repo, kind, ...rest] = parts;
+ if (kind === 'blob' && rest.length >= 2) return fetchCode(owner, repo, rest[0], rest.slice(1).join('/'), hash);
+ if (kind === 'commit' && /^[0-9a-f]{7,40}$/i.test(rest[0] ?? '')) return fetchCommit(owner, repo, rest[0]);
+ const og = `https://opengraph.githubassets.com/mercury/${parts.slice(0, 4).join('/')}`;
+ if (!repo) {
+ const u = await gh(`/users/${owner}`);
+ return { kind: 'user', login: u.login, name: u.name, bio: clip(u.bio, 200), avatar: safeUrl(u.avatar_url), followers: u.followers, repos: u.public_repos, type: u.type };
+ }
+ if (!kind) {
+ const r = await gh(`/repos/${owner}/${repo}`);
+ return {
+ kind: 'repo', fullName: r.full_name, description: clip(r.description, 240), stars: r.stargazers_count, forks: r.forks_count,
+ language: r.language, topics: (r.topics ?? []).slice(0, 5), avatar: safeUrl(r.owner?.avatar_url), license: r.license?.spdx_id, og,
+ };
+ }
+ if ((kind === 'issues' || kind === 'pull') && /^\d+$/.test(rest[0] ?? '')) {
+ const n = rest[0];
+ const i = await gh(`/repos/${owner}/${repo}/issues/${n}`);
+ const out = {
+ kind: i.pull_request ? 'pull' : 'issue', repo: `${owner}/${repo}`, number: Number(n), title: clip(i.title, 200),
+ state: i.state, stateReason: i.state_reason, author: i.user?.login, avatar: safeUrl(i.user?.avatar_url),
+ comments: i.comments, created: i.created_at, labels: (i.labels ?? []).slice(0, 4).map((l) => ({ name: l.name, color: /^[0-9a-f]{6}$/i.test(l.color) ? l.color : '8b949e' })),
+ };
+ if (i.pull_request) {
+ const p = await gh(`/repos/${owner}/${repo}/pulls/${n}`);
+ Object.assign(out, { merged: Boolean(p.merged_at), draft: p.draft, additions: p.additions, deletions: p.deletions, files: p.changed_files });
+ }
+ return out;
+ }
+ if (kind === 'releases' && rest[0] === 'tag' && rest[1]) {
+ const r = await gh(`/repos/${owner}/${repo}/releases/tags/${encodeURIComponent(rest.slice(1).join('/'))}`);
+ const body = String(r.body ?? '').replace(/[#*_`>]/g, '').replace(/\[([^\]]+)\]\([^)]+\)/g, '$1').replace(/\s+/g, ' ');
+ return { kind: 'release', repo: `${owner}/${repo}`, tag: r.tag_name, name: clip(r.name || r.tag_name, 160), published: r.published_at, body: clip(body, 260), prerelease: r.prerelease, avatar: safeUrl(r.author?.avatar_url) };
+ }
+ const meta = await unfurl(url).catch(() => ({}));
+ return { kind: 'page', repo: `${owner}/${repo}`, og, title: meta.title, description: meta.description };
+}
+
+async function resolve(url, d) {
+ const c = loadCache();
+ const hit = c[url];
+ if (hit && Date.now() - hit.at < TTL) return hit.data;
+ try {
+ const data = await fetchData(url, d);
+ c[url] = { at: Date.now(), data };
+ saveCache();
+ return data;
+ } catch (err) {
+ if (hit) return hit.data;
+ console.warn(`[social-embeds] no preview data for ${url}: ${err.message}`);
+ return {};
+ }
+}
+
+/* ── remark transform ────────────────────────────────────────────────── */
+
+function textOf(node) {
+ if (node.type === 'text' || node.type === 'inlineCode') return node.value;
+ return (node.children ?? []).map(textOf).join('');
+}
+
+/** The URL if this paragraph is nothing but one bare link, else null. */
+function bareLink(node) {
+ if (node.type !== 'paragraph') return null;
+ const kids = node.children.filter((c) => !(c.type === 'text' && !c.value.trim()));
+ if (kids.length !== 1 || kids[0].type !== 'link') return null;
+ const link = kids[0];
+ const label = textOf(link).trim();
+ const norm = (s) => s.replace(/^https?:\/\//, '').replace(/\/$/, '');
+ if (!/^https?:\/\//.test(link.url) || norm(label) !== norm(link.url)) return null;
+ return link.url;
+}
+
+module.exports = function remarkSocialEmbeds() {
+ return async (tree) => {
+ const jobs = [];
+ const walk = (parent) => {
+ (parent.children ?? []).forEach((node, index) => {
+ const url = bareLink(node);
+ if (url) {
+ const d = detect(url);
+ if (d) jobs.push({ parent, index, url, d });
+ return;
+ }
+ if (['blockquote', 'listItem', 'list', 'mdxJsxFlowElement'].includes(node.type)) walk(node);
+ });
+ };
+ walk(tree);
+ await Promise.all(jobs.map(async (job) => {
+ job.data = await resolve(job.url, job.d);
+ }));
+ for (const { parent, index, url, d, data } of jobs) {
+ const { provider, ...params } = d;
+ parent.children[index] = {
+ type: 'mdxJsxFlowElement',
+ name: 'SocialEmbed',
+ attributes: [
+ { type: 'mdxJsxAttribute', name: 'url', value: url },
+ { type: 'mdxJsxAttribute', name: 'provider', value: provider },
+ { type: 'mdxJsxAttribute', name: 'data', value: JSON.stringify({ ...params, ...data }) },
+ ],
+ children: [],
+ };
+ }
+ };
+};
+
+module.exports.detect = detect;
+module.exports.bareLink = bareLink;
diff --git a/website/src/components/Journal/Charts.tsx b/website/src/components/Journal/Charts.tsx
new file mode 100644
index 00000000..6f07801f
--- /dev/null
+++ b/website/src/components/Journal/Charts.tsx
@@ -0,0 +1,133 @@
+import React, { isValidElement } from 'react';
+import './charts.css';
+
+/**
+ * Data components for journal posts, usable in any post without imports
+ * (registered in src/theme/MDXComponents.tsx).
+ *
+ * <Compare highlight={2} caption="…"> wraps an ordinary Markdown table
+ * <BarChart title="…" data={[…]} /> horizontal bars, one series
+ * <Stats items={[…]} source="…" /> headline numbers
+ *
+ * Table cells that start with ✓ ◐ ✕ or ? render as yes / partial / no /
+ * unknown badges (glyph + text, never colour alone) via the Td override.
+ */
+
+/* ── comparison tables ────────────────────────────────────────────────── */
+
+const MARKS: Record<string, string> = { '✓': 'yes', '◐': 'partial', '✕': 'no', '?': 'unknown' };
+
+function leadingText(children: React.ReactNode): string {
+ const first = React.Children.toArray(children)[0];
+ if (typeof first === 'string') return first;
+ if (isValidElement<{ children?: React.ReactNode }>(first)) return leadingText(first.props.children);
+ return '';
+}
+
+/** MDX `td` override: a leading ✓ ◐ ✕ ? becomes a badge class on the cell. */
+export function Td(props: React.TdHTMLAttributes<HTMLTableCellElement>): React.ReactElement {
+ const glyph = leadingText(props.children).trimStart().charAt(0);
+ const kind = MARKS[glyph];
+ if (!kind) return <td {...props} />;
+ const kids = React.Children.toArray(props.children);
+ if (typeof kids[0] === 'string') kids[0] = (kids[0] as string).trimStart().slice(1).trimStart();
+ return (
+ <td {...props} className={`mj-cell is-${kind}${props.className ? ` ${props.className}` : ''}`}>
+ <span className="mj-mark" aria-hidden="true">{glyph}</span>
+ <span className="mj-cell-text">{kids}</span>
+ </td>
+ );
+}
+
+export function Compare({ children, caption, highlight }: { children: React.ReactNode; caption?: string; highlight?: number }): React.ReactElement {
+ return (
+ <figure className={`mj-compare${highlight ? ` hl-${highlight}` : ''}`}>
+ <div className="mj-compare-scroll" tabIndex={0} role="region" aria-label={caption ?? 'Comparison table'}>{children}</div>
+ <div className="mj-compare-legend" aria-hidden="true">
+ <span className="is-yes"><b>✓</b> Yes</span>
+ <span className="is-partial"><b>◐</b> Partly or opt-in</span>
+ <span className="is-no"><b>✕</b> No</span>
+ <span className="is-unknown"><b>?</b> Not documented</span>
+ </div>
+ {caption && <figcaption>{caption}</figcaption>}
+ </figure>
+ );
+}
+
+/* ── bar chart ───────────────────────────────────────────────────────── */
+
+interface Bar {
+ label: string;
+ value: number;
+ note?: string;
+ tone?: 'base' | 'muted' | 'warm';
+}
+
+const compact = (n: number) => new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(n);
+
+export function BarChart({ title, subtitle, data, unit = '', reference, source, max }: {
+ title: string;
+ subtitle?: string;
+ data: Bar[];
+ unit?: string;
+ reference?: { value: number; label: string };
+ source?: string;
+ max?: number;
+}): React.ReactElement {
+ const top = max ?? Math.max(...data.map((d) => d.value), reference?.value ?? 0) * 1.04;
+ const pct = (v: number) => `${Math.max(0.6, (v / top) * 100)}%`;
+ const fmt = (v: number) => `${compact(v)}${unit ? ` ${unit}` : ''}`;
+ const summary = `${title}. ${data.map((d) => `${d.label}: ${fmt(d.value)}`).join('; ')}${reference ? `; ${reference.label}: ${fmt(reference.value)}` : ''}.`;
+ return (
+ <figure className="mj-chart">
+ <header>
+ <strong>{title}</strong>
+ {subtitle && <span>{subtitle}</span>}
+ </header>
+ <div className="mj-bars" role="img" aria-label={summary}>
+ {reference && (
+ <div className="mj-ref" style={{ left: `calc(var(--mj-label-w) + (100% - var(--mj-label-w) - var(--mj-value-w)) * ${reference.value / top})` }}>
+ <span>{reference.label} · {fmt(reference.value)}</span>
+ </div>
+ )}
+ {data.map((d) => (
+ <div className={`mj-bar-row tone-${d.tone ?? 'base'}`} key={d.label} tabIndex={0}>
+ <span className="mj-bar-label">{d.label}</span>
+ <span className="mj-bar-track"><i style={{ width: pct(d.value) }} /></span>
+ <span className="mj-bar-value">{fmt(d.value)}</span>
+ {d.note && <span className="mj-bar-tip" role="tooltip">{d.label}: {fmt(d.value)}. {d.note}</span>}
+ </div>
+ ))}
+ </div>
+ <details className="mj-chart-table">
+ <summary>View as table</summary>
+ <table>
+ <thead><tr><th>Measure</th><th>Value</th><th>Note</th></tr></thead>
+ <tbody>
+ {data.map((d) => <tr key={d.label}><td>{d.label}</td><td>{d.value.toLocaleString('en-US')}{unit ? ` ${unit}` : ''}</td><td>{d.note ?? ''}</td></tr>)}
+ {reference && <tr><td>{reference.label}</td><td>{reference.value.toLocaleString('en-US')}{unit ? ` ${unit}` : ''}</td><td>Reference line</td></tr>}
+ </tbody>
+ </table>
+ </details>
+ {source && <figcaption>{source}</figcaption>}
+ </figure>
+ );
+}
+
+/* ── stat tiles ──────────────────────────────────────────────────────── */
+
+export function Stats({ items, source }: { items: { value: string; label: string }[]; source?: string }): React.ReactElement {
+ return (
+ <figure className="mj-stats">
+ <dl>
+ {items.map((s) => (
+ <div key={s.label}>
+ <dt>{s.label}</dt>
+ <dd>{s.value}</dd>
+ </div>
+ ))}
+ </dl>
+ {source && <figcaption>{source}</figcaption>}
+ </figure>
+ );
+}
diff --git a/website/src/components/Journal/JournalIndex.tsx b/website/src/components/Journal/JournalIndex.tsx
new file mode 100644
index 00000000..57f0b42d
--- /dev/null
+++ b/website/src/components/Journal/JournalIndex.tsx
@@ -0,0 +1,211 @@
+import React, { useEffect, useMemo, useState } from 'react';
+import Link from '@docusaurus/Link';
+import { searchText, type JournalPost } from './posts';
+import './journal.css';
+
+type Sort = 'newest' | 'oldest' | 'author';
+
+function readQuery(): { q: string; c: string; a: string; s: Sort } {
+ if (typeof window === 'undefined') return { q: '', c: '', a: '', s: 'newest' };
+ const p = new URLSearchParams(window.location.search);
+ const s = p.get('sort');
+ return { q: p.get('q') ?? '', c: p.get('category') ?? '', a: p.get('author') ?? '', s: s === 'oldest' || s === 'author' ? s : 'newest' };
+}
+
+function writeQuery(q: string, c: string, a: string, s: Sort): void {
+ if (typeof window === 'undefined') return;
+ const p = new URLSearchParams();
+ if (q) p.set('q', q);
+ if (c) p.set('category', c);
+ if (a) p.set('author', a);
+ if (s !== 'newest') p.set('sort', s);
+ const qs = p.toString();
+ window.history.replaceState(null, '', `${window.location.pathname}${qs ? `?${qs}` : ''}`);
+}
+
+export function PostMeta({ post, showAuthors = true }: { post: JournalPost; showAuthors?: boolean }): React.ReactElement {
+ return (
+ <div className="mj-meta">
+ {post.category && <span className="mj-meta-cat">{post.category.label}</span>}
+ <time dateTime={post.date}>{post.formattedDate}</time>
+ <span aria-hidden="true">·</span>
+ <span>{post.readingMinutes} min read</span>
+ {showAuthors && post.authors.length > 0 && (
+ <>
+ <span aria-hidden="true">·</span>
+ <span>{post.authors.map((a) => a.name).join(', ')}</span>
+ </>
+ )}
+ </div>
+ );
+}
+
+function Cover({ post, eager = false }: { post: JournalPost; eager?: boolean }): React.ReactElement {
+ return post.image ? (
+ <img className="mj-cover" src={post.image} alt="" loading={eager ? 'eager' : 'lazy'} decoding="async" />
+ ) : (
+ <div className="mj-cover mj-cover-fallback" aria-hidden="true" />
+ );
+}
+
+function Card({ post }: { post: JournalPost }): React.ReactElement {
+ return (
+ <article className="mj-card">
+ <Link to={post.permalink} className="mj-card-link">
+ <div className="mj-card-media"><Cover post={post} /></div>
+ <div className="mj-card-body">
+ <PostMeta post={post} showAuthors={false} />
+ <h3 className="mj-card-title">{post.title}</h3>
+ <p className="mj-card-desc">{post.description}</p>
+ {post.authors.length > 0 && (
+ <div className="mj-byline">
+ {post.authors.map((a) => (
+ <span key={a.key ?? a.name} className="mj-byline-author">
+ {a.imageURL && <img src={a.imageURL} alt="" width={22} height={22} loading="lazy" />}
+ {a.name}
+ </span>
+ ))}
+ </div>
+ )}
+ </div>
+ </Link>
+ </article>
+ );
+}
+
+export interface JournalIndexProps {
+ posts: JournalPost[];
+ /** Eyebrow + heading for filtered archives (tag or author pages). */
+ eyebrow?: string;
+ heading?: string;
+ intro?: string;
+ /** Archives hide the featured slot and the category row. */
+ archive?: boolean;
+}
+
+export default function JournalIndex({ posts, eyebrow = 'Mercury Journal', heading, intro, archive = false }: JournalIndexProps): React.ReactElement {
+ const initial = useMemo(readQuery, []);
+ const [query, setQuery] = useState(initial.q);
+ const [category, setCategory] = useState(initial.c);
+ const [author, setAuthor] = useState(initial.a);
+ const [sort, setSort] = useState<Sort>(initial.s);
+
+ useEffect(() => writeQuery(query, category, author, sort), [query, category, author, sort]);
+
+ const categories = useMemo(() => {
+ const seen = new Map<string, number>();
+ for (const p of posts) if (p.category) seen.set(p.category.label, (seen.get(p.category.label) ?? 0) + 1);
+ return [...seen.entries()].sort((a, b) => b[1] - a[1]).map(([label]) => label);
+ }, [posts]);
+
+ const authors = useMemo(() => {
+ const seen = new Map<string, { name: string; imageURL?: string; count: number }>();
+ for (const p of posts) for (const a of p.authors) {
+ const cur = seen.get(a.name) ?? { name: a.name, imageURL: a.imageURL, count: 0 };
+ cur.count++;
+ seen.set(a.name, cur);
+ }
+ return [...seen.values()].sort((a, b) => b.count - a.count || a.name.localeCompare(b.name));
+ }, [posts]);
+
+ const filtering = query.trim() !== '' || category !== '' || author !== '';
+ const featured = !archive && !filtering ? posts.find((p) => p.featured) ?? posts[0] : undefined;
+
+ const visible = useMemo(() => {
+ const terms = query.toLowerCase().split(/\s+/).filter(Boolean);
+ const list = posts.filter((p) => {
+ if (featured && p.permalink === featured.permalink) return false;
+ if (category && p.category?.label !== category) return false;
+ if (author && !p.authors.some((a) => a.name === author)) return false;
+ if (terms.length === 0) return true;
+ const hay = searchText(p);
+ return terms.every((t) => hay.includes(t));
+ });
+ const byDate = (a: JournalPost, b: JournalPost) => b.date.localeCompare(a.date);
+ if (sort === 'oldest') return list.sort((a, b) => a.date.localeCompare(b.date));
+ if (sort === 'author') return list.sort((a, b) => (a.authors[0]?.name ?? '').localeCompare(b.authors[0]?.name ?? '') || byDate(a, b));
+ return list.sort(byDate);
+ }, [posts, featured, query, category, author, sort]);
+
+ return (
+ <main className="mj-page">
+ <header className="mj-hero">
+ <p className="mj-eyebrow">{eyebrow}</p>
+ <h1 className="mj-hero-title">{heading ?? 'News, engineering notes and field reports from the people building Mercury.'}</h1>
+ {intro && <p className="mj-hero-intro">{intro}</p>}
+ <div className="mj-search" role="search">
+ <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path fill="currentColor" d="M10 4a6 6 0 1 0 3.87 10.59l4.27 4.27 1.41-1.41-4.27-4.27A6 6 0 0 0 10 4Zm0 2a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z" /></svg>
+ <input
+ type="search"
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ placeholder="Search posts, topics and authors"
+ aria-label="Search the journal"
+ />
+ </div>
+ </header>
+
+ {featured && (
+ <section className="mj-featured" aria-label="Featured">
+ <Link to={featured.permalink} className="mj-featured-link">
+ <Cover post={featured} eager />
+ <div className="mj-featured-body">
+ <PostMeta post={featured} />
+ <h2 className="mj-featured-title">{featured.title}</h2>
+ <p className="mj-featured-desc">{featured.description}</p>
+ <span className="mj-readmore">Read the post <span aria-hidden="true">→</span></span>
+ </div>
+ </Link>
+ </section>
+ )}
+
+ <section className="mj-controls" aria-label="Filter and sort">
+ {!archive && categories.length > 1 && (
+ <div className="mj-chips" role="tablist" aria-label="Category">
+ <button type="button" role="tab" aria-selected={category === ''} className={category === '' ? 'is-on' : ''} onClick={() => setCategory('')}>All</button>
+ {categories.map((c) => (
+ <button key={c} type="button" role="tab" aria-selected={category === c} className={category === c ? 'is-on' : ''} onClick={() => setCategory(category === c ? '' : c)}>{c}</button>
+ ))}
+ </div>
+ )}
+ <div className="mj-controls-right">
+ {!archive && authors.length > 1 && (
+ <label className="mj-select">
+ <span>Author</span>
+ <select value={author} onChange={(e) => setAuthor(e.target.value)}>
+ <option value="">Everyone</option>
+ {authors.map((a) => <option key={a.name} value={a.name}>{a.name} ({a.count})</option>)}
+ </select>
+ </label>
+ )}
+ <label className="mj-select">
+ <span>Sort</span>
+ <select value={sort} onChange={(e) => setSort(e.target.value as Sort)}>
+ <option value="newest">Newest</option>
+ <option value="oldest">Oldest</option>
+ <option value="author">By author</option>
+ </select>
+ </label>
+ </div>
+ </section>
+
+ {visible.length > 0 ? (
+ <section className="mj-grid" aria-label="Posts">
+ {visible.map((p) => <Card key={p.permalink} post={p} />)}
+ </section>
+ ) : (
+ <p className="mj-empty">
+ Nothing matches {query ? <>“{query}”</> : 'those filters'}.{' '}
+ <button type="button" onClick={() => { setQuery(''); setCategory(''); setAuthor(''); }}>Clear filters</button>
+ </p>
+ )}
+
+ <footer className="mj-index-foot">
+ <a href="/blog/rss.xml">RSS</a>
+ <a href="/blog/atom.xml">Atom</a>
+ <a href="/blog/feed.json">JSON Feed</a>
+ <a href="/llms.txt">llms.txt</a>
+ </footer>
+ </main>
+ );
+}
diff --git a/website/src/components/Journal/ReadingProgress.tsx b/website/src/components/Journal/ReadingProgress.tsx
new file mode 100644
index 00000000..d18a4332
--- /dev/null
+++ b/website/src/components/Journal/ReadingProgress.tsx
@@ -0,0 +1,92 @@
+import React, { useEffect, useState, type RefObject } from 'react';
+
+interface Progress {
+ ratio: number;
+ minutesLeft: number;
+ started: boolean;
+ activeId: string | null;
+}
+
+/**
+ * Tracks how far the reader is through `target` (the article body): a 0-1
+ * ratio, an estimate of minutes left based on the post's reading time, and
+ * the heading currently in view for the table of contents.
+ */
+export function useReadingProgress(target: RefObject<HTMLElement | null>, totalMinutes: number): Progress {
+ const [state, setState] = useState<Progress>({ ratio: 0, minutesLeft: totalMinutes, started: false, activeId: null });
+
+ useEffect(() => {
+ const el = target.current;
+ if (!el) return undefined;
+ let frame = 0;
+ const update = () => {
+ frame = 0;
+ const rect = el.getBoundingClientRect();
+ const span = rect.height - window.innerHeight * 0.6;
+ const ratio = span <= 0 ? 1 : Math.min(1, Math.max(0, -rect.top / span));
+ const headings = el.querySelectorAll<HTMLElement>('h2[id], h3[id]');
+ let activeId: string | null = null;
+ for (const hd of headings) {
+ if (hd.getBoundingClientRect().top < 140) activeId = hd.id;
+ else break;
+ }
+ setState({
+ ratio,
+ minutesLeft: Math.max(0, Math.ceil(totalMinutes * (1 - ratio))),
+ started: rect.top < 0,
+ activeId,
+ });
+ };
+ const onScroll = () => {
+ if (!frame) frame = requestAnimationFrame(update);
+ };
+ update();
+ window.addEventListener('scroll', onScroll, { passive: true });
+ window.addEventListener('resize', onScroll);
+ return () => {
+ window.removeEventListener('scroll', onScroll);
+ window.removeEventListener('resize', onScroll);
+ if (frame) cancelAnimationFrame(frame);
+ };
+ }, [target, totalMinutes]);
+
+ return state;
+}
+
+export function leftLabel(p: Progress): string {
+ if (p.ratio >= 0.995) return 'Finished';
+ if (p.minutesLeft <= 1) return 'Under a minute left';
+ return `${p.minutesLeft} min left`;
+}
+
+/** Thin bar pinned to the top of the viewport, plus a mobile pill. */
+export function ProgressBar({ progress }: { progress: Progress }): React.ReactElement {
+ const pct = Math.round(progress.ratio * 100);
+ return (
+ <>
+ <div
+ className="mj-progress"
+ role="progressbar"
+ aria-label="Reading progress"
+ aria-valuemin={0}
+ aria-valuemax={100}
+ aria-valuenow={pct}
+ >
+ <span style={{ transform: `scaleX(${progress.ratio})` }} />
+ </div>
+ <button
+ type="button"
+ className={`mj-progress-pill${progress.started ? ' is-on' : ''}`}
+ onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
+ aria-label={`${leftLabel(progress)}. Back to top`}
+ tabIndex={progress.started ? 0 : -1}
+ >
+ <svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true">
+ <circle cx="10" cy="10" r="8" className="mj-ring-bg" />
+ <circle cx="10" cy="10" r="8" className="mj-ring" style={{ strokeDashoffset: 50.27 * (1 - progress.ratio) }} />
+ </svg>
+ <span>{leftLabel(progress)}</span>
+ </button>
+ </>
+ );
+}
diff --git a/website/src/components/Journal/SocialEmbed.tsx b/website/src/components/Journal/SocialEmbed.tsx
new file mode 100644
index 00000000..5963d69f
--- /dev/null
+++ b/website/src/components/Journal/SocialEmbed.tsx
@@ -0,0 +1,539 @@
+import React, { useEffect, useRef, useState } from 'react';
+import { useColorMode } from '@docusaurus/theme-common';
+import CodeBlock from '@theme/CodeBlock';
+import './embeds.css';
+
+/**
+ * Rich previews for bare links in journal posts. The remark plugin
+ * (plugins/remark-social-embeds.cjs) detects the provider and fetches
+ * metadata at build time; this component renders a static card from that
+ * data (so search engines and no-JS readers get real content) and, once the
+ * card scrolls near the viewport, swaps in the platform's own widget where
+ * one exists. If a widget script is blocked, the static card stays.
+ */
+
+type Data = Record<string, any>;
+interface Props {
+ url: string;
+ provider: string;
+ data?: string;
+}
+
+/* ── helpers ─────────────────────────────────────────────────────────── */
+
+const scripts = new Map<string, Promise<void>>();
+function loadScript(src: string, fresh = false): Promise<void> {
+ if (fresh) {
+ document.querySelectorAll(`script[src="${src}"]`).forEach((s) => s.remove());
+ scripts.delete(src);
+ }
+ if (!scripts.has(src)) {
+ scripts.set(src, new Promise<void>((resolve, reject) => {
+ const s = document.createElement('script');
+ s.src = src;
+ s.async = true;
+ s.onload = () => resolve();
+ s.onerror = () => {
+ scripts.delete(src);
+ reject(new Error(`blocked: ${src}`));
+ };
+ document.body.appendChild(s);
+ }));
+ }
+ return scripts.get(src)!;
+}
+
+function useNearViewport<T extends HTMLElement>(): [React.RefObject<T | null>, boolean] {
+ const ref = useRef<T>(null);
+ const [near, setNear] = useState(false);
+ useEffect(() => {
+ const el = ref.current;
+ if (!el || near) return undefined;
+ if (!('IntersectionObserver' in window)) {
+ setNear(true);
+ return undefined;
+ }
+ const io = new IntersectionObserver((entries) => {
+ if (entries.some((e) => e.isIntersecting)) {
+ setNear(true);
+ io.disconnect();
+ }
+ }, { rootMargin: '600px 0px' });
+ io.observe(el);
+ return () => io.disconnect();
+ }, [near]);
+ return [ref, near];
+}
+
+/** Fires once a widget has rendered: its iframe loaded and sized itself (the platforms set style.height when content is ready), original blockquote gone. */
+function whenRendered(el: HTMLElement, onReady: () => void): () => void {
+ let tries = 0;
+ const loaded = new WeakSet<EventTarget>();
+ const onLoad = (e: Event) => loaded.add(e.target as EventTarget);
+ el.addEventListener('load', onLoad, true);
+ const stop = () => {
+ window.clearInterval(timer);
+ el.removeEventListener('load', onLoad, true);
+ };
+ const timer = window.setInterval(() => {
+ tries += 1;
+ const frame = el.querySelector('iframe');
+ if (frame && loaded.has(frame) && parseFloat(frame.style.height) > 80 && !el.querySelector('blockquote')) {
+ stop();
+ onReady();
+ } else if (tries > 80) {
+ stop();
+ }
+ }, 250);
+ return stop;
+}
+
+const compact = (n?: number) => (typeof n === 'number' ? new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(n) : '');
+const day = (iso?: string) => (iso ? new Date(iso).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) : '');
+const host = (u: string) => {
+ try {
+ return new URL(u).hostname.replace(/^www\./, '');
+ } catch {
+ return u;
+ }
+};
+
+/* ── brand marks (inline so nothing loads until needed) ──────────────── */
+
+const Icon = {
+ x: <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.9 2H22l-6.8 7.8L23 22h-6.2l-4.8-6.3L6.4 22H3.3l7.3-8.3L1 2h6.3l4.4 5.8L18.9 2Zm-1.1 18h1.7L6.3 3.9H4.5L17.8 20Z" /></svg>,
+ github: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38v-1.33c-2.23.48-2.7-1.07-2.7-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.88.87 2.33.66.07-.52.28-.87.5-1.07-1.78-.2-3.65-.89-3.65-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.2c0 .21.15.46.55.38A8 8 0 0 0 16 8c0-4.42-3.58-8-8-8Z" /></svg>,
+ instagram: <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M12 2.2c3.2 0 3.6 0 4.8.1 3.3.1 4.8 1.7 4.9 4.9.1 1.3.1 1.6.1 4.8s0 3.6-.1 4.8c-.1 3.2-1.7 4.8-4.9 4.9-1.3.1-1.6.1-4.8.1s-3.6 0-4.8-.1c-3.3-.1-4.8-1.7-4.9-4.9C2.2 15.6 2.2 15.2 2.2 12s0-3.6.1-4.8C2.4 3.9 3.9 2.4 7.2 2.3 8.4 2.2 8.8 2.2 12 2.2Zm0 4.9a4.9 4.9 0 1 0 0 9.8 4.9 4.9 0 0 0 0-9.8Zm0 8.1a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 0 1 0 6.4Zm5.1-9.4a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Z" /></svg>,
+ youtube: <svg viewBox="0 0 68 48" aria-hidden="true"><path fill="#f00" d="M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3Z" /><path fill="#fff" d="m27 34.3 17.8-10.3L27 13.7v20.6Z" /></svg>,
+ play: <svg viewBox="0 0 48 48" aria-hidden="true"><circle cx="24" cy="24" r="24" fill="rgba(0,0,0,.6)" /><path fill="#fff" d="m19 15 15 9-15 9z" /></svg>,
+ bluesky: <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M5.2 3.5C7.9 5.5 10.8 9.6 12 12c1.2-2.4 4.1-6.5 6.8-8.5 2-1.4 5.2-2.6 5.2 1 0 .7-.4 6-.7 6.8-.9 3-4 3.8-6.8 3.3 4.9.8 6.1 3.6 3.4 6.3-5.1 5.2-7.3-1.3-7.9-3l-.1-.3-.1.3c-.6 1.7-2.8 8.2-7.9 3-2.7-2.7-1.5-5.5 3.4-6.3-2.8.5-5.9-.3-6.8-3.3C.4 10.5 0 5.2 0 4.5c0-3.6 3.2-2.4 5.2-1Z" /></svg>,
+ link: <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" d="M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1" /></svg>,
+ star: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 .25a.75.75 0 0 1 .67.42l1.88 3.8 4.2.61a.75.75 0 0 1 .41 1.28l-3.04 2.96.72 4.18a.75.75 0 0 1-1.09.79L8 12.32l-3.75 1.97a.75.75 0 0 1-1.09-.79l.72-4.18L.84 6.36a.75.75 0 0 1 .41-1.28l4.2-.61L7.33.67A.75.75 0 0 1 8 .25Z" /></svg>,
+ fork: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M5 5.37v.25A2.25 2.25 0 0 0 7.25 7.9h1.5A2.25 2.25 0 0 0 11 5.62v-.25a2.25 2.25 0 1 1 1.5 0v.25a3.75 3.75 0 0 1-3.75 3.75h-.5v1.26a2.25 2.25 0 1 1-1.5 0V9.37h-.5A3.75 3.75 0 0 1 3.5 5.62v-.25a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.75 12.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z" /></svg>,
+ open: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" /><path fill="currentColor" d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z" /></svg>,
+ pr: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M1.5 3.25a2.25 2.25 0 1 1 3 2.12v5.26a2.25 2.25 0 1 1-1.5 0V5.37A2.25 2.25 0 0 1 1.5 3.25Zm5.68-1.03L9.25 0v1.5h1.5a2.75 2.75 0 0 1 2.75 2.75v6.38a2.25 2.25 0 1 1-1.5 0V4.25c0-.69-.56-1.25-1.25-1.25h-1.5v1.5L7.18 2.43a.25.25 0 0 1 0-.21ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z" /></svg>,
+ merged: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M5.45 5.15A2.25 2.25 0 1 0 4 5.37v5.26a2.25 2.25 0 1 0 1.5 0V8.05A4.48 4.48 0 0 0 9 9.75h1.13a2.25 2.25 0 1 0 0-1.5H9a3 3 0 0 1-2.95-2.47l-.6-.63ZM4.75 2.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm0 9.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm7.5-3a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z" /></svg>,
+ closed: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z" /></svg>,
+ tag: <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M1 7.78V2.75C1 1.78 1.78 1 2.75 1h5.03c.46 0 .9.18 1.23.51l5.75 5.75a1.75 1.75 0 0 1 0 2.47l-5.03 5.03a1.75 1.75 0 0 1-2.47 0L1.5 9.01A1.73 1.73 0 0 1 1 7.78Zm1.5 0c0 .07.03.13.07.18l5.75 5.75a.25.25 0 0 0 .35 0l5.03-5.03a.25.25 0 0 0 0-.35L7.96 2.57a.25.25 0 0 0-.18-.07H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" /></svg>,
+};
+
+const LANG_COLORS: Record<string, string> = {
+ TypeScript: '#3178c6', JavaScript: '#f1e05a', Python: '#3572A5', Go: '#00ADD8', Rust: '#dea584', Shell: '#89e051',
+ Swift: '#F05138', Kotlin: '#A97BFF', Java: '#b07219', 'C++': '#f34b7d', C: '#555555', Ruby: '#701516', HTML: '#e34c26', CSS: '#563d7c', MDX: '#fcb32c',
+};
+
+function Frame({ provider, url, children, label }: { provider: string; url: string; children: React.ReactNode; label?: string }) {
+ return (
+ <figure className={`mj-embed mj-embed--${provider}`} data-provider={provider}>
+ {children}
+ {label && (
+ <figcaption>
+ <a href={url} target="_blank" rel="noopener noreferrer">{label}</a>
+ </figcaption>
+ )}
+ </figure>
+ );
+}
+
+/* ── X / Twitter ─────────────────────────────────────────────────────── */
+
+function XPost({ url, d }: { url: string; d: Data }) {
+ const { colorMode } = useColorMode();
+ const [ref, near] = useNearViewport<HTMLDivElement>();
+ const hostEl = useRef<HTMLDivElement>(null);
+ const [live, setLive] = useState(false);
+ useEffect(() => {
+ if (!near || !hostEl.current) return undefined;
+ let cancelled = false;
+ const el = hostEl.current;
+ el.innerHTML = '';
+ setLive(false);
+ const stop = whenRendered(el, () => {
+ if (!cancelled) setLive(true);
+ });
+ loadScript('https://platform.twitter.com/widgets.js')
+ .then(() => (window as any).twttr?.widgets?.createTweet(d.id, el, { theme: colorMode, dnt: true, align: 'center', conversation: 'none' }))
+ .catch(() => undefined);
+ return () => {
+ cancelled = true;
+ stop();
+ };
+ }, [near, colorMode, d.id]);
+ const handle = d.handle && d.handle !== 'i' ? `@${d.handle}` : '';
+ return (
+ <Frame provider="x" url={url}>
+ <div ref={ref}>
+ <div ref={hostEl} className={live ? 'mj-embed-live' : 'mj-embed-staging'} aria-hidden={!live} />
+ {!live && (
+ <a className="mj-ecard mj-social" href={url} target="_blank" rel="noopener noreferrer">
+ <header>
+ <span className="mj-social-who"><strong>{d.author || handle || 'Post on X'}</strong>{d.author && handle && <span>{handle}</span>}</span>
+ <span className="mj-brand mj-brand--x">{Icon.x}</span>
+ </header>
+ {d.text ? <p className="mj-social-text">{d.text}</p> : <p className="mj-social-text is-dim">View this post on X</p>}
+ <footer>{d.date || host(url)}</footer>
+ </a>
+ )}
+ </div>
+ </Frame>
+ );
+}
+
+/* ── Instagram, Bluesky, TikTok: blockquote + official script ────────── */
+
+function ScriptEmbed({ url, provider, d, markup, script, fresh, rescan, fallback }: {
+ url: string; provider: string; d: Data; markup: string | null; script: string; fresh?: boolean; rescan?: () => void; fallback: React.ReactNode;
+}) {
+ const [ref, near] = useNearViewport<HTMLDivElement>();
+ const hostRef = useRef<HTMLDivElement>(null);
+ const [live, setLive] = useState(false);
+ const opts = useRef({ markup, script, fresh, rescan });
+ useEffect(() => {
+ const el = hostRef.current;
+ const { markup: html, script: src, fresh: reload, rescan: scan } = opts.current;
+ if (!near || !el || !html) return undefined;
+ el.innerHTML = html;
+ const stop = whenRendered(el, () => setLive(true));
+ loadScript(src, reload).then(() => scan?.()).catch(() => undefined);
+ return stop;
+ }, [near]);
+ return (
+ <Frame provider={provider} url={url}>
+ <div ref={ref}>
+ <div ref={hostRef} className={live ? 'mj-embed-live' : 'mj-embed-staging'} aria-hidden={!live} />
+ {!live && fallback}
+ </div>
+ </Frame>
+ );
+}
+
+const esc = (s: string) => s.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
+
+function Instagram({ url, d }: { url: string; d: Data }) {
+ const permalink = `https://www.instagram.com/${d.kind ?? 'p'}/${d.id}/`;
+ const markup = `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${esc(permalink)}?utm_source=ig_embed" data-instgrm-version="14" style="margin:0 auto;max-width:540px;min-width:280px;width:100%"><a href="${esc(permalink)}">View on Instagram</a></blockquote>`;
+ return (
+ <ScriptEmbed
+ url={url} provider="instagram" d={d} markup={markup} script="https://www.instagram.com/embed.js"
+ rescan={() => (window as any).instgrm?.Embeds?.process()}
+ fallback={(
+ <a className="mj-ecard mj-social mj-social--ig" href={url} target="_blank" rel="noopener noreferrer">
+ <header><span className="mj-social-who"><strong>Instagram</strong><span>{d.kind === 'reel' ? 'Reel' : 'Post'}</span></span><span className="mj-brand mj-brand--ig">{Icon.instagram}</span></header>
+ <p className="mj-social-text is-dim">View this {d.kind === 'reel' ? 'reel' : 'post'} on Instagram</p>
+ <footer>instagram.com</footer>
+ </a>
+ )}
+ />
+ );
+}
+
+function Bluesky({ url, d }: { url: string; d: Data }) {
+ const markup = d.uri && d.cid
+ ? `<blockquote class="bluesky-embed" data-bluesky-uri="${esc(d.uri)}" data-bluesky-cid="${esc(d.cid)}"><p>${esc(d.text ?? '')}</p></blockquote>`
+ : null;
+ return (
+ <ScriptEmbed
+ url={url} provider="bluesky" d={d} markup={markup} script="https://embed.bsky.app/static/embed.js"
+ rescan={() => (window as any).bluesky?.scan?.()}
+ fallback={(
+ <a className="mj-ecard mj-social" href={url} target="_blank" rel="noopener noreferrer">
+ <header><span className="mj-social-who"><strong>{d.author || `@${d.handle}`}</strong><span>@{d.handle}</span></span><span className="mj-brand mj-brand--bsky">{Icon.bluesky}</span></header>
+ <p className={`mj-social-text${d.text ? '' : ' is-dim'}`}>{d.text || 'View this post on Bluesky'}</p>
+ <footer>bsky.app</footer>
+ </a>
+ )}
+ />
+ );
+}
+
+function TikTok({ url, d }: { url: string; d: Data }) {
+ const markup = `<blockquote class="tiktok-embed" cite="${esc(url)}" data-video-id="${esc(d.id)}" style="max-width:605px;min-width:325px;margin:0 auto"><section><a href="${esc(url)}">TikTok</a></section></blockquote>`;
+ return (
+ <ScriptEmbed
+ url={url} provider="tiktok" d={d} markup={markup} script="https://www.tiktok.com/embed.js" fresh
+ fallback={<LinkCard url={url} d={{ title: d.title || 'Video on TikTok', description: d.author ? `@${d.handle} · ${d.author}` : `@${d.handle}`, image: d.thumbnail, siteName: 'TikTok' }} />}
+ />
+ );
+}
+
+/* ── video: click-to-play facades ─────────────────────────────────────── */
+
+function VideoFacade({ url, provider, thumb, title, author, iframe, vertical }: {
+ url: string; provider: string; thumb?: string; title?: string; author?: string; iframe: string; vertical?: boolean;
+}) {
+ const [playing, setPlaying] = useState(false);
+ const site = provider === 'youtube' ? 'YouTube' : provider === 'vimeo' ? 'Vimeo' : host(url);
+ const label = `${author ? `${author} · ` : ''}Watch on ${site}`;
+ return (
+ <Frame provider={provider} url={url} label={label}>
+ <div className={`mj-video${vertical ? ' is-vertical' : ''}`}>
+ {playing ? (
+ <iframe src={iframe} title={title ?? 'Video'} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen referrerPolicy="strict-origin-when-cross-origin" />
+ ) : (
+ <button type="button" onClick={() => setPlaying(true)} aria-label={`Play: ${title ?? 'video'}`}>
+ {thumb && <img src={thumb} alt="" loading="lazy" decoding="async" />}
+ {title && <span className="mj-video-title">{title}</span>}
+ <span className="mj-video-play">{provider === 'youtube' ? Icon.youtube : Icon.play}</span>
+ </button>
+ )}
+ </div>
+ </Frame>
+ );
+}
+
+/* ── GitHub ──────────────────────────────────────────────────────────── */
+
+function GitHub({ url, d }: { url: string; d: Data }) {
+ const parts: string[] = d.parts ?? [];
+ const repo = d.fullName ?? d.repo ?? parts.slice(0, 2).join('/');
+ const [owner, name] = String(repo).split('/');
+
+ if (d.kind === 'code') {
+ const sha = String(d.sha ?? d.ref ?? '');
+ const isSha = /^[0-9a-f]{7,40}$/i.test(sha);
+ const lines = d.start === d.end ? `L${d.start}` : `L${d.start}–${d.end}`;
+ return (
+ <figure className="mj-embed mj-embed--github mj-gh-code" data-provider="github">
+ <header className="mj-gh mj-gh-code-head">
+ <span className="mj-gh-mark">{Icon.github}</span>
+ <a href={`https://github.com/${repo}`} target="_blank" rel="noopener noreferrer" className="mj-gh-code-repo">{repo}</a>
+ <span className={`mj-gh-ref${isSha ? ' is-sha' : ''}`} title={isSha ? `Pinned to commit ${sha}` : `Branch or tag ${sha}`}>{isSha ? '@ ' : ''}{isSha ? sha.slice(0, 7) : sha}</span>
+ <a className="mj-gh-code-link" href={url} target="_blank" rel="noopener noreferrer">View on GitHub ↗</a>
+ </header>
+ <CodeBlock language={d.language ?? 'text'} title={`${d.path} · ${lines}`} showLineNumbers={d.start ?? 1}>{String(d.code ?? '')}</CodeBlock>
+ {d.commitTitle && (
+ <figcaption className="mj-gh-code-foot">
+ At <a href={`https://github.com/${repo}/commit/${sha}`} target="_blank" rel="noopener noreferrer"><code>{sha.slice(0, 7)}</code></a> · {d.commitTitle}{d.commitDate ? ` · ${day(d.commitDate)}` : ''}
+ </figcaption>
+ )}
+ </figure>
+ );
+ }
+
+ if (d.kind === 'commit') {
+ const max = Math.max(1, ...((d.files ?? []) as Array<{ additions: number; deletions: number }>).map((f) => f.additions + f.deletions));
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh mj-gh-commit" href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-gh-repo"><span className="mj-gh-mark">{Icon.github}</span>{repo}<span className="mj-gh-ref is-sha">{String(d.sha ?? '').slice(0, 7)}</span></div>
+ <strong className="mj-gh-title mj-gh-commit-title">{d.title}</strong>
+ {d.body && <p className="mj-gh-desc">{d.body}</p>}
+ <div className="mj-gh-meta">
+ {d.avatar && <img src={d.avatar} alt="" width={18} height={18} loading="lazy" />}
+ {d.author && <span><b>{d.author}</b> committed {day(d.date)}</span>}
+ {typeof d.fileCount === 'number' && <span>{d.fileCount} file{d.fileCount === 1 ? '' : 's'} changed</span>}
+ {typeof d.additions === 'number' && <span className="mj-gh-diff"><ins>+{compact(d.additions)}</ins> <del>−{compact(d.deletions)}</del></span>}
+ </div>
+ {d.files?.length > 0 && (
+ <ul className="mj-gh-files">
+ {(d.files as Array<{ name: string; additions: number; deletions: number }>).map((f) => (
+ <li key={f.name}>
+ <code>{f.name}</code>
+ <span className="mj-gh-bar" aria-label={`${f.additions} added, ${f.deletions} removed`}>
+ <i className="is-add" style={{ width: `${(f.additions / max) * 100}%` }} />
+ <i className="is-del" style={{ width: `${(f.deletions / max) * 100}%` }} />
+ </span>
+ <span className="mj-gh-diff"><ins>+{f.additions}</ins> <del>−{f.deletions}</del></span>
+ </li>
+ ))}
+ </ul>
+ )}
+ </a>
+ </Frame>
+ );
+ }
+
+ if (d.kind === 'issue' || d.kind === 'pull') {
+ const state = d.kind === 'pull' ? (d.merged ? 'merged' : d.draft ? 'draft' : d.state) : d.state === 'closed' && d.stateReason === 'not_planned' ? 'not-planned' : d.state;
+ const icon = d.kind === 'pull' ? (d.merged ? Icon.merged : Icon.pr) : d.state === 'closed' ? Icon.closed : Icon.open;
+ const stateLabel = { open: 'Open', closed: 'Closed', merged: 'Merged', draft: 'Draft', 'not-planned': 'Closed' }[state as string] ?? 'Open';
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh" href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-gh-repo"><span className="mj-gh-mark">{Icon.github}</span>{repo}<span className="mj-gh-num">#{d.number ?? parts[3]}</span></div>
+ <div className="mj-gh-title-row">
+ <span className={`mj-gh-state is-${state}`}>{icon}{stateLabel}</span>
+ <strong className="mj-gh-title">{d.title ?? `${d.kind === 'pull' ? 'Pull request' : 'Issue'} #${parts[3]}`}</strong>
+ </div>
+ {d.labels?.length > 0 && (
+ <div className="mj-gh-labels">
+ {d.labels.map((l: { name: string; color: string }) => (
+ <span key={l.name} style={{ ['--l' as string]: `#${l.color}` }}>{l.name}</span>
+ ))}
+ </div>
+ )}
+ <div className="mj-gh-meta">
+ {d.avatar && <img src={d.avatar} alt="" width={18} height={18} loading="lazy" />}
+ {d.author && <span><b>{d.author}</b> opened {day(d.created)}</span>}
+ {typeof d.comments === 'number' && <span>{d.comments} comment{d.comments === 1 ? '' : 's'}</span>}
+ {typeof d.additions === 'number' && <span className="mj-gh-diff"><ins>+{compact(d.additions)}</ins> <del>−{compact(d.deletions)}</del></span>}
+ </div>
+ </a>
+ </Frame>
+ );
+ }
+
+ if (d.kind === 'release') {
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh" href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-gh-repo"><span className="mj-gh-mark">{Icon.github}</span>{repo}</div>
+ <div className="mj-gh-title-row">
+ <span className="mj-gh-state is-release">{Icon.tag}{d.tag}</span>
+ <strong className="mj-gh-title">{d.name}</strong>
+ {d.prerelease && <span className="mj-gh-pill">Pre-release</span>}
+ </div>
+ {d.body && <p className="mj-gh-desc">{d.body}</p>}
+ <div className="mj-gh-meta">{d.published && <span>Released {day(d.published)}</span>}</div>
+ </a>
+ </Frame>
+ );
+ }
+
+ if (d.kind === 'user') {
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh mj-gh-user" href={url} target="_blank" rel="noopener noreferrer">
+ {d.avatar && <img src={d.avatar} alt="" width={64} height={64} loading="lazy" className={d.type === 'Organization' ? 'is-org' : ''} />}
+ <div>
+ <div className="mj-gh-title-row"><strong className="mj-gh-title">{d.name || d.login}</strong><span className="mj-gh-dim">{d.login}</span></div>
+ {d.bio && <p className="mj-gh-desc">{d.bio}</p>}
+ <div className="mj-gh-meta">
+ <span className="mj-gh-mark">{Icon.github}</span>
+ {typeof d.followers === 'number' && <span><b>{compact(d.followers)}</b> followers</span>}
+ {typeof d.repos === 'number' && <span><b>{compact(d.repos)}</b> repositories</span>}
+ </div>
+ </div>
+ </a>
+ </Frame>
+ );
+ }
+
+ if (d.kind === 'repo') {
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh mj-gh-repo-card" href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-gh-body">
+ <div className="mj-gh-repo is-big"><span className="mj-gh-mark">{Icon.github}</span><span className="mj-gh-dim">{owner}/</span><b>{name}</b></div>
+ {d.description && <p className="mj-gh-desc">{d.description}</p>}
+ {d.topics?.length > 0 && <div className="mj-gh-topics">{d.topics.map((t: string) => <span key={t}>{t}</span>)}</div>}
+ <div className="mj-gh-meta">
+ {d.language && <span><i style={{ background: LANG_COLORS[d.language] ?? '#8b949e' }} />{d.language}</span>}
+ {typeof d.stars === 'number' && <span>{Icon.star}{compact(d.stars)}</span>}
+ {typeof d.forks === 'number' && <span>{Icon.fork}{compact(d.forks)}</span>}
+ {d.license && d.license !== 'NOASSERTION' && <span>{d.license}</span>}
+ </div>
+ </div>
+ {d.avatar && <img className="mj-gh-owner" src={d.avatar} alt="" width={72} height={72} loading="lazy" />}
+ </a>
+ </Frame>
+ );
+ }
+
+ // Any other GitHub page (commit, file, tree, discussion…): GitHub's own social card.
+ const og = d.og ?? `https://opengraph.githubassets.com/mercury/${parts.slice(0, 4).join('/')}`;
+ return <LinkCard url={url} d={{ title: d.title || repo, description: d.description, image: og, siteName: 'GitHub', icon: undefined }} brand={Icon.github} wide />;
+}
+
+function Gist({ url, d }: { url: string; d: Data }) {
+ return (
+ <Frame provider="github" url={url}>
+ <a className="mj-ecard mj-gh mj-gh-gist" href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-gh-repo">
+ <span className="mj-gh-mark">{Icon.github}</span>
+ <span className="mj-gh-dim">{d.owner ?? 'gist'} /</span> <b>{d.filename ?? 'gist'}</b>
+ {d.files > 1 && <span className="mj-gh-dim">+{d.files - 1} files</span>}
+ </div>
+ {d.description && <p className="mj-gh-desc">{d.description}</p>}
+ {d.code && <pre><code>{d.code}</code></pre>}
+ </a>
+ </Frame>
+ );
+}
+
+/* ── generic link preview ─────────────────────────────────────────────── */
+
+function LinkCard({ url, d, brand, wide }: { url: string; d: Data; brand?: React.ReactNode; wide?: boolean }) {
+ const [imgOk, setImgOk] = useState(true);
+ const site = d.siteName || host(url);
+ return (
+ <Frame provider="link" url={url}>
+ <a className={`mj-ecard mj-link${d.image && imgOk ? ' has-image' : ''}${wide ? ' is-wide' : ''}`} href={url} target="_blank" rel="noopener noreferrer">
+ <div className="mj-link-body">
+ <div className="mj-link-site">
+ {brand ? <span className="mj-gh-mark">{brand}</span> : d.icon ? <img src={d.icon} alt="" width={16} height={16} loading="lazy" onError={(e) => { (e.target as HTMLImageElement).style.display = 'none'; }} /> : <span className="mj-gh-mark">{Icon.link}</span>}
+ <span>{site}</span>
+ </div>
+ <strong>{d.title || url}</strong>
+ {d.description && <p>{d.description}</p>}
+ <span className="mj-link-host">{host(url)}</span>
+ </div>
+ {d.image && imgOk && <img className="mj-link-img" src={d.image} alt="" loading="lazy" decoding="async" onError={() => setImgOk(false)} />}
+ </a>
+ </Frame>
+ );
+}
+
+/* ── dispatcher ──────────────────────────────────────────────────────── */
+
+export default function SocialEmbed({ url, provider, data }: Props): React.ReactElement {
+ const { colorMode } = useColorMode();
+ let d: Data = {};
+ try {
+ d = data ? JSON.parse(data) : {};
+ } catch {
+ d = {};
+ }
+ switch (provider) {
+ case 'x':
+ return <XPost url={url} d={d} />;
+ case 'youtube':
+ return (
+ <VideoFacade
+ url={url} provider="youtube" vertical={d.short} title={d.title} author={d.author}
+ thumb={`https://i.ytimg.com/vi/${d.id}/hqdefault.jpg`}
+ iframe={`https://www.youtube-nocookie.com/embed/${d.id}?autoplay=1&rel=0&modestbranding=1${d.start ? `&start=${d.start}` : ''}`}
+ />
+ );
+ case 'vimeo':
+ return <VideoFacade url={url} provider="vimeo" title={d.title} author={d.author} thumb={d.thumbnail} iframe={`https://player.vimeo.com/video/${d.id}?autoplay=1&dnt=1`} />;
+ case 'loom':
+ return (
+ <Frame provider="loom" url={url} label="Watch on Loom">
+ <div className="mj-video"><iframe src={`https://www.loom.com/embed/${d.id}`} title="Loom video" loading="lazy" allowFullScreen /></div>
+ </Frame>
+ );
+ case 'instagram':
+ return <Instagram url={url} d={d} />;
+ case 'bluesky':
+ return <Bluesky url={url} d={d} />;
+ case 'tiktok':
+ return <TikTok url={url} d={d} />;
+ case 'spotify': {
+ const tall = !['track', 'episode'].includes(d.kind);
+ return (
+ <Frame provider="spotify" url={url}>
+ <iframe className="mj-spotify" style={{ height: tall ? 352 : 152 }} src={`https://open.spotify.com/embed/${d.kind}/${d.id}?utm_source=mercury&theme=${colorMode === 'dark' ? 0 : 1}`} title="Spotify" loading="lazy" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" />
+ </Frame>
+ );
+ }
+ case 'codepen':
+ return (
+ <Frame provider="codepen" url={url} label="Open on CodePen">
+ <iframe className="mj-codepen" src={`https://codepen.io/${d.user}/embed/${d.id}?default-tab=result&theme-id=${colorMode}`} title="CodePen" loading="lazy" allowFullScreen />
+ </Frame>
+ );
+ case 'mastodon':
+ return (
+ <Frame provider="mastodon" url={url} label={`Open on ${host(url)}`}>
+ <iframe className="mj-mastodon" src={`${url}/embed`} title="Mastodon post" loading="lazy" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" />
+ </Frame>
+ );
+ case 'github':
+ return <GitHub url={url} d={d} />;
+ case 'gist':
+ return <Gist url={url} d={d} />;
+ default:
+ return <LinkCard url={url} d={d} />;
+ }
+}
diff --git a/website/src/components/Journal/SocialMeta.tsx b/website/src/components/Journal/SocialMeta.tsx
new file mode 100644
index 00000000..a7a17508
--- /dev/null
+++ b/website/src/components/Journal/SocialMeta.tsx
@@ -0,0 +1,59 @@
+import React from 'react';
+import Head from '@docusaurus/Head';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+
+/**
+ * Social and search metadata shared by every journal page. The card image is
+ * generated at build time by plugins/blog-social-cards.cjs at
+ * /img/og<permalink>.jpg, so the path here is derived the same way.
+ */
+export function cardPath(permalink: string): string {
+ return `/img/og${permalink.replace(/\/$/, '')}.jpg`;
+}
+
+interface Props {
+ permalink: string;
+ title: string;
+ imageAlt: string;
+ /** Overrides the generated card (front matter `social_image`). */
+ image?: string;
+ /** Extra label/value pairs shown by Slack and some other unfurlers. */
+ labels?: [string, string][];
+ creators?: string[];
+ section?: string;
+ breadcrumbs?: { name: string; path: string }[];
+}
+
+export default function SocialMeta({ permalink, title, imageAlt, image, labels = [], creators = [], section, breadcrumbs }: Props): React.ReactElement {
+ const { siteConfig } = useDocusaurusContext();
+ const abs = (p: string) => (/^https?:/.test(p) ? p : `${siteConfig.url}${p}`);
+ const card = abs(image ?? cardPath(permalink));
+ const isJpeg = /\.jpe?g$/i.test(card);
+ const crumbs = breadcrumbs && {
+ '@context': 'https://schema.org',
+ '@type': 'BreadcrumbList',
+ itemListElement: breadcrumbs.map((b, i) => ({ '@type': 'ListItem', position: i + 1, name: b.name, item: abs(b.path) })),
+ };
+ return (
+ <Head>
+ <meta property="og:image" content={card} />
+ <meta property="og:image:secure_url" content={card} />
+ {!image && <meta property="og:image:type" content={isJpeg ? 'image/jpeg' : 'image/png'} />}
+ {!image && <meta property="og:image:width" content="1200" />}
+ {!image && <meta property="og:image:height" content="630" />}
+ <meta property="og:image:alt" content={imageAlt} />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:image" content={card} />
+ <meta name="twitter:image:alt" content={imageAlt} />
+ <meta property="og:title" content={title} />
+ <meta name="twitter:title" content={title} />
+ {creators[0] && <meta name="twitter:creator" content={creators[0]} />}
+ {section && <meta property="article:section" content={section} />}
+ {labels.slice(0, 2).flatMap(([label, value], i) => [
+ <meta key={`l${i}`} name={`twitter:label${i + 1}`} content={label} />,
+ <meta key={`d${i}`} name={`twitter:data${i + 1}`} content={value} />,
+ ])}
+ {crumbs && <script type="application/ld+json">{JSON.stringify(crumbs)}</script>}
+ </Head>
+ );
+}
diff --git a/website/src/components/Journal/charts.css b/website/src/components/Journal/charts.css
new file mode 100644
index 00000000..56f1dfc3
--- /dev/null
+++ b/website/src/components/Journal/charts.css
@@ -0,0 +1,127 @@
+/* ── comparison table ─────────────────────────────────────────────────── */
+:root {
+ --c-yes: #1a7f37; --c-yes-bg: rgba(26, 127, 55, 0.09);
+ --c-partial: #9a6700; --c-partial-bg: rgba(191, 135, 0, 0.11);
+ --c-no: #b42318; --c-no-bg: rgba(180, 35, 24, 0.07);
+ --c-unknown: #6e7781; --c-unknown-bg: rgba(110, 119, 129, 0.08);
+}
+.mj-compare {
+ --c-ours: color-mix(in srgb, var(--ifm-color-primary) 8%, transparent);
+ margin: 2.2em 0; border: 1px solid var(--mj-line); border-radius: 16px; overflow: hidden;
+ background: var(--ifm-background-color);
+}
+[data-theme='dark'] {
+ --c-yes: #4ac26b; --c-yes-bg: rgba(74, 194, 107, 0.10);
+ --c-partial: #e3b341; --c-partial-bg: rgba(227, 179, 65, 0.10);
+ --c-no: #f47067; --c-no-bg: rgba(244, 112, 103, 0.08);
+ --c-unknown: #8b949e; --c-unknown-bg: rgba(139, 148, 158, 0.08);
+}
+.mj-compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
+.mj-compare-scroll:focus-visible { outline: 2px solid var(--mj-accent); outline-offset: -2px; }
+.mj-compare table { display: table; width: 100%; min-width: 760px; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 0.86rem; line-height: 1.45; }
+.mj-compare thead th {
+ position: sticky; top: 0; text-align: left; vertical-align: bottom; padding: 12px 14px; white-space: nowrap;
+ font-size: 0.78rem; font-weight: 600; color: var(--mj-ink); background: var(--mj-surface); border: 0; border-bottom: 1px solid var(--mj-line);
+}
+.mj-compare tbody tr { background: transparent !important; }
+.mj-compare td, .mj-compare tbody th { padding: 11px 14px; border: 0; border-bottom: 1px solid var(--mj-line); vertical-align: top; color: var(--mj-body); }
+.mj-compare tbody tr:last-child td { border-bottom: 0; }
+.mj-compare tr > :first-child {
+ position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 190px; font-weight: 600; color: var(--mj-ink);
+ background: var(--ifm-background-color); box-shadow: 1px 0 0 var(--mj-line);
+}
+.mj-compare thead tr > :first-child { background: var(--mj-surface); z-index: 2; }
+.mj-compare.hl-2 tr > :nth-child(2), .mj-compare.hl-3 tr > :nth-child(3), .mj-compare.hl-4 tr > :nth-child(4),
+.mj-compare.hl-5 tr > :nth-child(5), .mj-compare.hl-6 tr > :nth-child(6), .mj-compare.hl-7 tr > :nth-child(7) { background-image: linear-gradient(var(--c-ours), var(--c-ours)); }
+.mj-compare.hl-2 thead tr > :nth-child(2), .mj-compare.hl-3 thead tr > :nth-child(3), .mj-compare.hl-4 thead tr > :nth-child(4),
+.mj-compare.hl-5 thead tr > :nth-child(5), .mj-compare.hl-6 thead tr > :nth-child(6), .mj-compare.hl-7 thead tr > :nth-child(7) { color: var(--ifm-color-primary); box-shadow: inset 0 -2px 0 var(--ifm-color-primary); }
+
+.mj-cell .mj-mark {
+ display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%;
+ font-size: 11px; font-weight: 700; line-height: 1; vertical-align: -3px;
+}
+.mj-cell.is-yes .mj-mark { color: var(--c-yes); background: var(--c-yes-bg); }
+.mj-cell.is-partial .mj-mark { color: var(--c-partial); background: var(--c-partial-bg); }
+.mj-cell.is-no .mj-mark { color: var(--c-no); background: var(--c-no-bg); }
+.mj-cell.is-unknown .mj-mark { color: var(--c-unknown); background: var(--c-unknown-bg); }
+.mj-cell.is-unknown .mj-cell-text { color: var(--mj-dim); }
+
+.mj-compare-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--mj-line); font-size: 0.76rem; color: var(--mj-dim); }
+.mj-compare-legend b { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; margin-right: 4px; }
+.mj-compare-legend .is-yes b { color: var(--c-yes); background: var(--c-yes-bg); }
+.mj-compare-legend .is-partial b { color: var(--c-partial); background: var(--c-partial-bg); }
+.mj-compare-legend .is-no b { color: var(--c-no); background: var(--c-no-bg); }
+.mj-compare-legend .is-unknown b { color: var(--c-unknown); background: var(--c-unknown-bg); }
+.mj-compare > figcaption { padding: 10px 14px 12px; border-top: 1px solid var(--mj-line); font-size: 0.8rem; color: var(--mj-dim); }
+
+/* plain (unwrapped) tables in posts get the same cell badges, simpler frame */
+.mj-prose table .mj-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; font-size: 11px; font-weight: 700; vertical-align: -3px; }
+
+/* ── bar chart ───────────────────────────────────────────────────────── */
+.mj-chart {
+ --mj-label-w: 34%; --mj-value-w: 76px;
+ --bar: var(--ifm-color-primary); --bar-muted: color-mix(in srgb, var(--ifm-color-content) 35%, transparent); --bar-warm: #c8873e;
+ margin: 2.2em 0; padding: 18px 20px 14px; border: 1px solid var(--mj-line); border-radius: 16px; background: var(--ifm-background-color);
+}
+[data-theme='dark'] .mj-chart { --bar-warm: #e0a35f; }
+.mj-chart > header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
+.mj-chart > header strong { font-size: 0.98rem; color: var(--mj-ink); }
+.mj-chart > header span { font-size: 0.84rem; color: var(--mj-dim); }
+.mj-bars { position: relative; display: grid; gap: 4px; padding-top: 24px; }
+.mj-bar-row {
+ position: relative; display: grid; grid-template-columns: var(--mj-label-w) 1fr var(--mj-value-w); align-items: center;
+ gap: 0; padding: 8px 0; border-radius: 8px; outline: none;
+}
+.mj-bar-row:hover, .mj-bar-row:focus-visible { background: color-mix(in srgb, var(--mj-ink) 4%, transparent); }
+.mj-bar-label { padding-right: 14px; font-size: 0.86rem; color: var(--mj-body); line-height: 1.3; }
+.mj-bar-track { position: relative; height: 14px; }
+.mj-bar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--bar); transition: filter .15s; }
+.tone-muted .mj-bar-track i { background: var(--bar-muted); }
+.tone-warm .mj-bar-track i { background: var(--bar-warm); }
+.mj-bar-row:hover .mj-bar-track i { filter: brightness(1.08); }
+.mj-bar-value { padding-left: 10px; font-size: 0.84rem; font-variant-numeric: tabular-nums; color: var(--mj-ink); font-weight: 600; white-space: nowrap; }
+.mj-bar-tip {
+ position: absolute; left: var(--mj-label-w); bottom: calc(100% - 2px); z-index: 3; max-width: 340px; padding: 8px 10px; border-radius: 8px;
+ font-size: 0.78rem; line-height: 1.45; color: var(--ifm-background-color); background: var(--mj-ink);
+ opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s;
+}
+.mj-bar-row:hover .mj-bar-tip, .mj-bar-row:focus-visible .mj-bar-tip { opacity: 1; transform: none; }
+.mj-ref { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed color-mix(in srgb, var(--mj-ink) 55%, transparent); z-index: 2; pointer-events: none; }
+.mj-ref span { position: absolute; top: 0; left: 6px; white-space: nowrap; font-size: 0.74rem; font-weight: 600; color: var(--mj-ink); }
+.mj-chart-table { margin-top: 12px; font-size: 0.82rem; }
+.mj-chart-table summary { cursor: pointer; color: var(--mj-dim); }
+.mj-chart-table table { display: table; width: 100%; margin: 10px 0 0; font-size: 0.82rem; }
+.mj-chart > figcaption { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--mj-line); font-size: 0.78rem; color: var(--mj-dim); }
+
+/* ── stat tiles ──────────────────────────────────────────────────────── */
+.mj-stats { margin: 2em 0; }
+.mj-stats dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; }
+.mj-stats dl > div { padding: 14px 16px; border: 1px solid var(--mj-line); border-radius: 14px; background: var(--ifm-background-color); }
+.mj-stats dt { font-size: 0.78rem; color: var(--mj-dim); font-weight: 500; margin: 0; }
+.mj-stats dd { margin: 4px 0 0; font-family: var(--mj-serif); font-size: 2rem; line-height: 1.05; color: var(--mj-ink); }
+.mj-stats figcaption { margin-top: 8px; font-size: 0.78rem; color: var(--mj-dim); }
+
+@media (max-width: 640px) {
+ .mj-chart { --mj-label-w: 100%; --mj-value-w: 64px; padding: 16px 14px 12px; }
+ .mj-bar-row { grid-template-columns: 1fr var(--mj-value-w); row-gap: 6px; }
+ .mj-bar-label { grid-column: 1 / -1; padding-right: 0; }
+ .mj-ref { display: none; }
+ .mj-bar-tip { left: 0; }
+}
+
+/* Wide comparisons use the empty right-hand column beside the article (desktop with TOC),
+ or widen symmetrically on mid-size screens; phones keep the sticky-first-column scroll. */
+.mj-compare table { min-width: 900px; }
+.mj-compare td, .mj-compare tbody th { min-width: 108px; padding: 10px 12px; }
+.mj-compare thead th { padding: 11px 12px; }
+.mj-compare tr > :first-child { min-width: 128px; }
+.mj-compare table { font-size: 0.84rem; }
+@media (min-width: 1181px) {
+ .mj-post-layout.has-toc .mj-prose .mj-compare { margin-right: -268px; position: relative; z-index: 1; }
+}
+@media (min-width: 760px) and (max-width: 1180px) {
+ .mj-prose .mj-compare {
+ margin-left: calc((100% - min(100vw - 48px, 1000px)) / 2);
+ margin-right: calc((100% - min(100vw - 48px, 1000px)) / 2);
+ }
+}
diff --git a/website/src/components/Journal/embeds.css b/website/src/components/Journal/embeds.css
new file mode 100644
index 00000000..6483bfc1
--- /dev/null
+++ b/website/src/components/Journal/embeds.css
@@ -0,0 +1,152 @@
+/* ── Rich link previews in journal posts ─────────────────────────────── */
+.mj-embed { margin: 2em auto; max-width: 100%; }
+.mj-embed figcaption { margin-top: 10px; font-size: 0.84rem; text-align: center; }
+.mj-embed figcaption a { color: var(--mj-dim, inherit) !important; text-decoration: none !important; }
+.mj-embed figcaption a:hover { color: var(--mj-ink, inherit) !important; }
+.mj-embed-live { display: flex; justify-content: center; }
+.mj-embed-live > * { margin: 0 auto !important; }
+.mj-embed-staging { height: 0; overflow: hidden; visibility: hidden; }
+.mj-embed blockquote { border: 0; margin: 0 auto; padding: 0; font-family: inherit; font-size: 1rem; line-height: 1.5; color: inherit; background: none; }
+.mj-embed iframe { border: 0; display: block; width: 100%; }
+
+.mj-ecard {
+ display: block; color: var(--mj-body, inherit) !important; text-decoration: none !important;
+ border: 1px solid var(--mj-line); border-radius: 16px; background: var(--ifm-background-color);
+ transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
+}
+.mj-ecard:hover { border-color: color-mix(in srgb, var(--mj-ink) 35%, transparent); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); }
+
+/* social posts (static card before the widget loads) */
+.mj-social { max-width: 550px; margin: 0 auto; padding: 18px 20px 16px; }
+.mj-social header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
+.mj-social-who { display: flex; flex-direction: column; line-height: 1.25; }
+.mj-social-who strong { color: var(--mj-ink); font-size: 0.98rem; }
+.mj-social-who span { color: var(--mj-dim); font-size: 0.88rem; }
+.mj-social-text { margin: 0 0 12px !important; font-size: 1.02rem; line-height: 1.5; white-space: pre-line; color: var(--mj-ink); }
+.mj-social-text.is-dim { color: var(--mj-dim); }
+.mj-social footer { font-size: 0.84rem; color: var(--mj-dim); }
+.mj-brand { display: inline-flex; width: 22px; height: 22px; flex: none; }
+.mj-brand svg { width: 100%; height: 100%; }
+.mj-brand--x { color: var(--mj-ink); }
+.mj-brand--bsky { color: #1185fe; }
+.mj-brand--ig { color: #e1306c; }
+
+/* video facades */
+.mj-video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--mj-line); }
+.mj-video.is-vertical { aspect-ratio: 9 / 16; max-width: 340px; margin: 0 auto; }
+.mj-video iframe { position: absolute; inset: 0; height: 100%; }
+.mj-video button { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; }
+.mj-video button img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; opacity: 0.92; transition: opacity 160ms ease; }
+.mj-video button:hover img { opacity: 1; }
+.mj-video-title {
+ position: absolute; left: 0; right: 0; top: 0; padding: 16px 18px 40px; text-align: left;
+ color: #fff; font-size: 1rem; font-weight: 500; line-height: 1.35;
+ background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
+}
+.mj-video-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); transition: transform 160ms ease; }
+.mj-video-play svg { width: 100%; height: 100%; }
+.mj-video button:hover .mj-video-play { transform: translate(-50%, -50%) scale(1.08); }
+.mj-embed--vimeo .mj-video-play, .mj-embed--loom .mj-video-play { width: 64px; height: 64px; }
+
+.mj-spotify { border-radius: 14px; }
+.mj-codepen { height: 440px; border-radius: 14px; border: 1px solid var(--mj-line) !important; }
+.mj-mastodon { min-height: 320px; max-width: 550px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--mj-line) !important; }
+
+/* GitHub: follows GitHub's own palette so it reads as native */
+.mj-gh {
+ --gh-fg: #1f2328; --gh-dim: #59636e; --gh-line: #d1d9e0; --gh-bg: #ffffff; --gh-subtle: #f6f8fa;
+ --gh-open: #1a7f37; --gh-merged: #8250df; --gh-closed: #cf222e; --gh-draft: #59636e; --gh-accent: #0969da;
+ padding: 16px 18px; background: var(--gh-bg); border-color: var(--gh-line); color: var(--gh-fg) !important;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5;
+}
+[data-theme='dark'] .mj-gh {
+ --gh-fg: #f0f6fc; --gh-dim: #9198a1; --gh-line: #3d444d; --gh-bg: #0d1117; --gh-subtle: #151b23;
+ --gh-open: #3fb950; --gh-merged: #ab7df8; --gh-closed: #f85149; --gh-draft: #9198a1; --gh-accent: #4493f8;
+}
+.mj-gh svg { width: 16px; height: 16px; flex: none; }
+.mj-gh-mark { display: inline-flex; color: var(--gh-fg); }
+.mj-gh-repo { display: flex; align-items: center; gap: 8px; color: var(--gh-dim); font-size: 13px; }
+.mj-gh-repo.is-big { font-size: 17px; color: var(--gh-accent); gap: 0; }
+.mj-gh-repo.is-big .mj-gh-mark { margin-right: 10px; }
+.mj-gh-repo.is-big b { font-weight: 600; }
+.mj-gh-num { color: var(--gh-dim); }
+.mj-gh-dim { color: var(--gh-dim); font-weight: 400; }
+.mj-gh-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
+.mj-gh-title { font-size: 16px; font-weight: 600; color: var(--gh-fg); }
+.mj-gh-state { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 500; }
+.mj-gh-state.is-open { background: var(--gh-open); }
+.mj-gh-state.is-merged { background: var(--gh-merged); }
+.mj-gh-state.is-closed { background: var(--gh-closed); }
+.mj-gh-state.is-draft, .mj-gh-state.is-not-planned { background: var(--gh-draft); }
+.mj-gh-state.is-release { background: transparent; color: var(--gh-open); border: 1px solid var(--gh-open); }
+.mj-gh-pill { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid #bf8700; color: #bf8700; }
+.mj-gh-desc { margin: 8px 0 0 !important; color: var(--gh-dim); font-size: 14px; line-height: 1.5; }
+.mj-gh-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
+.mj-gh-labels span {
+ font-size: 12px; font-weight: 500; padding: 0 9px; line-height: 20px; border-radius: 999px;
+ color: color-mix(in srgb, var(--l) 70%, var(--gh-fg)); background: color-mix(in srgb, var(--l) 18%, transparent); border: 1px solid color-mix(in srgb, var(--l) 40%, transparent);
+}
+.mj-gh-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
+.mj-gh-topics span { font-size: 12px; font-weight: 500; padding: 0 10px; line-height: 22px; border-radius: 999px; color: var(--gh-accent); background: color-mix(in srgb, var(--gh-accent) 12%, transparent); }
+.mj-gh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 12px; color: var(--gh-dim); font-size: 12.5px; }
+.mj-gh-meta span { display: inline-flex; align-items: center; gap: 5px; }
+.mj-gh-meta b { color: var(--gh-fg); font-weight: 600; }
+.mj-gh-meta i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
+.mj-gh-meta img { border-radius: 50%; margin-right: -10px; }
+.mj-gh-diff ins { color: var(--gh-open); text-decoration: none; font-weight: 600; }
+.mj-gh-diff del { color: var(--gh-closed); text-decoration: none; font-weight: 600; }
+.mj-gh-repo-card { display: flex; gap: 18px; align-items: flex-start; }
+.mj-gh-body { flex: 1; min-width: 0; }
+.mj-gh-owner { flex: none; border-radius: 12px !important; }
+.mj-gh-user { display: flex; gap: 16px; align-items: center; }
+.mj-gh-user > img { border-radius: 50% !important; flex: none; }
+.mj-gh-user > img.is-org { border-radius: 12px !important; }
+.mj-gh-user .mj-gh-title-row { margin-top: 0; gap: 8px; }
+.mj-gh-gist pre { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--gh-subtle) !important; border: 1px solid var(--gh-line); font-size: 12.5px; line-height: 1.55; max-height: 280px; overflow: hidden; color: var(--gh-fg); }
+.mj-gh-gist pre code { padding: 0 !important; border: 0 !important; background: none !important; font-size: inherit; color: inherit; }
+
+/* generic link preview (Open Graph) */
+.mj-link { display: flex; overflow: hidden; min-height: 132px; }
+.mj-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
+.mj-link-site { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--mj-dim); }
+.mj-link-site img { border-radius: 4px !important; }
+.mj-link-site .mj-gh-mark svg { width: 16px; height: 16px; }
+.mj-link strong { color: var(--mj-ink); font-size: 1.02rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
+.mj-link p { margin: 0 !important; font-size: 0.9rem; line-height: 1.5; color: var(--mj-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
+.mj-link-host { margin-top: auto; padding-top: 6px; font-size: 0.78rem; color: var(--mj-dim); }
+.mj-link-img { flex: none; width: 34%; max-width: 260px; object-fit: cover; border-radius: 0 !important; border-left: 1px solid var(--mj-line); }
+.mj-link.is-wide { flex-direction: column-reverse; }
+.mj-link.is-wide .mj-link-img { width: 100%; max-width: none; aspect-ratio: 2 / 1; border-left: 0; border-bottom: 1px solid var(--mj-line); }
+
+@media (max-width: 640px) {
+ .mj-link { flex-direction: column-reverse; }
+ .mj-link-img { width: 100%; max-width: none; aspect-ratio: 1.91 / 1; border-left: 0; border-bottom: 1px solid var(--mj-line); }
+ .mj-gh-owner { display: none; }
+}
+
+/* GitHub code permalink: real lines at a pinned commit */
+.mj-gh-code { margin: 2em 0; }
+.mj-gh-code-head {
+ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px;
+ border: 1px solid var(--gh-line); border-bottom: 0; border-radius: 14px 14px 0 0; font-size: 13px;
+}
+.mj-gh-code-repo { color: var(--gh-fg) !important; font-weight: 600; text-decoration: none !important; }
+.mj-gh-ref { font-family: var(--ifm-font-family-monospace); font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--gh-subtle); border: 1px solid var(--gh-line); color: var(--gh-dim); }
+.mj-gh-ref.is-sha { color: var(--gh-accent); }
+.mj-gh-code-link { margin-left: auto; color: var(--gh-accent) !important; text-decoration: none !important; font-size: 12.5px; }
+.mj-gh-code .theme-code-block { margin: 0 !important; border-radius: 0 0 14px 14px !important; }
+.mj-gh-code-foot { margin-top: 8px; font-size: 0.8rem; color: var(--mj-dim); text-align: left; }
+.mj-gh-code-foot code { font-size: 0.92em; }
+.mj-gh-commit-title { display: block; margin-top: 8px; }
+.mj-gh-files { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--gh-line); display: grid; gap: 6px; }
+.mj-gh-files li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; align-items: center; gap: 12px; font-size: 12.5px; }
+.mj-gh-files code { padding: 0 !important; border: 0 !important; background: none !important; color: var(--gh-fg) !important; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.mj-gh-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--gh-subtle); }
+.mj-gh-bar i { display: block; height: 100%; }
+.mj-gh-bar .is-add { background: var(--gh-open); }
+.mj-gh-bar .is-del { background: var(--gh-closed); }
+@media (max-width: 640px) {
+ .mj-gh-code-link { margin-left: 0; flex-basis: 100%; }
+ .mj-gh-files li { grid-template-columns: minmax(0, 1fr) auto; }
+ .mj-gh-bar { display: none; }
+}
diff --git a/website/src/components/Journal/journal.css b/website/src/components/Journal/journal.css
new file mode 100644
index 00000000..2e766480
--- /dev/null
+++ b/website/src/components/Journal/journal.css
@@ -0,0 +1,318 @@
+/* ── Mercury Journal ────────────────────────────────────────────────────
+ * Editorial layout for /blog: a serif display face for headlines, the site
+ * sans for body, generous whitespace, covers with soft corners. Uses the
+ * site tokens so light and dark follow the rest of mercuryagent.sh.
+ */
+.mj-root {
+ --mj-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
+ --mj-ink: var(--ifm-heading-color);
+ --mj-body: var(--ifm-color-content);
+ --mj-dim: color-mix(in srgb, var(--ifm-color-content) 68%, transparent);
+ --mj-line: var(--mx-site-line);
+ --mj-surface: var(--ifm-background-surface-color);
+ --mj-accent: var(--ifm-color-primary);
+ --mj-radius: 18px;
+ --mj-max: 1200px;
+ --mj-read: 700px;
+}
+
+.mj-page, .mj-post { max-width: var(--mj-max); min-width: 0; width: 100%; margin: 0 auto; padding: 56px 24px 96px; box-sizing: border-box; }
+
+/* ── index: hero ─────────────────────────────────────────────────────── */
+.mj-eyebrow {
+ font-family: var(--ifm-font-family-monospace);
+ font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
+ color: var(--mj-accent); margin: 0 0 18px;
+}
+.mj-hero { max-width: 880px; margin-bottom: 56px; }
+.mj-hero-title {
+ font-family: var(--mj-serif); font-weight: 400;
+ font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.04; letter-spacing: -0.015em;
+ color: var(--mj-ink); margin: 0 0 18px;
+}
+.mj-hero-intro { font-size: 1.12rem; color: var(--mj-dim); max-width: 640px; margin: 0 0 8px; }
+.mj-search {
+ margin-top: 28px; display: flex; align-items: center; gap: 10px;
+ max-width: 520px; padding: 12px 16px; border: 1px solid var(--mj-line);
+ border-radius: 999px; background: var(--mj-surface); color: var(--mj-dim);
+ transition: border-color .15s, box-shadow .15s;
+}
+.mj-search:focus-within { border-color: var(--mj-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mj-accent) 14%, transparent); }
+.mj-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--mj-ink); }
+.mj-search input::placeholder { color: var(--mj-dim); }
+
+/* ── index: featured ─────────────────────────────────────────────────── */
+.mj-featured { margin-bottom: 64px; }
+.mj-featured-link {
+ display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center;
+ color: inherit; text-decoration: none !important;
+}
+.mj-featured-title {
+ font-family: var(--mj-serif); font-weight: 400; font-size: clamp(1.9rem, 3.2vw, 2.7rem);
+ line-height: 1.08; color: var(--mj-ink); margin: 14px 0 14px;
+}
+.mj-featured-desc { font-size: 1.08rem; color: var(--mj-body); margin: 0 0 22px; }
+.mj-readmore { font-weight: 600; color: var(--mj-accent); }
+.mj-featured-link:hover .mj-readmore span { margin-left: 4px; }
+.mj-featured-link:hover .mj-cover { transform: scale(1.012); }
+
+/* ── covers ──────────────────────────────────────────────────────────── */
+.mj-cover {
+ display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
+ border-radius: var(--mj-radius); background: var(--mj-surface);
+ transition: transform .35s ease;
+}
+.mj-cover-fallback { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--mj-accent) 30%, transparent), transparent 60%), var(--mj-surface); }
+
+/* ── index: controls ─────────────────────────────────────────────────── */
+.mj-controls {
+ display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
+ padding: 18px 0; margin-bottom: 36px; border-top: 1px solid var(--mj-line); border-bottom: 1px solid var(--mj-line);
+}
+.mj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
+.mj-chips button {
+ font: inherit; font-size: 0.9rem; padding: 7px 15px; border-radius: 999px; cursor: pointer;
+ border: 1px solid var(--mj-line); background: transparent; color: var(--mj-body);
+ transition: background .15s, color .15s, border-color .15s;
+}
+.mj-chips button:hover { border-color: var(--mj-ink); color: var(--mj-ink); }
+.mj-chips button.is-on { background: var(--mj-ink); border-color: var(--mj-ink); color: var(--ifm-background-color); }
+.mj-controls-right { display: flex; gap: 14px; margin-left: auto; }
+.mj-select { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--mj-dim); }
+.mj-select select {
+ font: inherit; font-size: 0.9rem; color: var(--mj-ink); background: transparent;
+ border: 1px solid var(--mj-line); border-radius: 10px; padding: 6px 10px; cursor: pointer;
+}
+
+/* ── index: grid ─────────────────────────────────────────────────────── */
+.mj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
+.mj-card {
+ --mj-card-bg: color-mix(in srgb, var(--mj-surface) 60%, var(--ifm-background-color));
+ display: flex; height: 100%; border: 1px solid var(--mj-line); border-radius: 22px; background: var(--mj-card-bg);
+ transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
+}
+.mj-card:hover {
+ border-color: color-mix(in srgb, var(--mj-ink) 22%, var(--mj-line)); transform: translateY(-2px);
+ box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.35);
+}
+.mj-card-link { display: flex; flex-direction: column; width: 100%; padding: 10px; color: inherit; text-decoration: none !important; border-radius: inherit; }
+.mj-card-link:focus-visible { outline: 2px solid var(--mj-accent); outline-offset: 3px; }
+.mj-card-media { border-radius: 14px; overflow: hidden; }
+.mj-card-media .mj-cover { border-radius: 0; }
+.mj-card-link:hover .mj-cover { transform: scale(1.03); }
+.mj-card-link:hover .mj-card-title { color: var(--mj-accent); }
+.mj-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 14px 8px; }
+.mj-card-title { font-family: var(--mj-serif); font-weight: 400; font-size: 1.58rem; line-height: 1.12; color: var(--mj-ink); margin: 0; transition: color .15s; }
+.mj-card-desc { color: var(--mj-body); font-size: 0.96rem; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
+.mj-byline { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 6px; }
+.mj-card .mj-byline { padding-top: 14px; margin-top: auto; border-top: 1px solid var(--mj-line); }
+.mj-card-desc + .mj-byline { margin-top: auto; }
+.mj-card-body > .mj-card-desc { margin-bottom: 8px; }
+.mj-byline-author { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--mj-dim); }
+.mj-byline-author img { border-radius: 50%; }
+
+.mj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--mj-dim); }
+.mj-meta-cat { font-weight: 600; color: var(--mj-ink); }
+
+.mj-empty { padding: 48px 0; color: var(--mj-dim); font-size: 1.05rem; }
+.mj-empty button { font: inherit; color: var(--mj-accent); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 0; }
+.mj-index-foot { display: flex; gap: 22px; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--mj-line); font-size: 0.86rem; }
+.mj-index-foot a { color: var(--mj-dim); }
+
+/* ── article ─────────────────────────────────────────────────────────── */
+.mj-post-head { max-width: 820px; margin: 0 auto 40px; text-align: center; }
+.mj-back { display: inline-block; font-size: 0.86rem; color: var(--mj-dim); margin-bottom: 32px; }
+.mj-post-cat {
+ display: block; font-family: var(--ifm-font-family-monospace); font-size: 0.78rem; letter-spacing: 0.08em;
+ text-transform: uppercase; color: var(--mj-accent); margin-bottom: 18px;
+}
+.mj-post-title {
+ font-family: var(--mj-serif); font-weight: 400; font-size: clamp(2.3rem, 5vw, 3.9rem);
+ line-height: 1.05; letter-spacing: -0.015em; color: var(--mj-ink); margin: 0 0 20px;
+}
+.mj-post-dek { font-size: 1.22rem; line-height: 1.5; color: var(--mj-body); max-width: 680px; margin: 0 auto 28px; }
+.mj-post-byline { display: flex; flex-direction: column; align-items: center; gap: 12px; }
+.mj-post-authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
+.mj-post-author { display: inline-flex; align-items: center; gap: 10px; text-align: left; color: inherit; text-decoration: none !important; }
+.mj-post-author img { border-radius: 50%; }
+.mj-post-author strong { display: block; font-size: 0.95rem; color: var(--mj-ink); font-weight: 600; }
+.mj-post-author em { display: block; font-style: normal; font-size: 0.82rem; color: var(--mj-dim); }
+.mj-post-banner {
+ max-width: 1140px; margin: 0 auto 56px; height: clamp(180px, 26vw, 320px);
+ border-radius: 22px; overflow: hidden; border: 1px solid var(--mj-line); background: var(--mj-surface);
+}
+.mj-post-banner img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
+
+/* reading progress */
+.mj-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: calc(var(--ifm-z-index-fixed) + 10); pointer-events: none; }
+.mj-progress span {
+ display: block; height: 100%; transform-origin: 0 50%; transition: transform 80ms linear;
+ background: linear-gradient(90deg, var(--mj-accent), #f0b26a);
+}
+.mj-progress-pill {
+ position: fixed; left: 50%; bottom: 20px; z-index: var(--ifm-z-index-fixed);
+ display: none; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
+ font: inherit; font-size: 0.82rem; font-weight: 500; color: var(--mj-ink); cursor: pointer;
+ background: color-mix(in srgb, var(--ifm-background-color) 82%, transparent);
+ border: 1px solid var(--mj-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
+ box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
+ opacity: 0; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms ease;
+}
+.mj-post.no-toc .mj-progress-pill { display: inline-flex; }
+.mj-progress-pill.is-on { opacity: 1; transform: translate(-50%, 0); }
+.mj-progress-pill svg { transform: rotate(-90deg); }
+.mj-ring-bg, .mj-ring { fill: none; stroke-width: 2.4; }
+.mj-ring-bg { stroke: var(--mj-line); }
+.mj-ring { stroke: var(--mj-accent); stroke-linecap: round; stroke-dasharray: 50.27; transition: stroke-dashoffset 80ms linear; }
+
+.mj-post-layout { display: grid; grid-template-columns: minmax(0, var(--mj-read)); justify-content: center; }
+.mj-post-layout.has-toc { grid-template-columns: 220px minmax(0, var(--mj-read)) 220px; gap: 48px; }
+.mj-post-toc { position: sticky; top: calc(var(--ifm-navbar-height) + 28px); align-self: start; font-size: 0.86rem; }
+.mj-toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
+.mj-toc-head p { font-weight: 600; color: var(--mj-ink); margin: 0; }
+.mj-toc-left { font-size: 0.76rem; color: var(--mj-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
+.mj-toc-meter { height: 2px; border-radius: 2px; background: var(--mj-line); overflow: hidden; margin-bottom: 14px; }
+.mj-toc-meter span { display: block; height: 100%; background: var(--mj-accent); transform-origin: 0 50%; transition: transform 80ms linear; }
+.mj-post-toc a { display: block; padding-left: 10px; margin-left: -11px; border-left: 1px solid transparent; transition: color 120ms ease, border-color 120ms ease; }
+.mj-post-toc a.is-active { color: var(--mj-ink); border-left-color: var(--mj-accent); }
+.mj-post-toc ul { list-style: none; padding-left: 0; margin: 0; }
+.mj-post-toc ul ul { padding-left: 12px; }
+.mj-post-toc li { margin: 6px 0; }
+.mj-post-toc a { color: var(--mj-dim); }
+.mj-post-toc a:hover { color: var(--mj-ink); text-decoration: none; }
+
+/* prose */
+.mj-prose { font-size: 1.1rem; line-height: 1.75; color: var(--mj-body); }
+.mj-prose > p:first-child { font-size: 1.2rem; }
+.mj-prose h2 { font-family: var(--mj-serif); font-weight: 400; font-size: 2rem; line-height: 1.15; color: var(--mj-ink); margin: 2.4em 0 0.6em; letter-spacing: -0.01em; }
+.mj-prose h3 { font-size: 1.22rem; font-weight: 600; color: var(--mj-ink); margin: 2em 0 0.5em; }
+.mj-prose p, .mj-prose ul, .mj-prose ol { margin-bottom: 1.3em; }
+.mj-prose a { color: var(--mj-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
+.mj-prose blockquote {
+ margin: 2em 0; padding: 0 0 0 22px; border-left: 2px solid var(--mj-accent);
+ font-family: var(--mj-serif); font-size: 1.5rem; line-height: 1.35; color: var(--mj-ink);
+}
+/* inline code */
+.mj-prose :not(pre) > code {
+ font-size: 0.86em; padding: 0.14em 0.42em; border-radius: 6px; vertical-align: 0.04em;
+ border: 1px solid var(--mj-line); background: var(--mj-surface); color: var(--mj-ink);
+}
+.mj-prose a > code { color: inherit; }
+
+/* code blocks: framed, labelled, with a palette tuned to the site */
+.mj-prose .theme-code-block {
+ --mj-code-bg: #f7f8fa; --mj-code-head: #eef1f4;
+ margin: 1.9em 0; border: 1px solid var(--mj-line); border-radius: 14px; overflow: hidden;
+ box-shadow: none; background: var(--mj-code-bg);
+}
+[data-theme='dark'] .mj-prose .theme-code-block { --mj-code-bg: #0e1217; --mj-code-head: #131920; }
+.mj-prose .theme-code-block::before,
+.mj-prose .theme-code-block > div[class*='codeBlockTitle'] {
+ display: block; padding: 9px 18px; font-family: var(--ifm-font-family-monospace);
+ font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mj-dim);
+ background: var(--mj-code-head); border-bottom: 1px solid var(--mj-line);
+}
+.mj-prose .theme-code-block > div[class*='codeBlockTitle'] { text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
+.mj-prose .theme-code-block:has(> div[class*='codeBlockTitle'])::before { display: none; }
+.mj-prose .theme-code-block::before { content: 'code'; }
+.mj-prose .theme-code-block.language-bash::before, .mj-prose .theme-code-block.language-sh::before, .mj-prose .theme-code-block.language-shell::before, .mj-prose .theme-code-block.language-zsh::before { content: 'shell'; }
+.mj-prose .theme-code-block.language-ts::before, .mj-prose .theme-code-block.language-typescript::before { content: 'typescript'; }
+.mj-prose .theme-code-block.language-tsx::before { content: 'tsx'; }
+.mj-prose .theme-code-block.language-js::before, .mj-prose .theme-code-block.language-javascript::before { content: 'javascript'; }
+.mj-prose .theme-code-block.language-jsx::before { content: 'jsx'; }
+.mj-prose .theme-code-block.language-json::before { content: 'json'; }
+.mj-prose .theme-code-block.language-yaml::before, .mj-prose .theme-code-block.language-yml::before { content: 'yaml'; }
+.mj-prose .theme-code-block.language-toml::before { content: 'toml'; }
+.mj-prose .theme-code-block.language-python::before, .mj-prose .theme-code-block.language-py::before { content: 'python'; }
+.mj-prose .theme-code-block.language-go::before { content: 'go'; }
+.mj-prose .theme-code-block.language-rust::before { content: 'rust'; }
+.mj-prose .theme-code-block.language-diff::before { content: 'diff'; }
+.mj-prose .theme-code-block.language-powershell::before { content: 'powershell'; }
+.mj-prose .theme-code-block.language-text::before, .mj-prose .theme-code-block.language-txt::before { content: 'output'; }
+.mj-prose .theme-code-block pre {
+ margin: 0; border-radius: 0; font-size: 0.86rem; line-height: 1.7;
+ background: var(--mj-code-bg) !important; color: #1f2328 !important;
+}
+.mj-prose .theme-code-block pre::before { content: none !important; display: none !important; }
+.mj-prose .theme-code-block pre code { background: transparent !important; border: 0; padding: 18px 22px; font-family: var(--ifm-font-family-monospace); font-variant-ligatures: none; }
+.mj-prose .theme-code-block button { border-color: var(--mj-line); background: var(--mj-code-head); }
+.mj-prose .theme-code-block [class*='codeLineNumber'] {
+ background: var(--mj-code-bg) !important; color: color-mix(in srgb, var(--ifm-color-content) 45%, transparent) !important;
+ padding-right: 14px !important; margin-right: 14px; border-right: 1px solid var(--mj-line); left: 0;
+}
+.mj-prose .theme-code-block [class*='codeLineNumber']::before { opacity: 1; }
+.mj-prose .theme-code-block-highlighted-line { background: color-mix(in srgb, var(--mj-accent) 14%, transparent); margin: 0 -22px; padding: 0 22px; }
+
+.mj-prose .theme-code-block .token { color: inherit !important; font-style: normal !important; }
+.mj-prose .theme-code-block .token.comment, .mj-prose .theme-code-block .token.prolog, .mj-prose .theme-code-block .token.doctype { color: #6e7781 !important; font-style: italic !important; }
+.mj-prose .theme-code-block .token.punctuation, .mj-prose .theme-code-block .token.operator { color: #57606a !important; }
+.mj-prose .theme-code-block .token.keyword, .mj-prose .theme-code-block .token.atrule, .mj-prose .theme-code-block .token.important, .mj-prose .theme-code-block .token.selector { color: #8250df !important; }
+.mj-prose .theme-code-block .token.string, .mj-prose .theme-code-block .token.char, .mj-prose .theme-code-block .token.attr-value, .mj-prose .theme-code-block .token.template-string, .mj-prose .theme-code-block .token.regex { color: #9a5b13 !important; }
+.mj-prose .theme-code-block .token.function, .mj-prose .theme-code-block .token.tag, .mj-prose .theme-code-block .token.builtin { color: #0b7285 !important; }
+.mj-prose .theme-code-block .token.number, .mj-prose .theme-code-block .token.boolean, .mj-prose .theme-code-block .token.constant, .mj-prose .theme-code-block .token.symbol { color: #c4432b !important; }
+.mj-prose .theme-code-block .token.class-name, .mj-prose .theme-code-block .token.maybe-class-name { color: #0550ae !important; }
+.mj-prose .theme-code-block .token.property, .mj-prose .theme-code-block .token.attr-name, .mj-prose .theme-code-block .token.key { color: #116329 !important; }
+.mj-prose .theme-code-block .token.inserted { color: #116329 !important; }
+.mj-prose .theme-code-block .token.deleted { color: #cf222e !important; }
+
+[data-theme='dark'] .mj-prose .theme-code-block pre { color: #d4dbe3 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.comment, [data-theme='dark'] .mj-prose .theme-code-block .token.prolog, [data-theme='dark'] .mj-prose .theme-code-block .token.doctype { color: #6b7785 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.punctuation, [data-theme='dark'] .mj-prose .theme-code-block .token.operator { color: #8b97a5 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.keyword, [data-theme='dark'] .mj-prose .theme-code-block .token.atrule, [data-theme='dark'] .mj-prose .theme-code-block .token.important, [data-theme='dark'] .mj-prose .theme-code-block .token.selector { color: #c4a7f5 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.string, [data-theme='dark'] .mj-prose .theme-code-block .token.char, [data-theme='dark'] .mj-prose .theme-code-block .token.attr-value, [data-theme='dark'] .mj-prose .theme-code-block .token.template-string, [data-theme='dark'] .mj-prose .theme-code-block .token.regex { color: #ecc48d !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.function, [data-theme='dark'] .mj-prose .theme-code-block .token.tag, [data-theme='dark'] .mj-prose .theme-code-block .token.builtin { color: #7dd3e0 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.number, [data-theme='dark'] .mj-prose .theme-code-block .token.boolean, [data-theme='dark'] .mj-prose .theme-code-block .token.constant, [data-theme='dark'] .mj-prose .theme-code-block .token.symbol { color: #f59e8b !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.class-name, [data-theme='dark'] .mj-prose .theme-code-block .token.maybe-class-name { color: #8fc8ff !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.property, [data-theme='dark'] .mj-prose .theme-code-block .token.attr-name, [data-theme='dark'] .mj-prose .theme-code-block .token.key { color: #9ddcc8 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.inserted { color: #9fd7a5 !important; }
+[data-theme='dark'] .mj-prose .theme-code-block .token.deleted { color: #f38b8b !important; }
+.mj-prose img { border-radius: 14px; }
+.mj-prose table { display: table; width: 100%; font-size: 0.95rem; }
+.mj-prose hr { border: 0; border-top: 1px solid var(--mj-line); margin: 3em 0; }
+
+/* article footer */
+.mj-post-foot { max-width: var(--mj-read); margin: 64px auto 0; }
+.mj-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 22px 0; border-top: 1px solid var(--mj-line); }
+.mj-tools a, .mj-tools button {
+ font: inherit; font-size: 0.86rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
+ border: 1px solid var(--mj-line); background: transparent; color: var(--mj-body); text-decoration: none !important;
+}
+.mj-tools a:hover, .mj-tools button:hover { border-color: var(--mj-ink); color: var(--mj-ink); }
+.mj-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
+.mj-post-tags a { font-size: 0.82rem; padding: 4px 11px; border-radius: 999px; background: var(--mj-surface); color: var(--mj-body); }
+.mj-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px 0; border-top: 1px solid var(--mj-line); }
+.mj-pager a { display: flex; flex-direction: column; gap: 4px; color: var(--mj-ink); font-family: var(--mj-serif); font-size: 1.25rem; line-height: 1.2; text-decoration: none !important; }
+.mj-pager a small { font-family: var(--ifm-font-family-base); font-size: 0.78rem; color: var(--mj-dim); text-transform: uppercase; letter-spacing: 0.06em; }
+.mj-pager .is-next { text-align: right; }
+.mj-more { padding-top: 24px; border-top: 1px solid var(--mj-line); }
+.mj-more h2 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mj-dim); font-weight: 600; margin-bottom: 14px; }
+.mj-more ul { list-style: none; padding: 0; margin: 0; }
+.mj-more li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--mj-line); }
+.mj-more li a { color: var(--mj-ink); font-weight: 500; }
+.mj-more time { font-size: 0.84rem; color: var(--mj-dim); white-space: nowrap; }
+
+/* ── responsive ──────────────────────────────────────────────────────── */
+@media (max-width: 1180px) {
+ .mj-post-layout.has-toc { grid-template-columns: minmax(0, var(--mj-read)); }
+ .mj-post-toc { display: none; }
+ .mj-progress-pill { display: inline-flex; }
+}
+@media (max-width: 996px) {
+ .mj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .mj-featured-link { grid-template-columns: 1fr; gap: 24px; }
+}
+@media (max-width: 640px) {
+ .mj-page, .mj-post { padding: 36px 16px 72px; }
+ .mj-grid { grid-template-columns: 1fr; gap: 20px; }
+ .mj-card-body { padding: 16px 10px 6px; }
+ .mj-controls-right { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 10px 12px; }
+ .mj-controls-right .mj-select { flex: 1 1 140px; min-width: 0; }
+ .mj-controls-right .mj-select select { flex: 1; min-width: 0; width: 100%; max-width: 100%; }
+ .mj-chips { flex-wrap: wrap; min-width: 0; }
+ .mj-pager { grid-template-columns: 1fr; }
+ .mj-pager .is-next { text-align: left; }
+ .mj-prose { font-size: 1.04rem; }
+ .mj-post-banner { border-radius: 16px; margin-bottom: 36px; height: 180px; }
+ .mj-prose .theme-code-block { margin-left: -4px; margin-right: -4px; }
+ .mj-prose .theme-code-block pre code { padding: 16px 16px; }
+}
diff --git a/website/src/components/Journal/posts.ts b/website/src/components/Journal/posts.ts
new file mode 100644
index 00000000..ab58e073
--- /dev/null
+++ b/website/src/components/Journal/posts.ts
@@ -0,0 +1,74 @@
+/**
+ * Normalises what the Docusaurus blog plugin hands a list page into the
+ * flat shape the journal UI renders, sorts and searches.
+ */
+import type { ComponentType } from 'react';
+
+export interface JournalAuthor {
+ key?: string;
+ name: string;
+ title?: string;
+ imageURL?: string;
+ page?: { permalink: string } | null;
+}
+
+export interface JournalPost {
+ permalink: string;
+ title: string;
+ description: string;
+ date: string;
+ formattedDate: string;
+ readingMinutes: number;
+ category: { label: string; permalink: string } | null;
+ tags: { label: string; permalink: string }[];
+ authors: JournalAuthor[];
+ image?: string;
+ featured: boolean;
+}
+
+type PostModule = ComponentType & {
+ metadata: {
+ permalink: string;
+ title: string;
+ description: string;
+ date: string;
+ readingTime?: number;
+ tags: { label: string; permalink: string }[];
+ authors: JournalAuthor[];
+ frontMatter: Record<string, unknown>;
+ };
+ assets?: { image?: string };
+ frontMatter?: Record<string, unknown>;
+};
+
+export function formatDate(iso: string | Date): string {
+ return new Date(iso).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' });
+}
+
+export function toJournalPosts(items: readonly { readonly content: unknown }[]): JournalPost[] {
+ return items.map(({ content }) => {
+ const mod = content as PostModule;
+ const m = mod.metadata;
+ return {
+ permalink: m.permalink,
+ title: m.title,
+ description: m.description,
+ date: m.date,
+ formattedDate: formatDate(m.date),
+ readingMinutes: Math.max(1, Math.round(m.readingTime ?? 1)),
+ category: m.tags[0] ?? null,
+ tags: m.tags,
+ authors: m.authors,
+ image: mod.assets?.image ?? (m.frontMatter.image as string | undefined),
+ featured: m.frontMatter.featured === true,
+ };
+ });
+}
+
+/** Lower-cased haystack for the client-side search box. */
+export function searchText(p: JournalPost): string {
+ return [p.title, p.description, p.category?.label, ...p.tags.map((t) => t.label), ...p.authors.map((a) => a.name)]
+ .filter(Boolean)
+ .join(' ')
+ .toLowerCase();
+}
diff --git a/website/src/css/custom.css b/website/src/css/custom.css
index 827ab6ef..8ea578bf 100644
--- a/website/src/css/custom.css
+++ b/website/src/css/custom.css
@@ -102,13 +102,28 @@
border-right: 1px solid var(--mx-site-line);
}
-/* ---- Navbar: hairline, translucent, same on docs and homepage ---- */
+/* ---- Navbar: hairline, translucent, same on docs and homepage ----
+ * The blur lives on a pseudo-element, never on .navbar itself. A
+ * backdrop-filter makes its element the containing block for position:fixed
+ * descendants, and the mobile drawer (.navbar-sidebar) is rendered inside the
+ * navbar: with the filter on .navbar, Safari and every iOS browser squeeze the
+ * drawer to the navbar's 64px height, so the menu opens blank. */
.navbar {
+ background: transparent;
+ border-bottom: 1px solid var(--mx-site-line);
+}
+.navbar::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ z-index: -1;
+ pointer-events: none;
background: color-mix(in srgb, var(--ifm-background-color) 82%, transparent);
- backdrop-filter: saturate(160%) blur(14px);
-webkit-backdrop-filter: saturate(160%) blur(14px);
- border-bottom: 1px solid var(--mx-site-line);
+ backdrop-filter: saturate(160%) blur(14px);
}
+/* While the drawer is open, keep the bar opaque behind it. */
+.navbar.navbar-sidebar--show::before { background: var(--ifm-background-color); }
.navbar__title { font-weight: 600; letter-spacing: -0.01em; }
.navbar__logo { height: 26px; }
.navbar__item.navbar__link { font-size: 0.92rem; font-weight: 500; }
diff --git a/website/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx b/website/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx
new file mode 100644
index 00000000..e38949e2
--- /dev/null
+++ b/website/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import clsx from 'clsx';
+import Layout from '@theme/Layout';
+import { PageMetadata, HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common';
+import SearchMetadata from '@theme/SearchMetadata';
+import type { Props } from '@theme/Blog/Pages/BlogAuthorsPostsPage';
+import JournalIndex from '@site/src/components/Journal/JournalIndex';
+import SocialMeta from '@site/src/components/Journal/SocialMeta';
+import { toJournalPosts } from '@site/src/components/Journal/posts';
+
+/** Everything one author has written, in the journal layout. */
+export default function BlogAuthorsPostsPage({ author, items }: Props): React.ReactElement {
+ const name = author.name ?? author.key;
+ const title = `${name} · Mercury Journal`;
+ const intro = [author.title, author.description].filter(Boolean).join('. ');
+ return (
+ <HtmlClassNameProvider className={clsx(ThemeClassNames.wrapper.blogPages, ThemeClassNames.page.blogAuthorsPostsPage, 'mj-root')}>
+ <PageMetadata title={title} description={intro || `Posts by ${name}.`} />
+ <SearchMetadata tag="blog_authors_posts" />
+ <SocialMeta permalink={author.page?.permalink ?? `/blog/authors/${author.key}`} title={title} imageAlt={`Posts by ${name} on the Mercury Journal`} breadcrumbs={[{ name: 'Mercury', path: '/' }, { name: 'Journal', path: '/blog' }, { name, path: author.page?.permalink ?? '/blog/authors' }]} />
+ <Layout>
+ <JournalIndex posts={toJournalPosts(items)} eyebrow="Mercury Journal · Author" heading={name} intro={intro || undefined} archive />
+ </Layout>
+ </HtmlClassNameProvider>
+ );
+}
diff --git a/website/src/theme/BlogListPage/index.tsx b/website/src/theme/BlogListPage/index.tsx
new file mode 100644
index 00000000..178be700
--- /dev/null
+++ b/website/src/theme/BlogListPage/index.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import clsx from 'clsx';
+import Layout from '@theme/Layout';
+import { PageMetadata, HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common';
+import SearchMetadata from '@theme/SearchMetadata';
+import BlogListPageStructuredData from '@theme/BlogListPage/StructuredData';
+import type { Props } from '@theme/BlogListPage';
+import JournalIndex from '@site/src/components/Journal/JournalIndex';
+import SocialMeta from '@site/src/components/Journal/SocialMeta';
+import { toJournalPosts } from '@site/src/components/Journal/posts';
+
+/** Journal home: featured post, search, category/author filters, sorting. */
+export default function BlogListPage(props: Props): React.ReactElement {
+ const { metadata, items } = props;
+ return (
+ <HtmlClassNameProvider className={clsx(ThemeClassNames.wrapper.blogPages, ThemeClassNames.page.blogListPage, 'mj-root')}>
+ <PageMetadata title={metadata.blogTitle} description={metadata.blogDescription} />
+ <SearchMetadata tag="blog_posts_list" />
+ <BlogListPageStructuredData {...props} />
+ <SocialMeta permalink={metadata.permalink} title={metadata.blogTitle} imageAlt="Mercury Journal: news, engineering notes and field reports from the people building Mercury." breadcrumbs={[{ name: 'Mercury', path: '/' }, { name: 'Journal', path: '/blog' }]} />
+ <Layout>
+ <JournalIndex posts={toJournalPosts(items)} />
+ </Layout>
+ </HtmlClassNameProvider>
+ );
+}
diff --git a/website/src/theme/BlogPostPage/index.tsx b/website/src/theme/BlogPostPage/index.tsx
new file mode 100644
index 00000000..1d7de331
--- /dev/null
+++ b/website/src/theme/BlogPostPage/index.tsx
@@ -0,0 +1,198 @@
+import React, { useEffect, useRef, useState } from 'react';
+import clsx from 'clsx';
+import Layout from '@theme/Layout';
+import Link from '@docusaurus/Link';
+import Head from '@docusaurus/Head';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import { HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common';
+import { BlogPostProvider, useBlogPost } from '@docusaurus/plugin-content-blog/client';
+import BlogPostPageMetadata from '@theme/BlogPostPage/Metadata';
+import BlogPostPageStructuredData from '@theme/BlogPostPage/StructuredData';
+import ContentVisibility from '@theme/ContentVisibility';
+import TOCInline from '@theme/TOCInline';
+import MDXContent from '@theme/MDXContent';
+import type { Props } from '@theme/BlogPostPage';
+import { formatDate } from '@site/src/components/Journal/posts';
+import SocialMeta from '@site/src/components/Journal/SocialMeta';
+import { ProgressBar, leftLabel, useReadingProgress } from '@site/src/components/Journal/ReadingProgress';
+import '@site/src/components/Journal/journal.css';
+
+function useCopy(): [string, (fn: () => Promise<string>) => void] {
+ const [state, setState] = useState('');
+ return [state, (fn) => {
+ fn()
+ .then((text) => navigator.clipboard.writeText(text))
+ .then(() => setState('copied'))
+ .catch(() => setState('failed'))
+ .finally(() => setTimeout(() => setState(''), 2200));
+ }];
+}
+
+function ArticleTools({ permalink, url, title }: { permalink: string; url: string; title: string }): React.ReactElement {
+ const [mdState, copyMd] = useCopy();
+ const [linkState, copyLink] = useCopy();
+ const mdUrl = `${permalink}.md`;
+ const share = encodeURIComponent(url);
+ return (
+ <div className="mj-tools" aria-label="Share and export">
+ <button type="button" onClick={() => copyMd(() => fetch(mdUrl).then((r) => { if (!r.ok) throw new Error(); return r.text(); }))}>
+ {mdState === 'copied' ? 'Copied Markdown' : mdState === 'failed' ? 'Copy failed' : 'Copy as Markdown'}
+ </button>
+ <a href={mdUrl}>View .md</a>
+ <button type="button" onClick={() => copyLink(async () => url)}>{linkState === 'copied' ? 'Link copied' : 'Copy link'}</button>
+ <a href={`https://x.com/intent/post?url=${share}&text=${encodeURIComponent(title)}`} target="_blank" rel="noopener noreferrer">Share on X</a>
+ <a href={`https://www.linkedin.com/sharing/share-offsite/?url=${share}`} target="_blank" rel="noopener noreferrer">LinkedIn</a>
+ </div>
+ );
+}
+
+function Article({ sidebar, children }: { sidebar: Props['sidebar']; children: React.ReactNode }): React.ReactElement {
+ const { metadata, toc, assets } = useBlogPost();
+ const { siteConfig } = useDocusaurusContext();
+ const { title, description, date, readingTime, authors, tags, permalink, nextItem, prevItem, frontMatter } = metadata;
+ const url = `${siteConfig.url}${permalink}`;
+ const image = assets.image ?? (frontMatter.image as string | undefined);
+ const category = tags[0];
+ const minutes = Math.max(1, Math.round(readingTime ?? 1));
+ const more = (sidebar?.items ?? []).filter((i) => i.permalink !== permalink).slice(0, 3);
+ const showToc = !frontMatter.hide_table_of_contents && toc.length > 2;
+ const bodyRef = useRef<HTMLElement>(null);
+ const tocRef = useRef<HTMLElement>(null);
+ const progress = useReadingProgress(bodyRef, minutes);
+ const creators = authors
+ .map((a) => (a.socials as Record<string, string> | undefined)?.x ?? (a.socials as Record<string, string> | undefined)?.twitter)
+ .filter((u): u is string => Boolean(u))
+ .map((u) => `@${u.replace(/\/+$/, '').split('/').pop()}`);
+ const socialImage = typeof frontMatter.social_image === 'string' ? (frontMatter.social_image as string) : undefined;
+
+ useEffect(() => {
+ const links = tocRef.current?.querySelectorAll<HTMLAnchorElement>('a[href^="#"]') ?? [];
+ links.forEach((a) => a.classList.toggle('is-active', a.getAttribute('href') === `#${progress.activeId}`));
+ }, [progress.activeId]);
+
+ return (
+ <main className={clsx('mj-post', !showToc && 'no-toc')}>
+ <Head>
+ <link rel="alternate" type="text/markdown" href={`${permalink}.md`} title="Markdown version" />
+ </Head>
+ <SocialMeta
+ permalink={permalink}
+ title={title}
+ image={socialImage}
+ imageAlt={`${title}. ${category ? `${category.label} · ` : ''}${authors.map((a) => a.name).join(' & ')} · ${minutes} min read`}
+ labels={[['Written by', authors.map((a) => a.name).join(' & ') || 'Mercury'], ['Reading time', `${minutes} min read`]]}
+ creators={creators}
+ section={category?.label}
+ breadcrumbs={[
+ { name: 'Mercury', path: '/' },
+ { name: 'Journal', path: '/blog' },
+ ...(category ? [{ name: category.label, path: category.permalink }] : []),
+ { name: title, path: permalink },
+ ]}
+ />
+ <ProgressBar progress={progress} />
+ <ContentVisibility metadata={metadata} />
+ <header className="mj-post-head">
+ <Link to="/blog" className="mj-back">← Journal</Link>
+ {category && <Link to={category.permalink} className="mj-post-cat">{category.label}</Link>}
+ <h1 className="mj-post-title">{title}</h1>
+ {description && <p className="mj-post-dek">{description}</p>}
+ <div className="mj-post-byline">
+ <div className="mj-post-authors">
+ {authors.map((a) => {
+ const inner = (
+ <>
+ {a.imageURL && <img src={a.imageURL} alt="" width={36} height={36} />}
+ <span>
+ <strong>{a.name}</strong>
+ {a.title && <em>{a.title}</em>}
+ </span>
+ </>
+ );
+ return a.page ? (
+ <Link key={a.key ?? a.name} to={a.page.permalink} className="mj-post-author">{inner}</Link>
+ ) : (
+ <span key={a.key ?? a.name} className="mj-post-author">{inner}</span>
+ );
+ })}
+ </div>
+ <div className="mj-meta">
+ <time dateTime={date}>{formatDate(date)}</time>
+ <span aria-hidden="true">·</span>
+ <span>{minutes} min read</span>
+ </div>
+ </div>
+ </header>
+
+ {image && (
+ <div className="mj-post-banner">
+ <img src={image} alt="" width={1600} height={900} fetchPriority="high" decoding="async" />
+ </div>
+ )}
+
+ <div className={clsx('mj-post-layout', showToc && 'has-toc')}>
+ {showToc && (
+ <aside className="mj-post-toc" aria-label="On this page" ref={tocRef}>
+ <div className="mj-toc-head">
+ <p>On this page</p>
+ <span className="mj-toc-left">{leftLabel(progress)}</span>
+ </div>
+ <div className="mj-toc-meter" aria-hidden="true"><span style={{ transform: `scaleX(${progress.ratio})` }} /></div>
+ <TOCInline toc={toc} maxHeadingLevel={3} />
+ </aside>
+ )}
+ <article className="mj-prose markdown" ref={bodyRef}>
+ {children}
+ </article>
+ </div>
+
+ <footer className="mj-post-foot">
+ <ArticleTools permalink={permalink} url={url} title={title} />
+ {tags.length > 0 && (
+ <div className="mj-post-tags">
+ {tags.map((t) => <Link key={t.permalink} to={t.permalink}>{t.label}</Link>)}
+ </div>
+ )}
+ {(prevItem || nextItem) && (
+ <nav className="mj-pager" aria-label="More posts">
+ {prevItem ? <Link to={prevItem.permalink}><small>Newer</small>{prevItem.title}</Link> : <span />}
+ {nextItem ? <Link to={nextItem.permalink} className="is-next"><small>Older</small>{nextItem.title}</Link> : <span />}
+ </nav>
+ )}
+ {more.length > 0 && (
+ <section className="mj-more">
+ <h2>More from the journal</h2>
+ <ul>
+ {more.map((i) => (
+ <li key={i.permalink}>
+ <Link to={i.permalink}>{i.title}</Link>
+ <time dateTime={new Date(i.date).toISOString()}>{formatDate(i.date)}</time>
+ </li>
+ ))}
+ </ul>
+ </section>
+ )}
+ </footer>
+ </main>
+ );
+}
+
+/** Long-form article page for the Mercury Journal. */
+export default function BlogPostPage(props: Props): React.ReactElement {
+ const BlogPostContent = props.content;
+ return (
+ <BlogPostProvider content={props.content} isBlogPostPage>
+ <HtmlClassNameProvider className={clsx(ThemeClassNames.wrapper.blogPages, ThemeClassNames.page.blogPostPage, 'mj-root')}>
+ <BlogPostPageMetadata />
+ <BlogPostPageStructuredData />
+ <Layout>
+ <Article sidebar={props.sidebar}>
+ <MDXContent>
+ <BlogPostContent />
+ </MDXContent>
+ </Article>
+ </Layout>
+ </HtmlClassNameProvider>
+ </BlogPostProvider>
+ );
+}
diff --git a/website/src/theme/BlogTagsPostsPage/index.tsx b/website/src/theme/BlogTagsPostsPage/index.tsx
new file mode 100644
index 00000000..8e7bde8e
--- /dev/null
+++ b/website/src/theme/BlogTagsPostsPage/index.tsx
@@ -0,0 +1,31 @@
+import React from 'react';
+import clsx from 'clsx';
+import Layout from '@theme/Layout';
+import { PageMetadata, HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common';
+import SearchMetadata from '@theme/SearchMetadata';
+import type { Props } from '@theme/BlogTagsPostsPage';
+import JournalIndex from '@site/src/components/Journal/JournalIndex';
+import SocialMeta from '@site/src/components/Journal/SocialMeta';
+import { toJournalPosts } from '@site/src/components/Journal/posts';
+
+/** Category / tag archive in the journal layout. */
+export default function BlogTagsPostsPage({ tag, items }: Props): React.ReactElement {
+ const title = `${tag.label} · Mercury Journal`;
+ const description = tag.description ?? `Posts about ${tag.label.toLowerCase()} from the Mercury team.`;
+ return (
+ <HtmlClassNameProvider className={clsx(ThemeClassNames.wrapper.blogPages, ThemeClassNames.page.blogTagPostListPage, 'mj-root')}>
+ <PageMetadata title={title} description={description} />
+ <SearchMetadata tag="blog_tags_posts" />
+ <SocialMeta permalink={tag.permalink} title={title} imageAlt={`${tag.label}: ${description}`} breadcrumbs={[{ name: 'Mercury', path: '/' }, { name: 'Journal', path: '/blog' }, { name: tag.label, path: tag.permalink }]} />
+ <Layout>
+ <JournalIndex
+ posts={toJournalPosts(items)}
+ eyebrow="Mercury Journal · Topic"
+ heading={tag.label}
+ intro={`${description} ${tag.count} post${tag.count === 1 ? '' : 's'}.`}
+ archive
+ />
+ </Layout>
+ </HtmlClassNameProvider>
+ );
+}
diff --git a/website/src/theme/MDXComponents.tsx b/website/src/theme/MDXComponents.tsx
new file mode 100644
index 00000000..bad82479
--- /dev/null
+++ b/website/src/theme/MDXComponents.tsx
@@ -0,0 +1,18 @@
+import MDXComponents from '@theme-original/MDXComponents';
+import SocialEmbed from '@site/src/components/Journal/SocialEmbed';
+import { BarChart, Compare, Stats, Td } from '@site/src/components/Journal/Charts';
+
+/**
+ * Global MDX components:
+ * - SocialEmbed is emitted by plugins/remark-social-embeds.cjs for bare links.
+ * - Compare / BarChart / Stats are usable in any post without an import.
+ * - td turns a leading ✓ ◐ ✕ ? into a yes / partial / no / unknown badge.
+ */
+export default {
+ ...MDXComponents,
+ td: Td,
+ SocialEmbed,
+ Compare,
+ BarChart,
+ Stats,
+};
diff --git a/website/src/theme/Mermaid/diagram.css b/website/src/theme/Mermaid/diagram.css
new file mode 100644
index 00000000..09130346
--- /dev/null
+++ b/website/src/theme/Mermaid/diagram.css
@@ -0,0 +1,109 @@
+/* ── Mermaid diagrams ─────────────────────────────────────────────────── */
+.mj-diagram {
+ --d-line: var(--mx-site-line, rgba(127, 127, 127, 0.2));
+ --d-bg: color-mix(in srgb, var(--ifm-background-surface-color) 55%, var(--ifm-background-color));
+ --d-dim: color-mix(in srgb, var(--ifm-color-content) 65%, transparent);
+ --d-lead-fill: #dff1f5; --d-lead-stroke: #0b7285; --d-lead-text: #08414c;
+ --d-accent-fill: #e6f5f8; --d-accent-stroke: #4fa8ba;
+ --d-warm-fill: #fbf0e1; --d-warm-stroke: #d39a52; --d-warm-text: #5a3a12;
+ --d-violet-fill: #f0ebfb; --d-violet-stroke: #9a86d8; --d-violet-text: #3b2c6e;
+ --d-muted-fill: #f2f3f1; --d-muted-stroke: #c9cfcf; --d-muted-text: #5b6468;
+ --d-ok-fill: #e7f5ea; --d-ok-stroke: #4c9a62; --d-ok-text: #1d4a2a;
+ --d-danger-fill: #fbe9e8; --d-danger-stroke: #cf5b52; --d-danger-text: #6b1d18;
+ margin: 2.2em 0; border: 1px solid var(--d-line); border-radius: 16px; background: var(--d-bg); overflow: hidden;
+}
+[data-theme='dark'] .mj-diagram {
+ --d-lead-fill: #10313a; --d-lead-stroke: #7dd3e0; --d-lead-text: #e6f8fb;
+ --d-accent-fill: #12262d; --d-accent-stroke: #4f9fae;
+ --d-warm-fill: #2a1f12; --d-warm-stroke: #d6a061; --d-warm-text: #f6e4cc;
+ --d-violet-fill: #1f1a33; --d-violet-stroke: #9d8be0; --d-violet-text: #ebe5fb;
+ --d-muted-fill: #151a1e; --d-muted-stroke: #2c353b; --d-muted-text: #9aa6ad;
+ --d-ok-fill: #12261a; --d-ok-stroke: #57b572; --d-ok-text: #dcf3e2;
+ --d-danger-fill: #2c1514; --d-danger-stroke: #e06a60; --d-danger-text: #fbe1de;
+}
+
+.mj-diagram-head {
+ display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
+ padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--d-line);
+ background: color-mix(in srgb, var(--ifm-background-surface-color) 80%, var(--ifm-background-color));
+}
+.mj-diagram-kind {
+ font-family: var(--ifm-font-family-monospace); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
+ color: var(--ifm-color-primary); padding: 3px 9px; border-radius: 999px;
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 40%, transparent);
+}
+.mj-diagram-title { font-size: 0.92rem; font-weight: 600; color: var(--ifm-heading-color); }
+.mj-diagram-actions { margin-left: auto; display: flex; gap: 6px; }
+.mj-diagram-actions button, .mj-diagram-viewer-bar button {
+ font: inherit; font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; cursor: pointer;
+ border: 1px solid var(--d-line, rgba(127,127,127,.25)); background: transparent; color: var(--ifm-color-content);
+}
+.mj-diagram-actions button:hover:not(:disabled), .mj-diagram-viewer-bar button:hover { border-color: var(--ifm-heading-color); color: var(--ifm-heading-color); }
+.mj-diagram-actions button:disabled { opacity: 0.4; cursor: default; }
+
+.mj-diagram-canvas {
+ position: relative; overflow-x: auto; overflow-y: hidden; padding: 24px 16px; -webkit-overflow-scrolling: touch;
+ background-image: radial-gradient(color-mix(in srgb, var(--ifm-color-content) 14%, transparent) 1px, transparent 1px);
+ background-size: 18px 18px; background-position: -9px -9px;
+ scrollbar-width: thin;
+}
+.mj-diagram-svg { display: flex; justify-content: center; min-width: min-content; }
+.mj-diagram-svg svg { display: block; margin: 0 auto; }
+.mj-diagram-loading { height: 220px; border-radius: 12px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ifm-color-content) 7%, transparent), transparent); background-size: 200% 100%; animation: mj-d-shimmer 1.4s linear infinite; }
+@keyframes mj-d-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
+.mj-diagram-hint { padding: 0 18px 10px; font-size: 0.76rem; color: var(--d-dim); text-align: center; }
+.mj-diagram > figcaption { padding: 12px 18px 14px; border-top: 1px solid var(--d-line); font-size: 0.86rem; color: var(--d-dim); text-align: center; }
+.mj-diagram-source { margin: 0; padding: 16px 18px; font-size: 0.8rem; white-space: pre; overflow: auto; background: transparent !important; }
+
+/* shape refinements inside the SVG */
+.mj-diagram svg .node rect, .mj-diagram svg .node .label-container { rx: 10px; ry: 10px; }
+.mj-diagram svg .node rect, .mj-diagram svg .node polygon, .mj-diagram svg .node circle, .mj-diagram svg .node path { stroke-width: 1.3px; }
+.mj-diagram svg .cluster rect { rx: 14px; ry: 14px; stroke-dasharray: 4 4; stroke-width: 1px; }
+.mj-diagram svg .cluster-label, .mj-diagram svg .cluster text { font-family: var(--ifm-font-family-monospace); font-size: 12px; letter-spacing: 0.04em; }
+.mj-diagram svg .edgePath .path, .mj-diagram svg .flowchart-link { stroke-width: 1.4px; }
+.mj-diagram svg .edgeLabel p { font-size: 13px; }
+.mj-diagram svg .edgeLabel rect, .mj-diagram svg .labelBkg { rx: 5px; ry: 5px; }
+.mj-diagram svg .nodeLabel, .mj-diagram svg .label { line-height: 1.35; }
+.mj-diagram svg .nodeLabel small, .mj-diagram svg .label small { display: block; font-size: 0.78em; opacity: 0.72; margin-top: 2px; }
+.mj-diagram svg .actor { stroke-width: 1.3px; }
+.mj-diagram svg rect.actor { rx: 10px; ry: 10px; }
+.mj-diagram svg .messageText { font-size: 13px; }
+.mj-diagram svg .note { rx: 8px; ry: 8px; }
+
+/* author classes: `A:::lead` or `class A lead` */
+.mj-diagram svg .node.lead > rect, .mj-diagram svg .node.lead > polygon, .mj-diagram svg .node.lead > circle, .mj-diagram svg .node.lead > path { fill: var(--d-lead-fill) !important; stroke: var(--d-lead-stroke) !important; stroke-width: 1.8px !important; }
+.mj-diagram svg .node.lead .nodeLabel, .mj-diagram svg .node.lead .label { color: var(--d-lead-text) !important; fill: var(--d-lead-text) !important; font-weight: 600; }
+.mj-diagram svg .node.accent > rect, .mj-diagram svg .node.accent > polygon, .mj-diagram svg .node.accent > circle, .mj-diagram svg .node.accent > path { fill: var(--d-accent-fill) !important; stroke: var(--d-accent-stroke) !important; }
+.mj-diagram svg .node.warm > rect, .mj-diagram svg .node.warm > polygon, .mj-diagram svg .node.warm > circle, .mj-diagram svg .node.warm > path { fill: var(--d-warm-fill) !important; stroke: var(--d-warm-stroke) !important; }
+.mj-diagram svg .node.warm .nodeLabel { color: var(--d-warm-text) !important; }
+.mj-diagram svg .node.violet > rect, .mj-diagram svg .node.violet > polygon, .mj-diagram svg .node.violet > circle, .mj-diagram svg .node.violet > path { fill: var(--d-violet-fill) !important; stroke: var(--d-violet-stroke) !important; }
+.mj-diagram svg .node.violet .nodeLabel { color: var(--d-violet-text) !important; }
+.mj-diagram svg .node.muted > rect, .mj-diagram svg .node.muted > polygon, .mj-diagram svg .node.muted > circle, .mj-diagram svg .node.muted > path { fill: var(--d-muted-fill) !important; stroke: var(--d-muted-stroke) !important; stroke-dasharray: 3 3; }
+.mj-diagram svg .node.muted .nodeLabel { color: var(--d-muted-text) !important; }
+.mj-diagram svg .node.ok > rect, .mj-diagram svg .node.ok > polygon, .mj-diagram svg .node.ok > circle, .mj-diagram svg .node.ok > path { fill: var(--d-ok-fill) !important; stroke: var(--d-ok-stroke) !important; }
+.mj-diagram svg .node.ok .nodeLabel { color: var(--d-ok-text) !important; }
+.mj-diagram svg .node.danger > rect, .mj-diagram svg .node.danger > polygon, .mj-diagram svg .node.danger > circle, .mj-diagram svg .node.danger > path { fill: var(--d-danger-fill) !important; stroke: var(--d-danger-stroke) !important; }
+.mj-diagram svg .node.danger .nodeLabel { color: var(--d-danger-text) !important; }
+
+/* full-screen viewer */
+.mj-diagram-viewer {
+ position: fixed; inset: 0; z-index: calc(var(--ifm-z-index-fixed) + 50); display: flex; flex-direction: column;
+ background: color-mix(in srgb, var(--ifm-background-color) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
+}
+.mj-diagram-viewer-bar {
+ display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
+ border-bottom: 1px solid var(--mx-site-line); background: var(--ifm-background-color);
+}
+.mj-diagram-viewer-bar strong { font-size: 0.95rem; color: var(--ifm-heading-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.mj-diagram-viewer-bar div { display: flex; gap: 6px; flex: none; }
+.mj-diagram-viewer-stage { flex: 1; overflow: auto; padding: 32px; outline: none; -webkit-overflow-scrolling: touch; }
+.mj-diagram-viewer-svg { margin: 0 auto; min-width: 100%; }
+.mj-diagram-viewer-svg svg { width: 100% !important; max-width: none !important; height: auto !important; }
+
+@media (max-width: 640px) {
+ .mj-diagram { border-radius: 14px; margin-left: -4px; margin-right: -4px; }
+ .mj-diagram-head { padding: 9px 10px 9px 14px; }
+ .mj-diagram-title { order: 3; flex-basis: 100%; font-size: 0.88rem; }
+ .mj-diagram-canvas { padding: 20px 14px; }
+ .mj-diagram-viewer-stage { padding: 16px; }
+}
diff --git a/website/src/theme/Mermaid/index.tsx b/website/src/theme/Mermaid/index.tsx
new file mode 100644
index 00000000..dbbdcc8a
--- /dev/null
+++ b/website/src/theme/Mermaid/index.tsx
@@ -0,0 +1,216 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import ErrorBoundary from '@docusaurus/ErrorBoundary';
+import { useColorMode } from '@docusaurus/theme-common';
+import { MermaidContainerClassName, useMermaidRenderResult } from '@docusaurus/theme-mermaid/client';
+import type { MermaidConfig, RenderResult } from 'mermaid';
+import './diagram.css';
+
+/**
+ * Mermaid, rendered for mercuryagent.sh instead of with the stock theme.
+ *
+ * %% title: Fleet runtime ← optional header line
+ * %% caption: One process, many bots ← optional caption under the figure
+ * flowchart LR
+ * A[Lead]:::lead --> B[Crew]
+ *
+ * Node classes `lead`, `accent`, `warm`, `violet`, `muted`, `ok`, `danger`
+ * are styled by diagram.css with theme-aware colours, so the same source
+ * reads well in light and dark mode. Wide diagrams keep a readable minimum
+ * width and scroll sideways on phones; Expand opens a zoomable full view.
+ */
+
+const FONT = "Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
+
+const PALETTE = {
+ dark: {
+ background: 'transparent', primaryColor: '#121c23', primaryTextColor: '#e8eef3', primaryBorderColor: '#2f5966',
+ secondaryColor: '#1a1628', secondaryTextColor: '#e8eef3', secondaryBorderColor: '#4a3f73',
+ tertiaryColor: '#1f1810', tertiaryTextColor: '#e8eef3', tertiaryBorderColor: '#6b4f2e',
+ lineColor: '#5e7a86', textColor: '#c9d3d9', mainBkg: '#121c23', nodeBorder: '#2f5966',
+ clusterBkg: 'rgba(125, 211, 224, 0.04)', clusterBorder: '#21404a', titleColor: '#e8eef3',
+ edgeLabelBackground: '#0d1216', noteBkgColor: '#1f1810', noteTextColor: '#f3e6d2', noteBorderColor: '#6b4f2e',
+ actorBkg: '#121c23', actorBorder: '#2f5966', actorTextColor: '#e8eef3', actorLineColor: '#3a4d55',
+ signalColor: '#9fb2bb', signalTextColor: '#d6dee3', labelBoxBkgColor: '#121c23', labelBoxBorderColor: '#2f5966',
+ labelTextColor: '#e8eef3', loopTextColor: '#c9d3d9', activationBkgColor: '#1a2a33', activationBorderColor: '#3f7584',
+ sequenceNumberColor: '#0b0e12',
+ },
+ light: {
+ background: 'transparent', primaryColor: '#eef6f8', primaryTextColor: '#111416', primaryBorderColor: '#93c4cf',
+ secondaryColor: '#f3effb', secondaryTextColor: '#111416', secondaryBorderColor: '#bcaee6',
+ tertiaryColor: '#fbf2e6', tertiaryTextColor: '#111416', tertiaryBorderColor: '#e3c193',
+ lineColor: '#7f9199', textColor: '#2b3236', mainBkg: '#eef6f8', nodeBorder: '#93c4cf',
+ clusterBkg: 'rgba(11, 114, 133, 0.035)', clusterBorder: '#d3e2e6', titleColor: '#111416',
+ edgeLabelBackground: '#fbfbf8', noteBkgColor: '#fbf2e6', noteTextColor: '#4a3418', noteBorderColor: '#e3c193',
+ actorBkg: '#eef6f8', actorBorder: '#93c4cf', actorTextColor: '#111416', actorLineColor: '#c4d3d8',
+ signalColor: '#5d6c73', signalTextColor: '#2b3236', labelBoxBkgColor: '#eef6f8', labelBoxBorderColor: '#93c4cf',
+ labelTextColor: '#111416', loopTextColor: '#2b3236', activationBkgColor: '#dcedf1', activationBorderColor: '#6aaab8',
+ sequenceNumberColor: '#ffffff',
+ },
+} as const;
+
+function configFor(mode: 'light' | 'dark'): MermaidConfig {
+ return {
+ startOnLoad: false,
+ theme: 'base',
+ securityLevel: 'strict',
+ fontFamily: FONT,
+ themeVariables: { ...PALETTE[mode], fontFamily: FONT, fontSize: '16px' },
+ flowchart: { curve: 'basis', padding: 16, nodeSpacing: 44, rankSpacing: 52, htmlLabels: true, useMaxWidth: false, diagramPadding: 12, wrappingWidth: 280 },
+ sequence: { useMaxWidth: false, mirrorActors: false, width: 112, actorMargin: 18, wrap: true, boxMargin: 12, messageMargin: 40, noteMargin: 12, rightAngles: false, showSequenceNumbers: false },
+ state: { useMaxWidth: false },
+ class: { useMaxWidth: false },
+ er: { useMaxWidth: false },
+ gantt: { useMaxWidth: false },
+ } as MermaidConfig;
+}
+
+const TYPES: [RegExp, string][] = [
+ [/^(flowchart|graph)\b/, 'Flowchart'], [/^sequenceDiagram/, 'Sequence'], [/^stateDiagram/, 'State machine'],
+ [/^classDiagram/, 'Class diagram'], [/^erDiagram/, 'Data model'], [/^gantt/, 'Timeline'], [/^timeline/, 'Timeline'],
+ [/^journey/, 'Journey'], [/^mindmap/, 'Mind map'], [/^pie/, 'Chart'], [/^xychart/, 'Chart'], [/^quadrantChart/, 'Quadrant'],
+ [/^architecture/, 'Architecture'], [/^block/, 'Block diagram'], [/^gitGraph/, 'Git graph'],
+];
+
+function parse(value: string): { source: string; title?: string; caption?: string; kind: string } {
+ let title: string | undefined;
+ let caption: string | undefined;
+ const lines = value.split('\n').filter((line) => {
+ const m = line.match(/^\s*%%\s*(title|caption)\s*:\s*(.+)$/i);
+ if (!m) return true;
+ if (m[1].toLowerCase() === 'title') title = m[2].trim();
+ else caption = m[2].trim();
+ return false;
+ });
+ const source = lines.join('\n').trim();
+ const first = source.split('\n').find((l) => l.trim() && !l.trim().startsWith('%%'))?.trim() ?? '';
+ const kind = TYPES.find(([re]) => re.test(first))?.[1] ?? 'Diagram';
+ return { source, title, caption, kind };
+}
+
+function naturalWidth(svg: SVGSVGElement | null): number {
+ const vb = svg?.viewBox?.baseVal;
+ return vb && vb.width ? vb.width : svg?.getBoundingClientRect().width ?? 0;
+}
+
+function Svg({ result, onReady }: { result: RenderResult; onReady?: (svg: SVGSVGElement | null) => void }) {
+ const ref = useRef<HTMLDivElement>(null);
+ useEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ result.bindFunctions?.(el);
+ const svg = el.querySelector('svg');
+ if (svg) {
+ const w = naturalWidth(svg);
+ svg.removeAttribute('height');
+ svg.style.maxWidth = `${w}px`;
+ // Never shrink below ~75% of natural size: below that, labels get too small to read; scroll instead.
+ svg.style.minWidth = `${Math.round(Math.min(w, Math.max(460, w * 0.66)))}px`;
+ svg.style.width = '100%';
+ svg.style.height = 'auto';
+ }
+ onReady?.(svg);
+ }, [result, onReady]);
+ // eslint-disable-next-line react/no-danger
+ return <div ref={ref} className={`${MermaidContainerClassName} mj-diagram-svg`} dangerouslySetInnerHTML={{ __html: result.svg }} />;
+}
+
+function Viewer({ svg, title, onClose }: { svg: string; title?: string; onClose: () => void }) {
+ const [zoom, setZoom] = useState(1);
+ const box = useRef<HTMLDivElement>(null);
+ useEffect(() => {
+ const prev = document.body.style.overflow;
+ document.body.style.overflow = 'hidden';
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') onClose();
+ if (e.key === '+' || e.key === '=') setZoom((z) => Math.min(4, z + 0.25));
+ if (e.key === '-') setZoom((z) => Math.max(0.5, z - 0.25));
+ };
+ window.addEventListener('keydown', onKey);
+ box.current?.focus();
+ return () => {
+ document.body.style.overflow = prev;
+ window.removeEventListener('keydown', onKey);
+ };
+ }, [onClose]);
+ return (
+ <div className="mj-diagram-viewer" role="dialog" aria-modal="true" aria-label={title ?? 'Diagram'} onClick={onClose}>
+ <div className="mj-diagram-viewer-bar" onClick={(e) => e.stopPropagation()}>
+ <strong>{title ?? 'Diagram'}</strong>
+ <div>
+ <button type="button" onClick={() => setZoom((z) => Math.max(0.5, z - 0.25))} aria-label="Zoom out">−</button>
+ <button type="button" onClick={() => setZoom(1)} aria-label="Reset zoom">{Math.round(zoom * 100)}%</button>
+ <button type="button" onClick={() => setZoom((z) => Math.min(4, z + 0.25))} aria-label="Zoom in">+</button>
+ <button type="button" onClick={onClose} aria-label="Close">Close</button>
+ </div>
+ </div>
+ <div className="mj-diagram-viewer-stage" ref={box} tabIndex={-1} onClick={(e) => e.stopPropagation()}>
+ {/* eslint-disable-next-line react/no-danger */}
+ <div className="mj-diagram-viewer-svg" style={{ width: `${zoom * 100}%` }} dangerouslySetInnerHTML={{ __html: svg }} />
+ </div>
+ </div>
+ );
+}
+
+function Diagram({ value }: { value: string }) {
+ const { colorMode } = useColorMode();
+ const { source, title, caption, kind } = useMemo(() => parse(value), [value]);
+ const config = useMemo(() => configFor(colorMode === 'dark' ? 'dark' : 'light'), [colorMode]);
+ const result = useMermaidRenderResult({ text: source, config });
+ const [open, setOpen] = useState(false);
+ const [copied, setCopied] = useState(false);
+ const [scrolls, setScrolls] = useState(false);
+ const canvas = useRef<HTMLDivElement>(null);
+
+ const onReady = useCallback(() => {
+ const el = canvas.current;
+ if (el) setScrolls(el.scrollWidth > el.clientWidth + 4);
+ }, []);
+ useEffect(() => {
+ const el = canvas.current;
+ if (!el || !('ResizeObserver' in window)) return undefined;
+ const ro = new ResizeObserver(() => setScrolls(el.scrollWidth > el.clientWidth + 4));
+ ro.observe(el);
+ return () => ro.disconnect();
+ }, [result]);
+
+ const copy = () => {
+ navigator.clipboard?.writeText(value).then(() => {
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1800);
+ }).catch(() => undefined);
+ };
+
+ return (
+ <figure className="mj-diagram">
+ <header className="mj-diagram-head">
+ <span className="mj-diagram-kind">{kind}</span>
+ {title && <strong className="mj-diagram-title">{title}</strong>}
+ <span className="mj-diagram-actions">
+ <button type="button" onClick={copy}>{copied ? 'Copied' : 'Copy source'}</button>
+ <button type="button" onClick={() => setOpen(true)} disabled={!result}>Expand</button>
+ </span>
+ </header>
+ <div className={`mj-diagram-canvas${scrolls ? ' is-scrolling' : ''}`} ref={canvas}>
+ {result ? <Svg result={result} onReady={onReady} /> : <div className="mj-diagram-loading" aria-hidden="true" />}
+ </div>
+ {scrolls && <div className="mj-diagram-hint">Scroll sideways or tap Expand to see the whole diagram</div>}
+ {caption && <figcaption>{caption}</figcaption>}
+ {open && result && <Viewer svg={result.svg} title={title} onClose={() => setOpen(false)} />}
+ </figure>
+ );
+}
+
+export default function Mermaid({ value }: { value: string }): React.ReactElement {
+ return (
+ <ErrorBoundary
+ fallback={({ error }) => (
+ <figure className="mj-diagram is-error">
+ <header className="mj-diagram-head"><span className="mj-diagram-kind">Diagram error</span><strong className="mj-diagram-title">{String(error?.message ?? error).split('\n')[0]}</strong></header>
+ <pre className="mj-diagram-source">{value}</pre>
+ </figure>
+ )}
+ >
+ <Diagram value={value} />
+ </ErrorBoundary>
+ );
+}
diff --git a/website/static/img/avatar-mercury.png b/website/static/img/avatar-mercury.png
new file mode 100644
index 00000000..6a566fd2
Binary files /dev/null and b/website/static/img/avatar-mercury.png differ