Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,17 @@ jobs:
--ignore=GHSA-5gmw-xhrv-c9v3 --ignore=GHSA-85c8-ppgw-ccpr
--ignore=GHSA-p6vx-979v-rg4c --ignore=GHSA-jp82-f5mq-hwhp
--ignore=GHSA-jqcg-44mw-7w3h
# Docs/dev-only transitives, no src/ or tarball reach (revisit on bumps):
# MCP SDK + body-parser via Blume and via @stainless-code/codemap devDep
# (evidence/skill tooling only), astro's zod, dompurify, markdown-it
# (typedoc), sharp, undici, launch-editor/shell-quote (changesets).
--ignore=GHSA-6qxp-vccf-f47h --ignore=GHSA-22jm-h49p-29qw
--ignore=GHSA-46jr-4wx8-v453 --ignore=GHSA-27r3-jxmh-p828
--ignore=GHSA-cg2g-xh64-v4q7 --ignore=GHSA-mrv2-3pqr-j5jr
--ignore=GHSA-587h-7wmj-h5pm --ignore=GHSA-pqg4-j6r4-53mv
--ignore=GHSA-gfr2-rv44-r23c --ignore=GHSA-r7fv-28h4-cvq7
--ignore=GHSA-wq5f-xc86-pv6w --ignore=GHSA-xjj6-f33q-929c
--ignore=GHSA-mrhx-c7xc-m3w5
)
NO_COLOR=1 bun audit "${IGNORES[@]}" 2>&1 | sed -E 's/\x1b\[[0-9;]*m//g' > /tmp/bun-audit.log
cat /tmp/bun-audit.log
Expand Down
66 changes: 66 additions & 0 deletions apps/docs/public/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,69 @@ ErrorDocument 404 /layers/404.html
<FilesMatch "^llms(-full|-small)?\.txt$">
Header set X-Robots-Tag "noindex"
</FilesMatch>

# Agent discovery (isitagentready) — Apache port of dist/_headers.
# Apache ignores that file; this is what actually ships headers under /layers.
<IfModule mod_mime.c>
AddType application/json .json
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</IfModule>

# Compound extension needs a filename match — AddType splits on dots.
<FilesMatch "\.tar\.gz$">
ForceType application/gzip
</FilesMatch>

# Homepage Link header (RFC 8288 / RFC 9727 s3). Minimal form; keep in sync with dist/_headers.
<IfModule mod_setenvif.c>
SetEnvIf Request_URI "^/layers/$" IS_LAYERS_HOME
SetEnvIf Request_URI "^/layers/index\.html$" IS_LAYERS_HOME
</IfModule>
<IfModule mod_headers.c>
Header always set Link "</layers/.well-known/api-catalog>; rel=\"api-catalog\"; type=\"application/linkset+json\", </layers/.well-known/ai-catalog.json>; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", </layers/openapi.json>; rel=\"service-desc\"; type=\"application/json\", </layers/agent-readability.json>; rel=\"describedby\"; type=\"application/json\", </layers/llms.txt>; rel=\"describedby\"; type=\"text/plain\", </layers/index.md>; rel=\"alternate\"; type=\"text/markdown\"" env=IS_LAYERS_HOME
# Internal rewrites rename request env vars with a REDIRECT_ prefix.
Header always set Link "</layers/.well-known/api-catalog>; rel=\"api-catalog\"; type=\"application/linkset+json\", </layers/.well-known/ai-catalog.json>; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", </layers/openapi.json>; rel=\"service-desc\"; type=\"application/json\", </layers/agent-readability.json>; rel=\"describedby\"; type=\"application/json\", </layers/llms.txt>; rel=\"describedby\"; type=\"text/plain\", </layers/index.md>; rel=\"alternate\"; type=\"text/markdown\"" env=REDIRECT_IS_LAYERS_HOME
</IfModule>

# Extensionless file needs explicit type (else text/plain fails the scan).
<Files "api-catalog">
ForceType 'application/linkset+json; profile="https://www.rfc-editor.org/info/rfc9727"'
</Files>

# Serve the catalog with its advertised media type (matches Link rel=ai-catalog).
<Files "ai-catalog.json">
ForceType application/ai-catalog+json
</Files>

<IfModule mod_headers.c>
<FilesMatch "(^ai-catalog\.json$|^ard\.json$|^api-catalog$|^agent-readability\.json$|index\.json$)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>

# Pragmatic Accept: text/markdown (static-first, not strict RFC).
# Subdir rules shadow the domain-root rewrite block, so both live here.
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_URI} \.(css|js|mjs|map|png|jpe?g|webp|gif|svg|avif|ico|woff2?|ttf|otf|eot|xml|txt|json|pdf|mp4|webm|mp3|wav|ogg|zip)$ [NC]
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} \.mdx?$ [NC]
RewriteRule ^ - [L]

# /layers/ -> /layers/index.md
RewriteCond %{HTTP:Accept} text/markdown [NC]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
RewriteRule ^$ /layers/index.md [L,T=text/markdown]

# /layers/index.html -> /layers/index.md (same representation as /layers/)
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
RewriteRule ^index\.html$ /layers/index.md [L,T=text/markdown]

# /layers/<route> -> twin .md
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
RewriteCond %{REQUEST_FILENAME} !\.md$ [NC]
RewriteCond %{DOCUMENT_ROOT}/layers/$1.md -f
RewriteRule ^(.+?)/?$ /layers/$1.md [L,T=text/markdown]
</IfModule>
Loading
Loading