Refactor Composio toolkit management for improved structure and maintainability

- Consolidated toolkit definitions and display names into a single source of truth in shared/composio.ts.
- Updated core composio/curated-toolkits.ts to re-export types and constants for backward compatibility.
- Enhanced the organization of toolkit data, ensuring clarity and ease of access for future development.
This commit is contained in:
tusharmagar 2026-04-02 15:58:37 +05:30
parent 0edc89b4a0
commit e0e7945bd9
2 changed files with 71 additions and 102 deletions

View file

@ -1,74 +1,11 @@
/**
* Curated list of Composio toolkits available to Rowboat users.
* Only these toolkits are shown in the UI and discoverable via chat.
* Exact slugs match Composio API naming convention.
*
* Display names come from @x/shared/composio (single source of truth).
* Re-exports from @x/shared/composio kept for backward compatibility
* so existing core imports don't need to change paths.
*/
import { COMPOSIO_DISPLAY_NAMES } from "@x/shared/dist/composio.js";
export { COMPOSIO_DISPLAY_NAMES } from "@x/shared/dist/composio.js";
export type ToolkitCategory = 'communication' | 'productivity' | 'development' | 'crm' | 'social' | 'storage' | 'support';
export interface CuratedToolkit {
slug: string;
displayName: string;
category: ToolkitCategory;
}
const toolkit = (slug: string, category: ToolkitCategory): CuratedToolkit => ({
slug,
displayName: COMPOSIO_DISPLAY_NAMES[slug] ?? slug,
category,
});
export const CURATED_TOOLKITS: CuratedToolkit[] = [
// Communication
toolkit('gmail', 'communication'),
toolkit('slack', 'communication'),
toolkit('microsoft_outlook', 'communication'),
toolkit('microsoft_teams', 'communication'),
// Productivity
toolkit('googlecalendar', 'productivity'),
toolkit('googledocs', 'productivity'),
toolkit('googlesheets', 'productivity'),
toolkit('notion', 'productivity'),
toolkit('airtable', 'productivity'),
toolkit('calendly', 'productivity'),
toolkit('cal', 'productivity'),
// Storage
toolkit('googledrive', 'storage'),
toolkit('dropbox', 'storage'),
toolkit('onedrive', 'storage'),
// Development
toolkit('github', 'development'),
toolkit('linear', 'development'),
toolkit('jira', 'development'),
// Project Management
toolkit('asana', 'productivity'),
toolkit('trello', 'productivity'),
// CRM & Sales
toolkit('hubspot', 'crm'),
toolkit('salesforce', 'crm'),
// Social
toolkit('linkedin', 'social'),
toolkit('twitter', 'social'),
toolkit('reddit', 'social'),
// Support
toolkit('intercom', 'support'),
toolkit('zendesk', 'support'),
];
/**
* Set of curated toolkit slugs for fast lookup.
*/
export const CURATED_TOOLKIT_SLUGS = new Set(CURATED_TOOLKITS.map(t => t.slug));
export {
type ToolkitCategory,
type CuratedToolkit,
CURATED_TOOLKITS,
CURATED_TOOLKIT_SLUGS,
COMPOSIO_DISPLAY_NAMES,
} from "@x/shared/dist/composio.js";

View file

@ -1,32 +1,64 @@
/**
* Composio display-name map: toolkit slug human-readable name.
* Single source of truth used by both core and renderer.
* Curated Composio toolkits available to Rowboat users.
* Single source of truth for slugs, display names, and categories.
*/
export const COMPOSIO_DISPLAY_NAMES: Record<string, string> = {
gmail: 'Gmail',
slack: 'Slack',
microsoft_outlook: 'Microsoft Outlook',
microsoft_teams: 'Microsoft Teams',
googlecalendar: 'Google Calendar',
googledocs: 'Google Docs',
googlesheets: 'Google Sheets',
notion: 'Notion',
airtable: 'Airtable',
calendly: 'Calendly',
cal: 'Cal.com',
googledrive: 'Google Drive',
dropbox: 'Dropbox',
onedrive: 'OneDrive',
github: 'GitHub',
linear: 'Linear',
jira: 'Jira',
asana: 'Asana',
trello: 'Trello',
hubspot: 'HubSpot',
salesforce: 'Salesforce',
linkedin: 'LinkedIn',
twitter: 'X',
reddit: 'Reddit',
intercom: 'Intercom',
zendesk: 'Zendesk',
};
export type ToolkitCategory = 'communication' | 'productivity' | 'development' | 'crm' | 'social' | 'storage' | 'support';
export interface CuratedToolkit {
slug: string;
displayName: string;
category: ToolkitCategory;
}
export const CURATED_TOOLKITS: CuratedToolkit[] = [
// Communication
{ slug: 'gmail', displayName: 'Gmail', category: 'communication' },
{ slug: 'slack', displayName: 'Slack', category: 'communication' },
{ slug: 'microsoft_outlook', displayName: 'Microsoft Outlook', category: 'communication' },
{ slug: 'microsoft_teams', displayName: 'Microsoft Teams', category: 'communication' },
// Productivity
{ slug: 'googlecalendar', displayName: 'Google Calendar', category: 'productivity' },
{ slug: 'googledocs', displayName: 'Google Docs', category: 'productivity' },
{ slug: 'googlesheets', displayName: 'Google Sheets', category: 'productivity' },
{ slug: 'notion', displayName: 'Notion', category: 'productivity' },
{ slug: 'airtable', displayName: 'Airtable', category: 'productivity' },
{ slug: 'calendly', displayName: 'Calendly', category: 'productivity' },
{ slug: 'cal', displayName: 'Cal.com', category: 'productivity' },
// Storage
{ slug: 'googledrive', displayName: 'Google Drive', category: 'storage' },
{ slug: 'dropbox', displayName: 'Dropbox', category: 'storage' },
{ slug: 'onedrive', displayName: 'OneDrive', category: 'storage' },
// Development
{ slug: 'github', displayName: 'GitHub', category: 'development' },
{ slug: 'linear', displayName: 'Linear', category: 'development' },
{ slug: 'jira', displayName: 'Jira', category: 'development' },
// Project Management
{ slug: 'asana', displayName: 'Asana', category: 'productivity' },
{ slug: 'trello', displayName: 'Trello', category: 'productivity' },
// CRM & Sales
{ slug: 'hubspot', displayName: 'HubSpot', category: 'crm' },
{ slug: 'salesforce', displayName: 'Salesforce', category: 'crm' },
// Social
{ slug: 'linkedin', displayName: 'LinkedIn', category: 'social' },
{ slug: 'twitter', displayName: 'X', category: 'social' },
{ slug: 'reddit', displayName: 'Reddit', category: 'social' },
// Support
{ slug: 'intercom', displayName: 'Intercom', category: 'support' },
{ slug: 'zendesk', displayName: 'Zendesk', category: 'support' },
];
/** Slug → display-name lookup. */
export const COMPOSIO_DISPLAY_NAMES: Record<string, string> = Object.fromEntries(
CURATED_TOOLKITS.map(t => [t.slug, t.displayName])
);
/** Set of curated slugs for fast membership checks. */
export const CURATED_TOOLKIT_SLUGS = new Set(CURATED_TOOLKITS.map(t => t.slug));