@vercel/geistdocs 2.8.0 → 2.9.1-canary.13e0204

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.
Files changed (42) hide show
  1. package/dist/assets/icons/icon-fullscreen-close.d.ts +26 -0
  2. package/dist/assets/icons/icon-fullscreen-close.d.ts.map +1 -0
  3. package/dist/assets/icons/icon-fullscreen-close.js +25 -0
  4. package/dist/assets/icons/icon-fullscreen.d.ts +26 -0
  5. package/dist/assets/icons/icon-fullscreen.d.ts.map +1 -0
  6. package/dist/assets/icons/icon-fullscreen.js +25 -0
  7. package/dist/assets/icons/index.d.ts +2 -0
  8. package/dist/assets/icons/index.d.ts.map +1 -1
  9. package/dist/assets/icons/index.js +2 -0
  10. package/dist/cli/index.js +1 -1
  11. package/dist/internal/chat/context.d.ts +3 -0
  12. package/dist/internal/chat/context.d.ts.map +1 -1
  13. package/dist/internal/chat/context.js +7 -0
  14. package/dist/internal/chat/message.js +1 -1
  15. package/dist/internal/chat/shell.d.ts.map +1 -1
  16. package/dist/internal/chat/shell.js +15 -10
  17. package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
  18. package/dist/internal/mdx-to-markdown.js +226 -19
  19. package/dist/internal/page-actions-client.d.ts +1 -1
  20. package/dist/internal/page-actions-client.d.ts.map +1 -1
  21. package/dist/internal/page-actions-client.js +5 -3
  22. package/dist/internal/provider-client.d.ts.map +1 -1
  23. package/dist/internal/provider-client.js +9 -3
  24. package/dist/pages/docs.d.ts.map +1 -1
  25. package/dist/pages/docs.js +5 -6
  26. package/docs/agents.md +1 -1
  27. package/docs/llms.txt +36 -23
  28. package/docs/manifest.json +1 -1
  29. package/docs/pages/agent-readiness.md +1 -2
  30. package/docs/pages/ask-ai.md +12 -7
  31. package/docs/pages/deployment.md +8 -6
  32. package/docs/pages/env.md +15 -8
  33. package/package.json +6 -6
  34. package/public-foundation.css +0 -2
  35. package/shared-theme.css +6 -0
  36. package/template/.env.example +2 -3
  37. package/template/AGENTS.md +1 -1
  38. package/template/content/docs/agent-readiness.mdx +1 -2
  39. package/template/content/docs/ask-ai.mdx +12 -7
  40. package/template/content/docs/deployment.mdx +8 -6
  41. package/template/content/docs/env.mdx +16 -9
  42. package/template/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ! THIS FILE WAS AUTO_GENERATED - DO NOT EDIT MANUALLY
