Skip to content

Conversation

@dimaMachina
Copy link
Collaborator

@dimaMachina dimaMachina commented Nov 24, 2025

  • auto update API reference for manage-api

  • NEW API reference for run-api
    image

  • updates all fumadocs dependencies

  • refactor all scripts from js to ts, thanks to --experimental-strip-types flag

  • polish README

  • refactor tailwind.config.mjs to ts

  • add "type": "module" in package.json to avoid specifying .mjs extension (like postcss.config.mjs)

  • pnpm generate-openapi and pnpm validate-link in prebuild script

  • fix a lot of broken urls (should be done in another PR)
    image

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2025

⚠️ No Changeset found

Latest commit: 7f7ea34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
agents-docs Error Error Dec 1, 2025 3:39am
agents-manage-api Ready Ready Preview Comment Dec 1, 2025 3:39am
agents-manage-ui Ready Ready Preview Comment Dec 1, 2025 3:39am
agents-run-api Ready Ready Preview Comment Dec 1, 2025 3:39am

@claude
Copy link

claude bot commented Nov 24, 2025

Claude finished @dimaMachina's task —— View job


Code Review Analysis

I'll provide a comprehensive review of this PR which appears to be a significant refactoring of the API documentation generation system.

Todo List:

  • Analyze overall PR scope and architectural changes
  • Review TypeScript migration (.mjs → .ts conversion)
  • Examine OpenAPI documentation generation changes
  • Evaluate package.json and dependency updates
  • Check navigation and content structure changes
  • Review deleted files and their impact
  • Assess potential breaking changes and missing functionality
  • Provide architectural feedback and recommendations

🏗️ Overall Assessment

This PR represents a well-executed modernization of the documentation infrastructure with significant architectural improvements. The changes demonstrate thoughtful engineering decisions that address scalability, maintainability, and developer experience.

✅ Strengths

1. Smart Migration Strategy

  • Clean conversion from .mjs to .ts scripts with proper typing
  • Removal of the massive index.json file (21,513 lines) in favor of dynamic generation
  • Uses Node.js --experimental-strip-types for direct TypeScript execution

2. Improved OpenAPI Architecture

// agents-docs/src/lib/openapi.ts:6-8
input: () => ({
  index: 'https://agents-manage-api.preview.inkeep.com/openapi.json',
  'run-api': 'https://agents-run-api.preview.inkeep.com/openapi.json',
}),
  • Generates docs from live endpoints rather than static files
  • Supports multi-API documentation (manage-api + run-api)
  • Leverages fumadocs-openapi for consistent generation

3. Enhanced Build Process

// agents-docs/package.json:17-20
"generate-openapi": "node scripts/generate-openapi-docs.ts --experimental-strip-types",
"generate-classnames": "node scripts/generate-classnames.ts --experimental-strip-types",
"prebuild": "pnpm generate-classnames",
"validate-link": "node scripts/validate-link.ts --experimental-strip-types"
  • Automated documentation generation integrated into build pipeline
  • Proper prebuild hooks ensure docs are current

4. Dependency Management

  • Updated to modern React 19.2.0 and Next.js 16.0.3
  • Consolidated fumadocs dependencies to compatible versions
  • Added proper typing with schema-dts for structured data

⚠️ Areas for Consideration

Critical: Environment Dependency Risk

Issue: The OpenAPI generation depends on preview URLs being accessible:

'https://agents-manage-api.preview.inkeep.com/openapi.json'
'https://agents-run-api.preview.inkeep.com/openapi.json'

Concerns:

  • Build failures if preview deployments are down/inaccessible
  • Documentation staleness if preview schemas differ from production
  • CI/CD brittleness in environments without preview access

Recommendations:

// Consider fallback strategy
input: () => ({
  index: process.env.MANAGE_API_OPENAPI_URL || 'https://agents-manage-api.preview.inkeep.com/openapi.json',
  'run-api': process.env.RUN_API_OPENAPI_URL || 'https://agents-run-api.preview.inkeep.com/openapi.json',
}),

Medium: Documentation Coverage Gaps

The generated run-api.mdx is notably sparse:

# agents-docs/content/docs/api-reference/run-api.mdx:5
toc: []

Questions:

  • Is this expected for the run-api?
  • Should there be more comprehensive endpoint documentation?
  • Are authentication examples missing?

Medium: Error Handling & Recovery

generate-openapi-docs.ts lacks robust error handling:

// agents-docs/scripts/generate-openapi-docs.ts:21
main().catch(console.error);

Suggestions:

  • Add network timeout handling
  • Implement retry logic for API failures
  • Provide clear error messages for debugging
  • Consider graceful degradation when APIs are unavailable

Low: Type Safety Improvements

sidebar/transform.ts uses loose typing:

