opencode/services/site
Luke Parker 08623d032b fix(core): list the browser on the step that follows a restart or an idle unload
A step lists the browser tools only if its session holds the desktop's
grant when the step selects its tools. After the server restarts or
unloads a location, the desktop attaches again only once it sees the
session run, about 100 ms after that step selected its tools, so the
step ran without the browser and the model was told it was gone.

- core: the experimental.step.before session hook runs before a step
  selects its agent, tools and instructions, as the MCP startup grace
  does for servers that are still connecting.
- plugin-browser: a session whose attachment ended is expected. Its next
  step waits for the desktop, 2 s at most and once; a step also waits
  for an attach that is in flight.
2026-11-25 09:11:08 +10:00
..
perf chore(perf): bench with strobe 0.20.0 from github.com/anomalyco/strobe (#62705) 2026-11-08 02:26:06 -06:00
public chore(web): move the V1 docs into services/site and remove packages/web (#63117) 2026-11-10 07:58:23 -06:00
script chore(site): serve OG Studio link cards from the files bucket, add docs previews (#63560) 2026-11-12 10:00:20 -06:00
src fix(core): list the browser on the step that follows a restart or an idle unload 2026-11-25 09:11:08 +10:00
test fix(site): permanent redirects for moved docs and marketing pages (#64305) 2026-11-17 15:08:52 -06:00
textjs chore(site): update Text.js to 1.6.1 and drop the DevTools focus workaround (#62353) 2026-11-06 14:09:24 +00:00
.gitignore feat(site): serve the V2 docs at /docs (#62389) 2026-11-06 17:57:04 +00:00
AGENTS.md refactor(site): share the docs' and static pages' shell code (#63161) 2026-11-10 17:04:33 +00:00
cloudflare.config.ts fix(site): permanent redirects for moved docs and marketing pages (#64305) 2026-11-17 15:08:52 -06:00
DESIGN.md fix(site): serve AV1/HEVC card videos and load card media after the page (#62971) 2026-11-09 16:55:13 -06:00
media-manifest.txt fix(site): serve 1344-wide hero videos to 1x screens and phones (#63135) 2026-11-10 15:07:04 +00:00
MEDIA.md chore(site): serve OG Studio link cards from the files bucket, add docs previews (#63560) 2026-11-12 10:00:20 -06:00
package.json feat(site): serve V1 docs in the new design at /v1/docs (#62951) 2026-11-09 18:35:13 -06:00
README.md feat(site): serve V1 docs in the new design at /v1/docs (#62951) 2026-11-09 18:35:13 -06:00
strobe.json perf(site): cut forced style recalcs on load (#62421) 2026-11-06 20:33:10 +00:00
tsconfig.json feat(site): deploy the opencode.ai site separately from the docs (#62209) 2026-11-05 17:53:39 -05:00
vite.config.ts refactor(site): make every page static and stop shipping the app's JavaScript (#63067) 2026-11-10 09:34:19 +00:00

SolidStart

Everything you need to build a Solid project, powered by solid-start;

Creating a project

# create a new project in the current directory
npm init solid@latest

# create a new project in my-app
npm init solid@latest my-app

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

GitHub API

The Worker holds no GitHub token. Stars, contributors and avatars come from the build-time snapshot (script/github-snapshot.ts, src/lib/github-snapshot.json). The changelog reads releases from the GitHub API without a token (src/lib/changelog.ts, src/lib/github-api.ts), cached for 15 minutes in memory and at the edge, with the snapshot as fallback. Without a token GitHub allows 60 calls an hour per IP; in dev the last good releases are kept in $TMPDIR/opencode-site-github/, so a restart while rate limited still has them. The snapshot script uses GITHUB_TOKEN when it is set (CI passes the workflow's own token):

GITHUB_TOKEN=$(gh auth token) bun ./script/github-snapshot.ts

Never commit a token.

Building and deploying

bun run build -- --mode dev builds the site (Nitro's cloudflare-module preset) into the Build Output Specification tree in .cloudflare/output; bun run deploy:dev builds and runs cf deploy --prebuilt --mode dev. cloudflare.config.ts defines the Worker (opencode-site-dev on dev.opencode.ai, opencode-site-production on opencode.ai), its bindings and its routes. CI deploys on pushes to dev and production (.github/workflows/deploy-site.yml). Production takes no routes until productionOwnsRoot is switched on.

Each build also carries the hashed scripts and stylesheets of the last 20 builds it replaces (for up to a week), downloaded from the live site's /_build/retained.json, so pages already open keep loading their code after a deploy (script/retain-assets.ts). A rollback in the Cloudflare dashboard restores the older version's assets only, so tabs opened on the rolled-back build reload once.

The V2 docs at /docs and the V1 docs at /v1/docs are part of this app (src/docs/, see src/docs/AGENTS.md). script/build.ts prerenders them into the Worker's assets after vite build. A /docs URL without a V2 page redirects to the same path on the V1 docs.

This project was created with the Solid CLI