3
+ *
4
+ * ▲ Part of Vercel's Geistcn Design System
5
+ * Generated by: pnpm icons:build
6
+ *
7
+ * @see Slack #project-geistcn for support: https://vercel.slack.com/archives/C08AW4PQHK3
8
+ */
9
+ import type { JSX } from "react";
10
+ import { type IconProps } from "../_internal/components/icon/base-icon.js";
11
+ /**
12
+ * Icon component - renders as SVG
13
+ *
14
+ * @param props.size - Controls icon height; width is auto-calculated to preserve aspect ratio (accepts number or string with optional "px" suffix)
15
+ * @param props.color - Fill color for the icon (default: 'currentColor')
16
+ * @param props.className - CSS class name for styling
17
+ * @param props.style - Inline styles (excludes `width`, `height` which are managed internally)
18
+ *
19
+ * @remarks
20
+ * - Inherits all standard SVG element props except `width`, `height`, `viewBox`, `fill` which are managed internally.
21
+ *
22
+ * @see {@link IconProps} for complete prop types
23
+ * @see {@link BaseIcon} for underlying implementation behavior
24
+ */
25
+ export declare function IconFullscreenClose(props: IconProps): JSX.Element;
26
+ //# sourceMappingURL=icon-fullscreen-close.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-fullscreen-close.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/icon-fullscreen-close.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMjE"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { BaseIcon, } from "../_internal/components/icon/base-icon.js";
3
+ /**
4
+ * Icon component - renders as SVG
5
+ *
6
+ * @param props.size - Controls icon height; width is auto-calculated to preserve aspect ratio (accepts number or string with optional "px" suffix)
7
+ * @param props.color - Fill color for the icon (default: 'currentColor')
8
+ * @param props.className - CSS class name for styling
9
+ * @param props.style - Inline styles (excludes `width`, `height` which are managed internally)
10
+ *
11
+ * @remarks
12
+ * - Inherits all standard SVG element props except `width`, `height`, `viewBox`, `fill` which are managed internally.
13
+ *
14
+ * @see {@link IconProps} for complete prop types
15
+ * @see {@link BaseIcon} for underlying implementation behavior
16
+ */
17
+ export function IconFullscreenClose(props) {
18
+ return (_jsx(BaseIcon, { "$generated": GENERATED_CONFIG, ...props, children: ICON_PATHS }));
19
+ }
20
+ const GENERATED_CONFIG = {
21
+ height: 16,
22
+ aspectRatio: 1,
23
+ viewBox: "0 0 16 16",
24
+ };
25
+ const ICON_PATHS = (_jsx(_Fragment, { children: _jsx("path", { clipRule: "evenodd", d: "M6 1v4a1 1 0 0 1-1 1H1V4.5h3.5V1zm8.25 5H15V4.5h-3.5V1H10v4a1 1 0 0 0 1 1zM10 14.25V15h1.5v-3.5h3.54V10H11a1 1 0 0 0-1 1zM1.75 10H1v1.5h3.5V15H6v-4a1 1 0 0 0-1-1z", fill: "currentColor", fillRule: "evenodd" }) }));
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ! THIS FILE WAS AUTO_GENERATED - DO NOT EDIT MANUALLY
3
+ *
4
+ * ▲ Part of Vercel's Geistcn Design System
5
+ * Generated by: pnpm icons:build
6
+ *
7
+ * @see Slack #project-geistcn for support: https://vercel.slack.com/archives/C08AW4PQHK3
8
+ */
9
+ import type { JSX } from "react";
10
+ import { type IconProps } from "../_internal/components/icon/base-icon.js";
11
+ /**
12
+ * Icon component - renders as SVG
13
+ *
14
+ * @param props.size - Controls icon height; width is auto-calculated to preserve aspect ratio (accepts number or string with optional "px" suffix)
15
+ * @param props.color - Fill color for the icon (default: 'currentColor')
16
+ * @param props.className - CSS class name for styling
17
+ * @param props.style - Inline styles (excludes `width`, `height` which are managed internally)
18
+ *
19
+ * @remarks
20
+ * - Inherits all standard SVG element props except `width`, `height`, `viewBox`, `fill` which are managed internally.
21
+ *
22
+ * @see {@link IconProps} for complete prop types
23
+ * @see {@link BaseIcon} for underlying implementation behavior
24
+ */
25
+ export declare function IconFullscreen(props: IconProps): JSX.Element;
26
+ //# sourceMappingURL=icon-fullscreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-fullscreen.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/icon-fullscreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAM5D"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { BaseIcon, } from "../_internal/components/icon/base-icon.js";
3
+ /**
4
+ * Icon component - renders as SVG
5
+ *
6
+ * @param props.size - Controls icon height; width is auto-calculated to preserve aspect ratio (accepts number or string with optional "px" suffix)
7
+ * @param props.color - Fill color for the icon (default: 'currentColor')
8
+ * @param props.className - CSS class name for styling
9
+ * @param props.style - Inline styles (excludes `width`, `height` which are managed internally)
10
+ *
11
+ * @remarks
12
+ * - Inherits all standard SVG element props except `width`, `height`, `viewBox`, `fill` which are managed internally.
13
+ *
14
+ * @see {@link IconProps} for complete prop types
15
+ * @see {@link BaseIcon} for underlying implementation behavior
16
+ */
17
+ export function IconFullscreen(props) {
18
+ return (_jsx(BaseIcon, { "$generated": GENERATED_CONFIG, ...props, children: ICON_PATHS }));
19
+ }
20
+ const GENERATED_CONFIG = {
21
+ height: 16,
22
+ aspectRatio: 1,
23
+ viewBox: "0 0 16 16",
24
+ };
25
+ const ICON_PATHS = (_jsx(_Fragment, { children: _jsx("path", { clipRule: "evenodd", d: "M1 5.25V6h1.5V2.5H6V1H2a1 1 0 0 0-1 1zM5.25 15H6v-1.5H2.5V10H1v4a1 1 0 0 0 1 1zM15 10v4a1 1 0 0 1-1 1h-4v-1.5h3.5V10zm-4.25-9H10v1.5h3.5V6H15V2a1 1 0 0 0-1-1z", fill: "currentColor", fillRule: "evenodd" }) }));
@@ -36,6 +36,8 @@ export { IconFileText } from "./icon-file-text";
36
36
  export { IconFluid } from "./icon-fluid";
