Files
composiohq__composio/docs/mdx-components.tsx
T
Rahul Tarak d17a268d3f docs: sessions-first rewrite — new guides, examples & components (+ core 0.13.0 SDK changes) (#3637)
Integration branch for the next docs release: a **sessions-first
documentation rewrite** — new and rewritten guides, example pages,
interactive components, and docs tooling — plus the supporting SDK
changes that the new docs describe.

The bulk of this PR is docs (~24k lines across ~150 commits); the SDK
changes (~5k lines) back the new guides.

## Documentation (the bulk)

- **Sessions-first restructure** — reorganized navigation and section
structure (incl. the "Sandbox (prev workbench)" section), with
v3-reorganization redirects so old URLs keep resolving.
- **Rewritten core guides** — quickstart, configuring sessions, triggers
(creating + subscribing to events), proxy-execute, toolkits
enable/disable, and common FAQ, rewritten in the house voice.
- **New example pages** — local-sandbox PR reviewer, daily standup bot,
and slack bot, with runnable build-ups.
- **New interactive components & diagrams** — triggers flow animation,
manage-connections visual, connection-refresh visual, and the
terminal-kit components.
- **Docs tooling** — a docs-graph link-graph connectivity checker,
search reprioritization (deprioritize legacy pages), and SDK-reference
regeneration.

## Supporting SDK changes

**`@composio/core` → 0.13.0 (minor)**
- `composio.sessions.create()` as the first-class sessions API
(`composio.create()` kept as an alias).
- **MCP is opt-in:** default `create()` / `use()` return native-tool
sessions (`SessionWithoutMcp`); pass `{ mcp: true }` to surface
`session.mcp`. _Migration: read `session.mcp` only after creating with
`{ mcp: true }`._
- `session.sandbox` is the canonical resolved config;
`session.workbench` kept as a deprecated alias. `sandbox` is the
preferred session-config key (`workbench` still accepted).
- `connectedAccounts.updateAcl()` graduated from experimental (alias
kept).
- `triggers.parse()` (parse + optionally verify an incoming webhook) and
`triggers.setWebhookSubscription()`.

**`@composio/experimental` → minor** — local-workbench helpers moved
onto the `@composio/experimental/workbench` subpath (out of
`@composio/core/experimental`), keeping the ~14 KB embedded Python
helper out of core. Plus the experimental Pi provider.

**`@composio/slim` → minor.**

**Python → 0.17.0** — mirrors the TS surface: `composio.sessions` mount
(`tool_router` deprecated), `triggers.parse()` /
`set_webhook_subscription()`, the `sandbox` config key, and
`connected_accounts.update_acl()`.

## Review response (#3664)

Addressed the `@composio/core` review:
- **Security:** `triggers.parse()` no longer fails open — a
present-but-empty `verifySecret` (e.g. unset `COMPOSIO_WEBHOOK_SECRET`)
now throws instead of silently skipping verification; omitting it stays
an explicit opt-out (both SDKs).
- Removed snake_case leakage from `transformWebhookSubscription` (+ the
index signature that allowed it).
- **Removed** the TS-only `connectedAccounts.link()` toolkit
auto-resolve (shipped with cancellability / orphaned-auth-config bugs
and was effectively undocumented; to be reintroduced properly later).
- Unified Python error types on `ValidationError`; added `mcp=True`
Python tests; fixed runtime-portability + error-type test assertions.
- Polished deprecation messages; fixed the backwards `/experimental`
`@deprecated` note and the `SessionWithMcp` JSDoc.

## Testing

- **TS:** `@composio/core` + `@composio/experimental` typecheck pass;
vitest green for the touched suites.
- **Python:** `test_tool_router.py` + `test_triggers.py` pass (161
tests).

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Kshitij Jhunjhunwala <kj@composio.dev>
Co-authored-by: Malay Vasa <malayvasa@gmail.com>
Co-authored-by: Sarah Simionescu <sarah@composio.dev>
Co-authored-by: Kshitij Jhunjhunwala <113939507+KJ-11@users.noreply.github.com>
2026-06-25 18:27:43 -07:00

170 lines
5.3 KiB
TypeScript

import defaultMdxComponents from 'fumadocs-ui/mdx';
import type { MDXComponents } from 'mdx/types';
import type { ComponentProps } from 'react';
import { Accordion as BaseAccordion, Accordions } from 'fumadocs-ui/components/accordion';
import { Tabs, Tab, TabsList, TabsTrigger, TabsContent } from 'fumadocs-ui/components/tabs';
import { Callout } from '@/components/callout';
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Card, Cards } from 'fumadocs-ui/components/card';
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
import { Heading } from '@/components/heading';
import { YouTube } from '@/components/youtube';
import { ProviderCard, ProviderGrid } from '@/components/provider-card';
import { FrameworkSelector, QuickstartFlow, FrameworkOption } from '@/components/quickstart';
import { IntegrationTabs, IntegrationContent } from '@/components/quickstart/integration-tabs';
import { ToolTypeFlow, ToolTypeOption } from '@/components/tool-type-selector';
import { ConnectFlow, ConnectClientOption } from '@/components/connect-flow';
import { Figure } from '@/components/figure';
import { StepTitle } from '@/components/step-title';
import { Video } from '@/components/video';
import { CapabilityCard, CapabilityList } from '@/components/capability-card';
import { TemplateCard, TemplateGrid } from '@/components/template-card';
import { ToolkitsLanding } from '@/components/toolkits/toolkits-landing';
import { ManagedAuthList } from '@/components/toolkits/managed-auth-list';
import { Mermaid } from '@/components/mermaid';
import { AIToolsBanner } from '@/components/ai-tools-banner';
import { DocsHero } from '@/components/docs-hero';
import { HomeFeatures } from '@/components/home-features';
import { SessionFlow } from '@/components/session-flow';
import { TriggersFlow } from '@/components/triggers-flow';
import { SlackBotFlow } from '@/components/slack-bot-flow';
import { LocalWorkbenchFlow } from '@/components/local-workbench-flow';
import { LocalSandboxBoundary } from '@/components/local-sandbox-boundary';
import { FileBuildup } from '@/components/file-buildup';
import { RepoBrowser } from '@/components/repo-browser';
import { AppLogo } from '@/components/standup-example';
import { WorkbenchFlow } from '@/components/workbench-flow';
import { AuthConfigFlow } from '@/components/auth-config-flow';
import { WhiteLabelFlow } from '@/components/white-label-flow';
import { ImportConnectionFlow } from '@/components/import-connection-flow';
import { HomeSurfaces } from '@/components/home-surfaces';
import { HomeResources } from '@/components/home-resources';
import { Glossary, GlossaryTerm } from '@/components/glossary';
import { ApiBaseUrl } from '@/components/api-base-url';
import { ApiEndpointsTable } from '@/components/api-endpoints-table';
import { ClaudeMockUI } from '@/components/claude-mock-ui';
import { InChatAuthTerminal } from '@/components/in-chat-auth-terminal';
import { MediaSplit } from '@/components/media-split';
import { ManageConnectionsVisual } from '@/components/manage-connections-visual';
import { ConnectionRefreshVisual } from '@/components/connection-refresh-visual';
import {
ShieldCheck,
Route as RouteIcon,
Key,
Search,
Wrench,
Database,
Zap,
Rocket,
Code,
Blocks,
Plug,
Play,
Terminal,
Palette,
BookOpen,
Monitor,
MessageCircle,
LayoutDashboard,
} from 'lucide-react';
function slugify(text: string): string {
return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
}
export function Accordion({ id, title, ...props }: ComponentProps<typeof BaseAccordion>) {
return <BaseAccordion id={id ?? (typeof title === 'string' ? slugify(title) : undefined)} title={title} {...props} />;
}
export { Accordions };
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
h2: (props) => <Heading as="h2" {...props} />,
h3: (props) => <Heading as="h3" {...props} />,
h4: (props) => <Heading as="h4" {...props} />,
img: (props) => <ImageZoom {...(props as any)} />,
YouTube,
Tabs,
Tab,
TabsList,
TabsTrigger,
TabsContent,
Accordion,
Accordions,
Callout,
Step,
Steps,
Card,
Cards,
ProviderCard,
ProviderGrid,
FrameworkSelector,
QuickstartFlow,
FrameworkOption,
IntegrationTabs,
IntegrationContent,
ToolTypeFlow,
ToolTypeOption,
ConnectFlow,
ConnectClientOption,
Figure,
Video,
CapabilityCard,
CapabilityList,
TemplateCard,
TemplateGrid,
ToolkitsLanding,
ManagedAuthList,
Mermaid,
AIToolsBanner,
DocsHero,
HomeFeatures,
SessionFlow,
TriggersFlow,
SlackBotFlow,
LocalWorkbenchFlow,
LocalSandboxBoundary,
FileBuildup,
RepoBrowser,
AppLogo,
WorkbenchFlow,
AuthConfigFlow,
WhiteLabelFlow,
ImportConnectionFlow,
HomeSurfaces,
HomeResources,
StepTitle,
Glossary,
GlossaryTerm,
ApiBaseUrl,
ApiEndpointsTable,
ClaudeMockUI,
InChatAuthTerminal,
MediaSplit,
ManageConnectionsVisual,
ConnectionRefreshVisual,
// Lucide icons
ShieldCheck,
RouteIcon,
Key,
Search,
Wrench,
Database,
Zap,
Rocket,
Code,
Blocks,
Plug,
Play,
Terminal,
Palette,
BookOpen,
Monitor,
MessageCircle,
LayoutDashboard,
...components,
};
}