@vercel/geistdocs 1.23.1 → 1.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{program as T}from"commander";import{access as ce,copyFile as le}from"fs/promises";import{join as pe}from"path";import{cancel as de,intro as ge,isCancel as ue,log as fe,outro as me,spinner as he,text as we}from"@clack/prompts";import{spawn as te}from"child_process";import{readFileSync as se}from"fs";import{cp as ne,readFile as ae,rename as re,writeFile as ie}from"fs/promises";import{join as $}from"path";import{fileURLToPath as oe}from"url";var g="@vercel/geistdocs",m=(e,t=[],s={})=>new Promise((n,a)=>{let r=te(e,t,{stdio:"inherit",...s});r.on("error",a),r.on("close",i=>{if(i===0){n();return}a(new Error(`Command failed with exit code ${i}: ${[e,...t].join(" ")}`))})}),A=["dependencies","devDependencies","optionalDependencies","peerDependencies"],_=()=>JSON.parse(se(new URL("../../package.json",import.meta.url),"utf8")).version,P=async e=>{let t=$(e,"package.json"),s=await ae(t,"utf8");return JSON.parse(s)},x=async(e,t)=>{let s=$(e,"package.json");await ie(s,`${JSON.stringify(t,null,2)}
3
- `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.23.1","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
3
+ `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.24.1","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
@@ -0,0 +1,8 @@
1
+ import type { GeistdocsConfig } from "../config";
2
+ type AgentConfig = GeistdocsConfig["agent"];
3
+ export declare const resolveAgentProductContext: (agent: AgentConfig, fallbackName?: string) => {
4
+ name: string;
5
+ product: import("../config").GeistdocsAgentProductConfig;
6
+ } | undefined;
7
+ export {};
8
+ //# sourceMappingURL=agent-product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-product.d.ts","sourceRoot":"","sources":["../../src/internal/agent-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,KAAK,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAE5C,eAAO,MAAM,0BAA0B,GACrC,OAAO,WAAW,EAClB,eAAe,MAAM;;;aAmBtB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const resolveAgentProductContext = (agent, fallbackName) => {
2
+ if (agent?.enabled === false) {
3
+ return undefined;
4
+ }
5
+ const product = agent?.product;
6
+ const name = product?.name ?? fallbackName;
7
+ if (!(product &&
8
+ name &&
9
+ (product.category || product.audience?.length || product.useCases?.length))) {
10
+ return undefined;
11
+ }
12
+ return { name, product };
13
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAatB,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAiBD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,EAAE,CAYnB;AA8DD,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAqEjE,CAAC"}
1
+ {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAatB,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAiBD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,EAAE,CAYnB;AA4DD,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAqEjE,CAAC"}
@@ -44,7 +44,7 @@ const DropdownNavItem = ({ first, item, }) => {
44
44
  const isActive = useNavActive();
45
45
  const hasActiveChild = item.items.some((child) => !isExternal(child) && isActive(child.href));
46
46
  const sections = groupDropdownItems(item);
47
- return (_jsxs(NavigationMenuItem, { className: "flex", children: [_jsx(NavigationMenuTrigger, { className: topLevelItemClassName(first), "data-active": hasActiveChild ? "" : undefined, children: item.label }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: true, children: _jsx("div", { className: "mx-auto w-full max-w-[1448px] px-2", children: _jsx("div", { className: "flex flex-nowrap gap-x-10 pt-4 pb-6 pl-4", children: sections.map((section) => (_jsxs("div", { className: "min-w-[180px] shrink-0", children: [_jsx("h5", { className: "text-gray-900 text-label-14", children: section.heading }), _jsx("ul", { className: "mt-[5px] flex list-none flex-col", children: section.items.map((child) => (_jsx("li", { className: "flex", children: _jsx(PanelLink, { active: !isExternal(child) && isActive(child.href), product: child }) }, child.href))) })] }, section.heading))) }) }) })] }));
47
+ return (_jsxs(NavigationMenuItem, { className: "flex", children: [_jsx(NavigationMenuTrigger, { className: topLevelItemClassName(first), "data-active": hasActiveChild ? "" : undefined, children: item.label }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: true, children: _jsx("div", { className: "mx-auto w-full max-w-[1448px] px-2", children: _jsx("div", { className: "flex flex-nowrap gap-x-10 pt-4 pb-6 pl-4", children: sections.map((section) => (_jsxs("div", { className: "min-w-[180px] shrink-0", children: [_jsx("p", { className: "text-gray-900 text-label-14", children: section.heading }), _jsx("ul", { className: "mt-[5px] flex list-none flex-col", children: section.items.map((child) => (_jsx("li", { className: "flex", children: _jsx(PanelLink, { active: !isExternal(child) && isActive(child.href), product: child }) }, child.href))) })] }, section.heading))) }) }) })] }));
48
48
  };
49
49
  export const DesktopMenu = ({ items, className }) => {
50
50
  const isActive = useNavActive();
@@ -40,14 +40,14 @@ function NavDropdownCollapsible({ dropdown, onLinkClick, }) {
40
40
  const external = item.external ?? item.href.startsWith("http");
41
41
  return (_jsx("li", { children: _jsx(SubNavLink, { active: !external && isActive(item.href), external: external, href: item.href, onClick: onLinkClick, children: _jsxs("span", { children: [item.label, external ? _jsx(ExternalArrow, {}) : null] }) }) }, item.href));
42
42
  });
43
- return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: dropdown.label }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), flat ? (_jsx("ul", { className: "flex list-none flex-col py-2", children: renderItems(dropdown.items) })) : (_jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("h3", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: renderItems(section.items) })] }, section.heading))) }))] }));
43
+ return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: dropdown.label }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), flat ? (_jsx("ul", { className: "flex list-none flex-col py-2", children: renderItems(dropdown.items) })) : (_jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: renderItems(section.items) })] }, section.heading))) }))] }));
44
44
  }
45
45
  /** Collapsible OSS menu (`<details>`) with uppercase subsection headings. */
46
46
  function OssCollapsible({ sections, onLinkClick, }) {
47
47
  if (sections.length === 0) {
48
48
  return null;
49
49
  }
50
- return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("h3", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(SubNavLink, { external: product.external ?? product.href.startsWith("http"), href: product.href, onClick: onLinkClick, children: product.label }) }, product.href))) })] }, section.heading))) })] }));
50
+ return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(SubNavLink, { external: product.external ?? product.href.startsWith("http"), href: product.href, onClick: onLinkClick, children: product.label }) }, product.href))) })] }, section.heading))) })] }));
51
51
  }
52
52
  function MobileMenuButton({ expanded, onClick, }) {
53
53
  return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAW9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAuF3D,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,gNAC4K,CAAC;AAEhN;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACzE,2CA+BA;AAwCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA6KjB"}
1
+ {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAW9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAuF3D,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,gNAC4K,CAAC;AAEhN;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACzE,2CA+BA;AAwCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CAuLjB"}
@@ -153,6 +153,7 @@ export function NavbarLogo({ className, href = "/", ...props }) {
153
153
  const ossSections = groupOssProducts(ossProducts.filter((product) => !product.featured));
154
154
  const [navValue, setNavValue] = useState("");
155
155
  const logoHoveredRef = useRef(false);
156
+ const suppressLogoHoverRef = useRef(false);
156
157
  const pathname = usePathname();
157
158
  const previousPathnameRef = useRef(pathname);
158
159
  const router = useRouter();
@@ -171,18 +172,26 @@ export function NavbarLogo({ className, href = "/", ...props }) {
171
172
  }
172
173
  }, [pathname]);
173
174
  return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "-mx-2 flex items-center rounded-md p-2 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 18 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden shrink-0", size: 18 })] })) : (_jsx(LogoIconVercel, { size: 18 })) }), _jsx("div", { className: "w-5 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, { size: 20 }) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: localizedHref, prefetch: true, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => {
175
+ if (value && suppressLogoHoverRef.current) {
176
+ return;
177
+ }
174
178
  if (value || !logoHoveredRef.current) {
175
179
  setNavValue(value);
176
180
  }
177
- }, skipDelayDuration: 0, value: navValue, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "-mr-3 flex h-full items-center", value: "oss-products", children: [_jsx(Link, { className: "relative flex h-full items-center text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", href: localizedHref, onClick: () => {
181
+ }, skipDelayDuration: 0, value: navValue, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "-mr-3 flex h-full items-center", onMouseLeave: () => {
182
+ suppressLogoHoverRef.current = false;
183
+ }, value: "oss-products", children: [_jsx(Link, { className: "relative flex h-full items-center text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", href: localizedHref, onClick: () => {
184
+ suppressLogoHoverRef.current = true;
178
185
  if (pathname === localizedHref) {
179
186
  logoHoveredRef.current = false;
180
187
  setNavValue("");
181
188
  }
182
189
  }, onMouseEnter: () => {
183
190
  logoHoveredRef.current = true;
184
- setNavValue("oss-products");
191
+ if (!suppressLogoHoverRef.current) {
192
+ setNavValue("oss-products");
193
+ }
185
194
  }, onMouseLeave: () => {
186
195
  logoHoveredRef.current = false;
187
- }, children: props.logo }), _jsx(NavigationMenuTrigger, { "aria-label": "Open product menu", className: "relative flex h-full w-7 items-center px-1 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset [&_svg]:top-0" }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: true, children: _jsx("div", { className: "mx-auto w-full max-w-[1448px] px-2", children: _jsxs("div", { className: "flex flex-nowrap gap-x-10 pt-4 pb-6 pl-4", children: [featuredProducts.length > 0 ? (_jsxs("div", { className: "flex shrink-0 flex-col", children: [_jsx("h5", { className: "text-gray-900 text-label-14", children: "Latest" }), _jsx("div", { className: "mt-[5px] flex flex-1 gap-x-10", children: featuredProducts.map((product) => (_jsx(OssFeaturedCard, { product: product }, product.href))) })] })) : null, ossSections.map((section) => (_jsxs("div", { className: "min-w-[180px] shrink-0", children: [_jsx("h5", { className: "text-gray-900 text-label-14", children: section.heading }), _jsx("ul", { className: "mt-[5px] flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { className: "flex", children: _jsx(PanelLink, { product: product }) }, product.href))) })] }, section.heading)))] }) }) })] }) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navValue ? "opacity-100" : "opacity-0") })] })] })) : (_jsx(Link, { className: "flex items-center text-gray-1000", href: localizedHref, prefetch: true, children: props.logo }))] }));
196
+ }, children: props.logo }), _jsx(NavigationMenuTrigger, { "aria-label": "Open product menu", className: "relative flex h-full w-7 items-center px-1 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset [&_svg]:top-0" }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: true, children: _jsx("div", { className: "mx-auto w-full max-w-[1448px] px-2", children: _jsxs("div", { className: "flex flex-nowrap gap-x-10 pt-4 pb-6 pl-4", children: [featuredProducts.length > 0 ? (_jsxs("div", { className: "flex shrink-0 flex-col", children: [_jsx("p", { className: "text-gray-900 text-label-14", children: "Latest" }), _jsx("div", { className: "mt-[5px] flex flex-1 gap-x-10", children: featuredProducts.map((product) => (_jsx(OssFeaturedCard, { product: product }, product.href))) })] })) : null, ossSections.map((section) => (_jsxs("div", { className: "min-w-[180px] shrink-0", children: [_jsx("p", { className: "text-gray-900 text-label-14", children: section.heading }), _jsx("ul", { className: "mt-[5px] flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { className: "flex", children: _jsx(PanelLink, { product: product }) }, product.href))) })] }, section.heading)))] }) }) })] }) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navValue ? "opacity-100" : "opacity-0") })] })] })) : (_jsx(Link, { className: "flex items-center text-gray-1000", href: localizedHref, prefetch: true, children: props.logo }))] }));
188
197
  }
@@ -0,0 +1,6 @@
1
+ export declare const renderNotFoundMarkdown: ({ docsUrl, llmsUrl, sitemapUrl, }: {
2
+ docsUrl: string;
3
+ llmsUrl: string;
4
+ sitemapUrl: string;
5
+ }) => string;
6
+ //# sourceMappingURL=not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/internal/not-found.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GAAI,mCAIpC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,WAOA,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const renderNotFoundMarkdown = ({ docsUrl, llmsUrl, sitemapUrl, }) => `# Page Not Found
2
+
3
+ The requested page does not exist.
4
+
5
+ - [Browse the documentation](${docsUrl})
6
+ - [Open the semantic sitemap](${sitemapUrl})
7
+ - [Open the complete Markdown corpus](${llmsUrl})
8
+ `;
package/dist/proxy.d.ts CHANGED
@@ -30,9 +30,13 @@ export interface CreateProxyOptions {
30
30
  after?: GeistdocsProxyHook | GeistdocsProxyHook[];
31
31
  before?: GeistdocsProxyHook | GeistdocsProxyHook[];
32
32
  config: Pick<GeistdocsConfig, "agent" | "basePath" | "content" | "defaultLanguage" | "translations">;
33
+ markdownNotFound?: true | ((context: {
34
+ language: string;
35
+ pathname: string;
36
+ }) => boolean);
33
37
  markdownRoutes?: GeistdocsMarkdownRoute[];
34
38
  trackMarkdownRequest?: (event: TrackMarkdownRequestEvent) => Promise<void> | void;
35
39
  }
36
- export declare const createProxy: ({ after, before, config, markdownRoutes, trackMarkdownRequest, }: CreateProxyOptions) => (request: NextRequest, context: NextFetchEvent) => Promise<Response>;
40
+ export declare const createProxy: ({ after, before, config, markdownNotFound, markdownRoutes, trackMarkdownRequest, }: CreateProxyOptions) => (request: NextRequest, context: NextFetchEvent) => Promise<Response>;
37
41
  export {};
38
42
  //# sourceMappingURL=proxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,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WAAW,sBAAsB;IACrC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC;IACnB,EAAE,EACE,IAAI,MAAM,EAAE,GACZ,CAAC,CAAC,OAAO,EAAE;QACT,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,MAAM,EAAE,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IAClD,MAAM,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IACnD,MAAM,EAAE,IAAI,CACV,eAAe,EACf,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,cAAc,CACtE,CAAC;IACF,gBAAgB,CAAC,EACb,IAAI,GACJ,CAAC,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,CAAC;IACnE,cAAc,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC1C,oBAAoB,CAAC,EAAE,CACrB,KAAK,EAAE,yBAAyB,KAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3B;AAmKD,eAAO,MAAM,WAAW,GAAI,oFAOzB,kBAAkB,MA0QL,SAAS,WAAW,EAAE,SAAS,cAAc,sBAiD5D,CAAC"}
package/dist/proxy.js CHANGED
@@ -4,7 +4,10 @@ import { createI18nMiddleware } from "fumadocs-core/i18n/middleware";
4
4
  import { isMarkdownPreferred } from "fumadocs-core/negotiation";
5
5
  import { NextResponse, } from "next/server";
6
6
  import { getPublicPath, normalizeBasePath, } from "./config";
7
+ import { renderNotFoundMarkdown } from "./internal/not-found";
8
+ import { localizeHref } from "./localize-href";
7
9
  const MDX_EXTENSION_PATTERN = /\.mdx?$/;
10
+ const RESOURCE_EXTENSION_PATTERN = /\.(?!mdx?$)[^/]+$/i;
8
11
  const PATH_TOKEN_PATTERN = /\*path|:path\*/g;
9
12
  const PATH_WILDCARD_PATTERN = /\/\*path$/;
10
13
  const DEFAULT_MARKDOWN_ROUTE = {
@@ -116,7 +119,7 @@ const getLocalizedPathname = (pathname, languages, defaultLanguage) => {
116
119
  pathname: `/${segments.slice(1).join("/")}`,
117
120
  };
118
121
  };
119
- export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdownRequest, }) => {
122
+ export const createProxy = ({ after, before, config, markdownNotFound, markdownRoutes, trackMarkdownRequest, }) => {
120
123
  const contentRouteMappings = markdownRoutes ??
121
124
  inferMarkdownRoutes(config) ?? [DEFAULT_MARKDOWN_ROUTE];
122
125
  const routeMappings = config.agent && config.agent.enabled !== false
@@ -141,6 +144,19 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
141
144
  }
142
145
  context.waitUntil(Promise.resolve(trackMarkdownRequest(event)));
143
146
  };
147
+ const createMarkdownNotFound = (pathname, language) => {
148
+ const publicPath = (href) => getPublicPath(localizeHref(href, language, defaultLanguage), config.basePath);
149
+ return createNotFoundResponse(getPublicPath(pathname, config.basePath), {
150
+ headers: { "Cache-Control": "private, no-store" },
151
+ markdown: renderNotFoundMarkdown({
152
+ docsUrl: publicPath("/docs"),
153
+ llmsUrl: publicPath("/llms.txt"),
154
+ sitemapUrl: publicPath("/sitemap.md"),
155
+ }),
156
+ });
157
+ };
158
+ const shouldCreateMarkdownNotFound = (pathname, language) => markdownNotFound === true ||
159
+ markdownNotFound?.({ language, pathname }) === true;
144
160
  const resolveMarkdownRewrite = (pathname, language) => {
145
161
  for (const route of routeMappings) {
146
162
  const path = getRoutePath(route, pathname);
@@ -230,7 +246,15 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
230
246
  return agentResponse;
231
247
  }
232
248
  }
233
- return handlePreferredMarkdownRequest(request, context, localized.pathname, localized.language, pathname);
249
+ const preferredResponse = handlePreferredMarkdownRequest(request, context, localized.pathname, localized.language, pathname);
250
+ if (preferredResponse) {
251
+ return preferredResponse;
252
+ }
253
+ return !RESOURCE_EXTENSION_PATTERN.test(localized.pathname) &&
254
+ (isMarkdownPreferred(request) || isAIAgent(request).detected) &&
255
+ shouldCreateMarkdownNotFound(localized.pathname, localized.language)
256
+ ? createMarkdownNotFound(pathname, localized.language)
257
+ : null;
234
258
  };
235
259
  const handleI18nRequest = async (request, context) => {
236
260
  const response = await internationalizer(request, context);
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,WAAW,CAAC;AAQnB,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,IAAI,CACV,eAAe,EACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,CACb,CAAC;IACF,SAAS,CAAC,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,KAC7C,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC/B;AAmTD,eAAO,MAAM,iBAAiB,GAAI,wBAG/B,wBAAwB;mBAId,WAAW,eACR;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;;;CA2BtD,CAAC"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,WAAW,CAAC;AASnB,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,IAAI,CACV,eAAe,EACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,CACb,CAAC;IACF,SAAS,CAAC,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,KAC7C,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC/B;AAsTD,eAAO,MAAM,iBAAiB,GAAI,wBAG/B,wBAAwB;mBAId,WAAW,eACR;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;;;CA2BtD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { getPublicPath, } from "../config";
2
+ import { resolveAgentProductContext } from "../internal/agent-product";
2
3
  import { getDiscoveryLanguages, toPublicUrl, toSiteUrl, validateAgentDiscoveryConfig, } from "./discovery";
3
4
  const getDefaultAgentInstructions = (config) => [
4
5
  `Use ${getPublicPath("/sitemap.md", config.basePath)} to identify the most relevant documentation pages before answering broad questions.`,
@@ -177,6 +178,7 @@ const renderAgentsMarkdown = (config, request) => {
177
178
  const product = agent.product ?? {};
178
179
  const origin = request.nextUrl.origin;
179
180
  const name = product.name ?? config.title;
181
+ const productContext = resolveAgentProductContext(agent, config.title);
180
182
  return [
181
183
  `# ${name}`,
182
184
  "",
@@ -184,7 +186,9 @@ const renderAgentsMarkdown = (config, request) => {
184
186
  "This file helps AI agents understand and use this documentation site.",
185
187
  "",
186
188
  ...renderDocumentationSection(config, origin),
187
- ...renderProductSection(name, product),
189
+ ...(productContext
190
+ ? renderProductSection(productContext.name, productContext.product)
191
+ : []),
188
192
  ...renderApiSection(agent.api, config, origin),
189
193
  ...renderMcpSection(agent.mcp, config, origin),
190
194
  ...renderImportantLinksSection(agent, config, origin),
@@ -1 +1 @@
1
- {"version":3,"file":"llms.d.ts","sourceRoot":"","sources":["../../src/routes/llms.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAahF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,UAAU,wBAAwB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,KAAK,iBAAiB,GAAG,CACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9B,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IACzE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AA+LD,eAAO,MAAM,eAAe,GAAI,6CAK7B,sBAAsB;gBAIf,WAAW,cACL;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;CAg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";
2
2
  import { notFound } from "next/navigation";
3
3
  import { getPublicPath, normalizeBasePath, withBasePath, } from "../config.js";
4
+ import { resolveAgentProductContext } from "../internal/agent-product.js";
4
5
  import { resolvePageMarkdownUrl } from "../internal/markdown-url.js";
5
6
  import { findSmartNotFoundSuggestions, renderSmartNotFoundMarkdown, } from "../internal/smart-not-found.js";
6
7
  import { isPageVisibleForSurface } from "../page-visibility.js";
@@ -13,6 +14,31 @@ const resolveSources = (source, sources, caller) => {
13
14
  }
14
15
  return resolvedSources;
15
16
  };
17
+ const renderWhenToUse = (agent, fallbackName) => {
18
+ const context = resolveAgentProductContext(agent, fallbackName);
19
+ if (!context) {
20
+ return undefined;
21
+ }
22
+ const { name, product } = context;
23
+ const lines = [
24
+ `# ${name} documentation`,
25
+ ...(product.description ? ["", `> ${product.description}`] : []),
26
+ "",
27
+ `## When to use ${name}`,
28
+ "",
29
+ ];
30
+ if (product.category) {
31
+ lines.push(`- Category: ${product.category}`);
32
+ }
33
+ if (product.audience?.length) {
34
+ lines.push(`- Audience: ${product.audience.join(", ")}`);
35
+ }
36
+ if (product.useCases?.length) {
37
+ lines.push("Common use cases:", "", ...product.useCases.map((useCase) => `- ${useCase}`));
38
+ }
39
+ lines.push("", "## Documentation");
40
+ return lines.join("\n");
41
+ };
16
42
  const pageUrlToSlug = (url) => url.split("/").filter(Boolean);
17
43
  const getPathnameFromSlug = (slug) => {
18
44
  const segments = slug ?? [];
@@ -118,7 +144,8 @@ export const createLlmsRoute = ({ filterPage, source, sources, transform, }) =>
118
144
  ? await transform(rendered, { lang, page, source: entry })
119
145
  : rendered;
120
146
  })));
121
- return new Response(scanned.join("\n\n"), {
147
+ const guidance = renderWhenToUse(routeSources[0].routingConfig.agent, routeSources[0].routingConfig.title);
148
+ return new Response([guidance, ...scanned].filter(Boolean).join("\n\n"), {
122
149
  headers: {
123
150
  "Content-Type": "text/markdown; charset=utf-8",
124
151
  },
@@ -1,6 +1,6 @@
1
1
  import type { NextRequest } from "next/server";
2
2
  import { type GeistdocsConfig } from "../config";
3
- interface CreateNotFoundRouteOptions {
3
+ export interface CreateNotFoundRouteOptions {
4
4
  config: Pick<GeistdocsConfig, "basePath" | "defaultLanguage" | "translations">;
5
5
  }
6
6
  export declare const createNotFoundRoute: ({ config }: CreateNotFoundRouteOptions) => {
@@ -10,5 +10,4 @@ export declare const createNotFoundRoute: ({ config }: CreateNotFoundRouteOption
10
10
  }>;
11
11
  }) => Promise<Response>;
12
12
  };
13
- export {};
14
13
  //# sourceMappingURL=not-found.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/routes/not-found.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAGhE,UAAU,0BAA0B;IAClC,MAAM,EAAE,IAAI,CACV,eAAe,EACf,UAAU,GAAG,iBAAiB,GAAG,cAAc,CAChD,CAAC;CACH;AASD,eAAO,MAAM,mBAAmB,GAAI,YAAY,0BAA0B;mBAE7D,WAAW,cACR;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;CAsErD,CAAC"}
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/routes/not-found.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAIhE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,IAAI,CACV,eAAe,EACf,UAAU,GAAG,iBAAiB,GAAG,cAAc,CAChD,CAAC;CACH;AASD,eAAO,MAAM,mBAAmB,GAAI,YAAY,0BAA0B;mBAE7D,WAAW,cACR;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;CA+DrD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { createNotFoundResponse, isAIAgent } from "@vercel/agent-readability";
2
2
  import { isMarkdownPreferred } from "fumadocs-core/negotiation";
3
3
  import { getPublicPath } from "../config";
4
+ import { renderNotFoundMarkdown } from "../internal/not-found";
4
5
  import { localizeHref } from "../localize-href";
5
6
  const escapeHtml = (value) => value
6
7
  .replaceAll("&", "&amp;")
@@ -29,14 +30,7 @@ export const createNotFoundRoute = ({ config }) => {
29
30
  "Cache-Control": "private, no-store",
30
31
  Vary: vary,
31
32
  },
32
- markdown: `# Page Not Found
33
-
34
- The requested page does not exist.
35
-
36
- - [Browse the documentation](${docsUrl})
37
- - [Open the semantic sitemap](${sitemapUrl})
38
- - [Open the complete Markdown corpus](${llmsUrl})
39
- `,
33
+ markdown: renderNotFoundMarkdown({ docsUrl, llmsUrl, sitemapUrl }),
40
34
  });
41
35
  }
42
36
  const html = `<!doctype html>
package/dist/source.d.ts CHANGED
@@ -38,7 +38,7 @@ export interface GeistdocsMarkdownOptions {
38
38
  }
39
39
  export interface CreateSourceOptions {
40
40
  baseUrl?: string;
41
- config: Pick<GeistdocsConfig, "agent" | "basePath" | "defaultLanguage" | "translations">;
41
+ config: Pick<GeistdocsConfig, "agent" | "basePath" | "defaultLanguage" | "translations"> & Partial<Pick<GeistdocsConfig, "title">>;
42
42
  docs: FumadocsCollection;
43
43
  id?: string;
44
44
  label?: string;
@@ -65,8 +65,10 @@ export interface CreateVersionedSourcesOptions {
65
65
  export declare const createSource: ({ docs, config, baseUrl, id, label, markdown, }: CreateSourceOptions) => {
66
66
  baseUrl: string;
67
67
  routingConfig: {
68
+ agent: import("./config.js").GeistdocsAgentReadinessConfig | undefined;
68
69
  basePath: string | undefined;
69
70
  defaultLanguage: string | undefined;
71
+ title: string | undefined;
70
72
  translations: import("./config.js").GeistdocsTranslations | undefined;
71
73
  };
72
74
  source: import("fumadocs-core/source").LoaderOutput<{
@@ -96,8 +98,10 @@ export declare const createSources: ({ config, sources }: CreateSourcesOptions)
96
98
  source: {
97
99
  baseUrl: string;
98
100
  routingConfig: {
101
+ agent: import("./config.js").GeistdocsAgentReadinessConfig | undefined;
99
102
  basePath: string | undefined;
100
103
  defaultLanguage: string | undefined;
104
+ title: string | undefined;
101
105
  translations: import("./config.js").GeistdocsTranslations | undefined;
102
106
  };
103
107
  source: import("fumadocs-core/source").LoaderOutput<{
@@ -131,8 +135,10 @@ export declare const createVersionedSources: ({ config, current, versions, }: Cr
131
135
  source: {
132
136
  baseUrl: string;
133
137
  routingConfig: {
138
+ agent: import("./config.js").GeistdocsAgentReadinessConfig | undefined;
134
139
  basePath: string | undefined;
135
140
  defaultLanguage: string | undefined;
141
+ title: string | undefined;
136
142
  translations: import("./config.js").GeistdocsTranslations | undefined;
137
143
  };
138
144
  source: import("fumadocs-core/source").LoaderOutput<{
@@ -157,8 +163,10 @@ export declare const createVersionedSources: ({ config, current, versions, }: Cr
157
163
  byId: Record<string, {
158
164
  baseUrl: string;
159
165
  routingConfig: {
166
+ agent: import("./config.js").GeistdocsAgentReadinessConfig | undefined;
160
167
  basePath: string | undefined;
161
168
  defaultLanguage: string | undefined;
169
+ title: string | undefined;
162
170
  translations: import("./config.js").GeistdocsTranslations | undefined;
163
171
  };
164
172
  source: import("fumadocs-core/source").LoaderOutput<{
@@ -182,8 +190,10 @@ export declare const createVersionedSources: ({ config, current, versions, }: Cr
182
190
  current: {
183
191
  baseUrl: string;
184
192
  routingConfig: {
193
+ agent: import("./config.js").GeistdocsAgentReadinessConfig | undefined;
185
194
  basePath: string | undefined;
186
195
  defaultLanguage: string | undefined;
196
+ title: string | undefined;
187
197
  translations: import("./config.js").GeistdocsTranslations | undefined;
188
198
  };
189
199
  source: import("fumadocs-core/source").LoaderOutput<{
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAA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H,eAAO,MAAM,mBAAmB,GAAI,6CAKjC,0BAA0B,KAAG,MAAM,EAYrC,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAC/C,UAAU,CAAC,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,EAAE,KAAK,CAAC,CAAC;CAClE;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,iCAIvC,gCAAgC,KAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAiBvE,CAAC"}
package/dist/source.js CHANGED
@@ -170,8 +170,10 @@ For an index of all available documentation, see [${llmsLabel}](${llmsPath})${ag
170
170
  return {
171
171
  baseUrl,
172
172
  routingConfig: {
173
+ agent: config.agent,
173
174
  basePath: config.basePath,
174
175
  defaultLanguage: config.defaultLanguage,
176
+ title: config.title,
175
177
  translations: config.translations,
176
178
  },
177
179
  source,
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.23.1 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.24.1 so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.23.1.
3
+ These docs are bundled with `@vercel/geistdocs` 1.24.1.
4
4
  They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
5
5
 
6
6
  ## Documentation Index
@@ -2300,15 +2300,13 @@ The response includes:
2300
2300
 
2301
2301
  All MDX components are processed and converted to plain Markdown equivalents.
2302
2302
 
2303
- ## Missing pages
2303
+ ## Missing documentation pages
2304
2304
 
2305
2305
  When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
2306
2306
 
2307
2307
  For example, a request for `/docs/env-vars` can suggest `/docs/environment-variables.md`. The response uses a short cache lifetime and returns a real `404` status. It also sends `X-Robots-Tag: noindex` and no canonical link because the requested page does not exist. Regular HTML requests keep the app's standard not-found behavior.
2308
2308
 
2309
- Generated projects also include a catch-all route for unknown application paths outside configured documentation sections. It returns a concise Markdown 404 with links to the docs, `sitemap.md`, and `llms.txt` for agent or `Accept: text/markdown` requests. Browser requests receive the same recovery links as HTML.
2310
-
2311
- Enable this behavior with `notFound: {}`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
2309
+ Enable the suggestion response with `notFound: {}` on `createDocsMarkdownRoute`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
2312
2310
 
2313
2311
  If a custom `markdownRoutes` mapping changes the public path shape, set `notFound.getRequestedPath` to reconstruct the app-local public pathname. This also keeps page lookup and suggestions within the right source when a flattened route serves multiple sources:
2314
2312
 
@@ -2323,6 +2321,21 @@ notFound: {
2323
2321
 
2324
2322
  Set `notFound.getPageMarkdownUrl` as well when suggested pages use a custom app-local Markdown URL.
2325
2323
 
2324
+ ### Unmatched application paths
2325
+
2326
+ Set `markdownNotFound: true` on `createProxy` only when every valid app page has a Markdown mapping. Unmapped Markdown or detected-agent requests then receive a concise 404 with links to the docs, `sitemap.md`, and `llms.txt`, while browser requests continue to the app's existing Next.js not-found UI.
2327
+
2328
+ Sites with valid custom pages outside their Markdown mappings should pass a predicate instead. Return `false` for route families that should continue to Next.js:
2329
+
2330
+ ```ts title="proxy.ts"
2331
+ const proxy = createProxy({
2332
+ config: geistdocsConfig,
2333
+ markdownNotFound: ({ pathname }) => !pathname.startsWith("/playground"),
2334
+ });
2335
+ ```
2336
+
2337
+ `createNotFoundRoute` remains available for apps that prefer an explicit catch-all Route Handler with Geistdocs' minimal HTML response.
2338
+
2326
2339
 
2327
2340
  ---
2328
2341
 
@@ -3225,7 +3238,7 @@ Geistdocs implements the [llms.txt standard](https://llmstxt.org/), a convention
3225
3238
 
3226
3239
  ## What it is
3227
3240
 
3228
- The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent metadata is configured, page-level Markdown also links agents to `/agents.md` for API and MCP discovery.
3241
+ The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent product metadata includes a category, audience, or use case, Geistdocs prepends a `When to use` section. It uses `agent.product.name` when set and otherwise uses the site title. Page-level Markdown also links agents to `/agents.md` for declared integration discovery.
3229
3242
 
3230
3243
  ### Access
3231
3244
 
@@ -3239,10 +3252,11 @@ Returns all documentation pages concatenated together as Markdown.
3239
3252
 
3240
3253
  The package route helper:
3241
3254
 
3242
- 1. Fetches pages from one or more source bundles.
3243
- 2. Processes each page to extract clean Markdown.
3244
- 3. Combines the pages into a single response.
3245
- 4. Returns the response as `text/markdown`.
3255
+ 1. Reads product guidance from the source bundle's Geistdocs config.
3256
+ 2. Fetches pages from one or more source bundles.
3257
+ 3. Processes each page to extract clean Markdown.
3258
+ 4. Combines the guidance and pages into a single response.
3259
+ 5. Returns the response as `text/markdown`.
3246
3260
 
3247
3261
  Pages are joined with double newlines (`\n\n`) for clear separation.
3248
3262
 
@@ -208,5 +208,5 @@
208
208
  }
209
209
  ],
210
210
  "source": "apps/template/content/docs",
211
- "version": "1.23.1"
211
+ "version": "1.24.1"
212
212
  }
@@ -20,7 +20,7 @@ Geistdocs implements the [llms.txt standard](https://llmstxt.org/), a convention
20
20
 
21
21
  ## What it is
22
22
 
23
- The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent metadata is configured, page-level Markdown also links agents to `/agents.md` for API and MCP discovery.
23
+ The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent product metadata includes a category, audience, or use case, Geistdocs prepends a `When to use` section. It uses `agent.product.name` when set and otherwise uses the site title. Page-level Markdown also links agents to `/agents.md` for declared integration discovery.
24
24
 
25
25
  ### Access
26
26
 
@@ -34,10 +34,11 @@ Returns all documentation pages concatenated together as Markdown.
34
34
 
35
35
  The package route helper:
36
36
 
37
- 1. Fetches pages from one or more source bundles.
38
- 2. Processes each page to extract clean Markdown.
39
- 3. Combines the pages into a single response.
40
- 4. Returns the response as `text/markdown`.
37
+ 1. Reads product guidance from the source bundle's Geistdocs config.
38
+ 2. Fetches pages from one or more source bundles.
39
+ 3. Processes each page to extract clean Markdown.
40
+ 4. Combines the guidance and pages into a single response.
41
+ 5. Returns the response as `text/markdown`.
41
42
 
42
43
  Pages are joined with double newlines (`\n\n`) for clear separation.
43
44
 
package/docs/pages/md.md CHANGED
@@ -89,15 +89,13 @@ The response includes:
89
89
 
90
90
  All MDX components are processed and converted to plain Markdown equivalents.
91
91
 
92
- ## Missing pages
92
+ ## Missing documentation pages
93
93
 
94
94
  When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
95
95
 
96
96
  For example, a request for `/docs/env-vars` can suggest `/docs/environment-variables.md`. The response uses a short cache lifetime and returns a real `404` status. It also sends `X-Robots-Tag: noindex` and no canonical link because the requested page does not exist. Regular HTML requests keep the app's standard not-found behavior.
97
97
 
98
- Generated projects also include a catch-all route for unknown application paths outside configured documentation sections. It returns a concise Markdown 404 with links to the docs, `sitemap.md`, and `llms.txt` for agent or `Accept: text/markdown` requests. Browser requests receive the same recovery links as HTML.
99
-
100
- Enable this behavior with `notFound: {}`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
98
+ Enable the suggestion response with `notFound: {}` on `createDocsMarkdownRoute`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
101
99
 
102
100
  If a custom `markdownRoutes` mapping changes the public path shape, set `notFound.getRequestedPath` to reconstruct the app-local public pathname. This also keeps page lookup and suggestions within the right source when a flattened route serves multiple sources:
103
101
 
@@ -111,3 +109,18 @@ notFound: {
111
109
  ```
112
110
 
113
111
  Set `notFound.getPageMarkdownUrl` as well when suggested pages use a custom app-local Markdown URL.
112
+
113
+ ### Unmatched application paths
114
+
115
+ Set `markdownNotFound: true` on `createProxy` only when every valid app page has a Markdown mapping. Unmapped Markdown or detected-agent requests then receive a concise 404 with links to the docs, `sitemap.md`, and `llms.txt`, while browser requests continue to the app's existing Next.js not-found UI.
116
+
117
+ Sites with valid custom pages outside their Markdown mappings should pass a predicate instead. Return `false` for route families that should continue to Next.js:
118
+
119
+ ```ts title="proxy.ts"
120
+ const proxy = createProxy({
121
+ config: geistdocsConfig,
122
+ markdownNotFound: ({ pathname }) => !pathname.startsWith("/playground"),
123
+ });
124
+ ```
125
+
126
+ `createNotFoundRoute` remains available for apps that prefer an explicit catch-all Route Handler with Geistdocs' minimal HTML response.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "1.23.1",
4
+ "version": "1.24.1",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,7 +34,7 @@ Use these instructions when an AI coding agent edits this project.
34
34
  | Configure the Fumadocs source adapter or versioned docs | `lib/geistdocs/source.ts` |
35
35
  | Configure Fumadocs collections and source-safe MDX processing | `source.config.ts` |
36
36
  | Configure the docs page renderer | `app/[lang]/docs/[[...slug]]/page.tsx` |
37
- | Configure AI-readable markdown output | `app/[lang]/agents.md/route.ts`, `app/[lang]/.well-known/mcp.json/route.ts`, `app/[lang]/llms.txt/route.ts`, `app/[lang]/llms.mdx/[[...slug]]/route.ts`, `app/[lang]/sitemap.md/route.ts` |
37
+ | Configure AI-readable markdown output and recovery | `app/[lang]/agents.md/route.ts`, `app/[lang]/.well-known/mcp.json/route.ts`, `app/[lang]/llms.txt/route.ts`, `app/[lang]/llms.mdx/[[...slug]]/route.ts`, `app/[lang]/sitemap.md/route.ts` |
38
38
  | Configure chat or search APIs | `app/api/chat/route.ts`, `app/api/search/route.ts` |
39
39
  | Add request handling before or after Geistdocs routing | `proxy.ts` |
40
40
  | Edit the marketing home page | `app/[lang]/(home)/**` |
@@ -18,7 +18,7 @@ Geistdocs implements the [llms.txt standard](https://llmstxt.org/), a convention
18
18
 
19
19
  ## What it is
20
20
 
21
- The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent metadata is configured, page-level Markdown also links agents to `/agents.md` for API and MCP discovery.
21
+ The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set. When agent product metadata includes a category, audience, or use case, Geistdocs prepends a `When to use` section. It uses `agent.product.name` when set and otherwise uses the site title. Page-level Markdown also links agents to `/agents.md` for declared integration discovery.
22
22
 
23
23
  ### Access
24
24
 
@@ -32,10 +32,11 @@ Returns all documentation pages concatenated together as Markdown.
32
32
 
33
33
  The package route helper:
34
34
 
35
- 1. Fetches pages from one or more source bundles.
36
- 2. Processes each page to extract clean Markdown.
37
- 3. Combines the pages into a single response.
38
- 4. Returns the response as `text/markdown`.
35
+ 1. Reads product guidance from the source bundle's Geistdocs config.
36
+ 2. Fetches pages from one or more source bundles.
37
+ 3. Processes each page to extract clean Markdown.
38
+ 4. Combines the guidance and pages into a single response.
39
+ 5. Returns the response as `text/markdown`.
39
40
 
40
41
  Pages are joined with double newlines (`\n\n`) for clear separation.
41
42
 
@@ -87,15 +87,13 @@ The response includes:
87
87
 
88
88
  All MDX components are processed and converted to plain Markdown equivalents.
89
89
 
90
- ## Missing pages
90
+ ## Missing documentation pages
91
91
 
92
92
  When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
93
93
 
94
94
  For example, a request for `/docs/env-vars` can suggest `/docs/environment-variables.md`. The response uses a short cache lifetime and returns a real `404` status. It also sends `X-Robots-Tag: noindex` and no canonical link because the requested page does not exist. Regular HTML requests keep the app's standard not-found behavior.
95
95
 
96
- Generated projects also include a catch-all route for unknown application paths outside configured documentation sections. It returns a concise Markdown 404 with links to the docs, `sitemap.md`, and `llms.txt` for agent or `Accept: text/markdown` requests. Browser requests receive the same recovery links as HTML.
97
-
98
- Enable this behavior with `notFound: {}`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
96
+ Enable the suggestion response with `notFound: {}` on `createDocsMarkdownRoute`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
99
97
 
100
98
  If a custom `markdownRoutes` mapping changes the public path shape, set `notFound.getRequestedPath` to reconstruct the app-local public pathname. This also keeps page lookup and suggestions within the right source when a flattened route serves multiple sources:
101
99
 
@@ -109,3 +107,18 @@ notFound: {
109
107
  ```
110
108
 
111
109
  Set `notFound.getPageMarkdownUrl` as well when suggested pages use a custom app-local Markdown URL.
110
+
111
+ ### Unmatched application paths
112
+
113
+ Set `markdownNotFound: true` on `createProxy` only when every valid app page has a Markdown mapping. Unmapped Markdown or detected-agent requests then receive a concise 404 with links to the docs, `sitemap.md`, and `llms.txt`, while browser requests continue to the app's existing Next.js not-found UI.
114
+
115
+ Sites with valid custom pages outside their Markdown mappings should pass a predicate instead. Return `false` for route families that should continue to Next.js:
116
+
117
+ ```ts title="proxy.ts"
118
+ const proxy = createProxy({
119
+ config: geistdocsConfig,
120
+ markdownNotFound: ({ pathname }) => !pathname.startsWith("/playground"),
121
+ });
122
+ ```
123
+
124
+ `createNotFoundRoute` remains available for apps that prefer an explicit catch-all Route Handler with Geistdocs' minimal HTML response.
@@ -18,7 +18,7 @@
18
18
  "@streamdown/code": "^1.0.1",
19
19
  "@vercel/agent-readability": "^0.6.0",
20
20
  "@vercel/analytics": "^1.6.1",
21
- "@vercel/geistdocs": "1.23.1",
21
+ "@vercel/geistdocs": "1.24.1",
22
22
  "@vercel/speed-insights": "^1.3.1",
23
23
  "ai": "^6.0.132",
24
24
  "class-variance-authority": "^0.7.1",