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 Link from 'next/link'; |
| 2 | import { ArrowUpRight } from 'lucide-react'; |
| 3 | import type { ReactNode } from 'react'; |
| 4 | import { AuthDiagram } from './home-auth-diagram'; |
| 5 | import { MOCK_FADE_STYLE } from './home-shared'; |
| 6 | import { TOOLKIT_COUNT_LABEL } from '@/lib/toolkit-count'; |
| 7 | |
| 8 | const LOGO_CDN = 'https://logos.composio.dev/api'; |
| 9 | // 10-col × 3-row grid: 29 recognizable toolkit logos plus a brand-tinted |
| 10 | // "+1K" cell in the final slot, ordered as a rough mixed rhythm of comms, |
| 11 | // project management, storage/design, and marketing/sales so no single |
| 12 | // category clusters visually. |
| 13 | const TOOLKIT_LOGOS = [ |
| 14 | 'gmail', 'slack', 'discord', 'zoom', 'notion', |
| 15 | 'linear', 'jira', 'asana', 'trello', 'clickup', |
| 16 | 'github', 'gitlab', 'figma', 'canva', 'googledrive', |
| 17 | 'dropbox', 'airtable', 'confluence', 'salesforce', 'hubspot', |
| 18 | 'stripe', 'shopify', 'zendesk', 'sendgrid', 'mailchimp', |
| 19 | 'calendly', 'youtube', 'twitter', 'linkedin', |
| 20 | ]; |
| 21 | |
| 22 | const TRIGGER_FEED: { app: string; event: string }[] = [ |
| 23 | { app: 'gmail', event: 'message.new' }, |
| 24 | { app: 'stripe', event: 'charge.succeeded' }, |
| 25 | { app: 'linear', event: 'issue.opened' }, |
| 26 | ]; |
| 27 | |
| 28 | // The sandbox is a persistent *Python* environment the agent drives through |
| 29 | // the COMPOSIO_REMOTE_WORKBENCH meta tool, with `run_composio_tool` / |
| 30 | // `invoke_llm` pre-initialized — see content/docs/sandbox/remote.mdx, which is |
| 31 | // where this card links. Keep the mock on that real surface so a reader who |
| 32 | // copies it lands on something that exists. |
| 33 | const SANDBOX_CODE = `issues, err = run_composio_tool("LINEAR_LIST_ISSUES", {}) |
| 34 | summary = invoke_llm(f"Summarize: {issues}") |
| 35 | run_composio_tool("SLACK_SEND_MESSAGE", {"text": summary})`; |
| 36 | |
| 37 | export function HomeFeatures() { |
| 38 | return ( |
| 39 | <section className="not-prose mb-14"> |
| 40 | <SectionHeading title="Everything you need to ship production agents." /> |
| 41 | <div className="grid grid-cols-1 gap-4 sm:auto-rows-fr sm:grid-cols-2"> |
| 42 | <FeatureCard |
| 43 | title="Tools that resolve by intent." |
| 44 | description={`Smart tool search over ${TOOLKIT_COUNT_LABEL} apps, surfaced just in time with the right scope.`} |
| 45 | href="/docs/how-composio-works" |
| 46 | visual={<ToolkitsVisual />} |
| 47 | /> |
| 48 | <FeatureCard |
| 49 | title="Act for users without exposing their tokens." |
| 50 | description="Composio stores and refreshes each user's credentials. Your application and model receive tool results, not raw OAuth tokens." |
| 51 | href="/docs/authentication" |
| 52 | visual={<AuthDiagram />} |
| 53 | /> |
| 54 | <FeatureCard |
| 55 | title="Listen to anything, anywhere." |
| 56 | description="Subscribe to events from any toolkit and route them straight to your agent." |
| 57 | href="/docs/triggers" |
| 58 | visual={<TriggersVisual />} |
| 59 | /> |
| 60 | <FeatureCard |
| 61 | title="Run arbitrary code, safely." |
| 62 | description={`A sandbox pre-wired with your user's connected accounts and ${TOOLKIT_COUNT_LABEL} apps.`} |
| 63 | href="/docs/sandbox" |
| 64 | visual={<SandboxVisual />} |
| 65 | /> |
| 66 | </div> |
| 67 | </section> |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | function FeatureCard({ |
| 72 | title, |
| 73 | description, |
| 74 | href, |
| 75 | visual, |
| 76 | }: { |
| 77 | title: string; |
| 78 | description: string; |
| 79 | href: string; |
| 80 | visual: ReactNode; |
| 81 | }) { |
| 82 | return ( |
| 83 | <Link |
| 84 | href={href} |
| 85 | className="group relative flex flex-col overflow-hidden rounded-[14px] border border-fd-border bg-fd-card p-5 no-underline shadow-[0_1px_0_rgba(15,15,15,0.04)] transition-[box-shadow,transform,border-color] duration-200 hover:-translate-y-px hover:border-fd-foreground/15 hover:shadow-[0_10px_24px_-12px_rgba(15,15,15,0.18)]" |
| 86 | > |
| 87 | <ArrowUpRight |
| 88 | aria-hidden="true" |
| 89 | className="absolute right-4 top-4 size-3.5 text-fd-foreground/45 transition-transform group-hover:-translate-y-px group-hover:translate-x-px sm:right-5 sm:top-5" |
| 90 | /> |
| 91 | <div className="flex flex-col gap-1.5 pr-6"> |
| 92 | <h3 className="text-balance text-[18px] font-medium leading-snug tracking-[-0.01em] text-fd-foreground"> |
| 93 | {title} |
| 94 | </h3> |
| 95 | <p className="max-w-[42ch] text-pretty text-[14px] leading-[1.55] text-fd-foreground/70"> |
| 96 | {description} |
| 97 | </p> |
| 98 | </div> |
| 99 | <div |
| 100 | aria-hidden="true" |
| 101 | className="pointer-events-none mt-4 h-28 select-none" |
| 102 | style={MOCK_FADE_STYLE} |
| 103 | > |
| 104 | {visual} |
| 105 | </div> |
| 106 | </Link> |
| 107 | ); |
| 108 | } |
| 109 | |
| 110 | function ToolkitsVisual() { |
| 111 | // 10×3 tile grid stretched to fill the visual pane. Tiles paint their own |
| 112 | // bg-fd-card so they read as elevated on the recessed pane; the container's |
| 113 | // bg-fd-border bleeds through the 1px gaps to draw hairlines between them. |
| 114 | return ( |
| 115 | <div className="grid h-full w-full grid-cols-10 grid-rows-3 gap-px overflow-hidden rounded-[8px] border border-fd-border bg-fd-border"> |
| 116 | {TOOLKIT_LOGOS.map((slug) => ( |
| 117 | <div |
| 118 | key={slug} |
| 119 | className="flex items-center justify-center bg-fd-card" |
| 120 | > |
| 121 | <img |
| 122 | alt="" |
| 123 | aria-hidden="true" |
| 124 | className="size-4 object-contain" |
| 125 | draggable={false} |
| 126 | src={`${LOGO_CDN}/${slug}`} |
| 127 | /> |
| 128 | </div> |
| 129 | ))} |
| 130 | <div className="flex items-center justify-center bg-[var(--composio-brand)]/10 font-mono text-[11px] font-medium tracking-[-0.01em] text-[var(--composio-brand)]"> |
| 131 | +1K |
| 132 | </div> |
| 133 | </div> |
| 134 | ); |
| 135 | } |
| 136 | |
| 137 | function TriggersVisual() { |
| 138 | return ( |
| 139 | <ul className="flex h-full w-full flex-col overflow-hidden rounded-[8px] border border-fd-border bg-fd-card font-mono text-[11.5px]"> |
| 140 | {TRIGGER_FEED.map((row, i) => ( |
| 141 | <li |
| 142 | key={`${row.app}-${row.event}`} |
| 143 | className={ |
| 144 | 'flex flex-1 items-center gap-3 px-4' + |
| 145 | (i < TRIGGER_FEED.length - 1 ? ' border-b border-fd-border' : '') |
| 146 | } |
| 147 | > |
| 148 | <img |
| 149 | alt="" |
| 150 | aria-hidden="true" |
| 151 | className="size-4 object-contain" |
| 152 | draggable={false} |
| 153 | src={`${LOGO_CDN}/${row.app}`} |
| 154 | /> |
| 155 | <span className="truncate"> |
| 156 | <span className="text-fd-foreground/45">{row.app}.</span> |
| 157 | <span className="text-fd-foreground/80">{row.event}</span> |
| 158 | </span> |
| 159 | </li> |
| 160 | ))} |
| 161 | </ul> |
| 162 | ); |
| 163 | } |
| 164 | |
| 165 | function SandboxVisual() { |
| 166 | return ( |
| 167 | <div className="flex h-full w-full flex-col overflow-hidden rounded-[8px] border border-fd-border bg-fd-card"> |
| 168 | <div className="flex shrink-0 items-center gap-2 border-b border-fd-border px-3.5 py-2"> |
| 169 | <span className="size-1.5 rounded-full bg-fd-foreground/25" /> |
| 170 | <span className="font-mono text-[10.5px] tracking-[0.02em] text-fd-foreground/50"> |
| 171 | sandbox.py |
| 172 | </span> |
| 173 | </div> |
| 174 | <pre className="flex-1 overflow-hidden bg-fd-muted/30 px-3.5 py-2.5 font-mono text-[10.5px] leading-[1.7] text-fd-foreground/70"> |
| 175 | {SANDBOX_CODE} |
| 176 | </pre> |
| 177 | </div> |
| 178 | ); |
| 179 | } |
| 180 | |
| 181 | export function SectionHeading({ |
| 182 | eyebrow, |
| 183 | id, |
| 184 | title, |
| 185 | }: { |
| 186 | eyebrow?: string; |
| 187 | id?: string; |
| 188 | title: string; |
| 189 | }) { |
| 190 | return ( |
| 191 | <div className="mb-4 flex flex-col gap-1.5"> |
| 192 | {eyebrow && ( |
| 193 | <span className="font-mono text-[10.5px] uppercase tracking-[0.08em] text-fd-foreground/55"> |
| 194 | {eyebrow} |
| 195 | </span> |
| 196 | )} |
| 197 | <h2 |
| 198 | className="text-balance text-xl font-medium leading-[1.15] tracking-[-0.01em] text-fd-foreground sm:text-2xl" |
| 199 | id={id} |
| 200 | > |
| 201 | {title} |
| 202 | </h2> |
| 203 | </div> |
| 204 | ); |
| 205 | } |