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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions agents-docs/_snippets/ui/CustomizationTip.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,30 @@ pnpm add @inkeep/agents-ui
</Tab>
</Tabs>

## Props

<Snippet file="ui/CustomizationTip.mdx" />
<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepChatButtonProps"
/>

### Base Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepBaseSettings"
/>

### Modal Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepModalSettings"
/>

### AI Chat Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepAIChatSettings"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,30 @@ pnpm add @inkeep/agents-ui
</Tab>
</Tabs>

<Snippet file="ui/CustomizationTip.mdx" />
## Props

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepModalChatProps"
/>

### Base Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepBaseSettings"
/>

### AI Chat Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepAIChatSettings"
/>

### Modal Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepModalSettings"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,23 @@ pnpm add @inkeep/agents-ui
</Tab>
</Tabs>

<Snippet file="ui/CustomizationTip.mdx" />
## Props

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepEmbeddedChatProps"
/>

### Base Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepBaseSettings"
/>

### AI Chat Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepAIChatSettings"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,26 @@ pnpm add @inkeep/agents-ui
| Property | Type | Description |
| ------------------------- | ------ | --------------------------------------------------- |
| `aiChatSettings` | object | Configuration for the AI chat connection |
| `aiChatSettings.agentUrl` | string | The URL of your agent endpoint |
| `aiChatSettings.agentUrl` | string | The URL of your agent endpoint |
| `aiChatSettings.headers` | object | Headers for authentication and agent identification |

<Snippet file="ui/CustomizationTip.mdx" />
## Props

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepSidebarChatProps"
/>

### Base Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepBaseSettings"
/>

### AI Chat Settings

<AutoTypeTable
path="./content/docs/talk-to-your-agents/react/types.ts"
name="InkeepAIChatSettings"
/>
14 changes: 14 additions & 0 deletions agents-docs/content/docs/talk-to-your-agents/react/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type {
InkeepChatButtonProps,
InkeepModalChatProps,
InkeepSidebarChatProps,
InkeepEmbeddedChatProps,
} from '@inkeep/agents-ui';

export type {
InkeepBaseSettings,
InkeepModalSettings,
InkeepAIChatSettings,
InkeepSearchSettings,
ColorModeProviderProps,
} from '@inkeep/agents-ui/types';
26 changes: 17 additions & 9 deletions agents-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"validate-link": "node scripts/validate-link.mjs"
},
"dependencies": {
"@inkeep/agents-ui": "^0.14.26",
"@inkeep/cxkit-react": "^0.5.98",
"@inkeep/docskit": "^0.0.6",
"@radix-ui/react-collapsible": "^1.1.1",
Expand All @@ -28,17 +29,18 @@
"@shikijs/langs": "^3.3.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"fumadocs-core": "15.7.13",
"fumadocs-mdx": "11.10.1",
"fumadocs-openapi": "^9.4.0",
"fumadocs-ui": "15.7.13",
"fumadocs-core": "16.0.2",
"fumadocs-mdx": "13.0.0",
"fumadocs-openapi": "^9.6.2",
"fumadocs-typescript": "^4.0.12",
"fumadocs-ui": "16.0.2",
"hast-util-to-jsx-runtime": "^2.3.6",
"lucide-react": "^0.503.0",
"mermaid": "^11.12.0",
"next": "15.5.4",
"next": "16.0.0",
"next-themes": "^0.4.6",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "19.2.0",
"react-dom": "19.2.0",
"remark": "^15.0.1",
"remark-emoji": "^5.0.1",
"remark-gfm": "^4.0.1",
Expand All @@ -55,8 +57,8 @@
"@tailwindcss/postcss": "^4.1.11",
"@types/mdx": "^2.0.13",
"@types/node": "24.0.7",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"fast-glob": "^3.3.3",
"next-validate-link": "^1.6.3",
"postcss": "^8.5.6",
Expand All @@ -66,5 +68,11 @@
},
"engines": {
"node": ">=22.0.0"
},
"pnpm": {
"overrides": {
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2"
}
}
}
2 changes: 1 addition & 1 deletion agents-docs/scripts/validate-link.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { getTableOfContents } from 'fumadocs-core/server';
import { getTableOfContents } from 'fumadocs-core/content/toc';
import { getSlugs, parseFilePath } from 'fumadocs-core/source';
import { printErrors, readFiles, scanURLs, validateFiles } from 'next-validate-link';

Expand Down
27 changes: 16 additions & 11 deletions agents-docs/src/app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { notFound, redirect } from 'next/navigation';
import { Breadcrumb } from '@/components/breadcrumb';
import { Footer } from '@/components/footer';
import { Markdown } from '@/components/markdown';
import { createMetadata, metadataImage } from '@/lib/metadata';
import { createMetadata } from '@/lib/metadata';
import { getDocsGroupFirstChild, source } from '@/lib/source';
import { getMDXComponents } from '@/mdx-components';

