Skip to content

AV1: the site on Workers - #2

Merged
ruehowl merged 1 commit into
mainfrom
av1-site
Oct 29, 2026
Merged

ruehowl merged 1 commit into
mainfrom
av1-site

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What (AV-2)

  • apps/web: Cloudflare's Agent Visibility template (MIT, apps/web/LICENSE):
    • upstream's Hono Worker serves /llms.txt, /llms-full.txt, /index.json, /:slug.md, /:slug.jsonld, /jsonld and /robots.txt, all with Content-Signal headers, from the VISIBILITY_CACHE KV store. Pages are enriched through the keyless AI binding, with upstream's deterministic fallback.
    • the React dashboard is built by Vite alone into dist/client as Static Assets. Upstream's run_worker_first list is unchanged.
  • Added /api/health. It reads the store from KV and never calls the model; the deploy smoke checks it.
  • wrangler.template.jsonc renders per environment from the cloudflare-kv wiring document. The committed wrangler.jsonc is the fixture render.
  • ADMIN_TOKEN is an optional Orun secret, pushed to the Worker as a Worker secret (tooling/wire/worker-secrets.mjs). The build runs with it unset, and writes answer 401 while it is missing, as upstream ships.
  • pnpm dev runs wrangler dev --local, matching upstream's remoteBindings: false. pnpm dev:remote uses the account's Workers AI.
  • tests/web runs upstream's suite with every assertion kept, over an in-memory KV store and a stand-in model. It also covers the health route, the enrichment and its fallback, writes with no token, and the config's routes and bindings.

Verified locally

  • pnpm typecheck, pnpm lint, pnpm test (34 tests) and pnpm build pass.
  • wrangler deploy --dry-run binds env.VISIBILITY_CACHE, env.AI and env.ASSETS.
  • Under wrangler dev --local, every surface and the dashboard serve, and SPA fallback works. Writes get 401 with no token and with a wrong one. With ADMIN_TOKEN in .dev.vars, a posted page is enriched, listed in llms.txt and served as Markdown, and /api/refresh clears the cache.

Generated by Claude Code

apps/web is Cloudflare's Agent Visibility template: its Hono Worker serving
llms.txt, llms-full.txt, index.json, per-page Markdown and JSON-LD,
robots.txt and Content-Signal headers from the VISIBILITY_CACHE KV store
enriched through the AI binding, and its React dashboard built by Vite into
the Worker's Static Assets, with upstream's run_worker_first routes. Added:
/api/health, which reads the store and never calls the model, for the
deploy smoke. The wrangler config renders per environment from the
cloudflare-kv root's wiring document; the committed wrangler.jsonc is the
fixture render. Writes stay refused until ADMIN_TOKEN is stored: an
optional Orun secret, pushed to the Worker as a Worker secret
(tooling/wire/worker-secrets.mjs) with the build running without it.

tests/web runs upstream's suite, every assertion kept, over an in-memory
KV store and a stand-in model, plus the health route, the enrichment and
its fallback, writes with no token, and the config's routes and bindings.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
@ruehowl
ruehowl merged commit 7cd28c1 into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants