@devries-cameron20 / composio Mirror · read-only
Fork 0

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

next
ts 22 lines 1003 Bytes
Raw
1 const REPO_BROWSER_PATTERN = /<RepoBrowser\b([^>]*)\/>/g;
2
3 const REPO_BROWSER_NOTICES: Record<string, string> = {
4 'slack-bot':
5 'The Slack bot browser is a documentation snapshot; a public repository is not available.',
6 'local-workbench':
7 'The local PR reviewer browser is a documentation snapshot; a public repository is not available.',
8 standup:
9 'The standup bot browser is a documentation snapshot; a public repository is not available.',
10 imessage:
11 'The iMessage implementation is maintained in [platform-imessage](https://github.com/ComposioHQ/platform-imessage).',
12 };
13
14 export function replaceRepoBrowserMarkdown(markdown: string): string {
15 return markdown.replace(REPO_BROWSER_PATTERN, (_, props: string) => {
16 const source = props.match(/\bsource="([^"]+)"/)?.[1] ?? 'slack-bot';
17 const notice =
18 REPO_BROWSER_NOTICES[source] ??
19 'This code browser is a documentation snapshot; a public repository is not available.';
20 return `\n> ${notice}\n`;
21 });
22 }