diff --git a/front/admin/cli.ts b/front/admin/cli.ts index b06e9d62d733..b60f9b066aef 100644 --- a/front/admin/cli.ts +++ b/front/admin/cli.ts @@ -81,6 +81,9 @@ const workspace = async (command: string, args: parseArgs.ParsedArgs) => { console.log( ` managed Github: ${plan.limits.connections.isGithubAllowed}` ); + console.log( + ` managed Intercom: ${plan.limits.connections.isIntercomAllowed}` + ); console.log( ` managed Google Drive: ${plan.limits.connections.isGoogleDriveAllowed}` ); diff --git a/front/components/ConnectorPermissionsModal.tsx b/front/components/ConnectorPermissionsModal.tsx index 4fd8f6fd298b..a0dd4a696bfb 100644 --- a/front/components/ConnectorPermissionsModal.tsx +++ b/front/components/ConnectorPermissionsModal.tsx @@ -20,6 +20,7 @@ const CONNECTOR_TYPE_TO_RESOURCE_NAME: Record = { google_drive: "Google Drive folders", slack: "Slack channels", github: "GitHub repositories", + intercom: "Intercom Help Center articles", }; const CONNECTOR_TYPE_TO_RESOURCE_LIST_TITLE_TEXT: Record< @@ -30,6 +31,7 @@ const CONNECTOR_TYPE_TO_RESOURCE_LIST_TITLE_TEXT: Record< notion: null, google_drive: null, github: null, + intercom: null, }; const CONNECTOR_TYPE_TO_DEFAULT_PERMISSION_TITLE_TEXT: Record< @@ -40,6 +42,7 @@ const CONNECTOR_TYPE_TO_DEFAULT_PERMISSION_TITLE_TEXT: Record< notion: null, google_drive: null, github: null, + intercom: null, }; const PERMISSIONS_EDITABLE_CONNECTOR_TYPES: Set = new Set([ diff --git a/front/components/ConnectorPermissionsTree.tsx b/front/components/ConnectorPermissionsTree.tsx index ba702d9fee82..06533f342222 100644 --- a/front/components/ConnectorPermissionsTree.tsx +++ b/front/components/ConnectorPermissionsTree.tsx @@ -31,6 +31,7 @@ const CONNECTOR_TYPE_TO_PERMISSIONS: Record< }, notion: undefined, github: undefined, + intercom: undefined, }; function PermissionTreeChildren({ diff --git a/front/components/assistant_builder/AssistantBuilder.tsx b/front/components/assistant_builder/AssistantBuilder.tsx index 43149992584e..982d2b5cc556 100644 --- a/front/components/assistant_builder/AssistantBuilder.tsx +++ b/front/components/assistant_builder/AssistantBuilder.tsx @@ -103,6 +103,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record< google_drive: { singular: "folder", plural: "folders" }, slack: { singular: "channel", plural: "channels" }, github: { singular: "repository", plural: "repositories" }, + intercom: { singular: "article", plural: "articles" }, }; export type AssistantBuilderDataSourceConfiguration = { diff --git a/front/components/assistant_builder/shared.ts b/front/components/assistant_builder/shared.ts index 666be4e2a03b..691df8174976 100644 --- a/front/components/assistant_builder/shared.ts +++ b/front/components/assistant_builder/shared.ts @@ -26,6 +26,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record< google_drive: { singular: "folder", plural: "folders" }, slack: { singular: "channel", plural: "channels" }, github: { singular: "repository", plural: "repositories" }, + intercom: { singular: "article", plural: "articles" }, }; export const DROID_AVATARS_BASE_PATH = "/static/droidavatar/"; diff --git a/front/components/poke/plans/form.tsx b/front/components/poke/plans/form.tsx index 65384d069d08..c291cc289ac6 100644 --- a/front/components/poke/plans/form.tsx +++ b/front/components/poke/plans/form.tsx @@ -4,6 +4,7 @@ import { DropdownMenu, GithubLogo, Input, + IntercomLogo, NotionLogo, SlackLogo, } from "@dust-tt/sparkle"; @@ -21,6 +22,7 @@ export type EditingPlanType = { isNotionAllowed: boolean; isGoogleDriveAllowed: boolean; isGithubAllowed: boolean; + isIntercomAllowed: boolean; maxMessages: string | number; dataSourcesCount: string | number; dataSourcesDocumentsCount: string | number; @@ -40,6 +42,7 @@ export const fromPlanType = (plan: PlanType): EditingPlanType => { isNotionAllowed: plan.limits.connections.isNotionAllowed, isGoogleDriveAllowed: plan.limits.connections.isGoogleDriveAllowed, isGithubAllowed: plan.limits.connections.isGithubAllowed, + isIntercomAllowed: plan.limits.connections.isIntercomAllowed, maxMessages: plan.limits.assistant.maxMessages, dataSourcesCount: plan.limits.dataSources.count, dataSourcesDocumentsCount: plan.limits.dataSources.documents.count, @@ -64,6 +67,7 @@ export const toPlanType = (editingPlan: EditingPlanType): PlanType => { isNotionAllowed: editingPlan.isNotionAllowed, isGoogleDriveAllowed: editingPlan.isGoogleDriveAllowed, isGithubAllowed: editingPlan.isGithubAllowed, + isIntercomAllowed: editingPlan.isIntercomAllowed, }, dataSources: { count: parseInt(editingPlan.dataSourcesCount.toString(), 10), @@ -92,6 +96,7 @@ const getEmptyPlan = (): EditingPlanType => ({ isNotionAllowed: false, isGoogleDriveAllowed: false, isGithubAllowed: false, + isIntercomAllowed: false, maxMessages: "", dataSourcesCount: "", dataSourcesDocumentsCount: "", @@ -199,6 +204,12 @@ export const PLAN_FIELDS = { title: "Github", IconComponent: () => , }, + isIntercomAllowed: { + type: "boolean", + width: "tiny", + title: "Intercom", + IconComponent: () => , + }, maxMessages: { type: "number", width: "medium", diff --git a/front/lib/auth.ts b/front/lib/auth.ts index afbb41afec3d..a5c32ee325cb 100644 --- a/front/lib/auth.ts +++ b/front/lib/auth.ts @@ -540,6 +540,7 @@ export async function subscriptionForWorkspace( isNotionAllowed: plan.isManagedNotionAllowed, isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed, isGithubAllowed: plan.isManagedGithubAllowed, + isIntercomAllowed: plan.isManagedIntercomAllowed, }, dataSources: { count: plan.maxDataSourcesCount, diff --git a/front/lib/connector_providers.ts b/front/lib/connector_providers.ts index 4a2897a4bd78..d6ccf4b52361 100644 --- a/front/lib/connector_providers.ts +++ b/front/lib/connector_providers.ts @@ -1,6 +1,13 @@ -import { DriveLogo, GithubLogo, NotionLogo, SlackLogo } from "@dust-tt/sparkle"; +import { + DriveLogo, + GithubLogo, + IntercomLogo, + NotionLogo, + SlackLogo, +} from "@dust-tt/sparkle"; import { ConnectorProvider } from "@app/lib/connectors_api"; +import { isDevelopment } from "@app/lib/development"; export const CONNECTOR_CONFIGURATIONS: Record< ConnectorProvider, @@ -54,4 +61,14 @@ export const CONNECTOR_CONFIGURATIONS: Record< logoComponent: GithubLogo, isNested: false, }, + intercom: { + name: "Intercom", + connectorProvider: "intercom", + isBuilt: isDevelopment(), // TODO @daph Activate Intercom connector + logoPath: "/static/intercom_32x32.png", + description: + "Authorize granular access to your company's Intercom Help Centers. Dust does not access your conversations.", + logoComponent: IntercomLogo, + isNested: false, + }, }; diff --git a/front/lib/connectors_api.ts b/front/lib/connectors_api.ts index 57dc67011e50..c4bbd96dc453 100644 --- a/front/lib/connectors_api.ts +++ b/front/lib/connectors_api.ts @@ -22,12 +22,14 @@ const CONNECTOR_PROVIDERS = [ "notion", "github", "google_drive", + "intercom", ] as const; export type ConnectorProvider = (typeof CONNECTOR_PROVIDERS)[number]; export const CONNECTOR_PROVIDERS_USING_NANGO = [ "slack", "notion", "google_drive", + "intercom", ] as const; type ConnectorProviderUsingNango = (typeof CONNECTOR_PROVIDERS_USING_NANGO)[number]; diff --git a/front/lib/data_sources.ts b/front/lib/data_sources.ts index 1f2a041d6591..89124d577856 100644 --- a/front/lib/data_sources.ts +++ b/front/lib/data_sources.ts @@ -21,7 +21,8 @@ export function getProviderLogoPathForDataSource( return `/static/github_black_32x32.png`; case "google_drive": return `/static/google_drive_32x32.png`; - + case "intercom": + return `/static/intercom_32x32.png`; default: // eslint-disable-next-line @typescript-eslint/no-unused-vars ((_provider: never) => { diff --git a/front/lib/models/plan.ts b/front/lib/models/plan.ts index b2d6178adeee..1cc57631d25c 100644 --- a/front/lib/models/plan.ts +++ b/front/lib/models/plan.ts @@ -41,6 +41,7 @@ export class Plan extends Model< declare isManagedNotionAllowed: boolean; declare isManagedGoogleDriveAllowed: boolean; declare isManagedGithubAllowed: boolean; + declare isManagedIntercomAllowed: boolean; declare maxDataSourcesCount: number; declare maxDataSourcesDocumentsCount: number; declare maxDataSourcesDocumentsSizeMb: number; @@ -110,6 +111,10 @@ Plan.init( type: DataTypes.BOOLEAN, defaultValue: false, }, + isManagedIntercomAllowed: { + type: DataTypes.BOOLEAN, + defaultValue: false, + }, maxDataSourcesCount: { type: DataTypes.INTEGER, allowNull: false, diff --git a/front/lib/plans/enterprise_plans.ts b/front/lib/plans/enterprise_plans.ts index 8831809d3c89..cd03ffbdfc63 100644 --- a/front/lib/plans/enterprise_plans.ts +++ b/front/lib/plans/enterprise_plans.ts @@ -30,6 +30,7 @@ export const ENT_PLAN_FAKE_DATA: PlanAttributes = { isManagedNotionAllowed: true, isManagedGoogleDriveAllowed: true, isManagedGithubAllowed: true, + isManagedIntercomAllowed: true, maxDataSourcesCount: -1, maxDataSourcesDocumentsCount: -1, maxDataSourcesDocumentsSizeMb: 2, diff --git a/front/lib/plans/free_plans.ts b/front/lib/plans/free_plans.ts index 7faa4817ce8d..2ecafacc13e5 100644 --- a/front/lib/plans/free_plans.ts +++ b/front/lib/plans/free_plans.ts @@ -36,6 +36,7 @@ export const FREE_TEST_PLAN_DATA: PlanAttributes = { isManagedNotionAllowed: false, isManagedGoogleDriveAllowed: false, isManagedGithubAllowed: false, + isManagedIntercomAllowed: false, maxDataSourcesCount: 5, maxDataSourcesDocumentsCount: 10, maxDataSourcesDocumentsSizeMb: 2, @@ -58,6 +59,7 @@ const FREE_PLANS_DATA: PlanAttributes[] = [ isManagedNotionAllowed: true, isManagedGoogleDriveAllowed: true, isManagedGithubAllowed: true, + isManagedIntercomAllowed: true, maxDataSourcesCount: -1, maxDataSourcesDocumentsCount: -1, maxDataSourcesDocumentsSizeMb: 2, diff --git a/front/lib/plans/pro_plans.ts b/front/lib/plans/pro_plans.ts index fa0275fb1082..59ef0640f9fc 100644 --- a/front/lib/plans/pro_plans.ts +++ b/front/lib/plans/pro_plans.ts @@ -40,6 +40,7 @@ if (isDevelopment()) { isManagedNotionAllowed: true, isManagedGoogleDriveAllowed: true, isManagedGithubAllowed: true, + isManagedIntercomAllowed: true, maxDataSourcesCount: -1, maxDataSourcesDocumentsCount: -1, maxDataSourcesDocumentsSizeMb: 2, diff --git a/front/lib/plans/subscription.ts b/front/lib/plans/subscription.ts index ffa286eb1856..6a9e7c390d63 100644 --- a/front/lib/plans/subscription.ts +++ b/front/lib/plans/subscription.ts @@ -82,6 +82,7 @@ export const internalSubscribeWorkspaceToFreeTestPlan = async ({ isNotionAllowed: freeTestPlan.isManagedNotionAllowed, isGoogleDriveAllowed: freeTestPlan.isManagedGoogleDriveAllowed, isGithubAllowed: freeTestPlan.isManagedGithubAllowed, + isIntercomAllowed: freeTestPlan.isManagedIntercomAllowed, }, dataSources: { count: freeTestPlan.maxDataSourcesCount, @@ -178,6 +179,7 @@ export const internalSubscribeWorkspaceToFreeUpgradedPlan = async ({ isNotionAllowed: plan.isManagedNotionAllowed, isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed, isGithubAllowed: plan.isManagedGithubAllowed, + isIntercomAllowed: plan.isManagedIntercomAllowed, }, dataSources: { count: plan.maxDataSourcesCount, @@ -332,6 +334,7 @@ export const getCheckoutUrlForUpgrade = async ( isNotionAllowed: plan.isManagedNotionAllowed, isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed, isGithubAllowed: plan.isManagedGithubAllowed, + isIntercomAllowed: plan.isManagedIntercomAllowed, }, dataSources: { count: plan.maxDataSourcesCount, diff --git a/front/pages/api/poke/plans.ts b/front/pages/api/poke/plans.ts index 4553efe05f80..ce55cf670b12 100644 --- a/front/pages/api/poke/plans.ts +++ b/front/pages/api/poke/plans.ts @@ -24,6 +24,7 @@ export const PlanTypeSchema = t.type({ isNotionAllowed: t.boolean, isGoogleDriveAllowed: t.boolean, isGithubAllowed: t.boolean, + isIntercomAllowed: t.boolean, }), dataSources: t.type({ count: t.number, @@ -91,6 +92,7 @@ async function handler( isNotionAllowed: plan.isManagedNotionAllowed, isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed, isGithubAllowed: plan.isManagedGithubAllowed, + isIntercomAllowed: plan.isManagedIntercomAllowed, }, dataSources: { count: plan.maxDataSourcesCount, @@ -178,6 +180,7 @@ async function handler( isManagedGoogleDriveAllowed: body.limits.connections.isGoogleDriveAllowed, isManagedGithubAllowed: body.limits.connections.isGithubAllowed, + isManagedIntercomAllowed: body.limits.connections.isIntercomAllowed, maxDataSourcesCount: body.limits.dataSources.count, maxDataSourcesDocumentsCount: body.limits.dataSources.documents.count, maxDataSourcesDocumentsSizeMb: body.limits.dataSources.documents.sizeMb, diff --git a/front/pages/api/w/[wId]/data_sources/managed.ts b/front/pages/api/w/[wId]/data_sources/managed.ts index 8b8d2695478a..0837fcee125f 100644 --- a/front/pages/api/w/[wId]/data_sources/managed.ts +++ b/front/pages/api/w/[wId]/data_sources/managed.ts @@ -82,7 +82,7 @@ async function handler( if ( !req.body.provider || - !["slack", "notion", "github", "google_drive"].includes( + !["slack", "notion", "github", "google_drive", "intercom"].includes( req.body.provider ) ) { @@ -133,6 +133,9 @@ async function handler( isDataSourceAllowedInPlan = plan.limits.connections.isGoogleDriveAllowed; break; + case "intercom": + isDataSourceAllowedInPlan = plan.limits.connections.isIntercomAllowed; + break; default: isDataSourceAllowedInPlan = false; // default to false if provider is not recognized } diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx index e5d834b327ed..24e94fd0524e 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx @@ -49,6 +49,7 @@ const { NANGO_SLACK_CONNECTOR_ID = "", NANGO_NOTION_CONNECTOR_ID = "", NANGO_GOOGLE_DRIVE_CONNECTOR_ID = "", + NANGO_INTERCOM_CONNECTOR_ID = "", NANGO_PUBLIC_KEY = "", GITHUB_APP_URL = "", } = process.env; @@ -67,6 +68,7 @@ export const getServerSideProps: GetServerSideProps<{ slackConnectorId: string; notionConnectorId: string; googleDriveConnectorId: string; + intercomConnectorId: string; }; githubAppUrl: string; gaTrackingId: string; @@ -125,6 +127,7 @@ export const getServerSideProps: GetServerSideProps<{ slackConnectorId: NANGO_SLACK_CONNECTOR_ID, notionConnectorId: NANGO_NOTION_CONNECTOR_ID, googleDriveConnectorId: NANGO_GOOGLE_DRIVE_CONNECTOR_ID, + intercomConnectorId: NANGO_INTERCOM_CONNECTOR_ID, }, githubAppUrl: GITHUB_APP_URL, gaTrackingId: GA_TRACKING_ID, @@ -434,6 +437,7 @@ const CONNECTOR_TYPE_TO_HELPER_TEXT: Record = { google_drive: "Google Drive folders and files Dust has access to.", slack: "Slack channels synchronized with Dust:", github: "GitHub repositories Dust has access to.", + intercom: "Intercom Help Centers synchronized with Dust:", }; const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record = { @@ -444,6 +448,8 @@ const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record = { "You cannot select another Github Organization.\nPlease contact us at team@dust.tt if you initially selected a wrong Organization.", google_drive: "You cannot select another Google Drive Domain.\nPlease contact us at team@dust.tt if you initially selected a wrong shared Drive.", + intercom: + "You cannot select another Intercom Workspace.\nPlease contact us at team@dust.tt if you initially selected a wrong Workspace.", }; function ManagedDataSourceView({ @@ -466,6 +472,7 @@ function ManagedDataSourceView({ slackConnectorId: string; notionConnectorId: string; googleDriveConnectorId: string; + intercomConnectorId: string; }; githubAppUrl: string; plan: PlanType; @@ -518,6 +525,7 @@ function ManagedDataSourceView({ slack: nangoConfig.slackConnectorId, notion: nangoConfig.notionConnectorId, google_drive: nangoConfig.googleDriveConnectorId, + intercom: nangoConfig.intercomConnectorId, }[provider]; const nango = new Nango({ publicKey: nangoConfig.publicKey }); @@ -670,6 +678,7 @@ function ManagedDataSourceView({ ); case "notion": case "github": + case "intercom": return (