// agents-docs/src/components/sidebar/transform.ts:4
export const transformItems = (group: any) => {

Consider stronger typing:

interface NavigationGroup {
  group?: string;
  icon?: string;  
  pages: (string | NavigationItem)[];
}

export const transformItems = (group: NavigationGroup) => {

🎯 Architectural Strengths

1. Separation of Concerns: Clean separation between generation scripts and runtime code
2. Dynamic Content: Live API schema fetching ensures documentation accuracy
3. Modern Toolchain: Leverages latest fumadocs capabilities and TypeScript features
4. Build Integration: Proper integration with existing build processes


🚀 Recommendations

Immediate (Pre-merge)

  1. Add environment variable support for OpenAPI URLs
  2. Implement retry logic in generation scripts
  3. Document the new build process in README

Short-term

  1. Add comprehensive error handling to generation scripts
  2. Strengthen TypeScript typing throughout the codebase
  3. Consider offline fallbacks for critical build scenarios

Long-term

  1. Monitor documentation build reliability in production
  2. Consider API versioning strategy for backward compatibility
  3. Evaluate caching strategies for frequently accessed schemas

📊 Impact Assessment

  • No Breaking Changes: Navigation structure preserved
  • Improved DX: Better typing and tooling
  • Reduced Bundle Size: Eliminated massive static JSON file
  • ⚠️ Build Dependencies: New external API dependencies
  • ⚠️ Runtime Reliability: Dependent on preview environment stability

This is a well-architected refactoring that modernizes the documentation infrastructure. The primary risk is build-time dependency on external APIs, which should be mitigated with proper fallback strategies.

@@ -1,27 +0,0 @@
# deps
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, .source already specified in root .gitignore

.source/

Comment on lines +189 to +190
{ page: 'api-reference', icon: 'LuDatabaseZap' },
{ page: 'api-reference/run-api', icon: 'LuPlay' },
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added possibility providing icon for individual pages, but IMO we should stays with meta.json convention

See https://inkeep.slack.com/archives/C08QXR5CWBH/p1763979484675009

// Package ts-morph can't be external
// The request ts-morph matches serverExternalPackages (or the default list).
transpilePackages: ['prettier', 'ts-morph'],
transpilePackages: ['prettier', 'ts-morph', 'shiki'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes warning while running next build

}}
container={{
className: 'lg:pt-0! [&>#nd-toc]:!pt-6 [&>#nd-toc]:pb-4 h-full min-h-0',
style: tocEnabled ? undefined : { '--fd-toc-width': 0 },
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +5 to +8
input: () => ({
index: 'https://agents-manage-api.preview.inkeep.com/openapi.json',
'run-api': 'https://agents-run-api.preview.inkeep.com/openapi.json',
}),
Copy link
Collaborator Author

@dimaMachina dimaMachina Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @amikofalvy 🚀 I guess I need inject environment variable here? INKEEP_AGENTS_MANAGE_API_URL and INKEEP_AGENTS_RUN_API_URL instead of https://agents-manage-api.preview.inkeep.com and https://agents-run-api.preview.inkeep.com

"content/docs/talk-to-your-agents/a2a.mdx",
"content/docs/talk-to-your-agents/mcp-server.mdx",
".next/dev/types/**/*.ts",
"scripts/generate-classnames.mjs"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since all scripts were migrated to .ts, no longer need

Comment on lines -12 to -24
docsFiles.forEach((file) => {
const info = parseFilePath(path.relative('content/docs', file.path));
const slugs = getSlugs(info);
const url = `/${slugs.join('/')}`;
validUrls[url] = true;

const hashes = getTableOfContents(file.content).map((item) => item.url.slice(1));
hashes.forEach((hash) => {
if (hash) {
validUrls[`${url}#${hash}`] = true;
}
});
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this is needed..

Comment on lines -10 to +11
'./mdx-components.{ts,tsx}',
'./src/mdx-components.{ts,tsx}',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong path, maybe we should just specify ./src/**/*.{ts,tsx} ?

Comment on lines -5 to +6
darkMode: ['class'],
const config: Config = {
darkMode: 'class',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type error

"dev": "next --turbo -p 3010",
"start": "next start",
"dev": "next --port 3010",
"start": "next start --port 3010",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use 3010 port for next start too

"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"build": "next build",
"dev": "next --turbo -p 3010",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turbo is by default with Next.js 16

Comment on lines -25 to -29
| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, since project structure was changed

url: page.url,
title: page.data.title,
icon: page.data.icon,
icon: item.icon ?? page.data.icon,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const OUTPUT_DIR = './content/docs/api-reference';
const DEFAULT_ICON = 'LuDatabaseZap';

async function addIconToFrontmatter(filePath) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is weird solution, I added possibility specifying icons for individual pages in navigation.ts file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants