import { Check, Share2 } from 'lucide-react';
import type { ReactNode } from 'react';
const LOGO_CDN = 'https://logos.composio.dev/api';
const CONNECTIONS: { slug: string; name: string; owner: string; shared?: boolean }[] = [
{ slug: 'slack', name: 'Slack', owner: 'workspace bot', shared: true },
{ slug: 'github', name: 'GitHub', owner: 'Alice' },
{ slug: 'gmail', name: 'Gmail', owner: 'Alice' },
];
/**
* SlackBotFlow — branded replacement for the plain `slack → server → agent`
* mermaid diagram on the Slack bot example page.
*
* Reads left-to-right as the request loop: a Slack message arrives as a trigger
* webhook, your server hands it to the Pi agent, and the agent works through a
* per-user session that pins one shared workspace Slack connection alongside the
* user's own connected apps. The reply flows back to Slack as the bot.
*
* Server component, no client JS. Adapts to light/dark via fd-* tokens.
*/
export function SlackBotFlow() {
return (
{/* header strip — mono, matches the other branded flow visuals */}
slackbot.runtime
listening in Slack
{/* ── Slack ──────────────────────────────────────────────── */}
{/* ── Your server / agent ────────────────────────────────── */}
{'{ }'}
Pi agent
verifies + loops
Verifies the webhook signature, then calls the session's tools.
{/* ── Session (the hub) ──────────────────────────────────── */}
scoped to user
slack:T09:alice
{/* The shared workspace connection + the user's own apps */}
{CONNECTIONS.map((conn, i) => (
-
{conn.name}
{conn.owner}
{conn.shared ? (
<>
shared
>
) : (
<>
linked
>
)}
))}
Posts to Slack as the workspace bot; acts in every other app as the
user.
{/* footer caption */}
message
trigger
agent
session (shared slack +
user apps)
reply
);
}
function Column({ children }: { children: ReactNode }) {
return {children}
;
}
function Lane({ label, accent = false }: { label: string; accent?: boolean }) {
return (
{label}
);
}
/**
* Directional connector shown between columns. Horizontal arrow on desktop,
* vertical on stacked mobile so the flow still reads top-to-bottom.
*/
function Connector({ accent = false }: { accent?: boolean }) {
const color = accent ? 'bg-[var(--composio-brand)]/40' : 'bg-fd-border';
const tip = accent ? 'border-l-[var(--composio-brand)]/50' : 'border-l-fd-border';
return (
);
}
function Arrow() {
return (
{'→'}
);
}