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): Add API reference and toolkits to llms-full.txt
- Add referenceSource and toolkitsSource imports - Order docs pages according to sidebar structure from meta.json - Add API Reference and Toolkits sections to full output Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 28, 2026 at 00:01 UTC
01fed2956ce56504bffeaf83cd68e16c0282bd78
1 file changed
+78
-3
docs/app/llms-full.txt/route.ts
+78
-3
@@ -1,4 +1,4 @@
1
-import { getLLMText, source, examplesSource } from '@/lib/source';
1
+import { getLLMText, source, examplesSource, referenceSource, toolkitsSource } from '@/lib/source';
2
3
export const revalidate = false;
4
@@ -15,11 +15,82 @@ async function getTextForPages(pages: ReturnType<typeof source.getPages>) {
15
);
16
}
17
18
+// Order pages according to sidebar structure from meta.json
19
+function orderDocPages(pages: ReturnType<typeof source.getPages>) {
20
+ // Define the order based on meta.json sidebar structure
21
+ const sidebarOrder = [
22
+ // Get Started
23
+ 'index',
24
+ 'quickstart',
25
+ // Providers folder
26
+ 'providers/openai-agents',
27
+ 'providers/anthropic',
28
+ 'providers/vercel',
29
+ 'providers/langchain',
30
+ 'providers/mastra',
31
+ 'providers/openai',
32
+ 'providers/google',
33
+ 'providers/llamaindex',
34
+ 'providers/crewai',
35
+ 'providers/custom-providers',
36
+ // Core Concepts
37
+ 'users-and-sessions',
38
+ 'authentication',
39
+ 'tools-and-toolkits',
40
+ // Getting Started
41
+ 'configuring-sessions',
42
+ 'authenticating-users/in-chat-authentication',
43
+ 'authenticating-users/manually-authenticating',
44
+ // Toolkits folder (from docs/toolkits)
45
+ 'toolkits',
46
+ // Guides
47
+ 'white-labeling-authentication',
48
+ 'managing-multiple-connected-accounts',
49
+ 'using-custom-auth-configuration',
50
+ // Features
51
+ 'triggers',
52
+ 'cli',
53
+ 'single-toolkit-mcp',
54
+ // Direct Tool Execution - Tools
55
+ 'tools-direct/fetching-tools',
56
+ 'tools-direct/authenticating-tools',
57
+ 'tools-direct/executing-tools',
58
+ 'tools-direct/modify-tool-behavior',
59
+ 'tools-direct/custom-tools',
60
+ 'tools-direct/toolkit-versioning',
61
+ // Direct Tool Execution - Auth Configuration
62
+ 'auth-configuration',
63
+ // Resources
64
+ 'debugging-info',
65
+ 'migration-guide',
66
+ 'troubleshooting',
67
+ ];
68
+
69
+ // Create a map for ordering
70
+ const orderMap = new Map<string, number>();
71
+ sidebarOrder.forEach((slug, index) => {
72
+ orderMap.set(slug, index);
73
+ });
74
+
75
+ // Sort pages based on sidebar order, unmatched pages go to end
76
+ return [...pages].sort((a, b) => {
77
+ const slugA = a.slugs.join('/');
78
+ const slugB = b.slugs.join('/');
79
+ const orderA = orderMap.get(slugA) ?? 999;
80
+ const orderB = orderMap.get(slugB) ?? 999;
81
+ return orderA - orderB;
82
+ });
83
+}
84
+
85
export async function GET() {
86
try {
20
- const [docsResults, examplesResults] = await Promise.all([
21
- getTextForPages(source.getPages()),
87
+ const orderedDocsPages = orderDocPages(source.getPages());
88
+
89
+ const [docsResults, examplesResults, referenceResults, toolkitsResults] = await Promise.all([
90
+ getTextForPages(orderedDocsPages),
91
getTextForPages(examplesSource.getPages()),
92
+ getTextForPages(referenceSource.getPages()),
93
+ getTextForPages(toolkitsSource.getPages()),
94
]);
95
96
const results = [
@@ -27,6 +98,10 @@ export async function GET() {
98
...docsResults,
99
'\n# Examples\n',
100
...examplesResults,
101
+ '\n# API Reference\n',
102
+ ...referenceResults,
103
+ '\n# Toolkits\n',
104
+ ...toolkitsResults,
105
];
106
107
return new Response(results.join('\n\n---\n\n'), {