@devries-cameron20 / composio Mirror · read-only / commits / 483bf6116
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 13:15 UTC

fix(docs): Fix type error in llms-full.txt for referenceSource

Use generic PageLike interface to handle different page types from various sources including OpenAPI pages from referenceSource. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Jan 28, 2026 at 00:04 UTC 483bf611644f05cf9630b93a1dd26bf7309f5ea0
1 file changed +19 -7
docs/app/llms-full.txt/route.ts
+19 -7
@@ -2,11 +2,23 @@ import { getLLMText, source, examplesSource, referenceSource, toolkitsSource } f
2
3 export const revalidate = false;
4
5 -async function getTextForPages(pages: ReturnType<typeof source.getPages>) {
5 +// Generic page type that works for all sources
6 +interface PageLike {
7 + url: string;
8 + slugs: string[];
9 + data: {
10 + title: string;
11 + description?: string;
12 + };
13 +}
14 +
15 +// eslint-disable-next-line @typescript-eslint/no-explicit-any
16 +async function getTextForPages(pages: PageLike[]) {
17 return Promise.all(
18 pages.map(async (page) => {
19 try {
9 - return await getLLMText(page);
20 + // eslint-disable-next-line @typescript-eslint/no-explicit-any
21 + return await getLLMText(page as any);
22 } catch {
23 // Graceful fallback if getText fails
24 return `# ${page.data.title} (${page.url})\n\n${page.data.description || ''}`;
@@ -16,7 +28,7 @@ async function getTextForPages(pages: ReturnType<typeof source.getPages>) {
28 }
29
30 // Order pages according to sidebar structure from meta.json
19 -function orderDocPages(pages: ReturnType<typeof source.getPages>) {
31 +function orderDocPages(pages: PageLike[]) {
32 // Define the order based on meta.json sidebar structure
33 const sidebarOrder = [
34 // Get Started
@@ -84,13 +96,13 @@ function orderDocPages(pages: ReturnType<typeof source.getPages>) {
96
97 export async function GET() {
98 try {
87 - const orderedDocsPages = orderDocPages(source.getPages());
99 + const orderedDocsPages = orderDocPages(source.getPages() as PageLike[]);
100
101 const [docsResults, examplesResults, referenceResults, toolkitsResults] = await Promise.all([
102 getTextForPages(orderedDocsPages),
91 - getTextForPages(examplesSource.getPages()),
92 - getTextForPages(referenceSource.getPages()),
93 - getTextForPages(toolkitsSource.getPages()),
103 + getTextForPages(examplesSource.getPages() as PageLike[]),
104 + getTextForPages(referenceSource.getPages() as PageLike[]),
105 + getTextForPages(toolkitsSource.getPages() as PageLike[]),
106 ]);
107
108 const results = [