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 type { ToolkitKnowledgeSummary } from './catalog'; |
| 2 | |
| 3 | type ToolkitKnowledgeRoute = Pick<ToolkitKnowledgeSummary, 'slug' | 'knowledgeCount'>; |
| 4 | |
| 5 | export function getToolkitKnowledgeRedirect( |
| 6 | toolkit: ToolkitKnowledgeRoute, |
| 7 | ): string | null { |
| 8 | return toolkit.knowledgeCount === 1 ? `/toolkits/${toolkit.slug}` : null; |
| 9 | } |
| 10 | |
| 11 | export function getToolkitKnowledgeHref(toolkit: ToolkitKnowledgeRoute): string { |
| 12 | return getToolkitKnowledgeRedirect(toolkit) ?? `/kb/toolkit/${toolkit.slug}`; |
| 13 | } |
| 14 | |
| 15 | export function getToolkitKnowledgeMarkdownHref( |
| 16 | toolkit: ToolkitKnowledgeRoute, |
| 17 | ): string { |
| 18 | return `${getToolkitKnowledgeHref(toolkit)}.md`; |
| 19 | } |