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 { Search, Layers, Terminal, Check } from 'lucide-react'; |
| 2 | import type { ReactNode } from 'react'; |
| 3 | |
| 4 | const STEPS: { |
| 5 | n: string; |
| 6 | icon: ReactNode; |
| 7 | tool: string; |
| 8 | note: string; |
| 9 | }[] = [ |
| 10 | { |
| 11 | n: '01', |
| 12 | icon: <Search className="size-3.5" aria-hidden="true" />, |
| 13 | tool: 'SEARCH_TOOLS', |
| 14 | note: 'Discovers the Gmail and Sheets tools', |
| 15 | }, |
| 16 | { |
| 17 | n: '02', |
| 18 | icon: <Layers className="size-3.5" aria-hidden="true" />, |
| 19 | tool: 'MULTI_EXECUTE', |
| 20 | note: 'Fetches the unread emails', |
| 21 | }, |
| 22 | { |
| 23 | n: '03', |
| 24 | icon: <Terminal className="size-3.5" aria-hidden="true" />, |
| 25 | tool: 'REMOTE_WORKBENCH', |
| 26 | note: 'Classifies, labels, and logs to the sheet in parallel', |
| 27 | }, |
| 28 | ]; |
| 29 | |
| 30 | /** |
| 31 | * WorkbenchFlow — branded replacement for the meta-tool pipeline mermaid |
| 32 | * diagram on the Workbench page. |
| 33 | * |
| 34 | * Reads as a story: one user request flows through the meta tools, escalating |
| 35 | * from discovery to bulk execution to the workbench when the task gets too |
| 36 | * complex for individual calls. The third step is brand-accented because it's |
| 37 | * the page's subject. Server component, no client JS, light/dark via fd-* tokens. |
| 38 | */ |
| 39 | export function WorkbenchFlow() { |
| 40 | return ( |
| 41 | <div className="not-prose my-6 overflow-hidden rounded-sm border border-fd-border bg-fd-background"> |
| 42 | {/* header strip */} |
| 43 | <div className="flex items-center justify-between border-b border-fd-border px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.06em] text-fd-foreground/45"> |
| 44 | <span>session.sandbox</span> |
| 45 | <span className="inline-flex items-center gap-1.5 text-fd-foreground/55"> |
| 46 | <span className="relative inline-flex"> |
| 47 | <span className="size-1.5 rounded-full bg-[var(--composio-brand)]" /> |
| 48 | <span className="absolute inset-0 animate-ping rounded-full bg-[var(--composio-brand)] opacity-60" /> |
| 49 | </span> |
| 50 | meta tools |
| 51 | </span> |
| 52 | </div> |
| 53 | |
| 54 | {/* the request */} |
| 55 | <div className="flex items-start gap-2 border-b border-fd-border px-3 py-2.5"> |
| 56 | <span className="mt-px flex size-5 shrink-0 items-center justify-center rounded-full bg-[var(--composio-brand)]/12 font-mono text-[10px] font-medium text-[var(--composio-brand)]"> |
| 57 | U |
| 58 | </span> |
| 59 | <p className="text-[12px] italic leading-snug text-fd-foreground/70"> |
| 60 | “Triage my emails, label the urgent ones, and log them to a |
| 61 | Google Sheet.” |
| 62 | </p> |
| 63 | </div> |
| 64 | |
| 65 | {/* the pipeline */} |
| 66 | <div className="grid items-stretch gap-px bg-fd-border md:grid-cols-3"> |
| 67 | {STEPS.map((step, i) => { |
| 68 | const last = i === STEPS.length - 1; |
| 69 | return ( |
| 70 | <div |
| 71 | key={step.tool} |
| 72 | className="relative flex flex-col gap-2 bg-fd-background p-3" |
| 73 | > |
| 74 | <div className="flex items-center gap-2"> |
| 75 | <span |
| 76 | className={ |
| 77 | 'flex size-6 shrink-0 items-center justify-center rounded-sm font-mono text-[10px] font-medium ' + |
| 78 | (last |
| 79 | ? 'bg-[var(--composio-brand)]/12 text-[var(--composio-brand)]' |
| 80 | : 'bg-fd-foreground/[0.06] text-fd-foreground/55') |
| 81 | } |
| 82 | > |
| 83 | {step.n} |
| 84 | </span> |
| 85 | <span |
| 86 | className={ |
| 87 | 'flex size-6 shrink-0 items-center justify-center rounded-sm ' + |
| 88 | (last |
| 89 | ? 'bg-[var(--composio-brand)]/10 text-[var(--composio-brand)]' |
| 90 | : 'bg-fd-foreground/[0.04] text-fd-foreground/45') |
| 91 | } |
| 92 | > |
| 93 | {step.icon} |
| 94 | </span> |
| 95 | </div> |
| 96 | <div className="min-w-0"> |
| 97 | <code className="block truncate font-mono text-[12px] font-medium text-fd-foreground"> |
| 98 | {step.tool} |
| 99 | </code> |
| 100 | <p className="mt-1 text-[11px] leading-snug text-fd-foreground/55"> |
| 101 | {step.note} |
| 102 | </p> |
| 103 | </div> |
| 104 | {!last && <Connector />} |
| 105 | </div> |
| 106 | ); |
| 107 | })} |
| 108 | </div> |
| 109 | |
| 110 | {/* footer caption */} |
| 111 | <div className="flex items-center justify-center gap-1.5 border-t border-fd-border px-3 py-2 font-mono text-[10px] text-fd-foreground/45"> |
| 112 | <Check aria-hidden="true" className="size-3 text-[var(--composio-brand)]" /> |
| 113 | emails triaged, labeled, and logged |
| 114 | </div> |
| 115 | </div> |
| 116 | ); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Directional connector between steps. Horizontal arrow on desktop, hidden on |
| 121 | * stacked mobile (vertical order already reads top-to-bottom). |
| 122 | */ |
| 123 | function Connector() { |
| 124 | return ( |
| 125 | <div |
| 126 | aria-hidden="true" |
| 127 | className="pointer-events-none absolute z-10 hidden md:block" |
| 128 | style={{ right: '-7px', top: '50%' }} |
| 129 | > |
| 130 | <div className="flex items-center"> |
| 131 | <span className="h-px w-3 bg-fd-border" /> |
| 132 | <span className="size-0 border-y-[3px] border-l-[5px] border-y-transparent border-l-fd-border" /> |
| 133 | </div> |
| 134 | </div> |
| 135 | ); |
| 136 | } |