37
37
  export { IconFolderOpen } from "./icon-folder-open";
38
38
  export { IconForward10Seconds10 } from "./icon-forward-10-seconds-10";
39
+ export { IconFullscreen } from "./icon-fullscreen";
40
+ export { IconFullscreenClose } from "./icon-fullscreen-close";
39
41
  export { IconInformation } from "./icon-information";
40
42
  export { IconLanguages } from "./icon-languages";
41
43
  export { IconLink } from "./icon-link";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/index.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AAGrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAA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O,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -37,6 +37,8 @@ export { IconFileText } from "./icon-file-text";
37
37
  export { IconFluid } from "./icon-fluid";
38
38
  export { IconFolderOpen } from "./icon-folder-open";
39
39
  export { IconForward10Seconds10 } from "./icon-forward-10-seconds-10";
40
+ export { IconFullscreen } from "./icon-fullscreen";
41
+ export { IconFullscreenClose } from "./icon-fullscreen-close";
40
42
  export { IconInformation } from "./icon-information";
41
43
  export { IconLanguages } from "./icon-languages";
42
44
  export { IconLink } from "./icon-link";
package/dist/cli/index.js CHANGED
@@ -4,4 +4,4 @@ import{Option as Rn,program as A}from"commander";import{access as Ke,copyFile as
4
4
  `);throw new AggregateError(i,`Mixedbread search sync did not complete:
5
5
  ${a}`)}return r},Ft=async({client:e,file:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=t,o=Date.now()+r;for(;s.status==="pending"||s.status==="in_progress";){if(Date.now()>=o)throw new Error(`Mixedbread timed out while indexing file ${t.id}.`);await i(n),s=await e.retrieveStoreFile(t.id)}if(s.status!=="completed")throw new Error(`Mixedbread failed to index file ${t.id} (${s.status}).`);return s},Dt=async({client:e,desired:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=await e.uploadFile({content:t.document.content,filename:`${U(t.document.id).slice(0,32)}.md`}),o;try{o=await e.createStoreFile({externalId:t.externalId,fileId:s,metadata:{...t.metadata,[g.rawFileId]:s}})}catch(a){try{await e.deleteFile(s)}catch(d){throw new AggregateError([a,d],`Mixedbread failed to attach and clean up raw file ${s}.`)}throw a}return Ft({client:e,file:o,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})},Ie=async({client:e,concurrency:t=St,manifest:n,pollIntervalMs:r=_t,pollTimeoutMs:i=Tt,revision:s,revisionAncestors:o=[],revisionTimestamp:a,sleep:d=Rt})=>{let c=_e(n);if(c.provider!=="mixedbread")return{deleted:0,skipped:c.documents.length,uploaded:0};let u=c.siteId?.trim();if(!u)throw new Error("Mixedbread retrieval requires a non-empty siteId in geistdocs.tsx.");if(c.documents.length===0)throw new Error("The Geistdocs search export is empty. Refusing to remove indexed documents.");let l=c.documents.map(p=>At(p,u,s,o,a)),m=new Map(l.map(p=>[p.document.id,p])),h=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),x=new Map,P=new Set;for(let p of h){W(p.metadata,s,a)&&P.add(p.metadata.documentId);let y=m.get(p.metadata.documentId);y&&p.metadata.contentHash===y.hash&&p.file.status==="completed"&&!x.has(p.metadata.documentId)&&x.set(p.metadata.documentId,p)}let _=l.filter(p=>!(x.has(p.document.id)||P.has(p.document.id)));await Ee(_,t,p=>Dt({client:e,desired:p,pollIntervalMs:r,pollTimeoutMs:i,sleep:d}));let b=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),D=new Set(b.filter(({metadata:p})=>W(p,s,a)).map(({metadata:p})=>p.documentId)),ie=new Set;for(let p of l){if(D.has(p.document.id))continue;let ae=b.filter(({file:V,metadata:k})=>V.status==="completed"&&k.documentId===p.document.id&&k.contentHash===p.hash).sort((V,k)=>V.file.id.localeCompare(k.file.id))[0];ae&&ie.add(ae.file.id)}let oe=b.filter(({file:p,metadata:y})=>p.status!=="pending"&&p.status!=="in_progress"&&!W(y,s,a)&&Mt({currentRevision:s,currentRevisionAncestors:o,currentRevisionTimestamp:a,desired:m.get(y.documentId),metadata:y})&&!ie.has(p.id));return await Ee(oe,t,async({file:p,metadata:y})=>{await e.deleteFile(y.rawFileId??p.id),await e.deleteStoreFile(p.id)}),{deleted:oe.length,skipped:l.length-_.length,uploaded:_.length}};var Ot=50,$t=e=>`vercel integration add mixedbread --name docs-${e||"your-site-id"} --environment production`,ve=(e,t)=>kt("git",t,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Nt=e=>{let t=process.env.VERCEL_GIT_COMMIT_SHA?.trim(),n=[];try{n=ve(e,["rev-list",`--max-count=${Ot+1}`,t||"HEAD"]).split(`
6
6
  `).filter(Boolean)}catch{n=[]}let r=t||n[0],i;for(let s of Array.from(new Set([r,"HEAD"].filter(Boolean))))try{let o=Number(ve(e,["show","-s","--format=%ct",s]));if(Number.isFinite(o)){i=o;break}}catch{}return{revision:r,revisionAncestors:n.filter(s=>s!==r),revisionTimestamp:i}},Pe=async({allowNonProduction:e=!1,dir:t=".next"}={})=>{let n=process.cwd();Ct.loadEnvConfig(n,!1);let r=process.env.MXBAI_API_KEY?.trim(),i=process.env.MXBAI_STORE_ID?.trim();if(process.env.VERCEL_ENV!=="production"&&!e){console.log("Geistdocs search sync skipped: this is not a production Vercel build.");return}if(!!r!=!!i)throw new Error("Mixedbread is partially configured. Set both MXBAI_API_KEY and MXBAI_STORE_ID.");let s;try{s=await Te({cwd:n,outputDirectory:t})}catch(a){if(!(r||i)){console.log("Geistdocs search sync skipped: no Mixedbread credentials or static search export were found.");return}throw a}if(s.provider!=="mixedbread"){console.log("Geistdocs search sync skipped: Ask AI uses local retrieval.");return}if(!(r&&i))throw new Error(["Mixedbread retrieval is enabled, but MXBAI_API_KEY or MXBAI_STORE_ID is missing.","From the root of this site's repository, linked to the correct Vercel project, run:",$t(s.siteId)].join(`
7
- `));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({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 Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.8.0","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.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(Ue);A.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(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
7
+ `));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({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 Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.9.1-canary.13e0204","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.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(Ue);A.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(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
@@ -43,11 +43,14 @@ interface GeistdocsChatContextValue {
43
43
  hasBeenOpened: boolean;
44
44
  /** Milliseconds a stored conversation is kept after its last message. */
45
45
  historyRetentionMs: number;
46
+ /** Desktop panel fills the viewport. Reset when the chat closes. */
47
+ isExpanded: boolean;
46
48
  isOpen: boolean;
47
49
  openWithPage: GeistdocsChatController["openWithPage"];
48
50
  preloadChat: () => void;
49
51
  prewarmEveAgent: boolean;
50
52
  prompt: string;
53
+ setIsExpanded: React.Dispatch<React.SetStateAction<boolean>>;
51
54
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
52
55
  setPrompt: React.Dispatch<React.SetStateAction<string>>;
53
56
  setUser: React.Dispatch<React.SetStateAction<ChatUser | null>>;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/context.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,WAAW,CAAC;AAInB,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;CACb;AAED,+DAA+D;AAC/D,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,UAAU,yBAAyB;IACjC,GAAG,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,SA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CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7D,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAMD,eAAO,MAAM,uBAAuB,iCAQnC,CAAC;AAEF,UAAU,0BAA0B;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;CAC5D;AAED,eAAO,MAAM,qBAAqB,GAAI,uBAGnC,0BAA0B,4CAkI5B,CAAC"}
@@ -14,6 +14,7 @@ export const useGeistdocsChatContext = () => {
14
14
  };
15
15
  export const GeistdocsChatProvider = ({ children, config, }) => {
16
16
  const [isOpen, setIsOpen] = useState(false);
17
+ const [isExpanded, setIsExpanded] = useState(false);
17
18
  const [hasBeenOpened, setHasBeenOpened] = useState(false);
18
19
  const [prompt, setPrompt] = useState("");
19
20
  const [user, setUser] = useState(null);
@@ -53,6 +54,9 @@ export const GeistdocsChatProvider = ({ children, config, }) => {
53
54
  if (isOpen) {
54
55
  setHasBeenOpened(true);
55
56
  }
57
+ else {
58
+ setIsExpanded(false);
59
+ }
56
60
  }, [isOpen]);
57
61
  useEffect(() => {
58
62
  window.localStorage.setItem(CHAT_OPEN_STORAGE_KEY, String(isOpen));
@@ -74,11 +78,13 @@ export const GeistdocsChatProvider = ({ children, config, }) => {
74
78
  enabled,
75
79
  hasBeenOpened,
76
80
  historyRetentionMs: resolveChatHistoryRetentionMs(retentionDays),
81
+ isExpanded,
77
82
  isOpen,
78
83
  openWithPage,
79
84
  preloadChat,
80
85
  prewarmEveAgent: config.ai?.eveAgent?.prewarm === true,
81
86
  prompt,
87
+ setIsExpanded,
82
88
  setIsOpen,
83
89
  setPrompt,
84
90
  setUser,
@@ -94,6 +100,7 @@ export const GeistdocsChatProvider = ({ children, config, }) => {
94
100
  config.title,
95
101
  enabled,
96
102
  hasBeenOpened,
103
+ isExpanded,
97
104
  isOpen,
98
105
  openWithPage,
99
106
  preloadChat,
@@ -31,7 +31,7 @@ const CHAT_RESPONSE_COMPONENTS = {
31
31
  code: ({ children, className, node, ...props }) => {
32
32
  const inline = node?.position?.start.line === node?.position?.end.line;
33
33
  if (inline) {
34
- return (_jsx("code", { className: cn("rounded bg-gray-100 px-1 py-0.5 font-mono text-sm", className), ...props, children: children }));
34
+ return (_jsx("code", { className: cn("rounded bg-gray-100 px-1 py-0.5 font-mono text-gray-1000 text-sm", className), ...props, children: children }));
35
35
  }
36
36
  const codeContent = Array.isArray(children)
37
37
  ? children.join("")
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AA2WA,eAAO,MAAM,kBAAkB,sDA8D9B,CAAC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AA6ZA,eAAO,MAAM,kBAAkB,sDAgE9B,CAAC"}
@@ -4,7 +4,7 @@ import { useChat } from "@ai-sdk/react";
4
4
  import { catchError } from "next/error";
5
5
  import { Portal } from "radix-ui";
6
6
  import { useEffect, useRef } from "react";
7
- import { IconChevronDoubleRight, IconTrash } from "#geistdocs-assets/icons";
7
+ import { IconChevronDoubleRight, IconFullscreen, IconFullscreenClose, IconTrash, } from "#geistdocs-assets/icons";
8
8
  import { Button } from "#geistdocs-ui/components/button";
9
9
  import { Drawer, DrawerTitle } from "#geistdocs-ui/components/drawer";
10
10
  import { Kbd } from "#geistdocs-ui/components/kbd";
@@ -28,7 +28,10 @@ import { Suggestion, Suggestions } from "./suggestion";
28
28
  import { useChatCommands } from "./use-chat-commands";
29
29
  import { useChatUserAvatar } from "./user-avatar";
30
30
  const ChatLoading = () => (_jsx("div", { className: "flex size-full w-full flex-col items-center justify-center overflow-hidden whitespace-nowrap rounded-xl xl:max-w-md xl:border xl:bg-background-100", children: _jsx(Spinner, {}) }));
31
- const GeistdocsChatInner = ({ active, isOpen, }) => {
31
+ // Centers the header, transcript, and composer when the panel fills the
32
+ // viewport, so lines stay readable on wide screens.
33
+ const EXPANDED_COLUMN = "mx-auto w-full max-w-5xl";
34
+ const GeistdocsChatInner = ({ active, expandable = false, isOpen, }) => {
32
35
  const state = useChatSession();
33
36
  const textareaRef = useRef(null);
34
37
  const ready = state.status === "ready";
@@ -59,11 +62,13 @@ const GeistdocsChatInner = ({ active, isOpen, }) => {
59
62
  if (state.status === "loading") {
60
63
  return _jsx(ChatLoading, {});
61
64
  }
62
- return (_jsx(GeistdocsChatPanel, { clearConversation: state.clearConversation, session: state.session, textareaRef: textareaRef }));
65
+ return (_jsx(GeistdocsChatPanel, { clearConversation: state.clearConversation, expandable: expandable, session: state.session, textareaRef: textareaRef }));
63
66
  };
64
- const GeistdocsChatPanel = ({ clearConversation, session, textareaRef, }) => {
67
+ const GeistdocsChatPanel = ({ clearConversation, expandable, session, textareaRef, }) => {
65
68
  const toast = useToasts();
66
- const { prompt, setPrompt, setIsOpen, chatTitle, commands, commandState, footer, suggestions, } = useGeistdocsChatContext();
69
+ const { prompt, setPrompt, setIsOpen, chatTitle, commands, commandState, footer, isExpanded: isExpandedState, setIsExpanded, suggestions, } = useGeistdocsChatContext();
70
+ const isExpanded = expandable && isExpandedState;
71
+ const expandLabel = isExpanded ? "Collapse chat" : "Expand chat";
67
72
  const userAvatar = useChatUserAvatar();
68
73
  const { messages, sendMessage, setMessages, status, stop } = useChat({
69
74
  chat: session.chat,
@@ -105,15 +110,15 @@ const GeistdocsChatPanel = ({ clearConversation, session, textareaRef, }) => {
105
110
  });
106
111
  }
107
112
  };
108
- return (_jsxs("aside", { "aria-label": `${chatTitle} chat`, className: "flex size-full w-full flex-col overflow-hidden whitespace-nowrap bg-background-100", children: [_jsxs("div", { className: "sticky top-0 z-10 flex h-16 items-center justify-between bg-background-100 py-2 pr-2 pl-3.5", children: [_jsx("h2", { className: "font-semibold text-sm", children: chatTitle }), _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(CopyChat, { messages: messages }), _jsx(Tooltip, { position: "bottom", text: "Delete chat", children: _jsx(Button, { "aria-label": "Delete chat", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0 ||
113
+ return (_jsxs("aside", { "aria-label": `${chatTitle} chat`, className: "flex size-full w-full flex-col overflow-hidden whitespace-nowrap bg-background-100", children: [_jsxs("div", { className: cn("sticky top-0 z-10 flex h-16 shrink-0 items-center justify-between bg-background-100 py-2 pr-2 pl-3.5", isExpanded && EXPANDED_COLUMN), children: [_jsx("h2", { className: "font-semibold text-sm", children: chatTitle }), _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(CopyChat, { messages: messages }), expandable ? (_jsx(Tooltip, { position: "bottom", text: expandLabel, children: _jsx(Button, { "aria-label": expandLabel, "aria-pressed": isExpanded, className: "text-gray-800! shadow-none", onClick: () => setIsExpanded(!isExpanded), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: isExpanded ? (_jsx(IconFullscreenClose, { size: 14 })) : (_jsx(IconFullscreen, { size: 14 })) }) })) : null, _jsx(Tooltip, { position: "bottom", text: "Delete chat", children: _jsx(Button, { "aria-label": "Delete chat", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0 ||
109
114
  status === "streaming" ||
110
- status === "submitted", onClick: handleClearChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconTrash, { size: 14 }) }) }), _jsx(Tooltip, { position: "bottom", text: "Close chat", children: _jsx(Button, { "aria-label": "Close chat", className: "text-gray-800! shadow-none", onClick: () => setIsOpen(false), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconChevronDoubleRight, { size: 14 }) }) })] })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { children: [messages.map((message, index) => (_jsxs(Message, { avatar: message.role === "user" ? userAvatar : undefined, from: message.role, children: [_jsx(MessageMetadata, { inProgress: isActiveAssistantMessage({
115
+ status === "submitted", onClick: handleClearChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconTrash, { size: 14 }) }) }), _jsx(Tooltip, { position: "bottom", text: "Close chat", children: _jsx(Button, { "aria-label": "Close chat", className: "text-gray-800! shadow-none", onClick: () => setIsOpen(false), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconChevronDoubleRight, { size: 14 }) }) })] })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { className: cn(isExpanded && EXPANDED_COLUMN), children: [messages.map((message, index) => (_jsxs(Message, { avatar: message.role === "user" ? userAvatar : undefined, from: message.role, children: [_jsx(MessageMetadata, { inProgress: isActiveAssistantMessage({
111
116
  index,
112
117
  messages,
113
118
  status,
114
119
  }), parts: message.parts }), _jsx(ChatMessagePageChip, { metadata: message.metadata }), message.parts
115
120
  .filter((part) => part.type === "text")
116
- .map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`))), _jsx(MessageActions, { index: index, messages: messages, setMessages: setMessages, status: status })] }, message.id))), shouldShowPendingActivity({ messages, status }) ? (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: _jsx(DotsSpinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: "relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.map((suggestion) => (_jsx(Suggestion, { className: "w-full", icon: suggestion.icon, onClick: handleSuggestionClick, suggestion: suggestion.text, variant: "tertiary" }, suggestion.key))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), commandState.attachedPage ? (_jsx(ChatPageAttachmentCard, { onRemove: commands.detachPage, page: commandState.attachedPage })) : null, _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
121
+ .map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`))), _jsx(MessageActions, { index: index, messages: messages, setMessages: setMessages, status: status })] }, message.id))), shouldShowPendingActivity({ messages, status }) ? (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: _jsx(DotsSpinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: cn("relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", isExpanded && EXPANDED_COLUMN), children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.map((suggestion) => (_jsx(Suggestion, { className: "w-full", icon: suggestion.icon, onClick: handleSuggestionClick, suggestion: suggestion.text, variant: "tertiary" }, suggestion.key))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), commandState.attachedPage ? (_jsx(ChatPageAttachmentCard, { onRemove: commands.detachPage, page: commandState.attachedPage })) : null, _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
117
122
  event.preventDefault();
118
123
  handleSubmit().catch((error) => {
119
124
  console.error("Failed to submit chat message:", error);
@@ -136,7 +141,7 @@ const GeistdocsChatError = ({ chatTitle, onClose, retry, }) => {
136
141
  const GeistdocsChatErrorFallback = ({ chatTitle, onClose }, { retry }) => (_jsx(GeistdocsChatError, { chatTitle: chatTitle, onClose: onClose, retry: retry }));
137
142
  const GeistdocsChatErrorBoundary = catchError(GeistdocsChatErrorFallback);
138
143
  export const GeistdocsChatShell = () => {
139
- const { chatTitle, enabled, isOpen, setIsOpen } = useGeistdocsChatContext();
144
+ const { chatTitle, enabled, isExpanded, isOpen, setIsOpen } = useGeistdocsChatContext();
140
145
  // The shell mounts only on the client after hydration, so read the
141
146
  // breakpoint now instead of starting as desktop for a frame.
142
147
  const isMobile = useIsMobileAfterHydration();
@@ -156,5 +161,5 @@ export const GeistdocsChatShell = () => {
156
161
  // modal surfaces like the search command menu, dialogs, and
157
162
  // dropdowns (z-50), so opening the command menu paints over an
158
163
  // open chat panel.
159
- "fixed inset-y-0 right-0 z-45 hidden h-full w-[400px] max-w-[75vw] flex-col gap-4 border-l bg-background-100 transition-transform min-[768px]:flex", "translate-x-full data-[state=open]:translate-x-0"), "data-state": isOpen ? "open" : "closed", children: _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: !isMobile, isOpen: isOpen }) }) }) }), _jsx("div", { className: "min-[768px]:hidden", children: _jsxs(Drawer, { className: "flex flex-col bg-background-100", height: "80dvh", onDismiss: () => setIsOpen(false), show: isMobile && isOpen, children: [_jsx(DrawerTitle, { className: "sr-only", children: chatTitle }), _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: isMobile, isOpen: isOpen }) })] }) })] }));
164
+ "fixed inset-y-0 right-0 z-45 hidden h-full flex-col gap-4 border-l bg-background-100 transition-transform min-[768px]:flex", isExpanded ? "w-screen border-l-0" : "w-[400px] max-w-[75vw]", "translate-x-full data-[state=open]:translate-x-0"), "data-state": isOpen ? "open" : "closed", children: _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: !isMobile, expandable: true, isOpen: isOpen }) }) }) }), _jsx("div", { className: "min-[768px]:hidden", children: _jsxs(Drawer, { className: "flex flex-col bg-background-100", height: "80dvh", onDismiss: () => setIsOpen(false), show: isMobile && isOpen, children: [_jsx(DrawerTitle, { className: "sr-only", children: chatTitle }), _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: isMobile, isOpen: isOpen }) })] }) })] }));
160
165
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mdx-to-markdown.d.ts","sourceRoot":"","sources":["../../src/internal/mdx-to-markdown.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,SAAS,CAAC;AA0nCtD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,aAAa,MAGjD,QAAQ,MAAM,oBAe7B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,aAAa,WAlBF,MAAM,oBAkBoB,CAAC"}
1
+ {"version":3,"file":"mdx-to-markdown.d.ts","sourceRoot":"","sources":["../../src/internal/mdx-to-markdown.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,SAAS,CAAC;AA43CtD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,aAAa,MAGjD,QAAQ,MAAM,oBAe7B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,aAAa,WAlBF,MAAM,oBAkBoB,CAAC"}