Expand Down Expand Up @@ -80,14 +80,19 @@ export async function generateMetadata(props: PageProps<'/[[...slug]]'>) {

if (!page) notFound();

return createMetadata(
metadataImage.withImage(page.slugs, {
title: `${page.data.title} - Inkeep Open Source Docs`,
description: page.data.description,
openGraph: {
url: page.url,
},
keywords: page.data.keywords,
})
);
return createMetadata({
title: `${page.data.title} - Inkeep Open Source Docs`,
description: page.data.description,
openGraph: {
url: page.url,
images: [
{
url: `/api/docs-og/${params.slug?.join('/')}/image.png`,
width: 1200,
height: 630,
},
],
},
keywords: page.data.keywords,
});
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { readFileSync } from 'node:fs';
import { metadataImage } from '@/lib/metadata';
import { generateOGImage } from './og';
import { source } from '@/lib/source';
import type { NextRequest } from 'next/server';

const font = readFileSync('./src/app/docs-og/[...slug]/Inter-Regular.ttf');
const fontSemiBold = readFileSync('./src/app/docs-og/[...slug]/Inter-SemiBold.ttf');
const font = readFileSync('./src/app/api/docs-og/[...slug]/Inter-Regular.ttf');
const fontSemiBold = readFileSync('./src/app/api/docs-og/[...slug]/Inter-SemiBold.ttf');

function getSubheading(path: string) {
const parts = path.split('/');
Expand All @@ -17,8 +18,11 @@ function getSubheading(path: string) {
return secondToLastItem.replace(/-/g, ' ');
}

export const GET = metadataImage.createAPI((page) => {
const subHeading = getSubheading(page.file.path);
export const GET = async (_req: NextRequest, ctx: RouteContext<'/api/docs-og/[...slug]'>) => {
const { slug } = await ctx.params;
const page = source.getPage(slug.slice(0, -1));
if (!page) return;
const subHeading = getSubheading(page.url);
return generateOGImage({
title: page.data.title,
description: page.data.description,
Expand All @@ -41,8 +45,4 @@ export const GET = metadataImage.createAPI((page) => {
},
],
});
});

export function generateStaticParams() {
return metadataImage.generateParams();
}
};
8 changes: 7 additions & 1 deletion agents-docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { JsonLd } from '@/components/seo/json-ld';
import { AppSidebar } from '@/components/sidebar';
import { SidebarProvider } from '@/components/ui/sidebar';
import { cn } from '@/lib/utils';
import { createMetadata } from '@/lib/metadata';

const inter = Inter({
subsets: ['latin'],
Expand Down Expand Up @@ -53,6 +54,11 @@ const siteLd: WithContext<WebSite> = {
alternateName: 'Inkeep Docs',
};

export const metadata = createMetadata({
title: siteLd.name as string,
description: orgLd.description as string,
});

export default function Layout({ children }: LayoutProps<'/'>) {
return (
<html lang="en" className={`${inter.className} antialiased`} suppressHydrationWarning>
Expand All @@ -75,7 +81,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
'mx-(--fd-layout-offset)',
'md:[&_#nd-page_article]:pt-0! xl:[--fd-toc-width:286px] xl:[&_#nd-page_article]:px-8',
'md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]',
'flex flex-1 flex-row pe-(--fd-layout-offset) max-w-fd-container relative top-[calc(var(--fd-nav-height)+1rem)] px-4 ms-auto! me-auto!'
'flex flex-1 flex-row max-w-fd-container relative top-[calc(var(--fd-nav-height)+1rem)] px-4 ms-auto! me-auto!'
)}
>
<AppSidebar />
Expand Down
3 changes: 2 additions & 1 deletion agents-docs/src/components/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import { useBreadcrumb } from 'fumadocs-core/breadcrumb';
import type { PageTree } from 'fumadocs-core/server';
import type * as PageTree from 'fumadocs-core/page-tree'

import { ChevronRight } from 'lucide-react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
Expand Down
3 changes: 1 addition & 2 deletions agents-docs/src/lib/get-llm-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const processor = remark().use(remarkMdx).use(mdxSnippet).use(remarkSourceCode).

export async function getLLMText(page: InferPageType<typeof source>) {
const processed = await processor.process({
path: page.data._file.absolutePath,
value: page.data.content,
value: await page.data.getText('raw'),
});

return `# ${page.data.title}
Expand Down
7 changes: 0 additions & 7 deletions agents-docs/src/lib/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { createMetadataImage } from 'fumadocs-core/server';
import type { Metadata } from 'next';
import { source } from './source';

export const metadataImage = createMetadataImage({
imageRoute: '/docs-og',
source,
});

export function createMetadata(override: Metadata): Metadata {
return {
Expand Down
6 changes: 6 additions & 0 deletions agents-docs/src/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
} from '@inkeep/docskit/mdx';
import { APIPage } from 'fumadocs-openapi/ui';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { createGenerator } from 'fumadocs-typescript';
import { AutoTypeTable } from 'fumadocs-typescript/ui';

import type { MDXComponents } from 'mdx/types';
import type { ComponentProps } from 'react';
import { Mermaid } from '@/components/mdx/mermaid';
Expand Down Expand Up @@ -80,11 +83,14 @@ function pre(props: ComponentProps<typeof OriginalPre>) {
return <OriginalPre {...rest}>{children}</OriginalPre>;
}

const generator = createGenerator();

// use this function to get MDX components, you will need it for rendering MDX
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
APIPage: (props) => <APIPage {...openapi.getAPIPageProps(props)} />,
AutoTypeTable: (props) => <AutoTypeTable {...props} generator={generator} />,
...components,
Accordions,
Accordion,
Expand Down
Loading