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 21, 03:37 UTC
| 1 | import { getPublishedKbGuides, getKbGuideUrl } from '@/lib/kb/repository'; |
| 2 | import { getKnowledgeToolkitSummaries } from './catalog'; |
| 3 | import { PRODUCT_AREAS } from './taxonomy'; |
| 4 | import { getToolkitKnowledgeRedirect } from './toolkit-routing'; |
| 5 | |
| 6 | export async function getLocalKnowledgeDiscoveryPaths(): Promise<string[]> { |
| 7 | const toolkitPages = (await getKnowledgeToolkitSummaries()) |
| 8 | .filter((toolkit) => !getToolkitKnowledgeRedirect(toolkit)) |
| 9 | .map((toolkit) => `/kb/toolkit/${toolkit.slug}`); |
| 10 | const topicPages = PRODUCT_AREAS.filter((area) => area.defaultBrowse).map( |
| 11 | (area) => `/kb/topic/${area.slug}`, |
| 12 | ); |
| 13 | const guidePages = getPublishedKbGuides().map(getKbGuideUrl); |
| 14 | |
| 15 | return Array.from(new Set([ |
| 16 | '/kb', |
| 17 | '/kb/search', |
| 18 | ...topicPages, |
| 19 | '/kb/toolkits', |
| 20 | ...toolkitPages, |
| 21 | ...guidePages, |
| 22 | ])); |
| 23 | } |
| 24 | |
| 25 | export function formatKnowledgeDiscoveryLinks(paths: string[]): string { |
| 26 | return paths |
| 27 | .map((path) => `- https://docs.composio.dev${path.startsWith('/kb/guide/') ? `${path}.md` : path}`) |
| 28 | .join('\n'); |
| 29 | } |