From 84bfb60cc82805d4a31547a93509d8ccfbf043a7 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Tue, 16 Jan 2024 18:22:10 +0100 Subject: [PATCH 1/6] Add eslint rule + fix front --- front/.eslintrc.js | 1 + front/components/Button.tsx | 3 +- .../components/ConnectorPermissionsModal.tsx | 4 +- front/components/ConnectorPermissionsTree.tsx | 4 +- .../DataSourceResourceSelectorTree.tsx | 4 +- front/components/EmptyCallToAction.tsx | 3 +- .../ManagedDataSourceDocumentModal.tsx | 2 +- front/components/PlansTables.tsx | 2 +- front/components/WorkspacePicker.tsx | 2 +- front/components/app/DatasetPicker.tsx | 4 +- front/components/app/DatasetView.tsx | 2 +- front/components/app/Deploy.tsx | 6 +- front/components/app/ModelPicker.tsx | 2 +- front/components/app/NewBlock.tsx | 4 +- front/components/app/SpecRunView.tsx | 6 +- front/components/app/blocks/Block.tsx | 6 +- front/components/app/blocks/Browser.tsx | 6 +- front/components/app/blocks/Chat.tsx | 10 ++-- front/components/app/blocks/Code.tsx | 6 +- front/components/app/blocks/Curl.tsx | 6 +- front/components/app/blocks/Data.tsx | 6 +- front/components/app/blocks/DataSource.tsx | 6 +- front/components/app/blocks/Database.tsx | 6 +- .../components/app/blocks/DatabaseSchema.tsx | 6 +- front/components/app/blocks/Input.tsx | 6 +- front/components/app/blocks/LLM.tsx | 6 +- front/components/app/blocks/MapReduce.tsx | 6 +- front/components/app/blocks/Output.tsx | 6 +- front/components/app/blocks/Search.tsx | 10 ++-- front/components/app/blocks/WhileEnd.tsx | 10 ++-- .../components/assistant/AssistantActions.tsx | 6 +- .../components/assistant/AssistantDetails.tsx | 14 +++-- .../components/assistant/AssistantPicker.tsx | 2 +- .../GalleryAssistantPreviewContainer.tsx | 7 ++- .../assistant/RenderMessageMarkdown.tsx | 9 +-- .../assistant/TryAssistantModal.tsx | 4 +- .../assistant/conversation/AgentAction.tsx | 2 +- .../assistant/conversation/AgentMessage.tsx | 7 ++- .../conversation/AgentSuggestion.tsx | 9 +-- .../conversation/ContentFragment.tsx | 3 +- .../assistant/conversation/Conversation.tsx | 17 +++--- .../conversation/ConversationMessage.tsx | 11 ++-- .../conversation/ConversationParticipants.tsx | 2 +- .../conversation/ConversationTitle.tsx | 7 ++- .../conversation/DatabaseQueryAction.tsx | 2 +- .../conversation/DustAppRunAction.tsx | 2 +- .../conversation/RetrievalAction.tsx | 2 +- .../assistant/conversation/SidebarMenu.tsx | 4 +- .../assistant/conversation/UserMessage.tsx | 4 +- .../conversation/input_bar/InputBar.tsx | 9 +-- .../input_bar/InputBarContainer.tsx | 5 +- .../input_bar/editor/MentionList.tsx | 2 +- .../editor/useAssistantSuggestions.ts | 2 +- .../input_bar/editor/useCustomEditor.tsx | 6 +- .../input_bar/editor/useHandleMentions.tsx | 2 +- .../components/assistant/conversation/lib.ts | 15 ++--- .../assistant_builder/AssistantBuilder.tsx | 25 ++++---- .../AssistantBuilderAvatarPicker.tsx | 8 ++- .../AssistantBuilderDataSourceModal.tsx | 12 ++-- .../AssistantBuilderDustAppModal.tsx | 4 +- .../DataSourceSelectionSection.tsx | 2 +- .../DustAppSelectionSection.tsx | 2 +- .../assistant_builder/TeamSharingSection.tsx | 2 +- front/components/assistant_builder/shared.ts | 4 +- .../data_source/DataSourcePicker.tsx | 2 +- front/components/home/carousel.tsx | 3 +- front/components/home/contentComponents.tsx | 3 +- front/components/home/particles.tsx | 3 +- front/components/home/scrollingHeader.tsx | 3 +- front/components/poke/plans/form.tsx | 7 ++- front/components/providers/AI21Setup.tsx | 2 +- front/components/providers/AnthropicSetup.tsx | 2 +- .../components/providers/AzureOpenAISetup.tsx | 2 +- .../providers/BrowserlessAPISetup.tsx | 2 +- front/components/providers/CohereSetup.tsx | 2 +- .../providers/GoogleVertexAISetup.tsx | 2 +- front/components/providers/MistralAISetup.tsx | 2 +- front/components/providers/OpenAISetup.tsx | 2 +- front/components/providers/SerpAPISetup.tsx | 2 +- front/components/providers/SerperSetup.tsx | 2 +- front/components/providers/TextSynthSetup.tsx | 2 +- front/components/sparkle/AppLayout.tsx | 11 ++-- front/components/sparkle/OnboardingLayout.tsx | 2 +- front/components/sparkle/navigation.tsx | 4 +- front/components/tables/TablePicker.tsx | 4 +- front/components/use/EventSchemaForm.tsx | 7 ++- front/lib/actions/helpers.ts | 13 ++-- front/lib/actions/server.ts | 9 ++- front/lib/actions/types.ts | 2 +- front/lib/api/app.ts | 4 +- .../api/assistant/actions/database_query.ts | 15 ++--- .../lib/api/assistant/actions/dust_app_run.ts | 25 ++++---- front/lib/api/assistant/actions/retrieval.ts | 20 ++++--- front/lib/api/assistant/agent.ts | 24 ++++---- front/lib/api/assistant/agent_usage.ts | 2 +- front/lib/api/assistant/configuration.ts | 35 ++++++----- front/lib/api/assistant/conversation.ts | 35 ++++++----- front/lib/api/assistant/generation.ts | 23 ++++---- front/lib/api/assistant/global_agents.ts | 11 ++-- front/lib/api/assistant/pubsub.ts | 11 ++-- front/lib/api/assistant/reaction.ts | 6 +- front/lib/api/assistant/recent_authors.ts | 4 +- front/lib/api/assistant/user_relation.ts | 11 ++-- front/lib/api/data_sources.ts | 11 ++-- front/lib/api/datasets.ts | 6 +- front/lib/api/extract.ts | 6 +- front/lib/api/run.ts | 6 +- front/lib/api/user.ts | 2 +- front/lib/api/workspace.ts | 6 +- front/lib/assistant.ts | 5 +- front/lib/auth.ts | 16 ++--- front/lib/client/handle_file_upload.ts | 3 +- front/lib/config.ts | 2 +- front/lib/connector_connection_id.ts | 2 +- front/lib/connector_providers.ts | 2 +- front/lib/data_sources.ts | 2 +- front/lib/datasets.ts | 2 +- front/lib/development.ts | 2 +- front/lib/diff.ts | 2 +- front/lib/email.ts | 2 +- front/lib/extract_event_app.ts | 7 ++- front/lib/extract_event_markers.ts | 2 +- front/lib/extract_events.ts | 4 +- front/lib/extract_events_properties.ts | 7 ++- front/lib/http_utils.ts | 6 +- front/lib/models/apps.ts | 11 ++-- .../assistant/actions/database_query.ts | 7 ++- .../models/assistant/actions/dust_app_run.ts | 9 +-- .../lib/models/assistant/actions/retrieval.ts | 11 ++-- front/lib/models/assistant/agent.ts | 13 ++-- front/lib/models/assistant/conversation.ts | 11 ++-- front/lib/models/data_source.ts | 11 ++-- front/lib/models/doc_tracker.ts | 7 ++- front/lib/models/extract.ts | 9 +-- front/lib/models/plan.ts | 18 +++--- front/lib/models/user.ts | 7 ++- front/lib/models/workspace.ts | 13 ++-- front/lib/models/xp1.ts | 7 ++- front/lib/plans/enterprise_plans.ts | 4 +- front/lib/plans/free_plans.ts | 2 +- front/lib/plans/pro_plans.ts | 2 +- front/lib/plans/stripe.ts | 7 ++- front/lib/plans/subscription.ts | 9 +-- front/lib/plans/workspace_usage.ts | 2 +- front/lib/providers.ts | 6 +- front/lib/specification.ts | 4 +- front/lib/swr.ts | 59 ++++++++++--------- front/lib/temporal.ts | 3 +- front/lib/temporal_monitoring.ts | 6 +- front/lib/user.ts | 4 +- front/lib/utils.ts | 2 +- front/pages/_app.tsx | 4 +- front/pages/api/[preStopSecret]/prestop.ts | 2 +- front/pages/api/login.ts | 4 +- front/pages/api/poke/plans.ts | 6 +- .../[wId]/agent_configurations/[aId]/index.ts | 4 +- .../[wId]/data_sources/[name]/config.ts | 4 +- .../[wId]/data_sources/[name]/index.ts | 4 +- .../api/poke/workspaces/[wId]/downgrade.ts | 6 +- .../pages/api/poke/workspaces/[wId]/index.ts | 6 +- .../pages/api/poke/workspaces/[wId]/revoke.ts | 4 +- .../api/poke/workspaces/[wId]/upgrade.ts | 6 +- front/pages/api/poke/workspaces/index.ts | 9 +-- front/pages/api/registry/[type]/lookup.ts | 2 +- front/pages/api/stripe/portal.ts | 4 +- front/pages/api/stripe/webhook.ts | 7 ++- front/pages/api/user/index.ts | 4 +- front/pages/api/user/metadata/[key]/index.ts | 6 +- .../apps/[user]/[sId]/runs/[runId]/index.ts | 6 +- .../api/v1/apps/[user]/[sId]/runs/index.ts | 6 +- front/pages/api/v1/apps/[user]/index.ts | 6 +- .../[name]/documents/[documentId]/index.ts | 8 +-- .../[user]/[name]/documents/index.ts | 6 +- .../v1/data_sources/[user]/[name]/search.ts | 6 +- .../w/[wId]/apps/[aId]/runs/[runId]/index.ts | 6 +- .../api/v1/w/[wId]/apps/[aId]/runs/index.ts | 8 +-- front/pages/api/v1/w/[wId]/apps/index.ts | 6 +- .../w/[wId]/assistant/agent_configurations.ts | 6 +- .../conversations/[cId]/content_fragments.ts | 8 +-- .../assistant/conversations/[cId]/events.ts | 4 +- .../assistant/conversations/[cId]/index.ts | 6 +- .../[cId]/messages/[mId]/events.ts | 4 +- .../conversations/[cId]/messages/index.ts | 6 +- .../w/[wId]/assistant/conversations/index.ts | 8 +-- .../[name]/documents/[documentId]/index.ts | 11 ++-- .../[name]/documents/[documentId]/parents.ts | 4 +- .../data_sources/[name]/documents/index.ts | 6 +- .../v1/w/[wId]/data_sources/[name]/search.ts | 10 ++-- .../data_sources/[name]/tables/[tId]/index.ts | 5 +- .../[name]/tables/[tId]/rows/[rId].ts | 5 +- .../[name]/tables/[tId]/rows/index.ts | 5 +- .../[wId]/data_sources/[name]/tables/index.ts | 5 +- .../w/[wId]/data_sources/[name]/tokenize.ts | 6 +- .../api/v1/w/[wId]/data_sources/index.ts | 6 +- front/pages/api/w/[wId]/apps/[aId]/clone.ts | 6 +- .../[wId]/apps/[aId]/datasets/[name]/index.ts | 6 +- .../api/w/[wId]/apps/[aId]/datasets/index.ts | 6 +- front/pages/api/w/[wId]/apps/[aId]/index.ts | 6 +- .../[runId]/blocks/[type]/[name]/index.ts | 6 +- .../w/[wId]/apps/[aId]/runs/[runId]/status.ts | 6 +- .../api/w/[wId]/apps/[aId]/runs/index.ts | 6 +- front/pages/api/w/[wId]/apps/[aId]/state.ts | 4 +- front/pages/api/w/[wId]/apps/index.ts | 6 +- .../agent_configurations/[aId]/index.ts | 7 ++- .../[aId]/linked_slack_channels.ts | 4 +- .../agent_configurations/[aId]/scope.ts | 4 +- .../agent_configurations/[aId]/usage.ts | 6 +- .../assistant/agent_configurations/avatar.ts | 2 +- .../assistant/agent_configurations/index.ts | 15 ++--- .../agent_configurations/name_available.ts | 4 +- .../assistant/conversations/[cId]/cancel.ts | 4 +- .../[cId]/content_fragment/index.ts | 9 +-- .../assistant/conversations/[cId]/events.ts | 4 +- .../assistant/conversations/[cId]/index.ts | 6 +- .../[cId]/messages/[mId]/edit.ts | 7 ++- .../[cId]/messages/[mId]/events.ts | 4 +- .../[cId]/messages/[mId]/reactions/index.ts | 6 +- .../[cId]/messages/[mId]/retry.ts | 7 ++- .../conversations/[cId]/messages/index.ts | 9 +-- .../conversations/[cId]/reactions.ts | 6 +- .../w/[wId]/assistant/conversations/index.ts | 11 ++-- .../assistant/global_agents/[aId]/index.ts | 4 +- .../[name]/documents/[documentId]/index.ts | 9 +-- .../data_sources/[name]/documents/index.ts | 4 +- .../api/w/[wId]/data_sources/[name]/index.ts | 6 +- .../[name]/managed/bot_enabled.ts | 4 +- .../data_sources/[name]/managed/parents.ts | 4 +- .../[name]/managed/permissions/index.ts | 9 +-- .../slack/channels_linked_with_agent.ts | 4 +- .../data_sources/[name]/managed/update.ts | 7 ++- .../api/w/[wId]/data_sources/[name]/search.ts | 6 +- .../w/[wId]/data_sources/[name]/tables/csv.ts | 10 ++-- .../[wId]/data_sources/[name]/tables/index.ts | 4 +- front/pages/api/w/[wId]/data_sources/index.ts | 6 +- .../pages/api/w/[wId]/data_sources/managed.ts | 10 ++-- front/pages/api/w/[wId]/index.ts | 6 +- .../[wId]/invitations/[invitationId]/index.ts | 4 +- front/pages/api/w/[wId]/invitations/index.ts | 4 +- .../api/w/[wId]/keys/[secret]/disable.ts | 4 +- front/pages/api/w/[wId]/keys/index.ts | 5 +- .../api/w/[wId]/members/[userId]/index.ts | 4 +- front/pages/api/w/[wId]/members/index.ts | 4 +- .../w/[wId]/members/me/agent_list_status.ts | 4 +- front/pages/api/w/[wId]/monthly-usage.ts | 2 +- .../api/w/[wId]/providers/[pId]/check.ts | 2 +- .../api/w/[wId]/providers/[pId]/index.ts | 4 +- .../api/w/[wId]/providers/[pId]/models.ts | 2 +- front/pages/api/w/[wId]/providers/index.ts | 4 +- .../pages/api/w/[wId]/subscriptions/index.ts | 6 +- .../w/[wId]/use/extract/events/[sId]/index.ts | 6 +- .../extract/templates/[sId]/events/index.ts | 6 +- .../use/extract/templates/[sId]/index.ts | 6 +- .../w/[wId]/use/extract/templates/index.ts | 6 +- front/pages/index.tsx | 4 +- front/pages/login-error.tsx | 2 +- .../poke/[wId]/assistants/[aId]/index.tsx | 7 ++- .../poke/[wId]/data_sources/[name]/index.tsx | 9 +-- .../poke/[wId]/data_sources/[name]/view.tsx | 4 +- front/pages/poke/[wId]/index.tsx | 15 ++--- front/pages/poke/[wId]/memberships.tsx | 4 +- front/pages/poke/index.tsx | 7 ++- front/pages/poke/plans.tsx | 7 ++- front/pages/w/[wId]/a/[aId]/clone.tsx | 10 ++-- .../w/[wId]/a/[aId]/datasets/[name]/index.tsx | 10 ++-- .../pages/w/[wId]/a/[aId]/datasets/index.tsx | 10 ++-- front/pages/w/[wId]/a/[aId]/datasets/new.tsx | 10 ++-- front/pages/w/[wId]/a/[aId]/execute/index.tsx | 12 ++-- front/pages/w/[wId]/a/[aId]/index.tsx | 14 ++--- .../w/[wId]/a/[aId]/runs/[runId]/index.tsx | 10 ++-- front/pages/w/[wId]/a/[aId]/runs/index.tsx | 10 ++-- front/pages/w/[wId]/a/[aId]/settings.tsx | 10 ++-- front/pages/w/[wId]/a/[aId]/specification.tsx | 8 +-- front/pages/w/[wId]/a/index.tsx | 10 ++-- front/pages/w/[wId]/a/new.tsx | 10 ++-- front/pages/w/[wId]/assistant/[cId]/index.tsx | 8 +-- front/pages/w/[wId]/assistant/assistants.tsx | 8 +-- front/pages/w/[wId]/assistant/gallery.tsx | 9 +-- front/pages/w/[wId]/assistant/new.tsx | 4 +- .../[wId]/builder/assistants/[aId]/index.tsx | 15 ++--- .../pages/w/[wId]/builder/assistants/dust.tsx | 4 +- .../w/[wId]/builder/assistants/index.tsx | 6 +- .../pages/w/[wId]/builder/assistants/new.tsx | 20 ++++--- .../builder/data-sources/[name]/index.tsx | 18 +++--- .../builder/data-sources/[name]/search.tsx | 8 +-- .../builder/data-sources/[name]/settings.tsx | 8 +-- .../builder/data-sources/[name]/upsert.tsx | 6 +- .../w/[wId]/builder/data-sources/managed.tsx | 11 ++-- .../builder/data-sources/new-public-url.tsx | 8 +-- .../w/[wId]/builder/data-sources/new.tsx | 8 +-- .../builder/data-sources/public-urls.tsx | 6 +- .../w/[wId]/builder/data-sources/static.tsx | 6 +- front/pages/w/[wId]/index.tsx | 2 +- front/pages/w/[wId]/join.tsx | 4 +- .../w/[wId]/members/DomainAutoJoinModal.tsx | 35 +++++++++++ front/pages/w/[wId]/members/index.tsx | 8 +-- front/pages/w/[wId]/subscription/index.tsx | 6 +- .../upgrade-enterprise/[secret].tsx | 2 +- front/pages/w/[wId]/tables/index.tsx | 6 +- .../w/[wId]/u/extract/events/[sId]/edit.tsx | 10 ++-- front/pages/w/[wId]/u/extract/index.tsx | 6 +- .../[wId]/u/extract/templates/[sId]/edit.tsx | 8 +-- .../[wId]/u/extract/templates/[sId]/index.tsx | 10 ++-- .../pages/w/[wId]/u/extract/templates/new.tsx | 6 +- front/pages/w/[wId]/u/index.tsx | 2 +- front/pages/w/[wId]/welcome.tsx | 4 +- front/pages/w/[wId]/workspace/index.tsx | 6 +- 306 files changed, 1109 insertions(+), 953 deletions(-) create mode 100644 front/pages/w/[wId]/members/DomainAutoJoinModal.tsx diff --git a/front/.eslintrc.js b/front/.eslintrc.js index c9202864c639..9ce4c0549300 100644 --- a/front/.eslintrc.js +++ b/front/.eslintrc.js @@ -19,6 +19,7 @@ module.exports = { "react/no-unescaped-entities": 0, "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/consistent-type-imports": "error", "no-case-declarations": 0, "react-hooks/rules-of-hooks": 0, "@next/next/no-img-element": 0, diff --git a/front/components/Button.tsx b/front/components/Button.tsx index 273da10ba43e..2a1db26b9171 100644 --- a/front/components/Button.tsx +++ b/front/components/Button.tsx @@ -1,9 +1,10 @@ +import type { + Icon} from "@dust-tt/sparkle"; import { Button, DropdownMenu, GithubLogo, GoogleLogo, - Icon, LoginIcon, Modal, RocketIcon, diff --git a/front/components/ConnectorPermissionsModal.tsx b/front/components/ConnectorPermissionsModal.tsx index 5b11c8f78795..177abf912ade 100644 --- a/front/components/ConnectorPermissionsModal.tsx +++ b/front/components/ConnectorPermissionsModal.tsx @@ -1,10 +1,10 @@ import { Modal, Page } from "@dust-tt/sparkle"; -import { +import type { ConnectorProvider, DataSourceType, WorkspaceType, } from "@dust-tt/types"; -import { ConnectorPermission, ConnectorType } from "@dust-tt/types"; +import type { ConnectorPermission, ConnectorType } from "@dust-tt/types"; import { useContext, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/ConnectorPermissionsTree.tsx b/front/components/ConnectorPermissionsTree.tsx index f7376c3af30e..44678747dbde 100644 --- a/front/components/ConnectorPermissionsTree.tsx +++ b/front/components/ConnectorPermissionsTree.tsx @@ -5,12 +5,12 @@ import { Tooltip, Tree, } from "@dust-tt/sparkle"; -import { +import type { ConnectorProvider, DataSourceType, WorkspaceType, } from "@dust-tt/types"; -import { ConnectorPermission } from "@dust-tt/types"; +import type { ConnectorPermission } from "@dust-tt/types"; import { useState } from "react"; import ManagedDataSourceDocumentModal from "@app/components/ManagedDataSourceDocumentModal"; diff --git a/front/components/DataSourceResourceSelectorTree.tsx b/front/components/DataSourceResourceSelectorTree.tsx index 42248f74eadf..96f542ea01c4 100644 --- a/front/components/DataSourceResourceSelectorTree.tsx +++ b/front/components/DataSourceResourceSelectorTree.tsx @@ -6,8 +6,8 @@ import { DocumentTextIcon, Spinner, } from "@dust-tt/sparkle"; -import { DataSourceType, WorkspaceType } from "@dust-tt/types"; -import { ConnectorPermission, ConnectorResourceType } from "@dust-tt/types"; +import type { DataSourceType, WorkspaceType } from "@dust-tt/types"; +import type { ConnectorPermission, ConnectorResourceType } from "@dust-tt/types"; import { CircleStackIcon, FolderIcon } from "@heroicons/react/20/solid"; import { useState } from "react"; diff --git a/front/components/EmptyCallToAction.tsx b/front/components/EmptyCallToAction.tsx index 428e0b2dce02..4074b268422a 100644 --- a/front/components/EmptyCallToAction.tsx +++ b/front/components/EmptyCallToAction.tsx @@ -1,6 +1,7 @@ import { Button, PlusIcon } from "@dust-tt/sparkle"; import Link from "next/link"; -import React, { ComponentType, MouseEvent } from "react"; +import type { ComponentType, MouseEvent } from "react"; +import React from "react"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/ManagedDataSourceDocumentModal.tsx b/front/components/ManagedDataSourceDocumentModal.tsx index 2cc783d7f74d..a0af953419d8 100644 --- a/front/components/ManagedDataSourceDocumentModal.tsx +++ b/front/components/ManagedDataSourceDocumentModal.tsx @@ -1,5 +1,5 @@ import { Modal } from "@dust-tt/sparkle"; -import { DataSourceType, WorkspaceType } from "@dust-tt/types"; +import type { DataSourceType, WorkspaceType } from "@dust-tt/types"; import { useEffect, useState } from "react"; export default function ManagedDataSourceDocumentModal({ diff --git a/front/components/PlansTables.tsx b/front/components/PlansTables.tsx index 68b4136f84f7..2d031df52ac9 100644 --- a/front/components/PlansTables.tsx +++ b/front/components/PlansTables.tsx @@ -1,5 +1,5 @@ import { Button, PriceTable, RocketIcon, SparklesIcon } from "@dust-tt/sparkle"; -import { PlanType } from "@dust-tt/types"; +import type { PlanType } from "@dust-tt/types"; import { Tab } from "@headlessui/react"; import React from "react"; diff --git a/front/components/WorkspacePicker.tsx b/front/components/WorkspacePicker.tsx index 5036d7b8d3d7..95e145e35cfa 100644 --- a/front/components/WorkspacePicker.tsx +++ b/front/components/WorkspacePicker.tsx @@ -1,5 +1,5 @@ import { DropdownMenu } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; export default function WorkspacePicker({ user, diff --git a/front/components/app/DatasetPicker.tsx b/front/components/app/DatasetPicker.tsx index c5409a78dafa..f812c4f8fd0c 100644 --- a/front/components/app/DatasetPicker.tsx +++ b/front/components/app/DatasetPicker.tsx @@ -1,6 +1,6 @@ import { ChevronDownIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import Link from "next/link"; diff --git a/front/components/app/DatasetView.tsx b/front/components/app/DatasetView.tsx index c4b09d74b719..e8ab9b8d4f56 100644 --- a/front/components/app/DatasetView.tsx +++ b/front/components/app/DatasetView.tsx @@ -8,7 +8,7 @@ import { PlusIcon, XCircleIcon, } from "@dust-tt/sparkle"; -import { DatasetEntry, DatasetSchema, DatasetType } from "@dust-tt/types"; +import type { DatasetEntry, DatasetSchema, DatasetType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { useEffect, useRef, useState } from "react"; import TextareaAutosize from "react-textarea-autosize"; diff --git a/front/components/app/Deploy.tsx b/front/components/app/Deploy.tsx index 81799671df2c..1a3cf4863b56 100644 --- a/front/components/app/Deploy.tsx +++ b/front/components/app/Deploy.tsx @@ -6,9 +6,9 @@ import { CubeIcon, DocumentTextIcon, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { AppType, SpecificationType } from "@dust-tt/types"; -import { RunConfig, RunType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationType } from "@dust-tt/types"; +import type { RunConfig, RunType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import dynamic from "next/dynamic"; import Link from "next/link"; diff --git a/front/components/app/ModelPicker.tsx b/front/components/app/ModelPicker.tsx index 5d51d891dfad..4fb6e90c94c2 100644 --- a/front/components/app/ModelPicker.tsx +++ b/front/components/app/ModelPicker.tsx @@ -1,5 +1,5 @@ import { ChevronDownIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import Link from "next/link"; import { useEffect, useState } from "react"; diff --git a/front/components/app/NewBlock.tsx b/front/components/app/NewBlock.tsx index d7908393f7b2..dcd23c27dee2 100644 --- a/front/components/app/NewBlock.tsx +++ b/front/components/app/NewBlock.tsx @@ -1,6 +1,6 @@ import { Button } from "@dust-tt/sparkle"; -import { SpecificationType, WorkspaceType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; +import type { SpecificationType, WorkspaceType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import { PlusIcon } from "@heroicons/react/20/solid"; diff --git a/front/components/app/SpecRunView.tsx b/front/components/app/SpecRunView.tsx index ca02396f5f09..02e1cc2b8d11 100644 --- a/front/components/app/SpecRunView.tsx +++ b/front/components/app/SpecRunView.tsx @@ -1,10 +1,10 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import TextareaAutosize from "react-textarea-autosize"; import Database from "@app/components/app/blocks/Database"; diff --git a/front/components/app/blocks/Block.tsx b/front/components/app/blocks/Block.tsx index 98135bf16485..8c5e100d6912 100644 --- a/front/components/app/blocks/Block.tsx +++ b/front/components/app/blocks/Block.tsx @@ -5,13 +5,13 @@ import { Square3Stack3DStrokeIcon, TrashIcon, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import { useEffect, useState } from "react"; import NewBlock from "@app/components/app/NewBlock"; diff --git a/front/components/app/blocks/Browser.tsx b/front/components/app/blocks/Browser.tsx index 470433b43731..c876384d4272 100644 --- a/front/components/app/blocks/Browser.tsx +++ b/front/components/app/blocks/Browser.tsx @@ -1,11 +1,11 @@ import { ChevronDownIcon, ChevronRightIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import Link from "next/link"; import { useState } from "react"; diff --git a/front/components/app/blocks/Chat.tsx b/front/components/app/blocks/Chat.tsx index d09616cbeef9..af0385d3b924 100644 --- a/front/components/app/blocks/Chat.tsx +++ b/front/components/app/blocks/Chat.tsx @@ -1,11 +1,11 @@ import "@uiw/react-textarea-code-editor/dist.css"; import { ChevronDownIcon, ChevronRightIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; -import { RunType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { useState } from "react"; diff --git a/front/components/app/blocks/Code.tsx b/front/components/app/blocks/Code.tsx index c89f68411694..14850af1c6f4 100644 --- a/front/components/app/blocks/Code.tsx +++ b/front/components/app/blocks/Code.tsx @@ -1,12 +1,12 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { classNames, shallowBlockClone } from "@app/lib/utils"; diff --git a/front/components/app/blocks/Curl.tsx b/front/components/app/blocks/Curl.tsx index 2f4e3b5b5311..8e7c05eef364 100644 --- a/front/components/app/blocks/Curl.tsx +++ b/front/components/app/blocks/Curl.tsx @@ -1,13 +1,13 @@ import "@uiw/react-textarea-code-editor/dist.css"; import { ChevronDownIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import dynamic from "next/dynamic"; import { useEffect } from "react"; diff --git a/front/components/app/blocks/Data.tsx b/front/components/app/blocks/Data.tsx index 62a9f058d35e..dc95dca9822e 100644 --- a/front/components/app/blocks/Data.tsx +++ b/front/components/app/blocks/Data.tsx @@ -1,10 +1,10 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import DatasetPicker from "@app/components/app/DatasetPicker"; import { shallowBlockClone } from "@app/lib/utils"; diff --git a/front/components/app/blocks/DataSource.tsx b/front/components/app/blocks/DataSource.tsx index 77ea81103894..06d3058e6d4e 100644 --- a/front/components/app/blocks/DataSource.tsx +++ b/front/components/app/blocks/DataSource.tsx @@ -1,12 +1,12 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import { ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/20/solid"; import dynamic from "next/dynamic"; import { useState } from "react"; diff --git a/front/components/app/blocks/Database.tsx b/front/components/app/blocks/Database.tsx index 7bfaf7cf1a73..dac8d62e2c0a 100644 --- a/front/components/app/blocks/Database.tsx +++ b/front/components/app/blocks/Database.tsx @@ -1,12 +1,12 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import DataSourcePicker from "@app/components/data_source/DataSourcePicker"; diff --git a/front/components/app/blocks/DatabaseSchema.tsx b/front/components/app/blocks/DatabaseSchema.tsx index dc1c4be6c8b7..eac57bbe7bc7 100644 --- a/front/components/app/blocks/DatabaseSchema.tsx +++ b/front/components/app/blocks/DatabaseSchema.tsx @@ -1,12 +1,12 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import DataSourcePicker from "@app/components/data_source/DataSourcePicker"; import TablePicker from "@app/components/tables/TablePicker"; diff --git a/front/components/app/blocks/Input.tsx b/front/components/app/blocks/Input.tsx index 1def7ac657a3..85fc8ad12e5e 100644 --- a/front/components/app/blocks/Input.tsx +++ b/front/components/app/blocks/Input.tsx @@ -1,10 +1,10 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import DatasetPicker from "@app/components/app/DatasetPicker"; import { shallowBlockClone } from "@app/lib/utils"; diff --git a/front/components/app/blocks/LLM.tsx b/front/components/app/blocks/LLM.tsx index 8055b808d3ee..3d17ee14a486 100644 --- a/front/components/app/blocks/LLM.tsx +++ b/front/components/app/blocks/LLM.tsx @@ -1,12 +1,12 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import { ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/20/solid"; import dynamic from "next/dynamic"; import { useState } from "react"; diff --git a/front/components/app/blocks/MapReduce.tsx b/front/components/app/blocks/MapReduce.tsx index ea551bb0fe7e..e913613e2208 100644 --- a/front/components/app/blocks/MapReduce.tsx +++ b/front/components/app/blocks/MapReduce.tsx @@ -1,10 +1,10 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; import { classNames, shallowBlockClone } from "@app/lib/utils"; diff --git a/front/components/app/blocks/Output.tsx b/front/components/app/blocks/Output.tsx index bc887533e010..6309434fd744 100644 --- a/front/components/app/blocks/Output.tsx +++ b/front/components/app/blocks/Output.tsx @@ -1,6 +1,6 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { AppType, SpecificationBlockType } from "@dust-tt/types"; -import { TraceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationBlockType } from "@dust-tt/types"; +import type { TraceType } from "@dust-tt/types"; import { CheckCircleIcon, ChevronDownIcon, diff --git a/front/components/app/blocks/Search.tsx b/front/components/app/blocks/Search.tsx index d741268ec132..4fd870871563 100644 --- a/front/components/app/blocks/Search.tsx +++ b/front/components/app/blocks/Search.tsx @@ -1,8 +1,8 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; -import { RunType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import { ChevronDownIcon } from "@heroicons/react/20/solid"; import Link from "next/link"; diff --git a/front/components/app/blocks/WhileEnd.tsx b/front/components/app/blocks/WhileEnd.tsx index 7964c588f7db..cf20d41f633e 100644 --- a/front/components/app/blocks/WhileEnd.tsx +++ b/front/components/app/blocks/WhileEnd.tsx @@ -1,10 +1,10 @@ import "@uiw/react-textarea-code-editor/dist.css"; -import { WorkspaceType } from "@dust-tt/types"; -import { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; -import { RunType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { SpecificationBlockType, SpecificationType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { classNames, shallowBlockClone } from "@app/lib/utils"; diff --git a/front/components/assistant/AssistantActions.tsx b/front/components/assistant/AssistantActions.tsx index 8454f7c2b671..023b2c51cda3 100644 --- a/front/components/assistant/AssistantActions.tsx +++ b/front/components/assistant/AssistantActions.tsx @@ -1,14 +1,14 @@ import { Dialog } from "@dust-tt/sparkle"; -import { +import type { LightAgentConfigurationType, PostOrPatchAgentConfigurationRequestBody, } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { useContext } from "react"; import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { useAgentConfiguration } from "@app/lib/swr"; -import { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; +import type { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; export function DeleteAssistantDialog({ owner, diff --git a/front/components/assistant/AssistantDetails.tsx b/front/components/assistant/AssistantDetails.tsx index cfd0c44b1231..71f7ed9dd03b 100644 --- a/front/components/assistant/AssistantDetails.tsx +++ b/front/components/assistant/AssistantDetails.tsx @@ -9,22 +9,24 @@ import { TrashIcon, XMarkIcon, } from "@dust-tt/sparkle"; -import { +import type { AgentUsageType, AgentUserListStatus, ConnectorProvider, LightAgentConfigurationType, } from "@dust-tt/types"; +import type { + DustAppRunConfigurationType} from "@dust-tt/types"; +import type { + DataSourceConfiguration} from "@dust-tt/types"; +import type { AgentConfigurationType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { - DustAppRunConfigurationType, isDustAppRunConfiguration, } from "@dust-tt/types"; import { - DataSourceConfiguration, isRetrievalConfiguration, } from "@dust-tt/types"; -import { AgentConfigurationType } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; import Link from "next/link"; import { useContext, useState } from "react"; import ReactMarkdown from "react-markdown"; @@ -33,7 +35,7 @@ import { DeleteAssistantDialog } from "@app/components/assistant/AssistantAction import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { CONNECTOR_CONFIGURATIONS } from "@app/lib/connector_providers"; import { useAgentConfiguration, useAgentUsage, useApp } from "@app/lib/swr"; -import { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; +import type { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; type AssistantDetailsFlow = "personal" | "workspace"; diff --git a/front/components/assistant/AssistantPicker.tsx b/front/components/assistant/AssistantPicker.tsx index 2fcf6ece15a8..b511430cdde7 100644 --- a/front/components/assistant/AssistantPicker.tsx +++ b/front/components/assistant/AssistantPicker.tsx @@ -7,7 +7,7 @@ import { Searchbar, WrenchIcon, } from "@dust-tt/sparkle"; -import { LightAgentConfigurationType, WorkspaceType } from "@dust-tt/types"; +import type { LightAgentConfigurationType, WorkspaceType } from "@dust-tt/types"; import Link from "next/link"; import { useEffect, useState } from "react"; diff --git a/front/components/assistant/GalleryAssistantPreviewContainer.tsx b/front/components/assistant/GalleryAssistantPreviewContainer.tsx index 67dd2c9a92e7..a3be96857d65 100644 --- a/front/components/assistant/GalleryAssistantPreviewContainer.tsx +++ b/front/components/assistant/GalleryAssistantPreviewContainer.tsx @@ -1,5 +1,5 @@ import { AssistantPreview } from "@dust-tt/sparkle"; -import { +import type { AgentUserListStatus, LightAgentConfigurationType, PlanType, @@ -7,13 +7,14 @@ import { } from "@dust-tt/types"; import { useContext, useEffect, useState } from "react"; +import type { + NotificationType} from "@app/components/sparkle/Notification"; import { - NotificationType, SendNotificationsContext, } from "@app/components/sparkle/Notification"; import { isLargeModel } from "@app/lib/assistant"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; -import { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; +import type { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; type AssistantPreviewFlow = "personal" | "workspace"; diff --git a/front/components/assistant/RenderMessageMarkdown.tsx b/front/components/assistant/RenderMessageMarkdown.tsx index ae427a3a9c7f..f08631638ccb 100644 --- a/front/components/assistant/RenderMessageMarkdown.tsx +++ b/front/components/assistant/RenderMessageMarkdown.tsx @@ -4,12 +4,13 @@ import { IconButton, Tooltip, } from "@dust-tt/sparkle"; -import { LightAgentConfigurationType } from "@dust-tt/types"; -import { RetrievalDocumentType } from "@dust-tt/types"; +import type { LightAgentConfigurationType } from "@dust-tt/types"; +import type { RetrievalDocumentType } from "@dust-tt/types"; import dynamic from "next/dynamic"; -import React, { ReactNode, useCallback, useEffect, useState } from "react"; +import type { ReactNode} from "react"; +import React, { useCallback, useEffect, useState } from "react"; import ReactMarkdown from "react-markdown"; -import { ReactMarkdownProps } from "react-markdown/lib/complex-types"; +import type { ReactMarkdownProps } from "react-markdown/lib/complex-types"; import remarkDirective from "remark-directive"; import remarkGfm from "remark-gfm"; import { diff --git a/front/components/assistant/TryAssistantModal.tsx b/front/components/assistant/TryAssistantModal.tsx index 295eb95a5d58..9a406f3494b8 100644 --- a/front/components/assistant/TryAssistantModal.tsx +++ b/front/components/assistant/TryAssistantModal.tsx @@ -1,12 +1,12 @@ import { Modal } from "@dust-tt/sparkle"; -import { +import type { AgentMention, ConversationType, LightAgentConfigurationType, MentionType, UserType, } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { useContext, useEffect, useState } from "react"; import Conversation from "@app/components/assistant/conversation/Conversation"; diff --git a/front/components/assistant/conversation/AgentAction.tsx b/front/components/assistant/conversation/AgentAction.tsx index bef984f1e720..83257ca31fac 100644 --- a/front/components/assistant/conversation/AgentAction.tsx +++ b/front/components/assistant/conversation/AgentAction.tsx @@ -1,9 +1,9 @@ +import type { AgentActionType } from "@dust-tt/types"; import { isDatabaseQueryActionType, isDustAppRunActionType, } from "@dust-tt/types"; import { isRetrievalActionType } from "@dust-tt/types"; -import { AgentActionType } from "@dust-tt/types"; import DatabaseQueryAction from "@app/components/assistant/conversation/DatabaseQueryAction"; import DustAppRunAction from "@app/components/assistant/conversation/DustAppRunAction"; diff --git a/front/components/assistant/conversation/AgentMessage.tsx b/front/components/assistant/conversation/AgentMessage.tsx index 4ba61af1a669..e25451f53edf 100644 --- a/front/components/assistant/conversation/AgentMessage.tsx +++ b/front/components/assistant/conversation/AgentMessage.tsx @@ -9,7 +9,7 @@ import { EyeIcon, Spinner, } from "@dust-tt/sparkle"; -import { +import type { AgentActionEvent, AgentActionSuccessEvent, AgentErrorEvent, @@ -20,8 +20,9 @@ import { UserType, WorkspaceType, } from "@dust-tt/types"; -import { isRetrievalActionType, RetrievalDocumentType } from "@dust-tt/types"; -import { AgentMessageType, MessageReactionType } from "@dust-tt/types"; +import type { RetrievalDocumentType } from "@dust-tt/types"; +import type { AgentMessageType, MessageReactionType } from "@dust-tt/types"; +import { isRetrievalActionType } from "@dust-tt/types"; import { useCallback, useContext, useEffect, useRef, useState } from "react"; import { AgentAction } from "@app/components/assistant/conversation/AgentAction"; diff --git a/front/components/assistant/conversation/AgentSuggestion.tsx b/front/components/assistant/conversation/AgentSuggestion.tsx index 1863579b07cf..ad46e2ccdf6a 100644 --- a/front/components/assistant/conversation/AgentSuggestion.tsx +++ b/front/components/assistant/conversation/AgentSuggestion.tsx @@ -1,11 +1,12 @@ import { Button, RobotIcon } from "@dust-tt/sparkle"; -import { +import type { ConversationType, - isAgentMention, - isUserMessageType, LightAgentConfigurationType, UserMessageType, - WorkspaceType, + WorkspaceType} from "@dust-tt/types"; +import { + isAgentMention, + isUserMessageType } from "@dust-tt/types"; import { useContext, useState } from "react"; diff --git a/front/components/assistant/conversation/ContentFragment.tsx b/front/components/assistant/conversation/ContentFragment.tsx index 1406ca01892d..1310f2f850bf 100644 --- a/front/components/assistant/conversation/ContentFragment.tsx +++ b/front/components/assistant/conversation/ContentFragment.tsx @@ -1,5 +1,6 @@ import { Citation } from "@dust-tt/sparkle"; -import { assertNever, ContentFragmentType } from "@dust-tt/types"; +import type { ContentFragmentType } from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; export function ContentFragment({ message }: { message: ContentFragmentType }) { let logoType: "document" | "slack" = "document"; diff --git a/front/components/assistant/conversation/Conversation.tsx b/front/components/assistant/conversation/Conversation.tsx index 24543e45e441..9fdd691f1708 100644 --- a/front/components/assistant/conversation/Conversation.tsx +++ b/front/components/assistant/conversation/Conversation.tsx @@ -1,15 +1,16 @@ -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { - AgentMention, - isAgentMention, - isUserMessageType, -} from "@dust-tt/types"; -import { AgentGenerationCancelledEvent } from "@dust-tt/types"; -import { +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { + AgentMention} from "@dust-tt/types"; +import type { AgentGenerationCancelledEvent } from "@dust-tt/types"; +import type { AgentMessageNewEvent, ConversationTitleEvent, UserMessageNewEvent, } from "@dust-tt/types"; +import { + isAgentMention, + isUserMessageType, +} from "@dust-tt/types"; import { useCallback, useEffect, useRef } from "react"; import { AgentMessage } from "@app/components/assistant/conversation/AgentMessage"; diff --git a/front/components/assistant/conversation/ConversationMessage.tsx b/front/components/assistant/conversation/ConversationMessage.tsx index 3601a2467ef9..50e995b29afb 100644 --- a/front/components/assistant/conversation/ConversationMessage.tsx +++ b/front/components/assistant/conversation/ConversationMessage.tsx @@ -1,12 +1,13 @@ import { Avatar, Button, DropdownMenu } from "@dust-tt/sparkle"; import { ReactionIcon } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { MessageReactionType } from "@dust-tt/types"; -import { Emoji, EmojiMartData } from "@emoji-mart/data"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { MessageReactionType } from "@dust-tt/types"; +import type { Emoji, EmojiMartData } from "@emoji-mart/data"; import Picker from "@emoji-mart/react"; -import { +import type { ComponentType, - MouseEventHandler, + MouseEventHandler} from "react"; +import { useEffect, useRef, useState, diff --git a/front/components/assistant/conversation/ConversationParticipants.tsx b/front/components/assistant/conversation/ConversationParticipants.tsx index 83051bee0192..01e429ba387c 100644 --- a/front/components/assistant/conversation/ConversationParticipants.tsx +++ b/front/components/assistant/conversation/ConversationParticipants.tsx @@ -1,5 +1,5 @@ import { Avatar } from "@dust-tt/sparkle"; -import { ConversationType } from "@dust-tt/types"; +import type { ConversationType } from "@dust-tt/types"; import React from "react"; export function ConversationParticipants({ diff --git a/front/components/assistant/conversation/ConversationTitle.tsx b/front/components/assistant/conversation/ConversationTitle.tsx index 1dca8580ffbc..be54f624feb6 100644 --- a/front/components/assistant/conversation/ConversationTitle.tsx +++ b/front/components/assistant/conversation/ConversationTitle.tsx @@ -10,9 +10,10 @@ import { TrashIcon, XMarkIcon, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { ConversationType } from "@dust-tt/types"; -import React, { MouseEvent, useRef, useState } from "react"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ConversationType } from "@dust-tt/types"; +import type { MouseEvent} from "react"; +import React, { useRef, useState } from "react"; import { useSWRConfig } from "swr"; import { ConversationParticipants } from "@app/components/assistant/conversation/ConversationParticipants"; diff --git a/front/components/assistant/conversation/DatabaseQueryAction.tsx b/front/components/assistant/conversation/DatabaseQueryAction.tsx index f5ca39f8fa61..955359d14bd6 100644 --- a/front/components/assistant/conversation/DatabaseQueryAction.tsx +++ b/front/components/assistant/conversation/DatabaseQueryAction.tsx @@ -6,7 +6,7 @@ import { Spinner, Tooltip, } from "@dust-tt/sparkle"; -import { DatabaseQueryActionType } from "@dust-tt/types"; +import type { DatabaseQueryActionType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { useState } from "react"; import { amber, emerald, slate } from "tailwindcss/colors"; diff --git a/front/components/assistant/conversation/DustAppRunAction.tsx b/front/components/assistant/conversation/DustAppRunAction.tsx index 963259fc1b12..75ae11faca0b 100644 --- a/front/components/assistant/conversation/DustAppRunAction.tsx +++ b/front/components/assistant/conversation/DustAppRunAction.tsx @@ -6,7 +6,7 @@ import { Spinner, Tooltip, } from "@dust-tt/sparkle"; -import { DustAppRunActionType } from "@dust-tt/types"; +import type { DustAppRunActionType } from "@dust-tt/types"; import dynamic from "next/dynamic"; import { useState } from "react"; import { amber, emerald, slate } from "tailwindcss/colors"; diff --git a/front/components/assistant/conversation/RetrievalAction.tsx b/front/components/assistant/conversation/RetrievalAction.tsx index 409ae8b65f72..6a6ac2fe48ba 100644 --- a/front/components/assistant/conversation/RetrievalAction.tsx +++ b/front/components/assistant/conversation/RetrievalAction.tsx @@ -7,7 +7,7 @@ import { Spinner, Tooltip, } from "@dust-tt/sparkle"; -import { RetrievalActionType, RetrievalDocumentType } from "@dust-tt/types"; +import type { RetrievalActionType, RetrievalDocumentType } from "@dust-tt/types"; import { Transition } from "@headlessui/react"; import { useState } from "react"; diff --git a/front/components/assistant/conversation/SidebarMenu.tsx b/front/components/assistant/conversation/SidebarMenu.tsx index 4387392bc151..e652d15a3148 100644 --- a/front/components/assistant/conversation/SidebarMenu.tsx +++ b/front/components/assistant/conversation/SidebarMenu.tsx @@ -1,6 +1,6 @@ import { Button, ChatBubbleBottomCenterPlusIcon, Item } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { ConversationWithoutContentType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ConversationWithoutContentType } from "@dust-tt/types"; import moment from "moment"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/front/components/assistant/conversation/UserMessage.tsx b/front/components/assistant/conversation/UserMessage.tsx index 7e78f7b910f3..c020ab9265e8 100644 --- a/front/components/assistant/conversation/UserMessage.tsx +++ b/front/components/assistant/conversation/UserMessage.tsx @@ -1,5 +1,5 @@ -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { ConversationType, MessageReactionType, UserMessageType, diff --git a/front/components/assistant/conversation/input_bar/InputBar.tsx b/front/components/assistant/conversation/input_bar/InputBar.tsx index e4deafe3d8b6..d1749954e8fa 100644 --- a/front/components/assistant/conversation/input_bar/InputBar.tsx +++ b/front/components/assistant/conversation/input_bar/InputBar.tsx @@ -1,7 +1,7 @@ import { Button, Citation, StopIcon } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { LightAgentConfigurationType } from "@dust-tt/types"; -import { AgentMention, MentionType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { LightAgentConfigurationType } from "@dust-tt/types"; +import type { AgentMention, MentionType } from "@dust-tt/types"; import { createContext, Fragment, @@ -13,9 +13,10 @@ import { import { mutate } from "swr"; import { GenerationContext } from "@app/components/assistant/conversation/GenerationContextProvider"; -import InputBarContainer, { +import type { InputBarContainerProps, } from "@app/components/assistant/conversation/input_bar/InputBarContainer"; +import InputBarContainer from "@app/components/assistant/conversation/input_bar/InputBarContainer"; import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { compareAgentsForSort } from "@app/lib/assistant"; import { handleFileUploadToText } from "@app/lib/client/handle_file_upload"; diff --git a/front/components/assistant/conversation/input_bar/InputBarContainer.tsx b/front/components/assistant/conversation/input_bar/InputBarContainer.tsx index e2fc0b55a5e5..174c625aec63 100644 --- a/front/components/assistant/conversation/input_bar/InputBarContainer.tsx +++ b/front/components/assistant/conversation/input_bar/InputBarContainer.tsx @@ -6,7 +6,7 @@ import { FullscreenIcon, IconButton, } from "@dust-tt/sparkle"; -import { +import type { AgentMention, LightAgentConfigurationType, WorkspaceType, @@ -16,9 +16,10 @@ import React, { useRef, useState } from "react"; import { AssistantPicker } from "@app/components/assistant/AssistantPicker"; import useAssistantSuggestions from "@app/components/assistant/conversation/input_bar/editor/useAssistantSuggestions"; -import useCustomEditor, { +import type { CustomEditorProps, } from "@app/components/assistant/conversation/input_bar/editor/useCustomEditor"; +import useCustomEditor from "@app/components/assistant/conversation/input_bar/editor/useCustomEditor"; import useHandleMentions from "@app/components/assistant/conversation/input_bar/editor/useHandleMentions"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/assistant/conversation/input_bar/editor/MentionList.tsx b/front/components/assistant/conversation/input_bar/editor/MentionList.tsx index 49fb8db2b70a..18904430f491 100644 --- a/front/components/assistant/conversation/input_bar/editor/MentionList.tsx +++ b/front/components/assistant/conversation/input_bar/editor/MentionList.tsx @@ -6,7 +6,7 @@ import React, { useState, } from "react"; -import { EditorSuggestion } from "@app/components/assistant/conversation/input_bar/editor/suggestion"; +import type { EditorSuggestion } from "@app/components/assistant/conversation/input_bar/editor/suggestion"; import { classNames } from "@app/lib/utils"; interface MentionListProps { diff --git a/front/components/assistant/conversation/input_bar/editor/useAssistantSuggestions.ts b/front/components/assistant/conversation/input_bar/editor/useAssistantSuggestions.ts index 7d29939f2ce2..e7dab70712c8 100644 --- a/front/components/assistant/conversation/input_bar/editor/useAssistantSuggestions.ts +++ b/front/components/assistant/conversation/input_bar/editor/useAssistantSuggestions.ts @@ -1,4 +1,4 @@ -import { LightAgentConfigurationType } from "@dust-tt/types"; +import type { LightAgentConfigurationType } from "@dust-tt/types"; import { useMemo } from "react"; import { compareAgentsForSort } from "@app/lib/assistant"; diff --git a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx index 991d46cf1056..277de9409ad3 100644 --- a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx +++ b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx @@ -1,11 +1,13 @@ import Mention, { MentionPluginKey } from "@tiptap/extension-mention"; import Placeholder from "@tiptap/extension-placeholder"; -import { Editor, JSONContent, useEditor } from "@tiptap/react"; +import type { Editor, JSONContent} from "@tiptap/react"; +import { useEditor } from "@tiptap/react"; import { StarterKit } from "@tiptap/starter-kit"; import { useMemo } from "react"; +import type { + EditorSuggestion} from "@app/components/assistant/conversation/input_bar/editor/suggestion"; import { - EditorSuggestion, makeGetAssistantSuggestions, } from "@app/components/assistant/conversation/input_bar/editor/suggestion"; diff --git a/front/components/assistant/conversation/input_bar/editor/useHandleMentions.tsx b/front/components/assistant/conversation/input_bar/editor/useHandleMentions.tsx index 4a2e1b721f80..8f182c67d820 100644 --- a/front/components/assistant/conversation/input_bar/editor/useHandleMentions.tsx +++ b/front/components/assistant/conversation/input_bar/editor/useHandleMentions.tsx @@ -1,4 +1,4 @@ -import { AgentMention, LightAgentConfigurationType } from "@dust-tt/types"; +import type { AgentMention, LightAgentConfigurationType } from "@dust-tt/types"; import { useEffect, useMemo, useRef } from "react"; import type { diff --git a/front/components/assistant/conversation/lib.ts b/front/components/assistant/conversation/lib.ts index cc00f92bf88e..ff923b23410d 100644 --- a/front/components/assistant/conversation/lib.ts +++ b/front/components/assistant/conversation/lib.ts @@ -1,18 +1,19 @@ -import { +import type { ConversationType, ConversationVisibility, - Err, InternalPostConversationsRequestBodySchema, MentionType, - Ok, Result, UserType, - WorkspaceType, + WorkspaceType} from "@dust-tt/types"; +import { + Err, + Ok } from "@dust-tt/types"; -import * as t from "io-ts"; +import type * as t from "io-ts"; -import { NotificationType } from "@app/components/sparkle/Notification"; -import { PostConversationsResponseBody } from "@app/pages/api/w/[wId]/assistant/conversations"; +import type { NotificationType } from "@app/components/sparkle/Notification"; +import type { PostConversationsResponseBody } from "@app/pages/api/w/[wId]/assistant/conversations"; export type ConversationErrorType = { type: diff --git a/front/components/assistant_builder/AssistantBuilder.tsx b/front/components/assistant_builder/AssistantBuilder.tsx index f7eb244cf3ad..2c2bc683e17a 100644 --- a/front/components/assistant_builder/AssistantBuilder.tsx +++ b/front/components/assistant_builder/AssistantBuilder.tsx @@ -15,29 +15,32 @@ import { SlackLogo, TrashIcon, } from "@dust-tt/sparkle"; -import { +import type { AgentConfigurationScope, ConnectorProvider, - DataSourceType, + DataSourceType} from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { + SupportedModel} from "@dust-tt/types"; +import type { TimeframeUnit } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { PostOrPatchAgentConfigurationRequestBodySchema } from "@dust-tt/types"; +import { GEMINI_PRO_DEFAULT_MODEL_CONFIG, } from "@dust-tt/types"; -import { UserType, WorkspaceType } from "@dust-tt/types"; import { CLAUDE_DEFAULT_MODEL_CONFIG, CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG, GPT_3_5_TURBO_MODEL_CONFIG, GPT_4_TURBO_MODEL_CONFIG, MISTRAL_MEDIUM_MODEL_CONFIG, - MISTRAL_SMALL_MODEL_CONFIG, - SupportedModel, + MISTRAL_SMALL_MODEL_CONFIG } from "@dust-tt/types"; -import { TimeframeUnit } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; -import { PostOrPatchAgentConfigurationRequestBodySchema } from "@dust-tt/types"; -import * as t from "io-ts"; +import type * as t from "io-ts"; import { useRouter } from "next/router"; -import { ReactNode, useCallback, useEffect, useState } from "react"; +import type { ReactNode} from "react"; +import { useCallback, useEffect, useState } from "react"; import React from "react"; import ReactTextareaAutosize from "react-textarea-autosize"; import { mutate } from "swr"; diff --git a/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx b/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx index 1e9e6b6d0559..092d1809525b 100644 --- a/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx +++ b/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx @@ -8,10 +8,12 @@ import { Modal, Tab, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { ChangeEvent, useRef, useState } from "react"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ChangeEvent} from "react"; +import { useRef, useState } from "react"; import React from "react"; -import ReactCrop, { centerCrop, Crop, makeAspectCrop } from "react-image-crop"; +import type { Crop} from "react-image-crop"; +import ReactCrop, { centerCrop, makeAspectCrop } from "react-image-crop"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx index 9f2b07a82f80..58687cf3fdbf 100644 --- a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx +++ b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx @@ -6,19 +6,21 @@ import { Page, SliderToggle, } from "@dust-tt/sparkle"; -import { assertNever, ConnectorProvider, DataSourceType } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; +import type { ConnectorProvider, DataSourceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; import { Transition } from "@headlessui/react"; -import type * as React from "react"; +import * as React from "react"; import { useCallback, useEffect, useState } from "react"; +import type { + AssistantBuilderDataSourceConfiguration} from "@app/components/assistant_builder/AssistantBuilder"; import { - AssistantBuilderDataSourceConfiguration, CONNECTOR_PROVIDER_TO_RESOURCE_NAME, } from "@app/components/assistant_builder/AssistantBuilder"; import DataSourceResourceSelectorTree from "@app/components/DataSourceResourceSelectorTree"; import { CONNECTOR_CONFIGURATIONS } from "@app/lib/connector_providers"; -import { GetConnectorResourceParentsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/parents"; +import type { GetConnectorResourceParentsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/parents"; export default function AssistantBuilderDataSourceModal({ isOpen, diff --git a/front/components/assistant_builder/AssistantBuilderDustAppModal.tsx b/front/components/assistant_builder/AssistantBuilderDustAppModal.tsx index 6217e5c0e432..dc5fe3ec66b8 100644 --- a/front/components/assistant_builder/AssistantBuilderDustAppModal.tsx +++ b/front/components/assistant_builder/AssistantBuilderDustAppModal.tsx @@ -5,10 +5,10 @@ import { Modal, Page, } from "@dust-tt/sparkle"; -import { AppType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; import { Transition } from "@headlessui/react"; -import { AssistantBuilderDustAppConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; +import type { AssistantBuilderDustAppConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; export default function AssistantBuilderDustAppModal({ isOpen, diff --git a/front/components/assistant_builder/DataSourceSelectionSection.tsx b/front/components/assistant_builder/DataSourceSelectionSection.tsx index c808acb394fd..18b3344c5675 100644 --- a/front/components/assistant_builder/DataSourceSelectionSection.tsx +++ b/front/components/assistant_builder/DataSourceSelectionSection.tsx @@ -7,7 +7,7 @@ import { TrashIcon, } from "@dust-tt/sparkle"; -import { AssistantBuilderDataSourceConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; +import type { AssistantBuilderDataSourceConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; import { CONNECTOR_PROVIDER_TO_RESOURCE_NAME } from "@app/components/assistant_builder/shared"; import { EmptyCallToAction } from "@app/components/EmptyCallToAction"; import { CONNECTOR_CONFIGURATIONS } from "@app/lib/connector_providers"; diff --git a/front/components/assistant_builder/DustAppSelectionSection.tsx b/front/components/assistant_builder/DustAppSelectionSection.tsx index 095ba10b29a6..bb063009d048 100644 --- a/front/components/assistant_builder/DustAppSelectionSection.tsx +++ b/front/components/assistant_builder/DustAppSelectionSection.tsx @@ -6,7 +6,7 @@ import { } from "@dust-tt/sparkle"; import { Transition } from "@headlessui/react"; -import { AssistantBuilderDustAppConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; +import type { AssistantBuilderDustAppConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; import { EmptyCallToAction } from "@app/components/EmptyCallToAction"; export default function DustAppSelectionSection({ diff --git a/front/components/assistant_builder/TeamSharingSection.tsx b/front/components/assistant_builder/TeamSharingSection.tsx index ac57f7f2fcf5..01c42bb6af00 100644 --- a/front/components/assistant_builder/TeamSharingSection.tsx +++ b/front/components/assistant_builder/TeamSharingSection.tsx @@ -5,7 +5,7 @@ import { Dialog, Icon, } from "@dust-tt/sparkle"; -import { AgentConfigurationScope, WorkspaceType } from "@dust-tt/types"; +import type { AgentConfigurationScope, WorkspaceType } from "@dust-tt/types"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/components/assistant_builder/shared.ts b/front/components/assistant_builder/shared.ts index 8592760a1346..59322625a195 100644 --- a/front/components/assistant_builder/shared.ts +++ b/front/components/assistant_builder/shared.ts @@ -1,5 +1,5 @@ -import { ConnectorProvider } from "@dust-tt/types"; -import { TimeframeUnit } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; +import type { TimeframeUnit } from "@dust-tt/types"; export const FILTERING_MODES = ["SEARCH", "TIMEFRAME"] as const; export type FilteringMode = (typeof FILTERING_MODES)[number]; diff --git a/front/components/data_source/DataSourcePicker.tsx b/front/components/data_source/DataSourcePicker.tsx index 4529ca0e93f4..b0eb5f0ffa53 100644 --- a/front/components/data_source/DataSourcePicker.tsx +++ b/front/components/data_source/DataSourcePicker.tsx @@ -1,4 +1,4 @@ -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import { ChevronDownIcon } from "@heroicons/react/20/solid"; import Link from "next/link"; diff --git a/front/components/home/carousel.tsx b/front/components/home/carousel.tsx index 6a51350d3d0d..3f342a91eff4 100644 --- a/front/components/home/carousel.tsx +++ b/front/components/home/carousel.tsx @@ -11,7 +11,8 @@ import { NotionLogo, SlackLogo, } from "@dust-tt/sparkle"; -import React, { Component, createRef, ReactNode, RefObject } from "react"; +import type { ReactNode, RefObject } from "react"; +import React, { Component, createRef } from "react"; import Slider from "react-slick"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/home/contentComponents.tsx b/front/components/home/contentComponents.tsx index 73fa3f07998e..77a66e61f012 100644 --- a/front/components/home/contentComponents.tsx +++ b/front/components/home/contentComponents.tsx @@ -10,7 +10,8 @@ import { TriangleIcon, } from "@dust-tt/sparkle"; import classNames from "classnames"; -import React, { AnchorHTMLAttributes, ReactElement, ReactNode } from "react"; +import type { AnchorHTMLAttributes, ReactElement, ReactNode } from "react"; +import React from "react"; const defaultGridClasses = "grid grid-cols-12 gap-x-6 gap-y-8 px-6 md:px-12 lg:px-20 2xl:px-0"; diff --git a/front/components/home/particles.tsx b/front/components/home/particles.tsx index 797bd5e544fc..02a5d7a5f177 100644 --- a/front/components/home/particles.tsx +++ b/front/components/home/particles.tsx @@ -1,4 +1,5 @@ -import { RefObject, useEffect } from "react"; +import type { RefObject} from "react"; +import { useEffect } from "react"; import * as THREE from "three"; const hasScrollBehavior = true; diff --git a/front/components/home/scrollingHeader.tsx b/front/components/home/scrollingHeader.tsx index bda239a2c9c7..fe71c2d02a36 100644 --- a/front/components/home/scrollingHeader.tsx +++ b/front/components/home/scrollingHeader.tsx @@ -1,5 +1,6 @@ import classNames from "classnames"; -import React, { ReactNode, useCallback, useEffect, useState } from "react"; +import type { ReactNode} from "react"; +import React, { useCallback, useEffect, useState } from "react"; // Define your scroll limit here const SCROLL_LIMIT_1 = 12; diff --git a/front/components/poke/plans/form.tsx b/front/components/poke/plans/form.tsx index f919c4fdb23d..d23225ccc80e 100644 --- a/front/components/poke/plans/form.tsx +++ b/front/components/poke/plans/form.tsx @@ -9,11 +9,12 @@ import { NotionLogo, SlackLogo, } from "@dust-tt/sparkle"; -import { - assertNever, +import type { FreeBillingType, PaidBillingType, - PlanType, + PlanType} from "@dust-tt/types"; +import { + assertNever } from "@dust-tt/types"; import { useCallback, useState } from "react"; diff --git a/front/components/providers/AI21Setup.tsx b/front/components/providers/AI21Setup.tsx index cd39f15b7867..6a8311d46daf 100644 --- a/front/components/providers/AI21Setup.tsx +++ b/front/components/providers/AI21Setup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/AnthropicSetup.tsx b/front/components/providers/AnthropicSetup.tsx index 854dd6da9a96..e4b367d5d362 100644 --- a/front/components/providers/AnthropicSetup.tsx +++ b/front/components/providers/AnthropicSetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/AzureOpenAISetup.tsx b/front/components/providers/AzureOpenAISetup.tsx index 56d37cbe8d2e..3017b711ef94 100644 --- a/front/components/providers/AzureOpenAISetup.tsx +++ b/front/components/providers/AzureOpenAISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/BrowserlessAPISetup.tsx b/front/components/providers/BrowserlessAPISetup.tsx index 973c2c084702..33652d92031e 100644 --- a/front/components/providers/BrowserlessAPISetup.tsx +++ b/front/components/providers/BrowserlessAPISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/CohereSetup.tsx b/front/components/providers/CohereSetup.tsx index 9a25c4dd6125..634e4cdce15b 100644 --- a/front/components/providers/CohereSetup.tsx +++ b/front/components/providers/CohereSetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/GoogleVertexAISetup.tsx b/front/components/providers/GoogleVertexAISetup.tsx index eea99c8ae479..e1b8d2fb0dc5 100644 --- a/front/components/providers/GoogleVertexAISetup.tsx +++ b/front/components/providers/GoogleVertexAISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/MistralAISetup.tsx b/front/components/providers/MistralAISetup.tsx index ad627a5a9699..bbf37ed0bdb4 100644 --- a/front/components/providers/MistralAISetup.tsx +++ b/front/components/providers/MistralAISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/OpenAISetup.tsx b/front/components/providers/OpenAISetup.tsx index cda34163b2b5..5264100e0f06 100644 --- a/front/components/providers/OpenAISetup.tsx +++ b/front/components/providers/OpenAISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/SerpAPISetup.tsx b/front/components/providers/SerpAPISetup.tsx index b9d137eabd44..557336533769 100644 --- a/front/components/providers/SerpAPISetup.tsx +++ b/front/components/providers/SerpAPISetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/SerperSetup.tsx b/front/components/providers/SerperSetup.tsx index f5ff8f6445b3..2050794e6031 100644 --- a/front/components/providers/SerperSetup.tsx +++ b/front/components/providers/SerperSetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/providers/TextSynthSetup.tsx b/front/components/providers/TextSynthSetup.tsx index 925e465595dd..ed5b32cbd575 100644 --- a/front/components/providers/TextSynthSetup.tsx +++ b/front/components/providers/TextSynthSetup.tsx @@ -1,5 +1,5 @@ import { Button } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Fragment, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/sparkle/AppLayout.tsx b/front/components/sparkle/AppLayout.tsx index 3decee9adf39..f304e81f5db3 100644 --- a/front/components/sparkle/AppLayout.tsx +++ b/front/components/sparkle/AppLayout.tsx @@ -6,8 +6,8 @@ import { Tab, XMarkIcon, } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; import { Bars3Icon } from "@heroicons/react/20/solid"; import Head from "next/head"; @@ -21,10 +21,11 @@ import React from "react"; import WorkspacePicker from "@app/components/WorkspacePicker"; import { classNames } from "@app/lib/utils"; -import { +import type { SidebarNavigation, - topNavigation, - TopNavigationId, + TopNavigationId} from "./navigation"; +import { + topNavigation } from "./navigation"; function NavigationBar({ diff --git a/front/components/sparkle/OnboardingLayout.tsx b/front/components/sparkle/OnboardingLayout.tsx index b81aee4d8270..e0bc2a65ca9f 100644 --- a/front/components/sparkle/OnboardingLayout.tsx +++ b/front/components/sparkle/OnboardingLayout.tsx @@ -1,4 +1,4 @@ -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import Head from "next/head"; import Script from "next/script"; import { useRef } from "react"; diff --git a/front/components/sparkle/navigation.tsx b/front/components/sparkle/navigation.tsx index 5e1f01b078b5..ce8570625b38 100644 --- a/front/components/sparkle/navigation.tsx +++ b/front/components/sparkle/navigation.tsx @@ -14,8 +14,8 @@ import { ServerIcon, ShapesIcon, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; import { UsersIcon } from "@heroicons/react/20/solid"; import { isDevelopmentOrDustWorkspace } from "@app/lib/development"; diff --git a/front/components/tables/TablePicker.tsx b/front/components/tables/TablePicker.tsx index 2ad875127505..6edf521e6b3e 100644 --- a/front/components/tables/TablePicker.tsx +++ b/front/components/tables/TablePicker.tsx @@ -1,5 +1,5 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { CoreAPITable } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { CoreAPITable } from "@dust-tt/types"; import { Menu } from "@headlessui/react"; import { ChevronDownIcon } from "@heroicons/react/20/solid"; diff --git a/front/components/use/EventSchemaForm.tsx b/front/components/use/EventSchemaForm.tsx index e99e4b6b903d..9fd0ee8ecc4f 100644 --- a/front/components/use/EventSchemaForm.tsx +++ b/front/components/use/EventSchemaForm.tsx @@ -5,9 +5,10 @@ import { Page, XCircleIcon, } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { eventSchemaPropertyAllTypes, EventSchemaType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { EventSchemaType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; +import { eventSchemaPropertyAllTypes } from "@dust-tt/types"; import { PlusIcon } from "@heroicons/react/24/outline"; import { useRouter } from "next/router"; import React, { useState } from "react"; diff --git a/front/lib/actions/helpers.ts b/front/lib/actions/helpers.ts index d0af918f33b1..8c41d6edd782 100644 --- a/front/lib/actions/helpers.ts +++ b/front/lib/actions/helpers.ts @@ -1,10 +1,13 @@ -import { Action, cloneBaseConfig } from "@dust-tt/types"; -import { - DustAPI, +import type { Action} from "@dust-tt/types"; +import type { DustAPIErrorResponse, - DustAppConfigType, + DustAppConfigType} from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { cloneBaseConfig } from "@dust-tt/types"; +import { + DustAPI } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import { isRight } from "fp-ts/lib/Either"; import * as t from "io-ts"; diff --git a/front/lib/actions/server.ts b/front/lib/actions/server.ts index cbf8977cbe0f..63a95dc543be 100644 --- a/front/lib/actions/server.ts +++ b/front/lib/actions/server.ts @@ -1,8 +1,11 @@ -import { DustProdActionRegistry, DustRegistryActionName } from "@dust-tt/types"; -import { DustAPI, DustAppConfigType, DustAppType } from "@dust-tt/types"; +import type { DustRegistryActionName } from "@dust-tt/types"; +import type { DustAppConfigType, DustAppType } from "@dust-tt/types"; +import { DustProdActionRegistry } from "@dust-tt/types"; +import { DustAPI } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; -import { Authenticator, prodAPICredentialsForOwner } from "@app/lib/auth"; +import type { Authenticator} from "@app/lib/auth"; +import { prodAPICredentialsForOwner } from "@app/lib/auth"; import logger from "@app/logger/logger"; import { statsDClient } from "@app/logger/withlogging"; diff --git a/front/lib/actions/types.ts b/front/lib/actions/types.ts index baccfca8cac9..da0ef083b48f 100644 --- a/front/lib/actions/types.ts +++ b/front/lib/actions/types.ts @@ -1,4 +1,4 @@ -import { ActionResponseBase } from "@dust-tt/types"; +import type { ActionResponseBase } from "@dust-tt/types"; import { isRight } from "fp-ts/lib/Either"; import * as t from "io-ts"; diff --git a/front/lib/api/app.ts b/front/lib/api/app.ts index e0f2f5950221..7927b9c306a3 100644 --- a/front/lib/api/app.ts +++ b/front/lib/api/app.ts @@ -1,7 +1,7 @@ -import { AppType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; import { Op } from "sequelize"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { App } from "@app/lib/models"; export async function getApp( diff --git a/front/lib/api/assistant/actions/database_query.ts b/front/lib/api/assistant/actions/database_query.ts index 731fb14144fb..80f19672cc0b 100644 --- a/front/lib/api/assistant/actions/database_query.ts +++ b/front/lib/api/assistant/actions/database_query.ts @@ -1,25 +1,26 @@ -import { +import type { AgentConfigurationType, AgentMessageType, - cloneBaseConfig, ConversationType, DatabaseQueryActionType, DatabaseQueryErrorEvent, DatabaseQueryOutputEvent, DatabaseQueryParamsEvent, DatabaseQuerySuccessEvent, + ModelMessageType, + Result, + UserMessageType} from "@dust-tt/types"; +import { + cloneBaseConfig, DustProdActionRegistry, Err, isDatabaseQueryConfiguration, - ModelMessageType, - Ok, - Result, - UserMessageType, + Ok } from "@dust-tt/types"; import { runActionStreamed } from "@app/lib/actions/server"; import { generateActionInputs } from "@app/lib/api/assistant/agent"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { AgentDatabaseQueryAction } from "@app/lib/models"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/assistant/actions/dust_app_run.ts b/front/lib/api/assistant/actions/dust_app_run.ts index d72444a41eb0..bb7c736267f6 100644 --- a/front/lib/api/assistant/actions/dust_app_run.ts +++ b/front/lib/api/assistant/actions/dust_app_run.ts @@ -1,4 +1,4 @@ -import { +import type { DustAppRunBlockEvent, DustAppRunErrorEvent, DustAppRunParamsEvent, @@ -6,26 +6,29 @@ import { ModelId, ModelMessageType, } from "@dust-tt/types"; -import { +import type { DustAppParameters, - DustAppRunActionType, - isDustAppRunConfiguration, -} from "@dust-tt/types"; -import { + DustAppRunActionType} from "@dust-tt/types"; +import type { AgentActionSpecification, AgentConfigurationType, } from "@dust-tt/types"; -import { +import type { AgentMessageType, ConversationType, UserMessageType, } from "@dust-tt/types"; -import { AppType, SpecificationType } from "@dust-tt/types"; -import { DatasetSchema } from "@dust-tt/types"; +import type { AppType, SpecificationType } from "@dust-tt/types"; +import type { DatasetSchema } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { + isDustAppRunConfiguration, +} from "@dust-tt/types"; import { DustAPI } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; -import { Authenticator, prodAPICredentialsForOwner } from "@app/lib/auth"; +import type { Authenticator} from "@app/lib/auth"; +import { prodAPICredentialsForOwner } from "@app/lib/auth"; import { extractConfig } from "@app/lib/config"; import { AgentDustAppRunAction } from "@app/lib/models"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/assistant/actions/retrieval.ts b/front/lib/api/assistant/actions/retrieval.ts index 2cee2c708e52..f6f14b91d085 100644 --- a/front/lib/api/assistant/actions/retrieval.ts +++ b/front/lib/api/assistant/actions/retrieval.ts @@ -1,33 +1,35 @@ -import { +import type { ModelId, ModelMessageType, RetrievalErrorEvent, RetrievalParamsEvent, RetrievalSuccessEvent, } from "@dust-tt/types"; -import { - isRetrievalConfiguration, +import type { RetrievalActionType, RetrievalConfigurationType, RetrievalDocumentType, - TimeFrame, -} from "@dust-tt/types"; -import { + TimeFrame} from "@dust-tt/types"; +import type { AgentActionSpecification, AgentConfigurationType, } from "@dust-tt/types"; -import { +import type { AgentMessageType, ConversationType, UserMessageType, } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { + isRetrievalConfiguration +} from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import { runActionStreamed } from "@app/lib/actions/server"; import { generateActionInputs } from "@app/lib/api/assistant/agent"; import { getSupportedModelConfig } from "@app/lib/assistant"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { front_sequelize } from "@app/lib/databases"; import { AgentRetrievalAction, diff --git a/front/lib/api/assistant/agent.ts b/front/lib/api/assistant/agent.ts index 21d9631f9a1f..dbcf0ecfc7bc 100644 --- a/front/lib/api/assistant/agent.ts +++ b/front/lib/api/assistant/agent.ts @@ -1,4 +1,4 @@ -import { +import type { AgentActionEvent, AgentActionSuccessEvent, AgentConfigurationType, @@ -7,25 +7,27 @@ import { AgentGenerationSuccessEvent, AgentMessageSuccessEvent, DatabaseQueryParamsEvent, - GenerationTokensEvent, - GPT_3_5_TURBO_MODEL_CONFIG, - GPT_4_32K_MODEL_CONFIG, - GPT_4_MODEL_CONFIG, - isDatabaseQueryConfiguration, -} from "@dust-tt/types"; -import { + GenerationTokensEvent} from "@dust-tt/types"; +import type { AgentActionSpecification, LightAgentConfigurationType, } from "@dust-tt/types"; -import { +import type { AgentMessageType, ConversationType, UserMessageType, } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { + GPT_3_5_TURBO_MODEL_CONFIG, + GPT_4_32K_MODEL_CONFIG, + GPT_4_MODEL_CONFIG, + isDatabaseQueryConfiguration, +} from "@dust-tt/types"; import { isDustAppRunConfiguration } from "@dust-tt/types"; import { isRetrievalConfiguration } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import { runActionStreamed } from "@app/lib/actions/server"; import { runDatabaseQuery } from "@app/lib/api/assistant/actions/database_query"; @@ -37,7 +39,7 @@ import { renderConversationForModel, runGeneration, } from "@app/lib/api/assistant/generation"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/assistant/agent_usage.ts b/front/lib/api/assistant/agent_usage.ts index 116a05399b95..4a3a9c48f8ec 100644 --- a/front/lib/api/assistant/agent_usage.ts +++ b/front/lib/api/assistant/agent_usage.ts @@ -1,4 +1,4 @@ -import { AgentUsageType, ModelId } from "@dust-tt/types"; +import type { AgentUsageType, ModelId } from "@dust-tt/types"; import { literal, Op } from "sequelize"; import { v4 as uuidv4 } from "uuid"; diff --git a/front/lib/api/assistant/configuration.ts b/front/lib/api/assistant/configuration.ts index 390d1183f5c4..ac8d054670ee 100644 --- a/front/lib/api/assistant/configuration.ts +++ b/front/lib/api/assistant/configuration.ts @@ -1,33 +1,36 @@ -import { +import type { AgentMention, AgentUserListStatus, - assertNever, - Err, LightAgentConfigurationType, - Ok, Result, - SupportedModel, -} from "@dust-tt/types"; -import { DustAppRunConfigurationType } from "@dust-tt/types"; -import { + SupportedModel} from "@dust-tt/types"; +import type { DustAppRunConfigurationType } from "@dust-tt/types"; +import type { AgentsGetViewType, DataSourceConfiguration, - isTemplatedQuery, - isTimeFrame, RetrievalConfigurationType, RetrievalQuery, - RetrievalTimeframe, -} from "@dust-tt/types"; -import { + RetrievalTimeframe} from "@dust-tt/types"; +import type { AgentActionConfigurationType, AgentConfigurationScope, AgentConfigurationType, AgentGenerationConfigurationType, AgentStatus, } from "@dust-tt/types"; +import type { DatabaseQueryConfigurationType } from "@dust-tt/types"; +import { + assertNever, + Err, + Ok +} from "@dust-tt/types"; +import { + isTemplatedQuery, + isTimeFrame +} from "@dust-tt/types"; import { isSupportedModel } from "@dust-tt/types"; -import { DatabaseQueryConfigurationType } from "@dust-tt/types"; -import { Op, Transaction, UniqueConstraintError } from "sequelize"; +import type { Transaction} from "sequelize"; +import { Op, UniqueConstraintError } from "sequelize"; import { getGlobalAgents, @@ -35,7 +38,7 @@ import { } from "@app/lib/api/assistant/global_agents"; import { agentConfigurationWasUpdatedBy } from "@app/lib/api/assistant/recent_authors"; import { agentUserListStatus } from "@app/lib/api/assistant/user_relation"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { front_sequelize } from "@app/lib/databases"; import { AgentConfiguration, diff --git a/front/lib/api/assistant/conversation.ts b/front/lib/api/assistant/conversation.ts index a7c46293e445..07efd4bd75ba 100644 --- a/front/lib/api/assistant/conversation.ts +++ b/front/lib/api/assistant/conversation.ts @@ -1,4 +1,4 @@ -import { +import type { AgentMessageNewEvent, ConversationTitleEvent, GenerationTokensEvent, @@ -6,9 +6,8 @@ import { UserMessageNewEvent, WorkspaceType, } from "@dust-tt/types"; -import { GPT_3_5_TURBO_MODEL_CONFIG } from "@dust-tt/types"; -import { LightAgentConfigurationType } from "@dust-tt/types"; -import { +import type { LightAgentConfigurationType } from "@dust-tt/types"; +import type { AgentMessageType, ContentFragmentContentType, ContentFragmentContextType, @@ -16,18 +15,12 @@ import { ConversationType, ConversationVisibility, ConversationWithoutContentType, - isAgentMention, - isAgentMessageType, - isUserMention, - isUserMessageType, MentionType, UserMessageContext, - UserMessageType, -} from "@dust-tt/types"; -import { PlanType } from "@dust-tt/types"; -import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; -import { + UserMessageType} from "@dust-tt/types"; +import type { PlanType } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import type { AgentActionEvent, AgentActionSuccessEvent, AgentErrorEvent, @@ -36,8 +29,18 @@ import { AgentMessageErrorEvent, AgentMessageSuccessEvent, } from "@dust-tt/types"; +import { GPT_3_5_TURBO_MODEL_CONFIG } from "@dust-tt/types"; +import { + isAgentMention, + isAgentMessageType, + isUserMention, + isUserMessageType +} from "@dust-tt/types"; +import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import crypto from "crypto"; -import { Op, Transaction } from "sequelize"; +import type { Transaction } from "sequelize"; +import { Op } from "sequelize"; import { runActionStreamed } from "@app/lib/actions/server"; import { renderRetrievalActionByModelId } from "@app/lib/api/assistant/actions/retrieval"; @@ -45,7 +48,7 @@ import { runAgent } from "@app/lib/api/assistant/agent"; import { signalAgentUsage } from "@app/lib/api/assistant/agent_usage"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; import { renderConversationForModel } from "@app/lib/api/assistant/generation"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { front_sequelize } from "@app/lib/databases"; import { AgentDatabaseQueryAction, diff --git a/front/lib/api/assistant/generation.ts b/front/lib/api/assistant/generation.ts index 6f710bd50178..00cc9f10f177 100644 --- a/front/lib/api/assistant/generation.ts +++ b/front/lib/api/assistant/generation.ts @@ -1,31 +1,34 @@ -import { +import type { AgentConfigurationType, GenerationCancelEvent, GenerationErrorEvent, GenerationSuccessEvent, GenerationTokensEvent, + ModelConversationType, + ModelMessageType} from "@dust-tt/types"; +import type { + AgentMessageType, + ConversationType, + UserMessageType} from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { GPT_4_32K_MODEL_ID, GPT_4_MODEL_CONFIG, isDatabaseQueryActionType, - isDustAppRunActionType, - ModelConversationType, - ModelMessageType, + isDustAppRunActionType } from "@dust-tt/types"; import { isRetrievalActionType, isRetrievalConfiguration, } from "@dust-tt/types"; import { - AgentMessageType, - ConversationType, isAgentMessageType, isContentFragmentType, - isUserMessageType, - UserMessageType, + isUserMessageType } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import moment from "moment-timezone"; import { runActionStreamed } from "@app/lib/actions/server"; @@ -37,7 +40,7 @@ import { } from "@app/lib/api/assistant/actions/retrieval"; import { getAgentConfigurations } from "@app/lib/api/assistant/configuration"; import { getSupportedModelConfig, isLargeModel } from "@app/lib/assistant"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; import { redisClient } from "@app/lib/redis"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/assistant/global_agents.ts b/front/lib/api/assistant/global_agents.ts index 9f8b41a3b40e..ea2d40090b8b 100644 --- a/front/lib/api/assistant/global_agents.ts +++ b/front/lib/api/assistant/global_agents.ts @@ -4,10 +4,12 @@ import { promisify } from "util"; const readFileAsync = promisify(fs.readFile); -import { +import type { AgentConfigurationType, ConnectorProvider, - DataSourceType, + DataSourceType} from "@dust-tt/types"; +import type { GlobalAgentStatus, PlanType } from "@dust-tt/types"; +import { GEMINI_PRO_DEFAULT_MODEL_CONFIG, } from "@dust-tt/types"; import { @@ -18,10 +20,11 @@ import { MISTRAL_MEDIUM_MODEL_CONFIG, MISTRAL_SMALL_MODEL_CONFIG, } from "@dust-tt/types"; -import { DustAPI, GlobalAgentStatus, PlanType } from "@dust-tt/types"; +import { DustAPI } from "@dust-tt/types"; import { GLOBAL_AGENTS_SID } from "@app/lib/assistant"; -import { Authenticator, prodAPICredentialsForOwner } from "@app/lib/auth"; +import type { Authenticator} from "@app/lib/auth"; +import { prodAPICredentialsForOwner } from "@app/lib/auth"; import { GlobalAgentSettings } from "@app/lib/models/assistant/agent"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/assistant/pubsub.ts b/front/lib/api/assistant/pubsub.ts index 56f6470be4c1..bce045a601ac 100644 --- a/front/lib/api/assistant/pubsub.ts +++ b/front/lib/api/assistant/pubsub.ts @@ -1,4 +1,4 @@ -import { +import type { AgentMessageType, ConversationType, GenerationTokensEvent, @@ -7,8 +7,8 @@ import { UserMessageContext, UserMessageType, } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; -import { +import type { Result } from "@dust-tt/types"; +import type { AgentActionEvent, AgentActionSuccessEvent, AgentErrorEvent, @@ -16,15 +16,16 @@ import { AgentGenerationSuccessEvent, AgentMessageSuccessEvent, } from "@dust-tt/types"; -import { +import type { AgentMessageNewEvent, ConversationTitleEvent, UserMessageErrorEvent, UserMessageNewEvent, } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import { rateLimiter } from "@dust-tt/types"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { AgentMessage, Message } from "@app/lib/models"; import { redisClient } from "@app/lib/redis"; import { wakeLock } from "@app/lib/wake_lock"; diff --git a/front/lib/api/assistant/reaction.ts b/front/lib/api/assistant/reaction.ts index 5171cee78b9d..1179abb86905 100644 --- a/front/lib/api/assistant/reaction.ts +++ b/front/lib/api/assistant/reaction.ts @@ -1,12 +1,12 @@ -import { UserType } from "@dust-tt/types"; -import { +import type { UserType } from "@dust-tt/types"; +import type { ConversationMessageReactions, ConversationType, ConversationWithoutContentType, MessageReactionType, } from "@dust-tt/types"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { Message, MessageReaction } from "@app/lib/models"; /** diff --git a/front/lib/api/assistant/recent_authors.ts b/front/lib/api/assistant/recent_authors.ts index d4bb7f4ba771..e9c94c72d421 100644 --- a/front/lib/api/assistant/recent_authors.ts +++ b/front/lib/api/assistant/recent_authors.ts @@ -1,11 +1,11 @@ -import { +import type { AgentRecentAuthors, LightAgentConfigurationType, UserType, } from "@dust-tt/types"; import { Sequelize } from "sequelize"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { AgentConfiguration } from "@app/lib/models"; import { safeRedisClient } from "@app/lib/redis"; diff --git a/front/lib/api/assistant/user_relation.ts b/front/lib/api/assistant/user_relation.ts index b6ada9be7ca6..d86a99680974 100644 --- a/front/lib/api/assistant/user_relation.ts +++ b/front/lib/api/assistant/user_relation.ts @@ -1,14 +1,15 @@ -import { +import type { AgentUserListStatus, + LightAgentConfigurationType, + Result} from "@dust-tt/types"; +import { assertNever, Err, - LightAgentConfigurationType, - Ok, - Result, + Ok } from "@dust-tt/types"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { AgentUserRelation } from "@app/lib/models/assistant/agent"; export function agentUserListStatus({ diff --git a/front/lib/api/data_sources.ts b/front/lib/api/data_sources.ts index 18952115e72e..189c4356f8cd 100644 --- a/front/lib/api/data_sources.ts +++ b/front/lib/api/data_sources.ts @@ -1,17 +1,18 @@ -import { +import type { APIError, ConnectorProvider, + DataSourceType, + Result} from "@dust-tt/types"; +import { ConnectorsAPI, CoreAPI, - DataSourceType, Err, - Ok, - Result, + Ok } from "@dust-tt/types"; import { Op } from "sequelize"; import { getMembers } from "@app/lib/api/workspace"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { sendGithubDeletionEmail } from "@app/lib/email"; import { DataSource } from "@app/lib/models"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/datasets.ts b/front/lib/api/datasets.ts index e1cb6ea9f03a..0284f37b2af0 100644 --- a/front/lib/api/datasets.ts +++ b/front/lib/api/datasets.ts @@ -1,8 +1,8 @@ -import { AppType } from "@dust-tt/types"; -import { DatasetSchema, DatasetType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { DatasetSchema, DatasetType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { Dataset } from "@app/lib/models"; import logger from "@app/logger/logger"; diff --git a/front/lib/api/extract.ts b/front/lib/api/extract.ts index fad12f694ddf..99e7431435ce 100644 --- a/front/lib/api/extract.ts +++ b/front/lib/api/extract.ts @@ -1,8 +1,8 @@ -import { ModelId } from "@dust-tt/types"; -import { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; +import type { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; import { Op } from "sequelize"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { isDevelopmentOrDustWorkspace } from "@app/lib/development"; import { sortedEventProperties } from "@app/lib/extract_events_properties"; import { EventSchema, ExtractedEvent } from "@app/lib/models"; diff --git a/front/lib/api/run.ts b/front/lib/api/run.ts index d093747fd54a..deb4aeb097da 100644 --- a/front/lib/api/run.ts +++ b/front/lib/api/run.ts @@ -1,11 +1,11 @@ -import { AppType, SpecificationType } from "@dust-tt/types"; -import { RunConfig, RunType } from "@dust-tt/types"; +import type { AppType, SpecificationType } from "@dust-tt/types"; +import type { RunConfig, RunType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; import fs from "fs"; import path from "path"; import peg from "pegjs"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import logger from "@app/logger/logger"; import { recomputeIndents, restoreTripleBackticks } from "../specification"; diff --git a/front/lib/api/user.ts b/front/lib/api/user.ts index dc2094662f2d..3efcf5e7e187 100644 --- a/front/lib/api/user.ts +++ b/front/lib/api/user.ts @@ -1,4 +1,4 @@ -import { UserMetadataType, UserType } from "@dust-tt/types"; +import type { UserMetadataType, UserType } from "@dust-tt/types"; import { User, UserMetadata } from "@app/lib/models"; diff --git a/front/lib/api/workspace.ts b/front/lib/api/workspace.ts index 0cdcd8046a69..5ce53a42abf9 100644 --- a/front/lib/api/workspace.ts +++ b/front/lib/api/workspace.ts @@ -1,12 +1,12 @@ -import { +import type { RoleType, UserType, WorkspaceSegmentationType, WorkspaceType, } from "@dust-tt/types"; -import { MembershipInvitationType } from "@dust-tt/types"; +import type { MembershipInvitationType } from "@dust-tt/types"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { Membership, MembershipInvitation, diff --git a/front/lib/assistant.ts b/front/lib/assistant.ts index 23d32e58e52b..6e490d2bc82b 100644 --- a/front/lib/assistant.ts +++ b/front/lib/assistant.ts @@ -1,5 +1,6 @@ -import { LightAgentConfigurationType } from "@dust-tt/types"; -import { SUPPORTED_MODEL_CONFIGS, SupportedModel } from "@dust-tt/types"; +import type { LightAgentConfigurationType } from "@dust-tt/types"; +import type { SupportedModel } from "@dust-tt/types"; +import { SUPPORTED_MODEL_CONFIGS } from "@dust-tt/types"; export function isLargeModel(model: unknown): model is SupportedModel { const maybeSupportedModel = model as SupportedModel; diff --git a/front/lib/auth.ts b/front/lib/auth.ts index 470c63b8ae58..661263a00356 100644 --- a/front/lib/auth.ts +++ b/front/lib/auth.ts @@ -1,9 +1,10 @@ -import { RoleType, UserType, WorkspaceType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; -import { DustAPICredentials } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; -import { APIErrorWithStatusCode } from "@dust-tt/types"; -import { +import type { RoleType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { DustAPICredentials } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import type { APIErrorWithStatusCode } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; +import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse, @@ -19,7 +20,8 @@ import { User, Workspace, } from "@app/lib/models"; -import { FREE_TEST_PLAN_DATA, PlanAttributes } from "@app/lib/plans/free_plans"; +import type { PlanAttributes } from "@app/lib/plans/free_plans"; +import { FREE_TEST_PLAN_DATA } from "@app/lib/plans/free_plans"; import { new_id } from "@app/lib/utils"; import logger from "@app/logger/logger"; import { authOptions } from "@app/pages/api/auth/[...nextauth]"; diff --git a/front/lib/client/handle_file_upload.ts b/front/lib/client/handle_file_upload.ts index 181bce296977..2bee80cfd7af 100644 --- a/front/lib/client/handle_file_upload.ts +++ b/front/lib/client/handle_file_upload.ts @@ -1,4 +1,5 @@ -import { Err, Ok, Result } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; // @ts-expect-error: type package doesn't load properly because of how we are loading pdfjs import * as PDFJS from "pdfjs-dist/build/pdf"; PDFJS.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${PDFJS.version}/pdf.worker.min.js`; diff --git a/front/lib/config.ts b/front/lib/config.ts index d1fa28e78f14..5bb805622934 100644 --- a/front/lib/config.ts +++ b/front/lib/config.ts @@ -1,4 +1,4 @@ -import { BlockRunConfig, SpecificationType } from "@dust-tt/types"; +import type { BlockRunConfig, SpecificationType } from "@dust-tt/types"; export function extractConfig(spec: SpecificationType): BlockRunConfig { const c = {} as { [key: string]: any }; diff --git a/front/lib/connector_connection_id.ts b/front/lib/connector_connection_id.ts index d0afbd95e890..65044ca5a557 100644 --- a/front/lib/connector_connection_id.ts +++ b/front/lib/connector_connection_id.ts @@ -1,4 +1,4 @@ -import { ConnectorProvider } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; import { client_side_new_id } from "@app/lib/utils"; diff --git a/front/lib/connector_providers.ts b/front/lib/connector_providers.ts index 89f033d44447..b1e6f8fc970a 100644 --- a/front/lib/connector_providers.ts +++ b/front/lib/connector_providers.ts @@ -6,7 +6,7 @@ import { NotionLogo, SlackLogo, } from "@dust-tt/sparkle"; -import { ConnectorProvider } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; export const CONNECTOR_CONFIGURATIONS: Record< ConnectorProvider, diff --git a/front/lib/data_sources.ts b/front/lib/data_sources.ts index 6382892ef532..867d6b751301 100644 --- a/front/lib/data_sources.ts +++ b/front/lib/data_sources.ts @@ -1,4 +1,4 @@ -import { CoreAPIDocument } from "@dust-tt/types"; +import type { CoreAPIDocument } from "@dust-tt/types"; export function getDisplayNameForDocument(document: CoreAPIDocument): string { const titleTagPrefix = "title:"; diff --git a/front/lib/datasets.ts b/front/lib/datasets.ts index 516a7624a814..d4cab7adc7ae 100644 --- a/front/lib/datasets.ts +++ b/front/lib/datasets.ts @@ -1,4 +1,4 @@ -import { DatasetEntry, DatasetSchema } from "@dust-tt/types"; +import type { DatasetEntry, DatasetSchema } from "@dust-tt/types"; function areSetsEqual(a: Set, b: Set): boolean { if (a.size !== b.size) { diff --git a/front/lib/development.ts b/front/lib/development.ts index 6de186e8e192..41c1b8e8950d 100644 --- a/front/lib/development.ts +++ b/front/lib/development.ts @@ -1,4 +1,4 @@ -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; const PRODUCTION_DUST_WORKSPACE_ID = "0ec9852c2f"; const PRODUCTION_DUST_APPS_WORKSPACE_ID = "78bda07b39"; diff --git a/front/lib/diff.ts b/front/lib/diff.ts index 444519262c95..0f2a1777567c 100644 --- a/front/lib/diff.ts +++ b/front/lib/diff.ts @@ -1,4 +1,4 @@ -import { Diff } from "@dust-tt/types"; +import type { Diff } from "@dust-tt/types"; import diff from "fast-diff"; export function diffStrings(text1: string, text2: string): Diff[] { diff --git a/front/lib/email.ts b/front/lib/email.ts index f2f1e0f86d30..0cc4995876e6 100644 --- a/front/lib/email.ts +++ b/front/lib/email.ts @@ -4,7 +4,7 @@ */ import sgMail from "@sendgrid/mail"; -import { XP1User } from "@app/lib/models"; +import type { XP1User } from "@app/lib/models"; import logger from "@app/logger/logger"; const { SENDGRID_API_KEY = "", XP1_CHROME_WEB_STORE_URL } = process.env; diff --git a/front/lib/extract_event_app.ts b/front/lib/extract_event_app.ts index 8d31a83a7340..5059a9a5619a 100644 --- a/front/lib/extract_event_app.ts +++ b/front/lib/extract_event_app.ts @@ -1,12 +1,13 @@ -import { +import type { EventSchemaType, ExtractEventAppResponseResults, } from "@dust-tt/types"; +import type { CoreAPITokenType } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; -import { CoreAPI, CoreAPITokenType } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; import { runAction } from "@app/lib/actions/server"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { findMarkersIndexes } from "@app/lib/extract_event_markers"; import { formatPropertiesForModel } from "@app/lib/extract_events_properties"; import logger from "@app/logger/logger"; diff --git a/front/lib/extract_event_markers.ts b/front/lib/extract_event_markers.ts index afdfaa2def41..19b09c043821 100644 --- a/front/lib/extract_event_markers.ts +++ b/front/lib/extract_event_markers.ts @@ -1,4 +1,4 @@ -import { CoreAPITokenType } from "@dust-tt/types"; +import type { CoreAPITokenType } from "@dust-tt/types"; import { Op } from "sequelize"; import { ExtractedEvent } from "@app/lib/models"; diff --git a/front/lib/extract_events.ts b/front/lib/extract_events.ts index 66a23cf61e4a..b04be3a8186a 100644 --- a/front/lib/extract_events.ts +++ b/front/lib/extract_events.ts @@ -1,11 +1,11 @@ import { Op } from "sequelize"; -import { +import type { DocumentsPostProcessHookFilterParams, DocumentsPostProcessHookOnUpsertParams, } from "@app/documents_post_process_hooks/hooks"; import { getDatasource } from "@app/documents_post_process_hooks/hooks/lib/data_source_helpers"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { _getMaxTextContentToProcess, _runExtractEventApp, diff --git a/front/lib/extract_events_properties.ts b/front/lib/extract_events_properties.ts index 324ca55850fb..2b9ed9b460a1 100644 --- a/front/lib/extract_events_properties.ts +++ b/front/lib/extract_events_properties.ts @@ -1,8 +1,9 @@ -import { +import type { EventSchemaPropertiesTypeForModel, - eventSchemaPropertyAllTypes, EventSchemaPropertyType, - ExtractedEventPropertyType, + ExtractedEventPropertyType} from "@dust-tt/types"; +import { + eventSchemaPropertyAllTypes } from "@dust-tt/types"; /** diff --git a/front/lib/http_utils.ts b/front/lib/http_utils.ts index fa27ba75a382..1b69f47ea29f 100644 --- a/front/lib/http_utils.ts +++ b/front/lib/http_utils.ts @@ -1,5 +1,7 @@ -import { Err, Ok, Result } from "@dust-tt/types"; -import Ajv, { JSONSchemaType } from "ajv"; +import type { Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; +import type { JSONSchemaType } from "ajv"; +import Ajv from "ajv"; const ajv = new Ajv({ coerceTypes: true, diff --git a/front/lib/models/apps.ts b/front/lib/models/apps.ts index 5f4f0981c532..f601f160b8be 100644 --- a/front/lib/models/apps.ts +++ b/front/lib/models/apps.ts @@ -1,12 +1,13 @@ -import { DatasetSchema } from "@dust-tt/types"; -import { +import type { DatasetSchema } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/assistant/actions/database_query.ts b/front/lib/models/assistant/actions/database_query.ts index a4fa2b0d630f..c08483a0557d 100644 --- a/front/lib/models/assistant/actions/database_query.ts +++ b/front/lib/models/assistant/actions/database_query.ts @@ -1,8 +1,9 @@ -import { +import type { CreationOptional, - DataTypes, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/models/assistant/actions/dust_app_run.ts b/front/lib/models/assistant/actions/dust_app_run.ts index bec77f388d41..c885776d34bb 100644 --- a/front/lib/models/assistant/actions/dust_app_run.ts +++ b/front/lib/models/assistant/actions/dust_app_run.ts @@ -1,9 +1,10 @@ -import { DustAppParameters } from "@dust-tt/types"; -import { +import type { DustAppParameters } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/models/assistant/actions/retrieval.ts b/front/lib/models/assistant/actions/retrieval.ts index c6119e7d59b0..393964203b92 100644 --- a/front/lib/models/assistant/actions/retrieval.ts +++ b/front/lib/models/assistant/actions/retrieval.ts @@ -1,12 +1,13 @@ -import { TimeframeUnit } from "@dust-tt/types"; -import { +import type { TimeframeUnit } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/assistant/agent.ts b/front/lib/models/assistant/agent.ts index d44c4a91a6ea..783b260227ba 100644 --- a/front/lib/models/assistant/agent.ts +++ b/front/lib/models/assistant/agent.ts @@ -1,20 +1,21 @@ -import { +import type { AgentUserListStatus, DustAppRunConfigurationType, } from "@dust-tt/types"; -import { +import type { AgentConfigurationScope, AgentStatus, GlobalAgentStatus, } from "@dust-tt/types"; -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/assistant/conversation.ts b/front/lib/models/assistant/conversation.ts index 179e45e585df..07a433d97bbf 100644 --- a/front/lib/models/assistant/conversation.ts +++ b/front/lib/models/assistant/conversation.ts @@ -1,18 +1,19 @@ -import { +import type { AgentMessageStatus, ContentFragmentContentType, ConversationVisibility, MessageVisibility, ParticipantActionType, } from "@dust-tt/types"; -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/data_source.ts b/front/lib/models/data_source.ts index 851dc77abc80..2f8c9370c0a5 100644 --- a/front/lib/models/data_source.ts +++ b/front/lib/models/data_source.ts @@ -1,12 +1,13 @@ -import { ConnectorProvider } from "@dust-tt/types"; -import { +import type { ConnectorProvider } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/doc_tracker.ts b/front/lib/models/doc_tracker.ts index 85c7706a1b76..d2357b4f8179 100644 --- a/front/lib/models/doc_tracker.ts +++ b/front/lib/models/doc_tracker.ts @@ -1,9 +1,10 @@ -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/models/extract.ts b/front/lib/models/extract.ts index 5cf6fba3639b..a611a85aa762 100644 --- a/front/lib/models/extract.ts +++ b/front/lib/models/extract.ts @@ -1,10 +1,11 @@ -import { EventSchemaPropertyType, EventSchemaStatus } from "@dust-tt/types"; -import { +import type { EventSchemaPropertyType, EventSchemaStatus } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/models/plan.ts b/front/lib/models/plan.ts index 28804fa516dd..ee321221c2d5 100644 --- a/front/lib/models/plan.ts +++ b/front/lib/models/plan.ts @@ -1,20 +1,22 @@ +import type { + FreeBillingType, + PaidBillingType, + SubscriptionStatusType} from "@dust-tt/types"; import { FREE_BILLING_TYPES, - FreeBillingType, PAID_BILLING_TYPES, - PaidBillingType, - SUBSCRIPTION_STATUSES, - SubscriptionStatusType, + SUBSCRIPTION_STATUSES } from "@dust-tt/types"; -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, NonAttribute, - Transaction, + Transaction} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/user.ts b/front/lib/models/user.ts index a3c5e758e7cc..bc437041411d 100644 --- a/front/lib/models/user.ts +++ b/front/lib/models/user.ts @@ -1,9 +1,10 @@ -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/models/workspace.ts b/front/lib/models/workspace.ts index b975425cee46..2956a23f89c7 100644 --- a/front/lib/models/workspace.ts +++ b/front/lib/models/workspace.ts @@ -1,16 +1,17 @@ -import { WorkspaceSegmentationType } from "@dust-tt/types"; -import { +import type { WorkspaceSegmentationType } from "@dust-tt/types"; +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, InferCreationAttributes, - Model, - NonAttribute, + NonAttribute} from "sequelize"; +import { + DataTypes, + Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; -import { Subscription } from "@app/lib/models/plan"; +import type { Subscription } from "@app/lib/models/plan"; import { User } from "@app/lib/models/user"; export class Workspace extends Model< diff --git a/front/lib/models/xp1.ts b/front/lib/models/xp1.ts index 6cd61f398b15..6f11dd00fd4b 100644 --- a/front/lib/models/xp1.ts +++ b/front/lib/models/xp1.ts @@ -1,9 +1,10 @@ -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/front/lib/plans/enterprise_plans.ts b/front/lib/plans/enterprise_plans.ts index 746a7cb36852..2bb1155af6be 100644 --- a/front/lib/plans/enterprise_plans.ts +++ b/front/lib/plans/enterprise_plans.ts @@ -1,6 +1,6 @@ -import { Attributes } from "sequelize"; +import type { Attributes } from "sequelize"; -import { Plan } from "@app/lib/models"; +import type { Plan } from "@app/lib/models"; import { ENT_PLAN_FAKE_CODE } from "@app/lib/plans/plan_codes"; export type PlanAttributes = Omit< diff --git a/front/lib/plans/free_plans.ts b/front/lib/plans/free_plans.ts index 90c62b5a3bc5..58cec64e0cd8 100644 --- a/front/lib/plans/free_plans.ts +++ b/front/lib/plans/free_plans.ts @@ -1,4 +1,4 @@ -import { Attributes } from "sequelize"; +import type { Attributes } from "sequelize"; import { Plan } from "@app/lib/models"; import { diff --git a/front/lib/plans/pro_plans.ts b/front/lib/plans/pro_plans.ts index 5401c98b4e04..8c961ef92f4a 100644 --- a/front/lib/plans/pro_plans.ts +++ b/front/lib/plans/pro_plans.ts @@ -1,4 +1,4 @@ -import { Attributes } from "sequelize"; +import type { Attributes } from "sequelize"; import { isDevelopment } from "@app/lib/development"; import { Plan } from "@app/lib/models"; diff --git a/front/lib/plans/stripe.ts b/front/lib/plans/stripe.ts index 10d13b35df19..00aff50812bf 100644 --- a/front/lib/plans/stripe.ts +++ b/front/lib/plans/stripe.ts @@ -1,8 +1,9 @@ -import { assertNever, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; import Stripe from "stripe"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { Plan } from "@app/lib/models"; import { countActiveSeatsInWorkspace } from "@app/lib/plans/workspace_usage"; diff --git a/front/lib/plans/subscription.ts b/front/lib/plans/subscription.ts index b831a3ecafa0..e60e81669a2a 100644 --- a/front/lib/plans/subscription.ts +++ b/front/lib/plans/subscription.ts @@ -1,12 +1,13 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; import { v4 as uuidv4 } from "uuid"; -import { Authenticator } from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { front_sequelize } from "@app/lib/databases"; import { Plan, Subscription, Workspace } from "@app/lib/models"; import { PlanInvitation } from "@app/lib/models/plan"; -import { FREE_TEST_PLAN_DATA, PlanAttributes } from "@app/lib/plans/free_plans"; +import type { PlanAttributes } from "@app/lib/plans/free_plans"; +import { FREE_TEST_PLAN_DATA } from "@app/lib/plans/free_plans"; import { FREE_TEST_PLAN_CODE, FREE_UPGRADED_PLAN_CODE, diff --git a/front/lib/plans/workspace_usage.ts b/front/lib/plans/workspace_usage.ts index 5871214f917e..f146a90657fa 100644 --- a/front/lib/plans/workspace_usage.ts +++ b/front/lib/plans/workspace_usage.ts @@ -1,4 +1,4 @@ -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { Op, QueryTypes } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/providers.ts b/front/lib/providers.ts index eb352a884339..e47276838996 100644 --- a/front/lib/providers.ts +++ b/front/lib/providers.ts @@ -1,8 +1,8 @@ -import { WorkspaceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; -import { GetProvidersCheckResponseBody } from "@app/pages/api/w/[wId]/providers/[pId]/check"; +import type { GetProvidersCheckResponseBody } from "@app/pages/api/w/[wId]/providers/[pId]/check"; -import { useProviders } from "./swr"; +import type { useProviders } from "./swr"; type ModelProvider = { providerId: string; diff --git a/front/lib/specification.ts b/front/lib/specification.ts index 7afddcdf636d..bbd9daa98ae6 100644 --- a/front/lib/specification.ts +++ b/front/lib/specification.ts @@ -1,5 +1,5 @@ -import { SpecificationType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; +import type { SpecificationType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; export function recomputeIndents(spec: SpecificationType): SpecificationType { let indent = 0; diff --git a/front/lib/swr.ts b/front/lib/swr.ts index 41806741b517..67c9ea41fa2e 100644 --- a/front/lib/swr.ts +++ b/front/lib/swr.ts @@ -1,36 +1,37 @@ -import { +import type { AgentConfigurationType, AgentsGetViewType, DataSourceType, } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; -import { ConversationMessageReactions, ConversationType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { RunRunType } from "@dust-tt/types"; -import { ConnectorPermission } from "@dust-tt/types"; -import useSWR, { Fetcher } from "swr"; - -import { GetPokePlansResponseBody } from "@app/pages/api/poke/plans"; -import { GetWorkspacesResponseBody } from "@app/pages/api/poke/workspaces"; -import { GetUserMetadataResponseBody } from "@app/pages/api/user/metadata/[key]"; -import { ListTablesResponseBody } from "@app/pages/api/v1/w/[wId]/data_sources/[name]/tables"; -import { GetDatasetsResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/datasets"; -import { GetRunsResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs"; -import { GetRunBlockResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]"; -import { GetRunStatusResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status"; -import { GetAgentConfigurationsResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations"; -import { GetAgentUsageResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage"; -import { GetDataSourcesResponseBody } from "@app/pages/api/w/[wId]/data_sources"; -import { GetDocumentsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/documents"; -import { GetOrPostBotEnabledResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled"; -import { GetDataSourcePermissionsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/permissions"; -import { GetSlackChannelsLinkedWithAgentResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent"; -import { GetWorkspaceInvitationsResponseBody } from "@app/pages/api/w/[wId]/invitations"; -import { GetKeysResponseBody } from "@app/pages/api/w/[wId]/keys"; -import { GetMembersResponseBody } from "@app/pages/api/w/[wId]/members"; -import { GetProvidersResponseBody } from "@app/pages/api/w/[wId]/providers"; -import { GetExtractedEventsResponseBody } from "@app/pages/api/w/[wId]/use/extract/events/[sId]"; -import { GetEventSchemasResponseBody } from "@app/pages/api/w/[wId]/use/extract/templates"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ConversationMessageReactions, ConversationType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { RunRunType } from "@dust-tt/types"; +import type { ConnectorPermission } from "@dust-tt/types"; +import type { Fetcher } from "swr"; +import useSWR from "swr"; + +import type { GetPokePlansResponseBody } from "@app/pages/api/poke/plans"; +import type { GetWorkspacesResponseBody } from "@app/pages/api/poke/workspaces"; +import type { GetUserMetadataResponseBody } from "@app/pages/api/user/metadata/[key]"; +import type { ListTablesResponseBody } from "@app/pages/api/v1/w/[wId]/data_sources/[name]/tables"; +import type { GetDatasetsResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/datasets"; +import type { GetRunsResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs"; +import type { GetRunBlockResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]"; +import type { GetRunStatusResponseBody } from "@app/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status"; +import type { GetAgentConfigurationsResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations"; +import type { GetAgentUsageResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage"; +import type { GetDataSourcesResponseBody } from "@app/pages/api/w/[wId]/data_sources"; +import type { GetDocumentsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/documents"; +import type { GetOrPostBotEnabledResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled"; +import type { GetDataSourcePermissionsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/permissions"; +import type { GetSlackChannelsLinkedWithAgentResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent"; +import type { GetWorkspaceInvitationsResponseBody } from "@app/pages/api/w/[wId]/invitations"; +import type { GetKeysResponseBody } from "@app/pages/api/w/[wId]/keys"; +import type { GetMembersResponseBody } from "@app/pages/api/w/[wId]/members"; +import type { GetProvidersResponseBody } from "@app/pages/api/w/[wId]/providers"; +import type { GetExtractedEventsResponseBody } from "@app/pages/api/w/[wId]/use/extract/events/[sId]"; +import type { GetEventSchemasResponseBody } from "@app/pages/api/w/[wId]/use/extract/templates"; export const fetcher = async (...args: Parameters) => fetch(...args).then(async (res) => { diff --git a/front/lib/temporal.ts b/front/lib/temporal.ts index fccbdeabd21d..808febe45a0e 100644 --- a/front/lib/temporal.ts +++ b/front/lib/temporal.ts @@ -1,4 +1,5 @@ -import { Client, Connection, ConnectionOptions } from "@temporalio/client"; +import type { ConnectionOptions } from "@temporalio/client"; +import { Client, Connection } from "@temporalio/client"; import { NativeConnection } from "@temporalio/worker"; import fs from "fs-extra"; diff --git a/front/lib/temporal_monitoring.ts b/front/lib/temporal_monitoring.ts index d470210df218..9040d00c1e20 100644 --- a/front/lib/temporal_monitoring.ts +++ b/front/lib/temporal_monitoring.ts @@ -1,13 +1,13 @@ import { isNangoError } from "@dust-tt/types"; -import { Context } from "@temporalio/activity"; -import { +import type { Context } from "@temporalio/activity"; +import type { ActivityExecuteInput, ActivityInboundCallsInterceptor, Next, } from "@temporalio/worker"; import type { Logger } from "@app/logger/logger"; -import logger from "@app/logger/logger"; +import type logger from "@app/logger/logger"; import { statsDClient } from "@app/logger/withlogging"; /** An Activity Context with an attached logger */ diff --git a/front/lib/user.ts b/front/lib/user.ts index b1d8bf37fc6a..c12562933acf 100644 --- a/front/lib/user.ts +++ b/front/lib/user.ts @@ -1,7 +1,7 @@ -import { UserMetadataType } from "@dust-tt/types"; +import type { UserMetadataType } from "@dust-tt/types"; import { useSWRConfig } from "swr"; -import { GetUserMetadataResponseBody } from "@app/pages/api/user/metadata/[key]"; +import type { GetUserMetadataResponseBody } from "@app/pages/api/user/metadata/[key]"; /** * Client-side: retrieves a metadata value for the current user. See also `useUserMetadata` for an diff --git a/front/lib/utils.ts b/front/lib/utils.ts index 288edfc4ab1b..b4d9ca3f91c6 100644 --- a/front/lib/utils.ts +++ b/front/lib/utils.ts @@ -1,4 +1,4 @@ -import { LightAgentConfigurationType } from "@dust-tt/types"; +import type { LightAgentConfigurationType } from "@dust-tt/types"; import { hash as blake3 } from "blake3"; import { v4 as uuidv4 } from "uuid"; diff --git a/front/pages/_app.tsx b/front/pages/_app.tsx index 116a2f75c295..03633bc3021f 100644 --- a/front/pages/_app.tsx +++ b/front/pages/_app.tsx @@ -1,10 +1,10 @@ import "@app/styles/global.css"; import { SparkleContext } from "@dust-tt/sparkle"; -import { AppProps } from "next/app"; +import type { AppProps } from "next/app"; import Link from "next/link"; import { SessionProvider } from "next-auth/react"; -import { MouseEvent, ReactNode } from "react"; +import type { MouseEvent, ReactNode } from "react"; import { NotificationArea } from "@app/components/sparkle/Notification"; diff --git a/front/pages/api/[preStopSecret]/prestop.ts b/front/pages/api/[preStopSecret]/prestop.ts index c309a079fc1c..2149f63d5c21 100644 --- a/front/pages/api/[preStopSecret]/prestop.ts +++ b/front/pages/api/[preStopSecret]/prestop.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { wakeLockIsFree } from "@app/lib/wake_lock"; import logger from "@app/logger/logger"; diff --git a/front/pages/api/login.ts b/front/pages/api/login.ts index 08c35a88f4a4..e57497f73609 100644 --- a/front/pages/api/login.ts +++ b/front/pages/api/login.ts @@ -1,6 +1,6 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { verify } from "jsonwebtoken"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/api/poke/plans.ts b/front/pages/api/poke/plans.ts index 675613cdcc8d..a914545a3111 100644 --- a/front/pages/api/poke/plans.ts +++ b/front/pages/api/poke/plans.ts @@ -1,9 +1,9 @@ -import { PlanType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { PlanType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import Stripe from "stripe"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/poke/workspaces/[wId]/agent_configurations/[aId]/index.ts b/front/pages/api/poke/workspaces/[wId]/agent_configurations/[aId]/index.ts index b38449839203..da53d94b475b 100644 --- a/front/pages/api/poke/workspaces/[wId]/agent_configurations/[aId]/index.ts +++ b/front/pages/api/poke/workspaces/[wId]/agent_configurations/[aId]/index.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { archiveAgentConfiguration, diff --git a/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/config.ts b/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/config.ts index 4025fa3762c8..7b647cfd4e12 100644 --- a/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/config.ts +++ b/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/config.ts @@ -1,6 +1,6 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { DataSource } from "@app/lib/models"; diff --git a/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/index.ts b/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/index.ts index b3257005a374..cdefa202c093 100644 --- a/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/index.ts +++ b/front/pages/api/poke/workspaces/[wId]/data_sources/[name]/index.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { deleteDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/poke/workspaces/[wId]/downgrade.ts b/front/pages/api/poke/workspaces/[wId]/downgrade.ts index 8167e17c89bd..e44d2f677467 100644 --- a/front/pages/api/poke/workspaces/[wId]/downgrade.ts +++ b/front/pages/api/poke/workspaces/[wId]/downgrade.ts @@ -1,6 +1,6 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { internalSubscribeWorkspaceToFreeTestPlan } from "@app/lib/plans/subscription"; diff --git a/front/pages/api/poke/workspaces/[wId]/index.ts b/front/pages/api/poke/workspaces/[wId]/index.ts index 07194fdb0b72..2ceeaf49c30f 100644 --- a/front/pages/api/poke/workspaces/[wId]/index.ts +++ b/front/pages/api/poke/workspaces/[wId]/index.ts @@ -1,9 +1,9 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { setInternalWorkspaceSegmentation } from "@app/lib/api/workspace"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/poke/workspaces/[wId]/revoke.ts b/front/pages/api/poke/workspaces/[wId]/revoke.ts index d681645fa131..34f868ac9029 100644 --- a/front/pages/api/poke/workspaces/[wId]/revoke.ts +++ b/front/pages/api/poke/workspaces/[wId]/revoke.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Membership } from "@app/lib/models"; diff --git a/front/pages/api/poke/workspaces/[wId]/upgrade.ts b/front/pages/api/poke/workspaces/[wId]/upgrade.ts index 4b47111902e8..b45f0ea71356 100644 --- a/front/pages/api/poke/workspaces/[wId]/upgrade.ts +++ b/front/pages/api/poke/workspaces/[wId]/upgrade.ts @@ -1,6 +1,6 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { diff --git a/front/pages/api/poke/workspaces/index.ts b/front/pages/api/poke/workspaces/index.ts index 349f146255a8..0590f51c7684 100644 --- a/front/pages/api/poke/workspaces/index.ts +++ b/front/pages/api/poke/workspaces/index.ts @@ -1,7 +1,8 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; -import { FindOptions, Op, WhereOptions } from "sequelize"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; +import type { FindOptions, WhereOptions } from "sequelize"; +import { Op } from "sequelize"; import { Authenticator, getSession } from "@app/lib/auth"; import { Subscription, Workspace } from "@app/lib/models"; diff --git a/front/pages/api/registry/[type]/lookup.ts b/front/pages/api/registry/[type]/lookup.ts index fa6e6e674dfb..08dda21b7ac2 100644 --- a/front/pages/api/registry/[type]/lookup.ts +++ b/front/pages/api/registry/[type]/lookup.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { DataSource, Workspace } from "@app/lib/models"; import { withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/stripe/portal.ts b/front/pages/api/stripe/portal.ts index b866a2699edf..82a417e897a7 100644 --- a/front/pages/api/stripe/portal.ts +++ b/front/pages/api/stripe/portal.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { createCustomerPortalSession } from "@app/lib/plans/stripe"; diff --git a/front/pages/api/stripe/webhook.ts b/front/pages/api/stripe/webhook.ts index d27eb3a36303..fac173526ba4 100644 --- a/front/pages/api/stripe/webhook.ts +++ b/front/pages/api/stripe/webhook.ts @@ -1,9 +1,10 @@ +import type { + ReturnedAPIErrorType} from "@dust-tt/types"; import { CoreAPI, - isRetrievalConfiguration, - ReturnedAPIErrorType, + isRetrievalConfiguration } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { pipeline, Writable } from "stream"; import Stripe from "stripe"; import { promisify } from "util"; diff --git a/front/pages/api/user/index.ts b/front/pages/api/user/index.ts index 0787df94fdbd..a529e3ad5705 100644 --- a/front/pages/api/user/index.ts +++ b/front/pages/api/user/index.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { updateUserFullName } from "@app/lib/api/user"; import { getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/api/user/metadata/[key]/index.ts b/front/pages/api/user/metadata/[key]/index.ts index 4857d8e467fa..15a7356fac89 100644 --- a/front/pages/api/user/metadata/[key]/index.ts +++ b/front/pages/api/user/metadata/[key]/index.ts @@ -1,6 +1,6 @@ -import { UserMetadataType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { UserMetadataType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getUserMetadata, setUserMetadata } from "@app/lib/api/user"; import { getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/api/v1/apps/[user]/[sId]/runs/[runId]/index.ts b/front/pages/api/v1/apps/[user]/[sId]/runs/[runId]/index.ts index b03ae28f6622..10fbef834a9f 100644 --- a/front/pages/api/v1/apps/[user]/[sId]/runs/[runId]/index.ts +++ b/front/pages/api/v1/apps/[user]/[sId]/runs/[runId]/index.ts @@ -1,6 +1,6 @@ -import { RunType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/apps/[user]/[sId]/runs/index.ts b/front/pages/api/v1/apps/[user]/[sId]/runs/index.ts index 0560156ea475..54a2c68b7a37 100644 --- a/front/pages/api/v1/apps/[user]/[sId]/runs/index.ts +++ b/front/pages/api/v1/apps/[user]/[sId]/runs/index.ts @@ -1,6 +1,6 @@ -import { RunType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/apps/[user]/index.ts b/front/pages/api/v1/apps/[user]/index.ts index 1198572648d8..faf5021198d2 100644 --- a/front/pages/api/v1/apps/[user]/index.ts +++ b/front/pages/api/v1/apps/[user]/index.ts @@ -1,6 +1,6 @@ -import { AppType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { AppType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/data_sources/[user]/[name]/documents/[documentId]/index.ts b/front/pages/api/v1/data_sources/[user]/[name]/documents/[documentId]/index.ts index 8e322e1b80e3..80b9f0253620 100644 --- a/front/pages/api/v1/data_sources/[user]/[name]/documents/[documentId]/index.ts +++ b/front/pages/api/v1/data_sources/[user]/[name]/documents/[documentId]/index.ts @@ -1,7 +1,7 @@ -import { DataSourceType } from "@dust-tt/types"; -import { DocumentType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { DataSourceType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/data_sources/[user]/[name]/documents/index.ts b/front/pages/api/v1/data_sources/[user]/[name]/documents/index.ts index 2eb9a79211f0..34dc8f767d24 100644 --- a/front/pages/api/v1/data_sources/[user]/[name]/documents/index.ts +++ b/front/pages/api/v1/data_sources/[user]/[name]/documents/index.ts @@ -1,6 +1,6 @@ -import { DocumentType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/data_sources/[user]/[name]/search.ts b/front/pages/api/v1/data_sources/[user]/[name]/search.ts index f167dbf246f1..e3aeaf448c8f 100644 --- a/front/pages/api/v1/data_sources/[user]/[name]/search.ts +++ b/front/pages/api/v1/data_sources/[user]/[name]/search.ts @@ -1,6 +1,6 @@ -import { DocumentType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import logger from "@app/logger/logger"; import { apiError, statsDClient, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/v1/w/[wId]/apps/[aId]/runs/[runId]/index.ts b/front/pages/api/v1/w/[wId]/apps/[aId]/runs/[runId]/index.ts index 377368ab58fb..121e1c8fd230 100644 --- a/front/pages/api/v1/w/[wId]/apps/[aId]/runs/[runId]/index.ts +++ b/front/pages/api/v1/w/[wId]/apps/[aId]/runs/[runId]/index.ts @@ -1,7 +1,7 @@ -import { RunType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/apps/[aId]/runs/index.ts b/front/pages/api/v1/w/[wId]/apps/[aId]/runs/index.ts index 290e9d40ac29..354c9b373a4e 100644 --- a/front/pages/api/v1/w/[wId]/apps/[aId]/runs/index.ts +++ b/front/pages/api/v1/w/[wId]/apps/[aId]/runs/index.ts @@ -1,12 +1,12 @@ -import { CredentialsType } from "@dust-tt/types"; -import { RunType } from "@dust-tt/types"; +import type { CredentialsType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { credentialsFromProviders, dustManagedCredentials, } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/apps/index.ts b/front/pages/api/v1/w/[wId]/apps/index.ts index 822b66140217..a9cb19ba1652 100644 --- a/front/pages/api/v1/w/[wId]/apps/index.ts +++ b/front/pages/api/v1/w/[wId]/apps/index.ts @@ -1,6 +1,6 @@ -import { AppType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { AppType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApps } from "@app/lib/api/app"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/assistant/agent_configurations.ts b/front/pages/api/v1/w/[wId]/assistant/agent_configurations.ts index 5166924994a2..7111ed251863 100644 --- a/front/pages/api/v1/w/[wId]/assistant/agent_configurations.ts +++ b/front/pages/api/v1/w/[wId]/assistant/agent_configurations.ts @@ -1,10 +1,10 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentConfigurations } from "@app/lib/api/assistant/configuration"; import { Authenticator, getAPIKey } from "@app/lib/auth"; import { apiError, withLogging } from "@app/logger/withlogging"; -import { GetAgentConfigurationsResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations"; +import type { GetAgentConfigurationsResponseBody } from "@app/pages/api/w/[wId]/assistant/agent_configurations"; async function handler( req: NextApiRequest, diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/content_fragments.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/content_fragments.ts index 1adfab6db347..f6757fcf1789 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/content_fragments.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/content_fragments.ts @@ -1,10 +1,10 @@ +import type { ContentFragmentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { PublicPostContentFragmentRequestBodySchema } from "@dust-tt/types"; -import { ContentFragmentType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; -import * as t from "io-ts"; +import type * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation, diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/events.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/events.ts index 136048856d66..8aa1e5ec174c 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/events.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/events.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationWithoutContent } from "@app/lib/api/assistant/conversation"; import { getConversationEvents } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/index.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/index.ts index dc6b73c80042..341cbbeb1c6e 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/index.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/index.ts @@ -1,6 +1,6 @@ -import { ConversationType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ConversationType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation } from "@app/lib/api/assistant/conversation"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts index 894b98f6c5c9..8793f91d3c5c 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationMessageType, diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/index.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/index.ts index 01b4fa4b9975..b7e696aa6956 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/index.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/index.ts @@ -1,9 +1,9 @@ +import type { UserMessageType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { PublicPostMessagesRequestBodySchema } from "@dust-tt/types"; -import { UserMessageType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation } from "@app/lib/api/assistant/conversation"; import { postUserMessageWithPubSub } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts index 208de1b42abc..1913e9e898ef 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts @@ -1,13 +1,13 @@ -import { PublicPostConversationsRequestBodySchema } from "@dust-tt/types"; -import { +import type { ContentFragmentType, ConversationType, UserMessageType, } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { PublicPostConversationsRequestBodySchema } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { createConversation, diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts index 5b6df7e0dc4d..4f2b9b6a6264 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts @@ -1,16 +1,17 @@ -import { +import type { CoreAPILightDocument, - DataSourceType, + DataSourceType} from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { PostDataSourceDocumentRequestBodySchema, sectionFullText, } from "@dust-tt/types"; -import { DocumentType } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDocumentsPostDeleteHooksToRun, diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/parents.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/parents.ts index 2de561963f28..b958b6314b9d 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/parents.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/parents.ts @@ -1,6 +1,6 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/index.ts index 9519c8c18854..7c35e28f3803 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/index.ts @@ -1,7 +1,7 @@ -import { DocumentType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/search.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/search.ts index b382636bd098..302bda81b984 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/search.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/search.ts @@ -1,13 +1,13 @@ -import { DocumentType } from "@dust-tt/types"; -import { CredentialsType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { CredentialsType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { credentialsFromProviders, dustManagedCredentials, } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { JSONSchemaType } from "ajv"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { JSONSchemaType } from "ajv"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/index.ts index 8c68d990b5ac..f9c616a5f038 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/index.ts @@ -1,5 +1,6 @@ -import { CoreAPI, CoreAPITable } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { CoreAPITable } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/[rId].ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/[rId].ts index 983aa877acbd..3a1cab6f3b6e 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/[rId].ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/[rId].ts @@ -1,5 +1,6 @@ -import { CoreAPI, CoreAPIRow } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { CoreAPIRow } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/index.ts index 638a10453ed3..8dee81e6e5d7 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/[tId]/rows/index.ts @@ -1,8 +1,9 @@ -import { CoreAPI, CoreAPIRow } from "@dust-tt/types"; +import type { CoreAPIRow } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/index.ts index d97087d7ef97..b35a30a49a1f 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/tables/index.ts @@ -1,8 +1,9 @@ -import { CoreAPI, CoreAPITable } from "@dust-tt/types"; +import type { CoreAPITable } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/tokenize.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/tokenize.ts index a1b49186245b..5964d3f399dd 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/tokenize.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/tokenize.ts @@ -1,10 +1,10 @@ -import { CoreAPITokenType } from "@dust-tt/types"; +import type { CoreAPITokenType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/v1/w/[wId]/data_sources/index.ts b/front/pages/api/v1/w/[wId]/data_sources/index.ts index 4a545e82d933..50e0192563a7 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/index.ts @@ -1,6 +1,6 @@ -import { DataSourceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { DataSourceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSources } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/clone.ts b/front/pages/api/w/[wId]/apps/[aId]/clone.ts index 6f54bc845103..7836d755a273 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/clone.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/clone.ts @@ -1,7 +1,7 @@ -import { AppType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { getDatasets } from "@app/lib/api/datasets"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/datasets/[name]/index.ts b/front/pages/api/w/[wId]/apps/[aId]/datasets/[name]/index.ts index 4dda8d746907..14b898c49fc5 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/datasets/[name]/index.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/datasets/[name]/index.ts @@ -1,9 +1,9 @@ -import { DatasetType } from "@dust-tt/types"; +import type { DatasetType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/datasets/index.ts b/front/pages/api/w/[wId]/apps/[aId]/datasets/index.ts index 762aec9f12d4..74ec161d58a8 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/datasets/index.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/datasets/index.ts @@ -1,10 +1,10 @@ -import { DatasetType } from "@dust-tt/types"; +import type { DatasetType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { getDatasets } from "@app/lib/api/datasets"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/index.ts b/front/pages/api/w/[wId]/apps/[aId]/index.ts index a4bd63213b4d..dca98f43b0dc 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/index.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/index.ts @@ -1,6 +1,6 @@ -import { AppType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { AppType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Op } from "sequelize"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]/index.ts b/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]/index.ts index c31c2efb9768..3302afc5a009 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]/index.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/blocks/[type]/[name]/index.ts @@ -1,7 +1,7 @@ -import { BlockType, RunType } from "@dust-tt/types"; +import type { BlockType, RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status.ts b/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status.ts index dc6713d14987..955ed5f61710 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/runs/[runId]/status.ts @@ -1,7 +1,7 @@ -import { RunType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/runs/index.ts b/front/pages/api/w/[wId]/apps/[aId]/runs/index.ts index 4dc8ceb8c162..9311b988bc03 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/runs/index.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/runs/index.ts @@ -1,8 +1,8 @@ -import { RunType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { credentialsFromProviders } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getApp } from "@app/lib/api/app"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/[aId]/state.ts b/front/pages/api/w/[wId]/apps/[aId]/state.ts index 8238b33a8f07..5a6dc8efd48f 100644 --- a/front/pages/api/w/[wId]/apps/[aId]/state.ts +++ b/front/pages/api/w/[wId]/apps/[aId]/state.ts @@ -1,5 +1,5 @@ -import { AppType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { AppType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Op } from "sequelize"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/apps/index.ts b/front/pages/api/w/[wId]/apps/index.ts index b9f1596421db..57672150594a 100644 --- a/front/pages/api/w/[wId]/apps/index.ts +++ b/front/pages/api/w/[wId]/apps/index.ts @@ -1,7 +1,7 @@ -import { AppType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { App } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts index a7f120ce41ee..bb91fb679531 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts @@ -1,11 +1,12 @@ +import type { + AgentConfigurationType} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { - AgentConfigurationType, PostOrPatchAgentConfigurationRequestBodySchema, } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { archiveAgentConfiguration, diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/linked_slack_channels.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/linked_slack_channels.ts index d346230f5b81..3b677403032a 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/linked_slack_channels.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/linked_slack_channels.ts @@ -1,9 +1,9 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/scope.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/scope.ts index 8b46d6cf8a26..3dd67ea11782 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/scope.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/scope.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentConfiguration, diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage.ts index cd48c6dae97a..f0c1a1b286d2 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/usage.ts @@ -1,6 +1,6 @@ -import { AgentUsageType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { AgentUsageType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentUsage } from "@app/lib/api/assistant/agent_usage"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/avatar.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/avatar.ts index f48953598508..a82d14ac06dc 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/avatar.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/avatar.ts @@ -1,7 +1,7 @@ import { Storage } from "@google-cloud/storage"; import { IncomingForm } from "formidable"; import fs from "fs"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts index 17db2f2e417b..f2ee52701ae4 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts @@ -1,17 +1,18 @@ -import { +import type { AgentActionConfigurationType, AgentConfigurationType, AgentGenerationConfigurationType, - GetAgentConfigurationsQuerySchema, LightAgentConfigurationType, - PostOrPatchAgentConfigurationRequestBodySchema, - Result, + Result} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { + GetAgentConfigurationsQuerySchema, + PostOrPatchAgentConfigurationRequestBodySchema } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; -import * as t from "io-ts"; +import type * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentUsage } from "@app/lib/api/assistant/agent_usage"; import { diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/name_available.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/name_available.ts index a096da61355d..bb956a5b4cf1 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/name_available.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/name_available.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { agentNameIsAvailable } from "@app/lib/api/assistant/configuration"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/cancel.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/cancel.ts index 7aa86356c3c5..1f90c74246e2 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/cancel.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/cancel.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationWithoutContent } from "@app/lib/api/assistant/conversation"; import { cancelMessageGenerationEvent } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts index 8792f4795c68..eb87e50d22c8 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts @@ -1,12 +1,13 @@ +import type { + ContentFragmentType} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { - ContentFragmentType, InternalPostContentFragmentRequestBodySchema, } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; -import * as t from "io-ts"; +import type * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation, diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/events.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/events.ts index 2516fd62c0b1..0c31e7cca911 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/events.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/events.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationWithoutContent } from "@app/lib/api/assistant/conversation"; import { getConversationEvents } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/index.ts index 4d883893dc71..4610a4cea9cb 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/index.ts @@ -1,9 +1,9 @@ -import { ConversationType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ConversationType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { deleteConversation, diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/edit.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/edit.ts index 1819bd128790..524938700820 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/edit.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/edit.ts @@ -1,9 +1,10 @@ -import { isUserMessageType, UserMessageType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { UserMessageType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { isUserMessageType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation } from "@app/lib/api/assistant/conversation"; import { editUserMessageWithPubSub } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts index 8b19c15e3390..24553c602429 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/events.ts @@ -1,5 +1,5 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationMessageType, diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/reactions/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/reactions/index.ts index 35fc15bcac55..da9d91d0252c 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/reactions/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/reactions/index.ts @@ -1,9 +1,9 @@ -import { MessageReactionType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { MessageReactionType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationWithoutContent } from "@app/lib/api/assistant/conversation"; import { diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts index 46f6488909dc..56e9e3237e57 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts @@ -1,9 +1,10 @@ -import { AgentMessageType, isAgentMessageType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { AgentMessageType} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { isAgentMessageType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation } from "@app/lib/api/assistant/conversation"; import { retryAgentMessageWithPubSub } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts index 508f4e516655..33d81836ff28 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts @@ -1,11 +1,12 @@ +import type { + UserMessageType} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { - InternalPostMessagesRequestBodySchema, - UserMessageType, + InternalPostMessagesRequestBodySchema } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversation } from "@app/lib/api/assistant/conversation"; import { postUserMessageWithPubSub } from "@app/lib/api/assistant/pubsub"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/reactions.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/reactions.ts index cbdb2d93eab0..7eb240ec06d3 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/reactions.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/reactions.ts @@ -1,6 +1,6 @@ -import { ConversationMessageReactions } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ConversationMessageReactions } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getConversationWithoutContent } from "@app/lib/api/assistant/conversation"; import { getMessageReactions } from "@app/lib/api/assistant/reaction"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/index.ts b/front/pages/api/w/[wId]/assistant/conversations/index.ts index 87645bed8f0a..12778490989f 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/index.ts @@ -1,14 +1,15 @@ -import { +import type { ContentFragmentType, ConversationType, ConversationWithoutContentType, - InternalPostConversationsRequestBodySchema, - UserMessageType, + UserMessageType} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { + InternalPostConversationsRequestBodySchema } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { createConversation, diff --git a/front/pages/api/w/[wId]/assistant/global_agents/[aId]/index.ts b/front/pages/api/w/[wId]/assistant/global_agents/[aId]/index.ts index 9988da472908..f3b938e250f9 100644 --- a/front/pages/api/w/[wId]/assistant/global_agents/[aId]/index.ts +++ b/front/pages/api/w/[wId]/assistant/global_agents/[aId]/index.ts @@ -1,8 +1,8 @@ -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { upsertGlobalAgentSettings } from "@app/lib/api/assistant/global_agents"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts index 457f49408ccf..c99c0a209abb 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts @@ -1,15 +1,16 @@ +import type { + CoreAPILightDocument} from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { - CoreAPILightDocument, PostDataSourceDocumentRequestBodySchema, sectionFullText, } from "@dust-tt/types"; -import { DocumentType } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/documents/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/documents/index.ts index 8e2307acd099..6525bcfaeaff 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/documents/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/documents/index.ts @@ -1,6 +1,6 @@ -import { DocumentType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/index.ts index dcb38ed9be76..cb15c5ec0cb8 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/index.ts @@ -1,7 +1,7 @@ -import { DataSourceType } from "@dust-tt/types"; +import type { DataSourceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled.ts index 6e8f8ff12133..e176f5746b19 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/bot_enabled.ts @@ -1,9 +1,9 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/parents.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/parents.ts index b251866ade3e..240003b1cf1c 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/parents.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/parents.ts @@ -1,9 +1,9 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts index c1363ddfd935..6578224a697e 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts @@ -1,14 +1,15 @@ +import type { + ConnectorPermission, + ConnectorResource} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { assertNever, - ConnectorPermission, - ConnectorResource, ConnectorsAPI, } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent.ts index 2cdbff7a5746..0eb81ca2c971 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/slack/channels_linked_with_agent.ts @@ -1,6 +1,6 @@ +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/update.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/update.ts index a0e5fdc39d7a..ce1039805a72 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/update.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/update.ts @@ -1,9 +1,10 @@ -import { ConnectorsAPI, ConnectorsAPIErrorResponse } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { ConnectorsAPIErrorResponse } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { ConnectorsAPI } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/search.ts b/front/pages/api/w/[wId]/data_sources/[name]/search.ts index 6885704ea9a2..c6f01608856b 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/search.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/search.ts @@ -1,8 +1,8 @@ -import { DocumentType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { JSONSchemaType } from "ajv"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { JSONSchemaType } from "ajv"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts index b945b0dd5164..164bbee92cdc 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts @@ -1,11 +1,13 @@ -import { CoreAPI, CoreAPIRow } from "@dust-tt/types"; -import { Err, Ok, Result } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { CoreAPIRow } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; +import { CoreAPI } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import { parse } from "csv-parse"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/tables/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/tables/index.ts index 101959c3acfc..8c734b771557 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/tables/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/tables/index.ts @@ -1,12 +1,12 @@ import { CoreAPI } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; import { isActivatedStructuredDB } from "@app/lib/development"; import logger from "@app/logger/logger"; import { apiError, withLogging } from "@app/logger/withlogging"; -import { ListTablesResponseBody } from "@app/pages/api/v1/w/[wId]/data_sources/[name]/tables"; +import type { ListTablesResponseBody } from "@app/pages/api/v1/w/[wId]/data_sources/[name]/tables"; async function handler( req: NextApiRequest, diff --git a/front/pages/api/w/[wId]/data_sources/index.ts b/front/pages/api/w/[wId]/data_sources/index.ts index f4f59897db2d..a165c8fc4201 100644 --- a/front/pages/api/w/[wId]/data_sources/index.ts +++ b/front/pages/api/w/[wId]/data_sources/index.ts @@ -1,8 +1,8 @@ -import { DataSourceType } from "@dust-tt/types"; +import type { DataSourceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getDataSources } from "@app/lib/api/data_sources"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/data_sources/managed.ts b/front/pages/api/w/[wId]/data_sources/managed.ts index ced0d50b2233..43adb8fbfa16 100644 --- a/front/pages/api/w/[wId]/data_sources/managed.ts +++ b/front/pages/api/w/[wId]/data_sources/managed.ts @@ -1,16 +1,18 @@ +import type { + DataSourceType} from "@dust-tt/types"; +import type { ConnectorType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { assertNever, - DataSourceType, isConnectorProvider, } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; -import { ConnectorsAPI, ConnectorType } from "@dust-tt/types"; +import { ConnectorsAPI } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, diff --git a/front/pages/api/w/[wId]/index.ts b/front/pages/api/w/[wId]/index.ts index 166c8cf28c9f..aa7227f4adb9 100644 --- a/front/pages/api/w/[wId]/index.ts +++ b/front/pages/api/w/[wId]/index.ts @@ -1,9 +1,9 @@ -import { WorkspaceType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Workspace } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/invitations/[invitationId]/index.ts b/front/pages/api/w/[wId]/invitations/[invitationId]/index.ts index 3a6d679cd775..110b4fffffd5 100644 --- a/front/pages/api/w/[wId]/invitations/[invitationId]/index.ts +++ b/front/pages/api/w/[wId]/invitations/[invitationId]/index.ts @@ -1,5 +1,5 @@ -import { MembershipInvitationType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { MembershipInvitationType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { MembershipInvitation } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/invitations/index.ts b/front/pages/api/w/[wId]/invitations/index.ts index 1d4cdfbc96f5..5c7ab537c918 100644 --- a/front/pages/api/w/[wId]/invitations/index.ts +++ b/front/pages/api/w/[wId]/invitations/index.ts @@ -1,7 +1,7 @@ -import { MembershipInvitationType } from "@dust-tt/types"; +import type { MembershipInvitationType } from "@dust-tt/types"; import sgMail from "@sendgrid/mail"; import { sign } from "jsonwebtoken"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getPendingInvitations } from "@app/lib/api/workspace"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/keys/[secret]/disable.ts b/front/pages/api/w/[wId]/keys/[secret]/disable.ts index 67d0e6ac2b12..7e65978ec0f1 100644 --- a/front/pages/api/w/[wId]/keys/[secret]/disable.ts +++ b/front/pages/api/w/[wId]/keys/[secret]/disable.ts @@ -1,5 +1,5 @@ -import { KeyType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { KeyType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Key } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/keys/index.ts b/front/pages/api/w/[wId]/keys/index.ts index 1ee14fa86264..6f2e6b25d8dd 100644 --- a/front/pages/api/w/[wId]/keys/index.ts +++ b/front/pages/api/w/[wId]/keys/index.ts @@ -1,5 +1,6 @@ -import { formatUserFullName, KeyType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { KeyType } from "@dust-tt/types"; +import { formatUserFullName } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Key, User } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/members/[userId]/index.ts b/front/pages/api/w/[wId]/members/[userId]/index.ts index f214be62de42..49d8142122c2 100644 --- a/front/pages/api/w/[wId]/members/[userId]/index.ts +++ b/front/pages/api/w/[wId]/members/[userId]/index.ts @@ -1,5 +1,5 @@ -import { UserType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { UserType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Membership, User } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/members/index.ts b/front/pages/api/w/[wId]/members/index.ts index 404b198fb315..89923b218bf2 100644 --- a/front/pages/api/w/[wId]/members/index.ts +++ b/front/pages/api/w/[wId]/members/index.ts @@ -1,5 +1,5 @@ -import { UserType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { UserType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getMembers } from "@app/lib/api/workspace"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/members/me/agent_list_status.ts b/front/pages/api/w/[wId]/members/me/agent_list_status.ts index ddc34cc9a7e1..0c204ab0c3ec 100644 --- a/front/pages/api/w/[wId]/members/me/agent_list_status.ts +++ b/front/pages/api/w/[wId]/members/me/agent_list_status.ts @@ -1,8 +1,8 @@ -import { AgentUserListStatus } from "@dust-tt/types"; +import type { AgentUserListStatus } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; import { setAgentUserListstatus } from "@app/lib/api/assistant/user_relation"; diff --git a/front/pages/api/w/[wId]/monthly-usage.ts b/front/pages/api/w/[wId]/monthly-usage.ts index 3698492d44cb..59e5c0c8f06e 100644 --- a/front/pages/api/w/[wId]/monthly-usage.ts +++ b/front/pages/api/w/[wId]/monthly-usage.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { QueryTypes } from "sequelize"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/providers/[pId]/check.ts b/front/pages/api/w/[wId]/providers/[pId]/check.ts index f33947232d7c..6a5440953728 100644 --- a/front/pages/api/w/[wId]/providers/[pId]/check.ts +++ b/front/pages/api/w/[wId]/providers/[pId]/check.ts @@ -1,5 +1,5 @@ import { GoogleAuth } from "google-auth-library"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { apiError, withLogging } from "@app/logger/withlogging"; diff --git a/front/pages/api/w/[wId]/providers/[pId]/index.ts b/front/pages/api/w/[wId]/providers/[pId]/index.ts index 9d1863052ceb..856e017e1ab8 100644 --- a/front/pages/api/w/[wId]/providers/[pId]/index.ts +++ b/front/pages/api/w/[wId]/providers/[pId]/index.ts @@ -1,5 +1,5 @@ -import { ProviderType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ProviderType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Provider } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/providers/[pId]/models.ts b/front/pages/api/w/[wId]/providers/[pId]/models.ts index 6fd764c6a97d..f0069909beeb 100644 --- a/front/pages/api/w/[wId]/providers/[pId]/models.ts +++ b/front/pages/api/w/[wId]/providers/[pId]/models.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Provider } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/providers/index.ts b/front/pages/api/w/[wId]/providers/index.ts index 27594d3eeed7..2b3e41d1e7ed 100644 --- a/front/pages/api/w/[wId]/providers/index.ts +++ b/front/pages/api/w/[wId]/providers/index.ts @@ -1,5 +1,5 @@ -import { ProviderType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ProviderType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Provider } from "@app/lib/models"; diff --git a/front/pages/api/w/[wId]/subscriptions/index.ts b/front/pages/api/w/[wId]/subscriptions/index.ts index 72fa302cb10e..4ae3c6d4e2bf 100644 --- a/front/pages/api/w/[wId]/subscriptions/index.ts +++ b/front/pages/api/w/[wId]/subscriptions/index.ts @@ -1,6 +1,6 @@ -import { PlanType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { PlanType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { diff --git a/front/pages/api/w/[wId]/use/extract/events/[sId]/index.ts b/front/pages/api/w/[wId]/use/extract/events/[sId]/index.ts index 6f07cefe2ec1..a788148bc7a4 100644 --- a/front/pages/api/w/[wId]/use/extract/events/[sId]/index.ts +++ b/front/pages/api/w/[wId]/use/extract/events/[sId]/index.ts @@ -1,6 +1,6 @@ -import { ExtractedEventType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ExtractedEventType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getExtractedEvent, updateExtractedEvent } from "@app/lib/api/extract"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/use/extract/templates/[sId]/events/index.ts b/front/pages/api/w/[wId]/use/extract/templates/[sId]/events/index.ts index 441d5eece227..c3cb48735b7d 100644 --- a/front/pages/api/w/[wId]/use/extract/templates/[sId]/events/index.ts +++ b/front/pages/api/w/[wId]/use/extract/templates/[sId]/events/index.ts @@ -1,6 +1,6 @@ -import { ExtractedEventType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ExtractedEventType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getExtractedEvents } from "@app/lib/api/extract"; import { getEventSchema } from "@app/lib/api/extract"; diff --git a/front/pages/api/w/[wId]/use/extract/templates/[sId]/index.ts b/front/pages/api/w/[wId]/use/extract/templates/[sId]/index.ts index e3b438c15485..4851fc2776cc 100644 --- a/front/pages/api/w/[wId]/use/extract/templates/[sId]/index.ts +++ b/front/pages/api/w/[wId]/use/extract/templates/[sId]/index.ts @@ -1,6 +1,6 @@ -import { EventSchemaType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { EventSchemaType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { getEventSchema, updateEventSchema } from "@app/lib/api/extract"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/api/w/[wId]/use/extract/templates/index.ts b/front/pages/api/w/[wId]/use/extract/templates/index.ts index e1835326537f..8530919a7414 100644 --- a/front/pages/api/w/[wId]/use/extract/templates/index.ts +++ b/front/pages/api/w/[wId]/use/extract/templates/index.ts @@ -1,6 +1,6 @@ -import { EventSchemaType } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { EventSchemaType } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { NextApiRequest, NextApiResponse } from "next"; import { createEventSchema, getEventSchemas } from "@app/lib/api/extract"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/index.tsx b/front/pages/index.tsx index 998f7c53c847..4152383f60e8 100644 --- a/front/pages/index.tsx +++ b/front/pages/index.tsx @@ -16,13 +16,13 @@ import { OpenaiWhiteLogo, SlackLogo, } from "@dust-tt/sparkle"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Head from "next/head"; import Link from "next/link"; import { useRouter } from "next/router"; import Script from "next/script"; import { signIn } from "next-auth/react"; -import { ParsedUrlQuery } from "querystring"; +import type { ParsedUrlQuery } from "querystring"; import React, { useEffect, useRef, useState } from "react"; import { useCookies } from "react-cookie"; diff --git a/front/pages/login-error.tsx b/front/pages/login-error.tsx index 8a3f53286a10..25aed559b348 100644 --- a/front/pages/login-error.tsx +++ b/front/pages/login-error.tsx @@ -1,5 +1,5 @@ import { Button, Logo } from "@dust-tt/sparkle"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; const { URL = "", GA_TRACKING_ID = "" } = process.env; diff --git a/front/pages/poke/[wId]/assistants/[aId]/index.tsx b/front/pages/poke/[wId]/assistants/[aId]/index.tsx index d198e2f8b6f8..7537581098e2 100644 --- a/front/pages/poke/[wId]/assistants/[aId]/index.tsx +++ b/front/pages/poke/[wId]/assistants/[aId]/index.tsx @@ -1,11 +1,12 @@ import { Avatar, ContextItem, Page } from "@dust-tt/sparkle"; +import type { + AgentConfigurationType} from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; import { - AgentConfigurationType, isDustAppRunConfiguration, isRetrievalConfiguration, } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import PokeNavbar from "@app/components/poke/PokeNavbar"; import { getAgentConfigurations } from "@app/lib/api/assistant/configuration"; diff --git a/front/pages/poke/[wId]/data_sources/[name]/index.tsx b/front/pages/poke/[wId]/data_sources/[name]/index.tsx index 53a8e1d0e809..937a74b75127 100644 --- a/front/pages/poke/[wId]/data_sources/[name]/index.tsx +++ b/front/pages/poke/[wId]/data_sources/[name]/index.tsx @@ -5,12 +5,13 @@ import { EyeIcon, Page, } from "@dust-tt/sparkle"; -import { CoreAPIDataSource, DataSourceType } from "@dust-tt/types"; -import { WorkspaceType } from "@dust-tt/types"; -import { ConnectorsAPI, ConnectorType } from "@dust-tt/types"; +import type { CoreAPIDataSource, DataSourceType } from "@dust-tt/types"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { ConnectorType } from "@dust-tt/types"; +import { ConnectorsAPI } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; import { JsonViewer } from "@textea/json-viewer"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/poke/[wId]/data_sources/[name]/view.tsx b/front/pages/poke/[wId]/data_sources/[name]/view.tsx index ff36adb4d7aa..c4f601d19efe 100644 --- a/front/pages/poke/[wId]/data_sources/[name]/view.tsx +++ b/front/pages/poke/[wId]/data_sources/[name]/view.tsx @@ -1,7 +1,7 @@ import { Input, Page } from "@dust-tt/sparkle"; -import { CoreAPIDocument } from "@dust-tt/types"; +import type { CoreAPIDocument } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import PokeNavbar from "@app/components/poke/PokeNavbar"; import { getDataSource } from "@app/lib/api/data_sources"; diff --git a/front/pages/poke/[wId]/index.tsx b/front/pages/poke/[wId]/index.tsx index a6d89b9ce453..18125d05feab 100644 --- a/front/pages/poke/[wId]/index.tsx +++ b/front/pages/poke/[wId]/index.tsx @@ -5,19 +5,20 @@ import { SliderToggle, Spinner, } from "@dust-tt/sparkle"; -import { +import type { AgentConfigurationType, DataSourceType, - isDustAppRunConfiguration, - isRetrievalConfiguration, LightAgentConfigurationType, - WorkspaceSegmentationType, + WorkspaceSegmentationType} from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; +import { + isDustAppRunConfiguration, + isRetrievalConfiguration } from "@dust-tt/types"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; import { JsonViewer } from "@textea/json-viewer"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import React, { useContext } from "react"; diff --git a/front/pages/poke/[wId]/memberships.tsx b/front/pages/poke/[wId]/memberships.tsx index 89efc91eeb89..0bdbd017da01 100644 --- a/front/pages/poke/[wId]/memberships.tsx +++ b/front/pages/poke/[wId]/memberships.tsx @@ -1,6 +1,6 @@ import { Button } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import React from "react"; diff --git a/front/pages/poke/index.tsx b/front/pages/poke/index.tsx index ffc5d50c7516..14af8ab289b5 100644 --- a/front/pages/poke/index.tsx +++ b/front/pages/poke/index.tsx @@ -1,6 +1,7 @@ -import { UserType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; -import React, { ChangeEvent, useState } from "react"; +import type { UserType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { ChangeEvent} from "react"; +import React, { useState } from "react"; import PokeNavbar from "@app/components/poke/PokeNavbar"; import { Authenticator, getSession } from "@app/lib/auth"; diff --git a/front/pages/poke/plans.tsx b/front/pages/poke/plans.tsx index 95b37cb0d522..d1f736d7d664 100644 --- a/front/pages/poke/plans.tsx +++ b/front/pages/poke/plans.tsx @@ -7,13 +7,14 @@ import { Spinner, XMarkIcon, } from "@dust-tt/sparkle"; -import { PlanType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { PlanType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import React from "react"; import { useSWRConfig } from "swr"; +import type { + EditingPlanType} from "@app/components/poke/plans/form"; import { - EditingPlanType, Field, fromPlanType, PLAN_FIELDS, diff --git a/front/pages/w/[wId]/a/[aId]/clone.tsx b/front/pages/w/[wId]/a/[aId]/clone.tsx index 5b751274027d..290484cba8ac 100644 --- a/front/pages/w/[wId]/a/[aId]/clone.tsx +++ b/front/pages/w/[wId]/a/[aId]/clone.tsx @@ -1,10 +1,10 @@ import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType, AppVisibility } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType, AppVisibility } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { ChevronRightIcon } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/datasets/[name]/index.tsx b/front/pages/w/[wId]/a/[aId]/datasets/[name]/index.tsx index 9fb0ab9a7c68..504314ad75e8 100644 --- a/front/pages/w/[wId]/a/[aId]/datasets/[name]/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/datasets/[name]/index.tsx @@ -1,11 +1,11 @@ import "@uiw/react-textarea-code-editor/dist.css"; import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { DatasetSchema, DatasetType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { DatasetSchema, DatasetType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/datasets/index.tsx b/front/pages/w/[wId]/a/[aId]/datasets/index.tsx index 2e0c669b34d8..feb1876b4277 100644 --- a/front/pages/w/[wId]/a/[aId]/datasets/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/datasets/index.tsx @@ -1,9 +1,9 @@ import { Button, PlusIcon, Tab, TrashIcon } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { DatasetType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { DatasetType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/front/pages/w/[wId]/a/[aId]/datasets/new.tsx b/front/pages/w/[wId]/a/[aId]/datasets/new.tsx index 21de67cb42c1..f71136cd6c99 100644 --- a/front/pages/w/[wId]/a/[aId]/datasets/new.tsx +++ b/front/pages/w/[wId]/a/[aId]/datasets/new.tsx @@ -1,11 +1,11 @@ import "@uiw/react-textarea-code-editor/dist.css"; import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { DatasetSchema, DatasetType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { DatasetSchema, DatasetType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/execute/index.tsx b/front/pages/w/[wId]/a/[aId]/execute/index.tsx index 538cec468cc0..fc9feaf55cc8 100644 --- a/front/pages/w/[wId]/a/[aId]/execute/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/execute/index.tsx @@ -1,16 +1,16 @@ import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType, BlockRunConfig, SpecificationType } from "@dust-tt/types"; -import { DatasetType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { TraceType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType, BlockRunConfig, SpecificationType } from "@dust-tt/types"; +import type { DatasetType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { TraceType } from "@dust-tt/types"; import { ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, PlayCircleIcon, } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import dynamic from "next/dynamic"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/index.tsx b/front/pages/w/[wId]/a/[aId]/index.tsx index e8b125b48760..58c025a595ff 100644 --- a/front/pages/w/[wId]/a/[aId]/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/index.tsx @@ -6,18 +6,18 @@ import { SparklesIcon, Tab, } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType, BlockRunConfig, SpecificationBlockType, SpecificationType, } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { BlockType } from "@dust-tt/types"; -import { CoreAPIErrorResponse } from "@dust-tt/types"; -import { ReturnedAPIErrorType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { BlockType } from "@dust-tt/types"; +import type { CoreAPIErrorResponse } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useRef, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/pages/w/[wId]/a/[aId]/runs/[runId]/index.tsx b/front/pages/w/[wId]/a/[aId]/runs/[runId]/index.tsx index 2bb15ca64c34..5cf7fcf4d753 100644 --- a/front/pages/w/[wId]/a/[aId]/runs/[runId]/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/runs/[runId]/index.tsx @@ -1,9 +1,9 @@ import { Button, CheckCircleIcon, ClockIcon, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType, SpecificationType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { RunType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType, SpecificationType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { RunType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/runs/index.tsx b/front/pages/w/[wId]/a/[aId]/runs/index.tsx index 1c941556e474..be051765d8e5 100644 --- a/front/pages/w/[wId]/a/[aId]/runs/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/runs/index.tsx @@ -1,9 +1,9 @@ import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { RunRunType, RunStatus } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { RunRunType, RunStatus } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/settings.tsx b/front/pages/w/[wId]/a/[aId]/settings.tsx index 108d60c8e278..a99cf8b99ba2 100644 --- a/front/pages/w/[wId]/a/[aId]/settings.tsx +++ b/front/pages/w/[wId]/a/[aId]/settings.tsx @@ -1,10 +1,10 @@ import { Button, Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType, AppVisibility } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType, AppVisibility } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { ChevronRightIcon } from "@heroicons/react/24/outline"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; import { useEffect } from "react"; diff --git a/front/pages/w/[wId]/a/[aId]/specification.tsx b/front/pages/w/[wId]/a/[aId]/specification.tsx index 488319664a54..bbec6241a816 100644 --- a/front/pages/w/[wId]/a/[aId]/specification.tsx +++ b/front/pages/w/[wId]/a/[aId]/specification.tsx @@ -1,9 +1,9 @@ import { Tab } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import AppLayout from "@app/components/sparkle/AppLayout"; diff --git a/front/pages/w/[wId]/a/index.tsx b/front/pages/w/[wId]/a/index.tsx index dc37f2c245c7..e512be0d3418 100644 --- a/front/pages/w/[wId]/a/index.tsx +++ b/front/pages/w/[wId]/a/index.tsx @@ -1,10 +1,10 @@ import { Button, CommandLineIcon, Page, PlusIcon } from "@dust-tt/sparkle"; -import { KeyType } from "@dust-tt/types"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { KeyType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; import { EyeIcon, EyeSlashIcon } from "@heroicons/react/24/outline"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/a/new.tsx b/front/pages/w/[wId]/a/new.tsx index dc2494aef2a3..9cf337ba1b39 100644 --- a/front/pages/w/[wId]/a/new.tsx +++ b/front/pages/w/[wId]/a/new.tsx @@ -1,10 +1,10 @@ import { Button, Page } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { ChevronRightIcon } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import React, { useCallback, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/assistant/[cId]/index.tsx b/front/pages/w/[wId]/assistant/[cId]/index.tsx index eaa169b89c28..a12da0d791dc 100644 --- a/front/pages/w/[wId]/assistant/[cId]/index.tsx +++ b/front/pages/w/[wId]/assistant/[cId]/index.tsx @@ -1,7 +1,7 @@ -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { AgentMention, MentionType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { AgentMention, MentionType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useContext, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/assistant/assistants.tsx b/front/pages/w/[wId]/assistant/assistants.tsx index c128f5d5acff..2fc197bf78dd 100644 --- a/front/pages/w/[wId]/assistant/assistants.tsx +++ b/front/pages/w/[wId]/assistant/assistants.tsx @@ -18,14 +18,14 @@ import { UserIcon, XMarkIcon, } from "@dust-tt/sparkle"; -import { +import type { AgentUserListStatus, LightAgentConfigurationType, UserType, WorkspaceType, } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useContext, useState } from "react"; @@ -45,7 +45,7 @@ import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; import { useAgentConfigurations } from "@app/lib/swr"; import { subFilter } from "@app/lib/utils"; -import { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; +import type { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; const { GA_TRACKING_ID = "" } = process.env; diff --git a/front/pages/w/[wId]/assistant/gallery.tsx b/front/pages/w/[wId]/assistant/gallery.tsx index 02bb6087b2da..f3dfc55a317a 100644 --- a/front/pages/w/[wId]/assistant/gallery.tsx +++ b/front/pages/w/[wId]/assistant/gallery.tsx @@ -1,14 +1,15 @@ import { Button, DropdownMenu, Page, Searchbar, Tab } from "@dust-tt/sparkle"; -import { +import type { AgentsGetViewType, - assertNever, LightAgentConfigurationType, PlanType, SubscriptionType, UserType, - WorkspaceType, + WorkspaceType} from "@dust-tt/types"; +import { + assertNever } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/assistant/new.tsx b/front/pages/w/[wId]/assistant/new.tsx index 568421552447..33c81678f561 100644 --- a/front/pages/w/[wId]/assistant/new.tsx +++ b/front/pages/w/[wId]/assistant/new.tsx @@ -9,7 +9,7 @@ import { Page, Popup, } from "@dust-tt/sparkle"; -import { +import type { AgentMention, ContentFragmentContentType, ConversationType, @@ -19,7 +19,7 @@ import { UserType, WorkspaceType, } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useContext, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx b/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx index 2b24c87fae4b..490e94b89048 100644 --- a/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx +++ b/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx @@ -1,21 +1,22 @@ -import { +import type { AgentConfigurationType, DataSourceType, UserType, WorkspaceType, } from "@dust-tt/types"; +import type { AppType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; import { isDatabaseQueryConfiguration } from "@dust-tt/types"; import { isDustAppRunConfiguration } from "@dust-tt/types"; import { isRetrievalConfiguration } from "@dust-tt/types"; -import { AppType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; -import AssistantBuilder, { +import type { AssistantBuilderInitialState, - BUILDER_FLOWS, - BuilderFlow, + BuilderFlow} from "@app/components/assistant_builder/AssistantBuilder"; +import AssistantBuilder, { + BUILDER_FLOWS } from "@app/components/assistant_builder/AssistantBuilder"; import { getApps } from "@app/lib/api/app"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; diff --git a/front/pages/w/[wId]/builder/assistants/dust.tsx b/front/pages/w/[wId]/builder/assistants/dust.tsx index 247a4b1e4e86..6be1d0d74616 100644 --- a/front/pages/w/[wId]/builder/assistants/dust.tsx +++ b/front/pages/w/[wId]/builder/assistants/dust.tsx @@ -7,7 +7,7 @@ import { PlusIcon, SliderToggle, } from "@dust-tt/sparkle"; -import { +import type { APIError, DataSourceType, LightAgentConfigurationType, @@ -15,7 +15,7 @@ import { UserType, WorkspaceType, } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useContext } from "react"; diff --git a/front/pages/w/[wId]/builder/assistants/index.tsx b/front/pages/w/[wId]/builder/assistants/index.tsx index 219befe0ce8d..2e24838c1c37 100644 --- a/front/pages/w/[wId]/builder/assistants/index.tsx +++ b/front/pages/w/[wId]/builder/assistants/index.tsx @@ -15,13 +15,13 @@ import { TrashIcon, XMarkIcon, } from "@dust-tt/sparkle"; -import { +import type { LightAgentConfigurationType, UserType, WorkspaceType, } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/builder/assistants/new.tsx b/front/pages/w/[wId]/builder/assistants/new.tsx index 7719f92c616e..6782ec546bee 100644 --- a/front/pages/w/[wId]/builder/assistants/new.tsx +++ b/front/pages/w/[wId]/builder/assistants/new.tsx @@ -1,21 +1,23 @@ -import { +import type { AgentConfigurationType, AppType, DataSourceType, - isDatabaseQueryConfiguration, - isDustAppRunConfiguration, - isRetrievalConfiguration, PlanType, SubscriptionType, UserType, - WorkspaceType, + WorkspaceType} from "@dust-tt/types"; +import { + isDatabaseQueryConfiguration, + isDustAppRunConfiguration, + isRetrievalConfiguration } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; -import AssistantBuilder, { +import type { AssistantBuilderInitialState, - BUILDER_FLOWS, - BuilderFlow, + BuilderFlow} from "@app/components/assistant_builder/AssistantBuilder"; +import AssistantBuilder, { + BUILDER_FLOWS } from "@app/components/assistant_builder/AssistantBuilder"; import { getApps } from "@app/lib/api/app"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; 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 dbc11acfca9d..62e4901ab3ef 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx @@ -13,22 +13,24 @@ import { SlackLogo, SliderToggle, } from "@dust-tt/sparkle"; -import { - assertNever, +import type { ConnectorProvider, DataSourceType, UserType, - WorkspaceType, + WorkspaceType} from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { + ConnectorType} from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; +import { + assertNever } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; import { connectorIsUsingNango, - ConnectorsAPI, - ConnectorType, + ConnectorsAPI } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; import Nango from "@nangohq/frontend"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useContext, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/search.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/search.tsx index 1ce63cd3f2d2..bfc393e771cb 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/search.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/search.tsx @@ -1,7 +1,7 @@ -import { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; -import { DocumentType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { DocumentType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/settings.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/settings.tsx index 06755e692b74..8f4e03701911 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/settings.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/settings.tsx @@ -1,14 +1,14 @@ import { Button, DropdownMenu, TrashIcon } from "@dust-tt/sparkle"; -import { +import type { DataSourceType, DataSourceVisibility, UserType, WorkspaceType, } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { ChevronRightIcon } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useCallback, useEffect, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx index d66a8ae516e2..d9bf27434090 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; // @ts-expect-error: type package doesn't load properly because of how we are loading pdfjs import * as PDFJS from "pdfjs-dist/build/pdf"; @@ -15,13 +15,13 @@ import { PlusIcon, TrashIcon, } from "@dust-tt/sparkle"; -import { +import type { DataSourceType, PostDataSourceDocumentRequestBody, UserType, WorkspaceType, } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; import AppLayout from "@app/components/sparkle/AppLayout"; import { AppLayoutSimpleSaveCancelTitle } from "@app/components/sparkle/AppLayoutTitle"; diff --git a/front/pages/w/[wId]/builder/data-sources/managed.tsx b/front/pages/w/[wId]/builder/data-sources/managed.tsx index ca4ed77095a1..058c92ffb96c 100644 --- a/front/pages/w/[wId]/builder/data-sources/managed.tsx +++ b/front/pages/w/[wId]/builder/data-sources/managed.tsx @@ -10,20 +10,21 @@ import { Page, Popup, } from "@dust-tt/sparkle"; -import { +import type { ConnectorProvider, DataSourceType, UserType, WorkspaceType, } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { + ConnectorType} from "@dust-tt/types"; import { connectorIsUsingNango, - ConnectorsAPI, - ConnectorType, + ConnectorsAPI } from "@dust-tt/types"; import Nango from "@nangohq/frontend"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useContext, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/new-public-url.tsx b/front/pages/w/[wId]/builder/data-sources/new-public-url.tsx index 2a52ed2ef2c5..c42343f9d695 100644 --- a/front/pages/w/[wId]/builder/data-sources/new-public-url.tsx +++ b/front/pages/w/[wId]/builder/data-sources/new-public-url.tsx @@ -1,8 +1,8 @@ import { Checkbox, Page } from "@dust-tt/sparkle"; -import { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useCallback, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/new.tsx b/front/pages/w/[wId]/builder/data-sources/new.tsx index 2cee6a5b3fe0..c872e8bbf4df 100644 --- a/front/pages/w/[wId]/builder/data-sources/new.tsx +++ b/front/pages/w/[wId]/builder/data-sources/new.tsx @@ -1,9 +1,9 @@ import { Checkbox, Page } from "@dust-tt/sparkle"; -import { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { ChevronRightIcon } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useCallback, useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/public-urls.tsx b/front/pages/w/[wId]/builder/data-sources/public-urls.tsx index 6089334f7505..288bfba88f47 100644 --- a/front/pages/w/[wId]/builder/data-sources/public-urls.tsx +++ b/front/pages/w/[wId]/builder/data-sources/public-urls.tsx @@ -8,9 +8,9 @@ import { PlusIcon, Popup, } from "@dust-tt/sparkle"; -import { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/builder/data-sources/static.tsx b/front/pages/w/[wId]/builder/data-sources/static.tsx index fbcee63b0794..a784e68177f7 100644 --- a/front/pages/w/[wId]/builder/data-sources/static.tsx +++ b/front/pages/w/[wId]/builder/data-sources/static.tsx @@ -8,9 +8,9 @@ import { PlusIcon, Popup, } from "@dust-tt/sparkle"; -import { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { DataSourceType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/index.tsx b/front/pages/w/[wId]/index.tsx index 1f285d43b220..6c9e2ab54ef8 100644 --- a/front/pages/w/[wId]/index.tsx +++ b/front/pages/w/[wId]/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/w/[wId]/join.tsx b/front/pages/w/[wId]/join.tsx index c533237c1a9a..a3559ee7281b 100644 --- a/front/pages/w/[wId]/join.tsx +++ b/front/pages/w/[wId]/join.tsx @@ -1,6 +1,6 @@ import { GoogleLogo, Logo } from "@dust-tt/sparkle"; -import { WorkspaceType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { WorkspaceType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { signIn } from "next-auth/react"; import { SignInButton } from "@app/components/Button"; diff --git a/front/pages/w/[wId]/members/DomainAutoJoinModal.tsx b/front/pages/w/[wId]/members/DomainAutoJoinModal.tsx new file mode 100644 index 000000000000..0269ce840ec0 --- /dev/null +++ b/front/pages/w/[wId]/members/DomainAutoJoinModal.tsx @@ -0,0 +1,35 @@ +import { Dialog } from "@dust-tt/sparkle"; + +export function DomainAutoJoinModal({ + domain, + domainAutoJoinEnabled, + isOpen, + onClose, +}: { + domain: string; + domainAutoJoinEnabled: boolean; + isOpen: boolean; + onClose: (action?: "enabled" | "disabled") => void; +}) { + const title = domainAutoJoinEnabled + ? "De-activate Single Sign-On" + : "Activate Single Sign-On"; + const validateLabel = domainAutoJoinEnabled ? "De-activate" : "Activate"; + const validateVariant = domainAutoJoinEnabled ? "primaryWarning" : "primary"; + + return ( + onClose(domainAutoJoinEnabled ? "disabled" : "enabled")} + onCancel={() => onClose()} + validateLabel={validateLabel} + validateVariant={validateVariant} + > +
+ Anyone with Google "@{domain}"{" "} + account will have access to your Dust Workspace. +
+
+ ); +} diff --git a/front/pages/w/[wId]/members/index.tsx b/front/pages/w/[wId]/members/index.tsx index 153130072ad2..12abf983193f 100644 --- a/front/pages/w/[wId]/members/index.tsx +++ b/front/pages/w/[wId]/members/index.tsx @@ -15,11 +15,11 @@ import { Popup, Searchbar, } from "@dust-tt/sparkle"; -import { RoleType, UserType, WorkspaceType } from "@dust-tt/types"; -import { MembershipInvitationType } from "@dust-tt/types"; -import { PlanType, SubscriptionType } from "@dust-tt/types"; +import type { RoleType, UserType, WorkspaceType } from "@dust-tt/types"; +import type { MembershipInvitationType } from "@dust-tt/types"; +import type { PlanType, SubscriptionType } from "@dust-tt/types"; import { UsersIcon } from "@heroicons/react/20/solid"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useContext, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/pages/w/[wId]/subscription/index.tsx b/front/pages/w/[wId]/subscription/index.tsx index 9c4237b0ce54..2f14a372579c 100644 --- a/front/pages/w/[wId]/subscription/index.tsx +++ b/front/pages/w/[wId]/subscription/index.tsx @@ -7,9 +7,9 @@ import { ShapesIcon, Spinner, } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { PlanInvitationType, SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { PlanInvitationType, SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import React, { useContext, useEffect } from "react"; diff --git a/front/pages/w/[wId]/subscription/upgrade-enterprise/[secret].tsx b/front/pages/w/[wId]/subscription/upgrade-enterprise/[secret].tsx index e57760e7bebd..40726f6d3bcc 100644 --- a/front/pages/w/[wId]/subscription/upgrade-enterprise/[secret].tsx +++ b/front/pages/w/[wId]/subscription/upgrade-enterprise/[secret].tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import { Authenticator, getSession } from "@app/lib/auth"; import { Workspace } from "@app/lib/models"; diff --git a/front/pages/w/[wId]/tables/index.tsx b/front/pages/w/[wId]/tables/index.tsx index 56e28781b31f..e7c8466982b6 100644 --- a/front/pages/w/[wId]/tables/index.tsx +++ b/front/pages/w/[wId]/tables/index.tsx @@ -9,15 +9,15 @@ import { Modal, Page, } from "@dust-tt/sparkle"; -import { +import type { CoreAPITable, DataSourceType, UserType, WorkspaceType, } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; import { PlusIcon } from "@heroicons/react/24/outline"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import React, { useContext, useRef } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/pages/w/[wId]/u/extract/events/[sId]/edit.tsx b/front/pages/w/[wId]/u/extract/events/[sId]/edit.tsx index b4d66e8cf74f..5c4d0c1078df 100644 --- a/front/pages/w/[wId]/u/extract/events/[sId]/edit.tsx +++ b/front/pages/w/[wId]/u/extract/events/[sId]/edit.tsx @@ -1,9 +1,9 @@ import { ArrowUpOnSquareIcon, Button, Page } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import React, { useEffect, useRef, useState } from "react"; diff --git a/front/pages/w/[wId]/u/extract/index.tsx b/front/pages/w/[wId]/u/extract/index.tsx index 55abecab3f1e..d0317d65ae6b 100644 --- a/front/pages/w/[wId]/u/extract/index.tsx +++ b/front/pages/w/[wId]/u/extract/index.tsx @@ -1,8 +1,8 @@ import { ArrowUpOnSquareIcon, Button, Page } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; import { PlusIcon } from "@heroicons/react/24/outline"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/front/pages/w/[wId]/u/extract/templates/[sId]/edit.tsx b/front/pages/w/[wId]/u/extract/templates/[sId]/edit.tsx index 5b6dcab04811..e0dfc4fb3a35 100644 --- a/front/pages/w/[wId]/u/extract/templates/[sId]/edit.tsx +++ b/front/pages/w/[wId]/u/extract/templates/[sId]/edit.tsx @@ -1,7 +1,7 @@ -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { EventSchemaType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { EventSchemaType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import AppLayout from "@app/components/sparkle/AppLayout"; import { subNavigationAdmin } from "@app/components/sparkle/navigation"; diff --git a/front/pages/w/[wId]/u/extract/templates/[sId]/index.tsx b/front/pages/w/[wId]/u/extract/templates/[sId]/index.tsx index 7334308882f3..7bbae53fcfe9 100644 --- a/front/pages/w/[wId]/u/extract/templates/[sId]/index.tsx +++ b/front/pages/w/[wId]/u/extract/templates/[sId]/index.tsx @@ -9,12 +9,12 @@ import { PencilSquareIcon, XCircleIcon, } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { APIError } from "@dust-tt/types"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { EventSchemaType, ExtractedEventType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { APIError } from "@dust-tt/types"; import { Dialog, Transition } from "@headlessui/react"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { Fragment, useState } from "react"; diff --git a/front/pages/w/[wId]/u/extract/templates/new.tsx b/front/pages/w/[wId]/u/extract/templates/new.tsx index b17f7b8ad7a9..89e289cce44f 100644 --- a/front/pages/w/[wId]/u/extract/templates/new.tsx +++ b/front/pages/w/[wId]/u/extract/templates/new.tsx @@ -1,6 +1,6 @@ -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import AppLayout from "@app/components/sparkle/AppLayout"; import { subNavigationAdmin } from "@app/components/sparkle/navigation"; diff --git a/front/pages/w/[wId]/u/index.tsx b/front/pages/w/[wId]/u/index.tsx index 6d01c129a62f..c774915174f5 100644 --- a/front/pages/w/[wId]/u/index.tsx +++ b/front/pages/w/[wId]/u/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import { getSession, getUserFromSession } from "@app/lib/auth"; diff --git a/front/pages/w/[wId]/welcome.tsx b/front/pages/w/[wId]/welcome.tsx index e8ae9090b145..b34f9bf33608 100644 --- a/front/pages/w/[wId]/welcome.tsx +++ b/front/pages/w/[wId]/welcome.tsx @@ -1,6 +1,6 @@ import { Button, Input, RadioButton } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/front/pages/w/[wId]/workspace/index.tsx b/front/pages/w/[wId]/workspace/index.tsx index 3606c7f5e098..1ffe30d6b1d8 100644 --- a/front/pages/w/[wId]/workspace/index.tsx +++ b/front/pages/w/[wId]/workspace/index.tsx @@ -6,9 +6,9 @@ import { Page, PlanetIcon, } from "@dust-tt/sparkle"; -import { UserType, WorkspaceType } from "@dust-tt/types"; -import { SubscriptionType } from "@dust-tt/types"; -import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import type { UserType, WorkspaceType } from "@dust-tt/types"; +import type { SubscriptionType } from "@dust-tt/types"; +import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useCallback, useEffect, useState } from "react"; import AppLayout from "@app/components/sparkle/AppLayout"; From 1e879848cd2273b1e2b1ff402dcb6fa5138fb20d Mon Sep 17 00:00:00 2001 From: Flavien David Date: Tue, 16 Jan 2024 18:23:25 +0100 Subject: [PATCH 2/6] Add ESLint rules + fix --- connectors/.eslintrc.js | 1 + ...20240110_batch_resync_notion_connectors.ts | 2 +- ...11_batch_resync_google_drive_connectors.ts | 2 +- connectors/src/admin/cli.ts | 2 +- connectors/src/admin/db.ts | 2 +- connectors/src/api/connector_config.ts | 4 ++-- connectors/src/api/create_connector.ts | 21 +++++++++-------- connectors/src/api/delete_connector.ts | 4 ++-- connectors/src/api/get_connector.ts | 6 ++--- .../src/api/get_connector_permissions.ts | 6 ++--- connectors/src/api/get_resources_parents.ts | 2 +- connectors/src/api/get_resources_titles.ts | 4 ++-- connectors/src/api/resume_connector.ts | 4 ++-- .../src/api/set_connector_permissions.ts | 4 ++-- .../api/slack_channels_linked_with_agent.ts | 4 ++-- connectors/src/api/stop_connector.ts | 4 ++-- connectors/src/api/sync_connector.ts | 4 ++-- connectors/src/api/update_connector.ts | 4 ++-- connectors/src/api/webhooks/webhook_github.ts | 4 ++-- .../src/api/webhooks/webhook_google_drive.ts | 4 ++-- connectors/src/api/webhooks/webhook_slack.ts | 7 +++--- connectors/src/connectors/confluence/index.ts | 15 ++++++------ .../confluence/lib/confluence_api.ts | 4 ++-- connectors/src/connectors/github/index.ts | 13 ++++++----- .../src/connectors/github/lib/github_api.ts | 7 +++--- .../connectors/github/temporal/activities.ts | 9 ++++---- .../github/temporal/cast_known_errors.ts | 4 ++-- .../src/connectors/github/temporal/client.ts | 5 ++-- .../src/connectors/github/temporal/utils.ts | 2 +- .../src/connectors/github/temporal/worker.ts | 2 +- .../connectors/github/temporal/workflows.ts | 2 +- .../src/connectors/google_drive/index.ts | 12 +++++----- connectors/src/connectors/google_drive/lib.ts | 5 ++-- .../google_drive/temporal/activities.ts | 15 +++++++----- .../google_drive/temporal/client.ts | 8 ++++--- .../google_drive/temporal/worker.ts | 2 +- .../google_drive/temporal/workflows.ts | 4 ++-- connectors/src/connectors/index.ts | 4 ++-- connectors/src/connectors/intercom/index.ts | 15 ++++++------ .../connectors/intercom/lib/intercom_api.ts | 3 ++- connectors/src/connectors/interface.ts | 10 ++++---- connectors/src/connectors/notion/index.ts | 15 ++++++------ connectors/src/connectors/notion/lib/cli.ts | 2 +- .../notion/lib/connectors_db_helpers.ts | 4 ++-- .../src/connectors/notion/lib/notion_api.ts | 11 +++++---- .../src/connectors/notion/lib/parents.ts | 5 ++-- connectors/src/connectors/notion/lib/types.ts | 2 +- .../connectors/notion/temporal/activities.ts | 4 ++-- .../notion/temporal/cast_known_errors.ts | 2 +- .../src/connectors/notion/temporal/client.ts | 9 ++++---- .../src/connectors/notion/temporal/utils.ts | 4 ++-- .../src/connectors/notion/temporal/worker.ts | 2 +- .../connectors/notion/temporal/workflows.ts | 2 +- connectors/src/connectors/slack/bot.ts | 23 +++++++++++-------- connectors/src/connectors/slack/index.ts | 10 ++++---- .../src/connectors/slack/lib/channels.ts | 12 ++++++---- connectors/src/connectors/slack/lib/errors.ts | 3 ++- .../src/connectors/slack/lib/slack_client.ts | 12 ++++++---- connectors/src/connectors/slack/lib/thread.ts | 6 ++--- .../connectors/slack/temporal/activities.ts | 22 ++++++++++-------- .../src/connectors/slack/temporal/client.ts | 4 ++-- .../src/connectors/slack/temporal/worker.ts | 2 +- .../connectors/slack/temporal/workflows.ts | 2 +- connectors/src/connectors/webcrawler/index.ts | 4 ++-- .../src/connectors/webcrawler/lib/utils.ts | 2 +- .../webcrawler/temporal/activities.ts | 2 +- .../connectors/webcrawler/temporal/client.ts | 6 +++-- .../connectors/webcrawler/temporal/worker.ts | 2 +- .../webcrawler/temporal/workflows.ts | 2 +- connectors/src/lib/api/data_source_config.ts | 4 ++-- connectors/src/lib/data_sources.ts | 10 ++++---- connectors/src/lib/databases.ts | 2 +- connectors/src/lib/models/confluence.ts | 7 +++--- connectors/src/lib/models/index.ts | 2 +- connectors/src/lib/models/intercom.ts | 7 +++--- connectors/src/lib/models/notion.ts | 2 +- connectors/src/lib/models/slack.ts | 2 +- connectors/src/lib/nango_client.ts | 6 +++-- connectors/src/lib/nango_helpers.ts | 2 +- connectors/src/lib/sync_status.ts | 7 +++--- connectors/src/lib/temporal.ts | 5 ++-- connectors/src/lib/temporal_monitoring.ts | 7 +++--- connectors/src/logger/logger.ts | 3 ++- connectors/src/logger/withlogging.ts | 4 ++-- connectors/src/middleware/auth.ts | 4 ++-- connectors/src/types/connector.ts | 2 +- connectors/src/types/resources.ts | 2 +- 87 files changed, 266 insertions(+), 224 deletions(-) diff --git a/connectors/.eslintrc.js b/connectors/.eslintrc.js index 297843508d04..147a9b44bcf9 100644 --- a/connectors/.eslintrc.js +++ b/connectors/.eslintrc.js @@ -29,6 +29,7 @@ module.exports = { }, ], "simple-import-sort/exports": "error", + "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/return-await": ["error", "in-try-catch"], diff --git a/connectors/migrations/20240110_batch_resync_notion_connectors.ts b/connectors/migrations/20240110_batch_resync_notion_connectors.ts index b4010effb29c..1441b33b0605 100644 --- a/connectors/migrations/20240110_batch_resync_notion_connectors.ts +++ b/connectors/migrations/20240110_batch_resync_notion_connectors.ts @@ -1,4 +1,4 @@ -import { Result } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; import parseArgs from "minimist"; import readline from "readline"; diff --git a/connectors/migrations/20240111_batch_resync_google_drive_connectors.ts b/connectors/migrations/20240111_batch_resync_google_drive_connectors.ts index 0dd552b388c3..2230ac6659e0 100644 --- a/connectors/migrations/20240111_batch_resync_google_drive_connectors.ts +++ b/connectors/migrations/20240111_batch_resync_google_drive_connectors.ts @@ -1,4 +1,4 @@ -import { Result } from "@dust-tt/types"; +import type { Result } from "@dust-tt/types"; import parseArgs from "minimist"; import readline from "readline"; diff --git a/connectors/src/admin/cli.ts b/connectors/src/admin/cli.ts index 84623e58c16e..f659378a2342 100644 --- a/connectors/src/admin/cli.ts +++ b/connectors/src/admin/cli.ts @@ -37,7 +37,7 @@ import { GoogleDriveFiles } from "@connectors/lib/models/google_drive"; import { NotionDatabase, NotionPage } from "@connectors/lib/models/notion"; import { SlackConfiguration } from "@connectors/lib/models/slack"; import { nango_client } from "@connectors/lib/nango_client"; -import { Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; import { getTemporalClient, terminateAllWorkflowsForConnectorId, diff --git a/connectors/src/admin/db.ts b/connectors/src/admin/db.ts index 7009320fcb67..f4c682599fc3 100644 --- a/connectors/src/admin/db.ts +++ b/connectors/src/admin/db.ts @@ -1,4 +1,4 @@ -import { Sequelize } from "sequelize"; +import type { Sequelize } from "sequelize"; import { Connector, sequelize_conn } from "@connectors/lib/models"; import { diff --git a/connectors/src/api/connector_config.ts b/connectors/src/api/connector_config.ts index 0b5646929269..2d90743f9d9b 100644 --- a/connectors/src/api/connector_config.ts +++ b/connectors/src/api/connector_config.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; @@ -9,7 +9,7 @@ import { } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; const ConfigSetReqBodySchema = t.type({ configValue: t.string, diff --git a/connectors/src/api/create_connector.ts b/connectors/src/api/create_connector.ts index 4649a01c09de..d30e0920d242 100644 --- a/connectors/src/api/create_connector.ts +++ b/connectors/src/api/create_connector.ts @@ -1,19 +1,20 @@ -import { - assertNever, - ConnectorCreateRequestBodySchema, +import type { ConnectorProvider, CreateConnectorOAuthRequestBodySchema, CreateConnectorUrlRequestBodySchema, - isConnectorProvider, - Result, + Result} from "@dust-tt/types"; +import { + assertNever, + ConnectorCreateRequestBodySchema, + isConnectorProvider } from "@dust-tt/types"; -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; -import * as t from "io-ts"; +import type * as t from "io-ts"; import * as reporter from "io-ts-reporters"; import { CREATE_CONNECTOR_BY_TYPE } from "@connectors/connectors"; -import { +import type { ConnectorCreatorOAuth, ConnectorCreatorUrl, } from "@connectors/connectors/interface"; @@ -21,8 +22,8 @@ import { errorFromAny } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import logger from "@connectors/logger/logger"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorType } from "@connectors/types/connector"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorType } from "@connectors/types/connector"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type ConnectorCreateResBody = ConnectorType | ConnectorsAPIErrorResponse; diff --git a/connectors/src/api/delete_connector.ts b/connectors/src/api/delete_connector.ts index a6ae660d9d36..7e52a7fd7f87 100644 --- a/connectors/src/api/delete_connector.ts +++ b/connectors/src/api/delete_connector.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { DELETE_CONNECTOR_BY_TYPE, @@ -7,7 +7,7 @@ import { import { Connector } from "@connectors/lib/models"; import { terminateAllWorkflowsForConnectorId } from "@connectors/lib/temporal"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type ConnectorDeleteReqBody = { dataSourceName: string; diff --git a/connectors/src/api/get_connector.ts b/connectors/src/api/get_connector.ts index c6b97c1dd023..4793f79cd17d 100644 --- a/connectors/src/api/get_connector.ts +++ b/connectors/src/api/get_connector.ts @@ -1,11 +1,11 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { Connector } from "@connectors/lib/models"; import { GithubDiscussion, GithubIssue } from "@connectors/lib/models/github"; import { NotionPage } from "@connectors/lib/models/notion"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorType } from "@connectors/types/connector"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorType } from "@connectors/types/connector"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type GetConnectorRes = ConnectorType | ConnectorsAPIErrorResponse; diff --git a/connectors/src/api/get_connector_permissions.ts b/connectors/src/api/get_connector_permissions.ts index 83855e08ae58..b11fbb895325 100644 --- a/connectors/src/api/get_connector_permissions.ts +++ b/connectors/src/api/get_connector_permissions.ts @@ -1,10 +1,10 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { RETRIEVE_CONNECTOR_PERMISSIONS_BY_TYPE } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorPermission, ConnectorResource, } from "@connectors/types/resources"; diff --git a/connectors/src/api/get_resources_parents.ts b/connectors/src/api/get_resources_parents.ts index 34c550d7ef45..95ffe32fe0d9 100644 --- a/connectors/src/api/get_resources_parents.ts +++ b/connectors/src/api/get_resources_parents.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { zip } from "fp-ts/lib/Array"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; diff --git a/connectors/src/api/get_resources_titles.ts b/connectors/src/api/get_resources_titles.ts index d2a2794c9b81..47706d6ef19f 100644 --- a/connectors/src/api/get_resources_titles.ts +++ b/connectors/src/api/get_resources_titles.ts @@ -1,11 +1,11 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; import { BATCH_RETRIEVE_RESOURCE_TITLE_BY_TYPE } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; -import { Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; import { apiError, withLogging } from "@connectors/logger/withlogging"; const GetResourcesTitlesRequestBodySchema = t.type({ diff --git a/connectors/src/api/resume_connector.ts b/connectors/src/api/resume_connector.ts index b4ece02e03ff..6d24064acf1d 100644 --- a/connectors/src/api/resume_connector.ts +++ b/connectors/src/api/resume_connector.ts @@ -1,11 +1,11 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { RESUME_CONNECTOR_BY_TYPE } from "@connectors/connectors"; import { errorFromAny } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import logger from "@connectors/logger/logger"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type ConnectorResumeResBody = | { connectorId: string } diff --git a/connectors/src/api/set_connector_permissions.ts b/connectors/src/api/set_connector_permissions.ts index 824d56dd2b00..877bb01ae577 100644 --- a/connectors/src/api/set_connector_permissions.ts +++ b/connectors/src/api/set_connector_permissions.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; @@ -6,7 +6,7 @@ import * as reporter from "io-ts-reporters"; import { SET_CONNECTOR_PERMISSIONS_BY_TYPE } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type SetConnectorPermissionsRes = | { success: true } diff --git a/connectors/src/api/slack_channels_linked_with_agent.ts b/connectors/src/api/slack_channels_linked_with_agent.ts index e9b90cd6528e..10023e39ef22 100644 --- a/connectors/src/api/slack_channels_linked_with_agent.ts +++ b/connectors/src/api/slack_channels_linked_with_agent.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; @@ -6,7 +6,7 @@ import { Op } from "sequelize"; import { joinChannel } from "@connectors/connectors/slack/lib/channels"; import { getChannels } from "@connectors/connectors/slack/temporal/activities"; -import { APIErrorWithStatusCode } from "@connectors/lib/error"; +import type { APIErrorWithStatusCode } from "@connectors/lib/error"; import { sequelize_conn } from "@connectors/lib/models"; import { SlackChannel } from "@connectors/lib/models/slack"; import { apiError, withLogging } from "@connectors/logger/withlogging"; diff --git a/connectors/src/api/stop_connector.ts b/connectors/src/api/stop_connector.ts index 69819362d3cb..7aa34acecb74 100644 --- a/connectors/src/api/stop_connector.ts +++ b/connectors/src/api/stop_connector.ts @@ -1,11 +1,11 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { STOP_CONNECTOR_BY_TYPE } from "@connectors/connectors"; import { errorFromAny } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import logger from "@connectors/logger/logger"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type ConnectorStopResBody = | { connectorId: string } diff --git a/connectors/src/api/sync_connector.ts b/connectors/src/api/sync_connector.ts index 2d069c4c6f1d..61e33cdc43d6 100644 --- a/connectors/src/api/sync_connector.ts +++ b/connectors/src/api/sync_connector.ts @@ -1,9 +1,9 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { SYNC_CONNECTOR_BY_TYPE } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; import { withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type GetSyncStatusRes = { workflowId: string } | ConnectorsAPIErrorResponse; diff --git a/connectors/src/api/update_connector.ts b/connectors/src/api/update_connector.ts index 9936404aae41..1765e3a326ca 100644 --- a/connectors/src/api/update_connector.ts +++ b/connectors/src/api/update_connector.ts @@ -1,9 +1,9 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { UPDATE_CONNECTOR_BY_TYPE } from "@connectors/connectors"; import { Connector } from "@connectors/lib/models"; import { apiError, withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; type ConnectorUpdateReqBody = { connectionId?: string | null; diff --git a/connectors/src/api/webhooks/webhook_github.ts b/connectors/src/api/webhooks/webhook_github.ts index cefe07b1837a..732dd3677909 100644 --- a/connectors/src/api/webhooks/webhook_github.ts +++ b/connectors/src/api/webhooks/webhook_github.ts @@ -1,5 +1,5 @@ import { assertNever } from "@dust-tt/types"; -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; import { Op } from "sequelize"; @@ -29,7 +29,7 @@ import { } from "@connectors/lib/models/github"; import mainLogger from "@connectors/logger/logger"; import { withLogging } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; const HANDLED_WEBHOOKS = { installation_repositories: new Set(["added", "removed"]), diff --git a/connectors/src/api/webhooks/webhook_google_drive.ts b/connectors/src/api/webhooks/webhook_google_drive.ts index edce940aa6e7..191f4bc34485 100644 --- a/connectors/src/api/webhooks/webhook_google_drive.ts +++ b/connectors/src/api/webhooks/webhook_google_drive.ts @@ -1,8 +1,8 @@ import { RateLimitError } from "@dust-tt/types"; -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { launchGoogleDriveIncrementalSyncWorkflow } from "@connectors/connectors/google_drive/temporal/client"; -import { APIErrorWithStatusCode } from "@connectors/lib/error"; +import type { APIErrorWithStatusCode } from "@connectors/lib/error"; import { GoogleDriveWebhook } from "@connectors/lib/models/google_drive"; import logger from "@connectors/logger/logger"; import { apiError, withLogging } from "@connectors/logger/withlogging"; diff --git a/connectors/src/api/webhooks/webhook_slack.ts b/connectors/src/api/webhooks/webhook_slack.ts index f6a606d8629d..8fd827f3c352 100644 --- a/connectors/src/api/webhooks/webhook_slack.ts +++ b/connectors/src/api/webhooks/webhook_slack.ts @@ -1,4 +1,4 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { botAnswerMessageWithErrorHandling } from "@connectors/connectors/slack/bot"; import { getBotUserIdMemoized } from "@connectors/connectors/slack/temporal/activities"; @@ -7,11 +7,12 @@ import { launchSlackSyncOneThreadWorkflow, } from "@connectors/connectors/slack/temporal/client"; import { launchSlackGarbageCollectWorkflow } from "@connectors/connectors/slack/temporal/client"; -import { APIErrorWithStatusCode } from "@connectors/lib/error"; +import type { APIErrorWithStatusCode } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import { SlackChannel, SlackConfiguration } from "@connectors/lib/models/slack"; import { Ok } from "@connectors/lib/result"; -import mainLogger, { Logger } from "@connectors/logger/logger"; +import type { Logger } from "@connectors/logger/logger"; +import mainLogger from "@connectors/logger/logger"; import { apiError, withLogging } from "@connectors/logger/withlogging"; type SlackWebhookReqBody = { diff --git a/connectors/src/connectors/confluence/index.ts b/connectors/src/connectors/confluence/index.ts index cbfdcf3cda26..01e52bb34ed3 100644 --- a/connectors/src/connectors/confluence/index.ts +++ b/connectors/src/connectors/confluence/index.ts @@ -1,27 +1,28 @@ -import { +import type { ConnectorPermission, ConnectorResource, ModelId, } from "@dust-tt/types"; -import { ConnectorsAPIErrorResponse } from "@dust-tt/types"; +import type { ConnectorsAPIErrorResponse } from "@dust-tt/types"; import { confluenceConfig } from "@connectors/connectors/confluence/lib/config"; import { getConfluenceCloudInformation, listConfluenceSpaces, } from "@connectors/connectors/confluence/lib/confluence_api"; -import { ConfluenceSpaceType } from "@connectors/connectors/confluence/lib/confluence_client"; -import { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; +import type { ConfluenceSpaceType } from "@connectors/connectors/confluence/lib/confluence_client"; +import type { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; import { Connector, sequelize_conn } from "@connectors/lib/models"; import { ConfluenceConfiguration, ConfluenceSpace, } from "@connectors/lib/models/confluence"; import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { NangoConnectionId } from "@connectors/types/nango_connection_id"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { NangoConnectionId } from "@connectors/types/nango_connection_id"; const { getRequiredNangoConfluenceConnectorId } = confluenceConfig; diff --git a/connectors/src/connectors/confluence/lib/confluence_api.ts b/connectors/src/connectors/confluence/lib/confluence_api.ts index b5aa5bb12dfa..6f496d577d9b 100644 --- a/connectors/src/connectors/confluence/lib/confluence_api.ts +++ b/connectors/src/connectors/confluence/lib/confluence_api.ts @@ -1,8 +1,8 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { confluenceConfig } from "@connectors/connectors/confluence/lib/config"; import { ConfluenceClient } from "@connectors/connectors/confluence/lib/confluence_client"; -import { Connector } from "@connectors/lib/models"; +import type { Connector } from "@connectors/lib/models"; import { ConfluenceConfiguration } from "@connectors/lib/models/confluence"; import { getConnectionFromNango } from "@connectors/lib/nango_helpers"; diff --git a/connectors/src/connectors/github/index.ts b/connectors/src/connectors/github/index.ts index a7f638f33a55..bec405a49eac 100644 --- a/connectors/src/connectors/github/index.ts +++ b/connectors/src/connectors/github/index.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { getRepo, @@ -15,16 +15,17 @@ import { GithubDiscussion, GithubIssue, } from "@connectors/lib/models/github"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorPermission, ConnectorResource, } from "@connectors/types/resources"; -import { +import type { ConnectorConfigGetter, ConnectorPermissionRetriever, } from "../interface"; diff --git a/connectors/src/connectors/github/lib/github_api.ts b/connectors/src/connectors/github/lib/github_api.ts index 980c3e8f4374..95802bb32a47 100644 --- a/connectors/src/connectors/github/lib/github_api.ts +++ b/connectors/src/connectors/github/lib/github_api.ts @@ -8,13 +8,14 @@ import * as reporter from "io-ts-reporters"; import { Octokit } from "octokit"; import { tmpdir } from "os"; import { basename, extname, join, resolve } from "path"; -import { Readable } from "stream"; +import type { Readable } from "stream"; import { pipeline } from "stream/promises"; import { extract } from "tar"; -import { +import type { DiscussionCommentNode, - DiscussionNode, + DiscussionNode} from "@connectors/connectors/github/lib/github_graphql"; +import { ErrorPayloadSchema, GetDiscussionCommentRepliesPayloadSchema, GetDiscussionCommentsPayloadSchema, diff --git a/connectors/src/connectors/github/temporal/activities.ts b/connectors/src/connectors/github/temporal/activities.ts index 2010eb324fd5..38fd2926ec20 100644 --- a/connectors/src/connectors/github/temporal/activities.ts +++ b/connectors/src/connectors/github/temporal/activities.ts @@ -1,9 +1,12 @@ -import { CoreAPIDataSourceDocumentSection } from "@dust-tt/types"; +import type { CoreAPIDataSourceDocumentSection } from "@dust-tt/types"; import { hash as blake3 } from "blake3"; import { promises as fs } from "fs"; import PQueue from "p-queue"; import { Op } from "sequelize"; +import type { + GithubIssue as GithubIssueType, + GithubUser} from "@connectors/connectors/github/lib/github_api"; import { cleanUpProcessRepository, getDiscussion, @@ -14,8 +17,6 @@ import { getRepoDiscussionsPage, getRepoIssuesPage, getReposPage, - GithubIssue as GithubIssueType, - GithubUser, processRepository, } from "@connectors/connectors/github/lib/github_api"; import { @@ -35,7 +36,7 @@ import { } from "@connectors/lib/models/github"; import { syncStarted, syncSucceeded } from "@connectors/lib/sync_status"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; const logger = mainLogger.child({ provider: "github", diff --git a/connectors/src/connectors/github/temporal/cast_known_errors.ts b/connectors/src/connectors/github/temporal/cast_known_errors.ts index 22f559d9a4b6..193918582ea4 100644 --- a/connectors/src/connectors/github/temporal/cast_known_errors.ts +++ b/connectors/src/connectors/github/temporal/cast_known_errors.ts @@ -1,5 +1,5 @@ -import { RequestError } from "@octokit/types"; -import { +import type { RequestError } from "@octokit/types"; +import type { ActivityExecuteInput, ActivityInboundCallsInterceptor, Next, diff --git a/connectors/src/connectors/github/temporal/client.ts b/connectors/src/connectors/github/temporal/client.ts index a968d660c1a9..00cc62df1334 100644 --- a/connectors/src/connectors/github/temporal/client.ts +++ b/connectors/src/connectors/github/temporal/client.ts @@ -1,6 +1,7 @@ -import { +import type { WorkflowExecutionDescription, - WorkflowHandle, + WorkflowHandle} from "@temporalio/client"; +import { WorkflowNotFoundError, } from "@temporalio/client"; diff --git a/connectors/src/connectors/github/temporal/utils.ts b/connectors/src/connectors/github/temporal/utils.ts index 47b8f0c7e9fb..3e42fe6b2ed6 100644 --- a/connectors/src/connectors/github/temporal/utils.ts +++ b/connectors/src/connectors/github/temporal/utils.ts @@ -1,4 +1,4 @@ -import { DataSourceInfo } from "@connectors/types/data_source_config"; +import type { DataSourceInfo } from "@connectors/types/data_source_config"; export function getFullSyncWorkflowId(dataSourceInfo: DataSourceInfo) { return `workflow-github-full-sync-${dataSourceInfo.workspaceId}-${dataSourceInfo.dataSourceName}`; diff --git a/connectors/src/connectors/github/temporal/worker.ts b/connectors/src/connectors/github/temporal/worker.ts index c2f2fa9266c8..611a5fb3cac6 100644 --- a/connectors/src/connectors/github/temporal/worker.ts +++ b/connectors/src/connectors/github/temporal/worker.ts @@ -1,4 +1,4 @@ -import { Context } from "@temporalio/activity"; +import type { Context } from "@temporalio/activity"; import { Worker } from "@temporalio/worker"; import * as activities from "@connectors/connectors/github/temporal/activities"; diff --git a/connectors/src/connectors/github/temporal/workflows.ts b/connectors/src/connectors/github/temporal/workflows.ts index 5c6326b69edf..90aada2ee9a6 100644 --- a/connectors/src/connectors/github/temporal/workflows.ts +++ b/connectors/src/connectors/github/temporal/workflows.ts @@ -9,7 +9,7 @@ import { import PQueue from "p-queue"; import type * as activities from "@connectors/connectors/github/temporal/activities"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; import { newWebhookSignal } from "./signals"; import { getFullSyncWorkflowId, getReposSyncWorkflowId } from "./utils"; diff --git a/connectors/src/connectors/google_drive/index.ts b/connectors/src/connectors/google_drive/index.ts index 1e20d87664d3..6b6adba83e8d 100644 --- a/connectors/src/connectors/google_drive/index.ts +++ b/connectors/src/connectors/google_drive/index.ts @@ -1,12 +1,12 @@ +import type { drive_v3 } from "googleapis"; import { google } from "googleapis"; -import { drive_v3 } from "googleapis"; -import { GaxiosResponse } from "googleapis-common"; +import type { GaxiosResponse } from "googleapis-common"; import { getLocalParents, registerWebhook, } from "@connectors/connectors/google_drive/lib"; -import { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; +import type { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; import { Connector, sequelize_conn } from "@connectors/lib/models"; import { GoogleDriveConfig, @@ -19,8 +19,8 @@ import { nangoDeleteConnection } from "@connectors/lib/nango_client"; import { Err, Ok, type Result } from "@connectors/lib/result.js"; import logger from "@connectors/logger/logger"; import type { DataSourceConfig } from "@connectors/types/data_source_config.js"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorPermission, ConnectorResource, ConnectorResourceType, @@ -41,7 +41,7 @@ import { launchGoogleGarbageCollector, } from "./temporal/client"; export type NangoConnectionId = string; -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { v4 as uuidv4 } from "uuid"; const { diff --git a/connectors/src/connectors/google_drive/lib.ts b/connectors/src/connectors/google_drive/lib.ts index f5924526efe2..c0c80121baf2 100644 --- a/connectors/src/connectors/google_drive/lib.ts +++ b/connectors/src/connectors/google_drive/lib.ts @@ -1,8 +1,9 @@ -import { cacheWithRedis, ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; +import { cacheWithRedis } from "@dust-tt/types"; import { v4 as uuidv4 } from "uuid"; import { HTTPError } from "@connectors/lib/error"; -import { Connector } from "@connectors/lib/models"; +import type { Connector } from "@connectors/lib/models"; import { GoogleDriveFiles } from "@connectors/lib/models/google_drive"; import { Err, Ok, type Result } from "@connectors/lib/result.js"; diff --git a/connectors/src/connectors/google_drive/temporal/activities.ts b/connectors/src/connectors/google_drive/temporal/activities.ts index 8364047b4239..ebbca837f0b1 100644 --- a/connectors/src/connectors/google_drive/temporal/activities.ts +++ b/connectors/src/connectors/google_drive/temporal/activities.ts @@ -1,5 +1,6 @@ import fs from "fs/promises"; -import { GaxiosError, GaxiosResponse } from "googleapis-common"; +import type { GaxiosResponse } from "googleapis-common"; +import { GaxiosError } from "googleapis-common"; import StatsD from "hot-shots"; import os from "os"; import PQueue from "p-queue"; @@ -13,15 +14,17 @@ import { import { HTTPError } from "@connectors/lib/error"; import { nango_client } from "@connectors/lib/nango_client"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { GoogleDriveObjectType } from "@connectors/types/google_drive"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { GoogleDriveObjectType } from "@connectors/types/google_drive"; const { NANGO_GOOGLE_DRIVE_CONNECTOR_ID = "google" } = process.env; -import { cacheWithRedis, ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; +import { cacheWithRedis } from "@dust-tt/types"; import { uuid4 } from "@temporalio/workflow"; +import type { drive_v3 } from "googleapis"; import { google } from "googleapis"; -import { drive_v3 } from "googleapis"; import { OAuth2Client } from "googleapis-common"; -import { CreationAttributes, literal, Op } from "sequelize"; +import type { CreationAttributes} from "sequelize"; +import { literal, Op } from "sequelize"; import { registerWebhook } from "@connectors/connectors/google_drive/lib"; import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config"; diff --git a/connectors/src/connectors/google_drive/temporal/client.ts b/connectors/src/connectors/google_drive/temporal/client.ts index 14224931ae6d..e2bca60d6f68 100644 --- a/connectors/src/connectors/google_drive/temporal/client.ts +++ b/connectors/src/connectors/google_drive/temporal/client.ts @@ -1,10 +1,12 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { rateLimiter, RateLimitError } from "@dust-tt/types"; -import { WorkflowHandle, WorkflowNotFoundError } from "@temporalio/client"; +import type { WorkflowHandle} from "@temporalio/client"; +import { WorkflowNotFoundError } from "@temporalio/client"; import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config"; import { Connector } from "@connectors/lib/models"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import { getTemporalClient } from "@connectors/lib/temporal"; import mainLogger from "@connectors/logger/logger"; diff --git a/connectors/src/connectors/google_drive/temporal/worker.ts b/connectors/src/connectors/google_drive/temporal/worker.ts index 55b59b41ac52..d2d67118add5 100644 --- a/connectors/src/connectors/google_drive/temporal/worker.ts +++ b/connectors/src/connectors/google_drive/temporal/worker.ts @@ -1,4 +1,4 @@ -import { Context } from "@temporalio/activity"; +import type { Context } from "@temporalio/activity"; import { Worker } from "@temporalio/worker"; import * as activities from "@connectors/connectors/google_drive/temporal/activities"; diff --git a/connectors/src/connectors/google_drive/temporal/workflows.ts b/connectors/src/connectors/google_drive/temporal/workflows.ts index f2a7cb627c69..d254766fc927 100644 --- a/connectors/src/connectors/google_drive/temporal/workflows.ts +++ b/connectors/src/connectors/google_drive/temporal/workflows.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { continueAsNew, executeChild, @@ -10,7 +10,7 @@ import { import type * as activities from "@connectors/connectors/google_drive/temporal/activities"; import type * as sync_status from "@connectors/lib/sync_status"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; import { GDRIVE_INCREMENTAL_SYNC_DEBOUNCE_SEC } from "./config"; import { newWebhookSignal } from "./signals"; diff --git a/connectors/src/connectors/index.ts b/connectors/src/connectors/index.ts index 9b155cb61c42..321f9a84ab2f 100644 --- a/connectors/src/connectors/index.ts +++ b/connectors/src/connectors/index.ts @@ -1,4 +1,4 @@ -import { ConnectorProvider } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; import { createConfluenceConnector, @@ -42,7 +42,7 @@ import { stopIntercomConnector, updateIntercomConnector, } from "@connectors/connectors/intercom"; -import { +import type { ConnectorBatchResourceTitleRetriever, ConnectorCleaner, ConnectorConfigGetter, diff --git a/connectors/src/connectors/intercom/index.ts b/connectors/src/connectors/intercom/index.ts index 7b7107e1ded3..cc7445579f7c 100644 --- a/connectors/src/connectors/intercom/index.ts +++ b/connectors/src/connectors/intercom/index.ts @@ -1,15 +1,16 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { validateAccessToken } from "@connectors/connectors/intercom/lib/intercom_api"; -import { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; +import type { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; import { Connector } from "@connectors/lib/models"; import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import logger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { NangoConnectionId } from "@connectors/types/nango_connection_id"; -import { ConnectorResource } from "@connectors/types/resources"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { NangoConnectionId } from "@connectors/types/nango_connection_id"; +import type { ConnectorResource } from "@connectors/types/resources"; const { NANGO_INTERCOM_CONNECTOR_ID } = process.env; diff --git a/connectors/src/connectors/intercom/lib/intercom_api.ts b/connectors/src/connectors/intercom/lib/intercom_api.ts index c2ae99548491..d91e5b8bf260 100644 --- a/connectors/src/connectors/intercom/lib/intercom_api.ts +++ b/connectors/src/connectors/intercom/lib/intercom_api.ts @@ -1,4 +1,5 @@ -import { ArticleObject, Client, CollectionObject } from "intercom-client"; +import type { ArticleObject, CollectionObject } from "intercom-client"; +import { Client } from "intercom-client"; import { HTTPError } from "@connectors/lib/error"; import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers"; diff --git a/connectors/src/connectors/interface.ts b/connectors/src/connectors/interface.ts index 5e8b40c267d1..badbee321373 100644 --- a/connectors/src/connectors/interface.ts +++ b/connectors/src/connectors/interface.ts @@ -1,9 +1,9 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; -import { Result } from "@connectors/lib/result"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { +import type { Result } from "@connectors/lib/result"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorPermission, ConnectorResource, } from "@connectors/types/resources"; diff --git a/connectors/src/connectors/notion/index.ts b/connectors/src/connectors/notion/index.ts index 9b650845d962..3f523550954a 100644 --- a/connectors/src/connectors/notion/index.ts +++ b/connectors/src/connectors/notion/index.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { v4 as uuidv4 } from "uuid"; import { notionConfig } from "@connectors/connectors/notion/lib/config"; @@ -19,14 +19,15 @@ import { nangoDeleteConnection, } from "@connectors/lib/nango_client"; import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { NangoConnectionId } from "@connectors/types/nango_connection_id"; -import { ConnectorResource } from "@connectors/types/resources"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { NangoConnectionId } from "@connectors/types/nango_connection_id"; +import type { ConnectorResource } from "@connectors/types/resources"; -import { ConnectorPermissionRetriever } from "../interface"; +import type { ConnectorPermissionRetriever } from "../interface"; import { getParents } from "./lib/parents"; const { getRequiredNangoNotionConnectorId } = notionConfig; diff --git a/connectors/src/connectors/notion/lib/cli.ts b/connectors/src/connectors/notion/lib/cli.ts index 1785320295e0..d4ee166b894f 100644 --- a/connectors/src/connectors/notion/lib/cli.ts +++ b/connectors/src/connectors/notion/lib/cli.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { Client, isFullDatabase, isFullPage } from "@notionhq/client"; import { Op } from "sequelize"; diff --git a/connectors/src/connectors/notion/lib/connectors_db_helpers.ts b/connectors/src/connectors/notion/lib/connectors_db_helpers.ts index 117620925788..8aea8c01fc7f 100644 --- a/connectors/src/connectors/notion/lib/connectors_db_helpers.ts +++ b/connectors/src/connectors/notion/lib/connectors_db_helpers.ts @@ -1,8 +1,8 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { Connector } from "@connectors/lib/models"; import { NotionDatabase, NotionPage } from "@connectors/lib/models/notion"; -import { DataSourceInfo } from "@connectors/types/data_source_config"; +import type { DataSourceInfo } from "@connectors/types/data_source_config"; // Note: this function does not let you "remove" a skipReason. export async function upsertNotionPageInConnectorsDb({ diff --git a/connectors/src/connectors/notion/lib/notion_api.ts b/connectors/src/connectors/notion/lib/notion_api.ts index 6153a7169f43..3ef84fcf92b5 100644 --- a/connectors/src/connectors/notion/lib/notion_api.ts +++ b/connectors/src/connectors/notion/lib/notion_api.ts @@ -1,13 +1,14 @@ import { cacheWithRedis } from "@dust-tt/types"; +import type { + LogLevel} from "@notionhq/client"; import { APIResponseError, Client, isFullBlock, isFullDatabase, - isFullPage, - LogLevel, + isFullPage } from "@notionhq/client"; -import { +import type { BlockObjectResponse, GetDatabaseResponse, GetPageResponse, @@ -17,9 +18,9 @@ import { RichTextItemResponse, SearchResponse, } from "@notionhq/client/build/src/api-endpoints"; -import { Logger } from "pino"; +import type { Logger } from "pino"; -import { +import type { PageObjectProperties, ParsedNotionBlock, ParsedNotionDatabase, diff --git a/connectors/src/connectors/notion/lib/parents.ts b/connectors/src/connectors/notion/lib/parents.ts index 85c4ee7d4304..a9513259aae7 100644 --- a/connectors/src/connectors/notion/lib/parents.ts +++ b/connectors/src/connectors/notion/lib/parents.ts @@ -1,4 +1,5 @@ -import { cacheWithRedis, ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; +import { cacheWithRedis } from "@dust-tt/types"; import PQueue from "p-queue"; import { @@ -9,7 +10,7 @@ import { } from "@connectors/connectors/notion/lib/connectors_db_helpers"; import { updateDocumentParentsField } from "@connectors/lib/data_sources"; import { Connector } from "@connectors/lib/models"; -import { NotionDatabase, NotionPage } from "@connectors/lib/models/notion"; +import type { NotionDatabase, NotionPage } from "@connectors/lib/models/notion"; import logger from "@connectors/logger/logger"; /** Compute the parents field for a notion pageOrDb See the [Design diff --git a/connectors/src/connectors/notion/lib/types.ts b/connectors/src/connectors/notion/lib/types.ts index f13e8305ffea..50e9bf4db21c 100644 --- a/connectors/src/connectors/notion/lib/types.ts +++ b/connectors/src/connectors/notion/lib/types.ts @@ -1,4 +1,4 @@ -import { +import type { BlockObjectResponse, PageObjectResponse, } from "@notionhq/client/build/src/api-endpoints"; diff --git a/connectors/src/connectors/notion/temporal/activities.ts b/connectors/src/connectors/notion/temporal/activities.ts index a48808a53c49..fd029a490422 100644 --- a/connectors/src/connectors/notion/temporal/activities.ts +++ b/connectors/src/connectors/notion/temporal/activities.ts @@ -1,4 +1,4 @@ -import { CoreAPIDataSourceDocumentSection, ModelId } from "@dust-tt/types"; +import type { CoreAPIDataSourceDocumentSection, ModelId } from "@dust-tt/types"; import { isFullBlock, isFullPage, isNotionClientError } from "@notionhq/client"; import { Context } from "@temporalio/activity"; import { Op } from "sequelize"; @@ -34,7 +34,7 @@ import { updateAllParentsFields, } from "@connectors/connectors/notion/lib/parents"; import { getTagsForPage } from "@connectors/connectors/notion/lib/tags"; -import { +import type { PageObjectProperties, ParsedNotionBlock, } from "@connectors/connectors/notion/lib/types"; diff --git a/connectors/src/connectors/notion/temporal/cast_known_errors.ts b/connectors/src/connectors/notion/temporal/cast_known_errors.ts index 526912ae7bd3..a3f2efe430ee 100644 --- a/connectors/src/connectors/notion/temporal/cast_known_errors.ts +++ b/connectors/src/connectors/notion/temporal/cast_known_errors.ts @@ -3,7 +3,7 @@ import { UnknownHTTPResponseError, } from "@notionhq/client"; import { APIErrorCode, APIResponseError } from "@notionhq/client"; -import { +import type { ActivityExecuteInput, ActivityInboundCallsInterceptor, Next, diff --git a/connectors/src/connectors/notion/temporal/client.ts b/connectors/src/connectors/notion/temporal/client.ts index b79aa4560dcb..33031665958f 100644 --- a/connectors/src/connectors/notion/temporal/client.ts +++ b/connectors/src/connectors/notion/temporal/client.ts @@ -1,7 +1,8 @@ -import { ModelId } from "@dust-tt/types"; -import { +import type { ModelId } from "@dust-tt/types"; +import type { WorkflowExecutionDescription, - WorkflowHandle, + WorkflowHandle} from "@temporalio/client"; +import { WorkflowNotFoundError, } from "@temporalio/client"; @@ -12,7 +13,7 @@ import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_c import { Connector } from "@connectors/lib/models"; import { getTemporalClient } from "@connectors/lib/temporal"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceInfo } from "@connectors/types/data_source_config"; +import type { DataSourceInfo } from "@connectors/types/data_source_config"; const logger = mainLogger.child({ provider: "notion" }); diff --git a/connectors/src/connectors/notion/temporal/utils.ts b/connectors/src/connectors/notion/temporal/utils.ts index 3d54bc5731cd..92f9c4be1e13 100644 --- a/connectors/src/connectors/notion/temporal/utils.ts +++ b/connectors/src/connectors/notion/temporal/utils.ts @@ -1,6 +1,6 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; -import { DataSourceInfo } from "@connectors/types/data_source_config"; +import type { DataSourceInfo } from "@connectors/types/data_source_config"; // Changes made here should be reflected in the production environment checks. export function getWorkflowId(dataSourceInfo: DataSourceInfo) { diff --git a/connectors/src/connectors/notion/temporal/worker.ts b/connectors/src/connectors/notion/temporal/worker.ts index f202e361a604..c74e8fb5c317 100644 --- a/connectors/src/connectors/notion/temporal/worker.ts +++ b/connectors/src/connectors/notion/temporal/worker.ts @@ -1,4 +1,4 @@ -import { Context } from "@temporalio/activity"; +import type { Context } from "@temporalio/activity"; import { Worker } from "@temporalio/worker"; import * as activities from "@connectors/connectors/notion/temporal/activities"; diff --git a/connectors/src/connectors/notion/temporal/workflows.ts b/connectors/src/connectors/notion/temporal/workflows.ts index 15b025ad6a7c..a218f3912537 100644 --- a/connectors/src/connectors/notion/temporal/workflows.ts +++ b/connectors/src/connectors/notion/temporal/workflows.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { continueAsNew, defineQuery, diff --git a/connectors/src/connectors/slack/bot.ts b/connectors/src/connectors/slack/bot.ts index bf4be2a1df64..84ff55889283 100644 --- a/connectors/src/connectors/slack/bot.ts +++ b/connectors/src/connectors/slack/bot.ts @@ -1,21 +1,23 @@ -import { +import type { AgentActionType, AgentMessageType, ConversationType, LightAgentConfigurationType, ModelId, RetrievalDocumentType, - sectionFullText, - UserMessageType, + UserMessageType} from "@dust-tt/types"; +import type { + AgentGenerationSuccessEvent, + PublicPostContentFragmentRequestBodySchema} from "@dust-tt/types"; +import { + sectionFullText } from "@dust-tt/types"; import { - AgentGenerationSuccessEvent, - DustAPI, - PublicPostContentFragmentRequestBodySchema, + DustAPI } from "@dust-tt/types"; -import { WebClient } from "@slack/web-api"; -import { MessageElement } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; -import * as t from "io-ts"; +import type { WebClient } from "@slack/web-api"; +import type { MessageElement } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; +import type * as t from "io-ts"; import jaroWinkler from "talisman/metrics/jaro-winkler"; import { @@ -30,7 +32,8 @@ import { SlackChatBotMessage, SlackConfiguration, } from "@connectors/lib/models/slack"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import logger from "@connectors/logger/logger"; import { diff --git a/connectors/src/connectors/slack/index.ts b/connectors/src/connectors/slack/index.ts index b21806cb70d7..50016b29aa3c 100644 --- a/connectors/src/connectors/slack/index.ts +++ b/connectors/src/connectors/slack/index.ts @@ -1,8 +1,8 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { WebClient } from "@slack/web-api"; import PQueue from "p-queue"; -import { +import type { ConnectorConfigGetter, ConnectorPermissionRetriever, } from "@connectors/connectors/interface"; @@ -31,9 +31,9 @@ import { import { Err, Ok, type Result } from "@connectors/lib/result.js"; import logger from "@connectors/logger/logger"; import type { DataSourceConfig } from "@connectors/types/data_source_config.js"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; -import { NangoConnectionId } from "@connectors/types/nango_connection_id"; -import { +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { NangoConnectionId } from "@connectors/types/nango_connection_id"; +import type { ConnectorPermission, ConnectorResource, } from "@connectors/types/resources"; diff --git a/connectors/src/connectors/slack/lib/channels.ts b/connectors/src/connectors/slack/lib/channels.ts index 732cbf4dd627..4b8a9e91a0b9 100644 --- a/connectors/src/connectors/slack/lib/channels.ts +++ b/connectors/src/connectors/slack/lib/channels.ts @@ -1,12 +1,14 @@ -import { ModelId } from "@dust-tt/types"; -import { CodedError, ErrorCode, WebAPIPlatformError } from "@slack/web-api"; -import { Channel } from "@slack/web-api/dist/response/ConversationsListResponse"; +import type { ModelId } from "@dust-tt/types"; +import type { CodedError, WebAPIPlatformError } from "@slack/web-api"; +import { ErrorCode } from "@slack/web-api"; +import type { Channel } from "@slack/web-api/dist/response/ConversationsListResponse"; import { Connector, sequelize_conn } from "@connectors/lib/models"; import { SlackChannel } from "@connectors/lib/models/slack"; -import { Err, Ok, Result } from "@connectors/lib/result"; +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; import logger from "@connectors/logger/logger"; -import { ConnectorPermission } from "@connectors/types/resources"; +import type { ConnectorPermission } from "@connectors/types/resources"; import { getSlackClient } from "./slack_client"; diff --git a/connectors/src/connectors/slack/lib/errors.ts b/connectors/src/connectors/slack/lib/errors.ts index 460088a1528f..ede116e05c9c 100644 --- a/connectors/src/connectors/slack/lib/errors.ts +++ b/connectors/src/connectors/slack/lib/errors.ts @@ -1,4 +1,5 @@ -import { ErrorCode, WebAPIPlatformError } from "@slack/web-api"; +import type { WebAPIPlatformError } from "@slack/web-api"; +import { ErrorCode } from "@slack/web-api"; export function isSlackWebAPIPlatformError( err: unknown diff --git a/connectors/src/connectors/slack/lib/slack_client.ts b/connectors/src/connectors/slack/lib/slack_client.ts index 320a23884860..379fd92e0d55 100644 --- a/connectors/src/connectors/slack/lib/slack_client.ts +++ b/connectors/src/connectors/slack/lib/slack_client.ts @@ -1,14 +1,16 @@ -import { ModelId } from "@dust-tt/types"; -import { +import type { ModelId } from "@dust-tt/types"; +import type { CodedError, - ErrorCode, UsersInfoResponse, WebAPIHTTPError, - WebAPIPlatformError, + WebAPIPlatformError} from "@slack/web-api"; +import { + ErrorCode, WebClient, } from "@slack/web-api"; -import { ExternalOauthTokenError, WorkflowError } from "@connectors/lib/error"; +import type { WorkflowError } from "@connectors/lib/error"; +import { ExternalOauthTokenError } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers"; const { NANGO_SLACK_CONNECTOR_ID } = process.env; diff --git a/connectors/src/connectors/slack/lib/thread.ts b/connectors/src/connectors/slack/lib/thread.ts index d210b191ec01..da52cbedd0f0 100644 --- a/connectors/src/connectors/slack/lib/thread.ts +++ b/connectors/src/connectors/slack/lib/thread.ts @@ -1,6 +1,6 @@ -import { WebClient } from "@slack/web-api"; -import { MessageElement } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; -import { ConversationsRepliesResponse } from "@slack/web-api/dist/response/ConversationsRepliesResponse"; +import type { WebClient } from "@slack/web-api"; +import type { MessageElement } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; +import type { ConversationsRepliesResponse } from "@slack/web-api/dist/response/ConversationsRepliesResponse"; // The pagination logic for getting all the messages of a Slack thread // is a bit complicated, so we put it in a separate function. diff --git a/connectors/src/connectors/slack/temporal/activities.ts b/connectors/src/connectors/slack/temporal/activities.ts index 2cd614111e75..40f53f8e8585 100644 --- a/connectors/src/connectors/slack/temporal/activities.ts +++ b/connectors/src/connectors/slack/temporal/activities.ts @@ -1,19 +1,21 @@ -import { - cacheWithRedis, +import type { CoreAPIDataSourceDocumentSection, - ModelId, -} from "@dust-tt/types"; + ModelId} from "@dust-tt/types"; import { + cacheWithRedis +} from "@dust-tt/types"; +import type { CodedError, - ErrorCode, WebAPIPlatformError, - WebClient, -} from "@slack/web-api"; + WebClient} from "@slack/web-api"; import { + ErrorCode +} from "@slack/web-api"; +import type { ConversationsHistoryResponse, MessageElement, } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; -import { +import type { Channel, ConversationsListResponse, } from "@slack/web-api/dist/response/ConversationsListResponse"; @@ -34,7 +36,7 @@ import { renderDocumentTitleAndContent, upsertToDatasource, } from "@connectors/lib/data_sources"; -import { WorkflowError } from "@connectors/lib/error"; +import type { WorkflowError } from "@connectors/lib/error"; import { Connector } from "@connectors/lib/models"; import { SlackChannel, SlackMessages } from "@connectors/lib/models/slack"; import { @@ -42,7 +44,7 @@ import { syncSucceeded, } from "@connectors/lib/sync_status"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; import { getWeekEnd, getWeekStart } from "../lib/utils"; diff --git a/connectors/src/connectors/slack/temporal/client.ts b/connectors/src/connectors/slack/temporal/client.ts index fa8d0f4b09f9..c54e23887e1a 100644 --- a/connectors/src/connectors/slack/temporal/client.ts +++ b/connectors/src/connectors/slack/temporal/client.ts @@ -1,10 +1,10 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { Connector } from "@connectors/lib/models"; import { Err, Ok } from "@connectors/lib/result"; import { getTemporalClient } from "@connectors/lib/temporal"; import mainLogger from "@connectors/logger/logger"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; import { getWeekStart } from "../lib/utils"; import { getChannelsToSync } from "./activities"; diff --git a/connectors/src/connectors/slack/temporal/worker.ts b/connectors/src/connectors/slack/temporal/worker.ts index c0aab2c1c6e7..92ccf0a159a5 100644 --- a/connectors/src/connectors/slack/temporal/worker.ts +++ b/connectors/src/connectors/slack/temporal/worker.ts @@ -1,4 +1,4 @@ -import { Context } from "@temporalio/activity"; +import type { Context } from "@temporalio/activity"; import { Worker } from "@temporalio/worker"; import * as activities from "@connectors/connectors/slack/temporal/activities"; diff --git a/connectors/src/connectors/slack/temporal/workflows.ts b/connectors/src/connectors/slack/temporal/workflows.ts index 1cb12c98c351..e63376df75ab 100644 --- a/connectors/src/connectors/slack/temporal/workflows.ts +++ b/connectors/src/connectors/slack/temporal/workflows.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { executeChild, proxyActivities, diff --git a/connectors/src/connectors/webcrawler/index.ts b/connectors/src/connectors/webcrawler/index.ts index 72ed0feb9bae..a0eb84df5710 100644 --- a/connectors/src/connectors/webcrawler/index.ts +++ b/connectors/src/connectors/webcrawler/index.ts @@ -1,4 +1,4 @@ -import { ConnectorResource, ModelId } from "@dust-tt/types"; +import type { ConnectorResource, ModelId } from "@dust-tt/types"; import { stableIdForUrl } from "@connectors/connectors/webcrawler/lib/utils"; import { Connector, sequelize_conn } from "@connectors/lib/models"; @@ -11,7 +11,7 @@ import { Err, Ok, type Result } from "@connectors/lib/result.js"; import logger from "@connectors/logger/logger"; import type { DataSourceConfig } from "@connectors/types/data_source_config.js"; -import { ConnectorPermissionRetriever } from "../interface"; +import type { ConnectorPermissionRetriever } from "../interface"; import { launchCrawlWebsiteWorkflow, stopCrawlWebsiteWorkflow, diff --git a/connectors/src/connectors/webcrawler/lib/utils.ts b/connectors/src/connectors/webcrawler/lib/utils.ts index 7e363463ce36..1576efce95cd 100644 --- a/connectors/src/connectors/webcrawler/lib/utils.ts +++ b/connectors/src/connectors/webcrawler/lib/utils.ts @@ -1,4 +1,4 @@ -import { ConnectorResourceType } from "@dust-tt/types"; +import type { ConnectorResourceType } from "@dust-tt/types"; import { hash as blake3 } from "blake3"; // Generate a stable id for a given url and ressource type diff --git a/connectors/src/connectors/webcrawler/temporal/activities.ts b/connectors/src/connectors/webcrawler/temporal/activities.ts index 4d7cb1d08b2c..c2c8bc99a583 100644 --- a/connectors/src/connectors/webcrawler/temporal/activities.ts +++ b/connectors/src/connectors/webcrawler/temporal/activities.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { Context } from "@temporalio/activity"; import { CheerioCrawler, Configuration } from "crawlee"; import turndown from "turndown"; diff --git a/connectors/src/connectors/webcrawler/temporal/client.ts b/connectors/src/connectors/webcrawler/temporal/client.ts index d539c0c64d7d..c06585521bb3 100644 --- a/connectors/src/connectors/webcrawler/temporal/client.ts +++ b/connectors/src/connectors/webcrawler/temporal/client.ts @@ -1,5 +1,7 @@ -import { Err, ModelId, Ok, Result } from "@dust-tt/types"; -import { WorkflowHandle, WorkflowNotFoundError } from "@temporalio/client"; +import type { ModelId, Result } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; +import type { WorkflowHandle} from "@temporalio/client"; +import { WorkflowNotFoundError } from "@temporalio/client"; import { Connector } from "@connectors/lib/models"; import { getTemporalClient } from "@connectors/lib/temporal"; diff --git a/connectors/src/connectors/webcrawler/temporal/worker.ts b/connectors/src/connectors/webcrawler/temporal/worker.ts index b1b3880d9d27..1e944f5fbda2 100644 --- a/connectors/src/connectors/webcrawler/temporal/worker.ts +++ b/connectors/src/connectors/webcrawler/temporal/worker.ts @@ -1,4 +1,4 @@ -import { Context } from "@temporalio/activity"; +import type { Context } from "@temporalio/activity"; import { Worker } from "@temporalio/worker"; import * as activities from "@connectors/connectors/webcrawler/temporal/activities"; diff --git a/connectors/src/connectors/webcrawler/temporal/workflows.ts b/connectors/src/connectors/webcrawler/temporal/workflows.ts index 94c1a229c642..a2b71d287b49 100644 --- a/connectors/src/connectors/webcrawler/temporal/workflows.ts +++ b/connectors/src/connectors/webcrawler/temporal/workflows.ts @@ -1,4 +1,4 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { proxyActivities } from "@temporalio/workflow"; import type * as activities from "@connectors/connectors/webcrawler/temporal/activities"; diff --git a/connectors/src/lib/api/data_source_config.ts b/connectors/src/lib/api/data_source_config.ts index b1cb7219d14a..95d03b61b4d3 100644 --- a/connectors/src/lib/api/data_source_config.ts +++ b/connectors/src/lib/api/data_source_config.ts @@ -1,5 +1,5 @@ -import { Connector } from "@connectors/lib/models"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { Connector } from "@connectors/lib/models"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; export function dataSourceConfigFromConnector( connector: Connector diff --git a/connectors/src/lib/data_sources.ts b/connectors/src/lib/data_sources.ts index 67f0686cb3e9..29b467df24c8 100644 --- a/connectors/src/lib/data_sources.ts +++ b/connectors/src/lib/data_sources.ts @@ -1,9 +1,11 @@ -import { +import type { CoreAPIDataSourceDocumentSection, - PostDataSourceDocumentRequestBody, + PostDataSourceDocumentRequestBody} from "@dust-tt/types"; +import { sectionFullText, } from "@dust-tt/types"; -import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; +import type { AxiosRequestConfig, AxiosResponse } from "axios"; +import axios from "axios"; import { fromMarkdown } from "mdast-util-from-markdown"; import { gfmFromMarkdown, gfmToMarkdown } from "mdast-util-gfm"; import { toMarkdown } from "mdast-util-to-markdown"; @@ -12,7 +14,7 @@ import { gfm } from "micromark-extension-gfm"; import { withRetries } from "@connectors/lib/dust_front_api_helpers"; import logger from "@connectors/logger/logger"; import { statsDClient } from "@connectors/logger/withlogging"; -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; const { DUST_FRONT_API } = process.env; if (!DUST_FRONT_API) { diff --git a/connectors/src/lib/databases.ts b/connectors/src/lib/databases.ts index ab0cfa41eaf4..fb5ec6a76947 100644 --- a/connectors/src/lib/databases.ts +++ b/connectors/src/lib/databases.ts @@ -1,4 +1,4 @@ -import { DataSourceConfig } from "@connectors/types/data_source_config"; +import type { DataSourceConfig } from "@connectors/types/data_source_config"; import { withRetries } from "./dust_front_api_helpers"; diff --git a/connectors/src/lib/models/confluence.ts b/connectors/src/lib/models/confluence.ts index da6f12603ba7..d57f3733995b 100644 --- a/connectors/src/lib/models/confluence.ts +++ b/connectors/src/lib/models/confluence.ts @@ -1,9 +1,10 @@ -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/connectors/src/lib/models/index.ts b/connectors/src/lib/models/index.ts index 0fcc9e6a1a59..cc3856953c82 100644 --- a/connectors/src/lib/models/index.ts +++ b/connectors/src/lib/models/index.ts @@ -8,7 +8,7 @@ import { Sequelize, } from "sequelize"; -import { +import type { ConnectorErrorType, ConnectorSyncStatus, } from "@connectors/types/connector"; diff --git a/connectors/src/lib/models/intercom.ts b/connectors/src/lib/models/intercom.ts index 4bd1b4c9cf8e..63e9ac873b8c 100644 --- a/connectors/src/lib/models/intercom.ts +++ b/connectors/src/lib/models/intercom.ts @@ -1,9 +1,10 @@ -import { +import type { CreationOptional, - DataTypes, ForeignKey, InferAttributes, - InferCreationAttributes, + InferCreationAttributes} from "sequelize"; +import { + DataTypes, Model, } from "sequelize"; diff --git a/connectors/src/lib/models/notion.ts b/connectors/src/lib/models/notion.ts index ab196a34d97b..48dfaa662a98 100644 --- a/connectors/src/lib/models/notion.ts +++ b/connectors/src/lib/models/notion.ts @@ -7,7 +7,7 @@ import { Model, } from "sequelize"; -import { +import type { NotionBlockType, PageObjectProperties, } from "@connectors/connectors/notion/lib/types"; diff --git a/connectors/src/lib/models/slack.ts b/connectors/src/lib/models/slack.ts index 1e2a2cc0979e..d035afd2384a 100644 --- a/connectors/src/lib/models/slack.ts +++ b/connectors/src/lib/models/slack.ts @@ -8,7 +8,7 @@ import { } from "sequelize"; import { Connector, sequelize_conn } from "@connectors/lib/models"; -import { ConnectorPermission } from "@connectors/types/resources"; +import type { ConnectorPermission } from "@connectors/types/resources"; export class SlackConfiguration extends Model< InferAttributes, diff --git a/connectors/src/lib/nango_client.ts b/connectors/src/lib/nango_client.ts index 260e284e7bc2..fbeb5acacda8 100644 --- a/connectors/src/lib/nango_client.ts +++ b/connectors/src/lib/nango_client.ts @@ -1,9 +1,11 @@ import { Nango } from "@nangohq/node"; import axios from "axios"; -import { ExternalOauthTokenError, WorkflowError } from "@connectors/lib/error"; +import type { WorkflowError } from "@connectors/lib/error"; +import { ExternalOauthTokenError } from "@connectors/lib/error"; -import { Err, Ok, Result } from "./result"; +import type { Result } from "./result"; +import { Err, Ok } from "./result"; const { NANGO_SECRET_KEY } = process.env; diff --git a/connectors/src/lib/nango_helpers.ts b/connectors/src/lib/nango_helpers.ts index e10ff46645f7..b55d2e91c4aa 100644 --- a/connectors/src/lib/nango_helpers.ts +++ b/connectors/src/lib/nango_helpers.ts @@ -1,6 +1,6 @@ import { cacheWithRedis } from "@dust-tt/types"; -import { NangoConnectionId } from "@connectors/types/nango_connection_id"; +import type { NangoConnectionId } from "@connectors/types/nango_connection_id"; import { nango_client } from "./nango_client"; diff --git a/connectors/src/lib/sync_status.ts b/connectors/src/lib/sync_status.ts index f1541b65ce41..0b7112e5479d 100644 --- a/connectors/src/lib/sync_status.ts +++ b/connectors/src/lib/sync_status.ts @@ -1,8 +1,9 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; import { Connector } from "@connectors/lib/models"; -import { Err, Ok, Result } from "@connectors/lib/result"; -import { +import type { Result } from "@connectors/lib/result"; +import { Err, Ok } from "@connectors/lib/result"; +import type { ConnectorErrorType, ConnectorSyncStatus, } from "@connectors/types/connector"; diff --git a/connectors/src/lib/temporal.ts b/connectors/src/lib/temporal.ts index e5541ff98868..05d1d4b32640 100644 --- a/connectors/src/lib/temporal.ts +++ b/connectors/src/lib/temporal.ts @@ -1,8 +1,9 @@ -import { ModelId } from "@dust-tt/types"; +import type { ModelId } from "@dust-tt/types"; +import type { + ConnectionOptions} from "@temporalio/client"; import { Client, Connection, - ConnectionOptions, WorkflowNotFoundError, } from "@temporalio/client"; import { NativeConnection } from "@temporalio/worker"; diff --git a/connectors/src/lib/temporal_monitoring.ts b/connectors/src/lib/temporal_monitoring.ts index 73b19e4acd2f..e50544fcf0cc 100644 --- a/connectors/src/lib/temporal_monitoring.ts +++ b/connectors/src/lib/temporal_monitoring.ts @@ -1,13 +1,14 @@ import { isNangoError } from "@dust-tt/types"; -import { Context } from "@temporalio/activity"; -import { +import type { Context } from "@temporalio/activity"; +import type { ActivityExecuteInput, ActivityInboundCallsInterceptor, Next, } from "@temporalio/worker"; import tracer from "dd-trace"; -import logger, { Logger } from "@connectors/logger/logger"; +import type { Logger } from "@connectors/logger/logger"; +import type logger from "@connectors/logger/logger"; import { statsDClient } from "@connectors/logger/withlogging"; import { ExternalOauthTokenError } from "./error"; diff --git a/connectors/src/logger/logger.ts b/connectors/src/logger/logger.ts index b7d15b135c99..58731524c088 100644 --- a/connectors/src/logger/logger.ts +++ b/connectors/src/logger/logger.ts @@ -1,4 +1,5 @@ -import pino, { LoggerOptions } from "pino"; +import type { LoggerOptions } from "pino"; +import pino from "pino"; const NODE_ENV = process.env.NODE_ENV; const LOG_LEVEL = process.env.LOG_LEVEL || "info"; diff --git a/connectors/src/logger/withlogging.ts b/connectors/src/logger/withlogging.ts index b735c33fb3b6..31160b3b1aaa 100644 --- a/connectors/src/logger/withlogging.ts +++ b/connectors/src/logger/withlogging.ts @@ -1,7 +1,7 @@ -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import StatsD from "hot-shots"; -import { APIErrorWithStatusCode } from "@connectors/lib/error"; +import type { APIErrorWithStatusCode } from "@connectors/lib/error"; import logger from "./logger"; diff --git a/connectors/src/middleware/auth.ts b/connectors/src/middleware/auth.ts index c00b8471e877..c33b2f9b758c 100644 --- a/connectors/src/middleware/auth.ts +++ b/connectors/src/middleware/auth.ts @@ -1,9 +1,9 @@ import crypto from "crypto"; -import { NextFunction, Request, Response } from "express"; +import type { NextFunction, Request, Response } from "express"; import logger from "@connectors/logger/logger"; import { apiError } from "@connectors/logger/withlogging"; -import { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; +import type { ConnectorsAPIErrorResponse } from "@connectors/types/errors"; const { DUST_CONNECTORS_SECRET, diff --git a/connectors/src/types/connector.ts b/connectors/src/types/connector.ts index be07617154ee..8e45ef117fe5 100644 --- a/connectors/src/types/connector.ts +++ b/connectors/src/types/connector.ts @@ -1,4 +1,4 @@ -import { ConnectorProvider } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; export type ConnectorSyncStatus = "succeeded" | "failed"; export type ConnectorErrorType = "oauth_token_revoked"; diff --git a/connectors/src/types/resources.ts b/connectors/src/types/resources.ts index 770f739b72bf..845d239bfe22 100644 --- a/connectors/src/types/resources.ts +++ b/connectors/src/types/resources.ts @@ -1,4 +1,4 @@ -import { ConnectorProvider } from "@dust-tt/types"; +import type { ConnectorProvider } from "@dust-tt/types"; /** * This type represents the permission associated with a ConnectorResource. For now the only From 941294edede270c302548fd82e24f3a424d077fe Mon Sep 17 00:00:00 2001 From: Flavien David Date: Tue, 16 Jan 2024 18:27:04 +0100 Subject: [PATCH 3/6] Prettier everything --- ...31109_incident_gdrive_non_deleted_files.ts | 11 ++- connectors/src/api/create_connector.ts | 5 +- .../api/slack_channels_linked_with_agent.ts | 11 ++- .../src/connectors/github/lib/github_api.ts | 3 +- .../connectors/github/temporal/activities.ts | 3 +- .../src/connectors/github/temporal/client.ts | 5 +- .../src/connectors/google_drive/index.ts | 11 ++- .../google_drive/temporal/activities.ts | 2 +- .../google_drive/temporal/client.ts | 2 +- connectors/src/connectors/notion/index.ts | 11 ++- connectors/src/connectors/notion/lib/cli.ts | 5 +- .../src/connectors/notion/lib/notion_api.ts | 7 +- .../connectors/notion/temporal/activities.ts | 11 ++- .../src/connectors/notion/temporal/client.ts | 5 +- .../connectors/notion/temporal/workflows.ts | 9 +-- connectors/src/connectors/slack/bot.ts | 12 ++- connectors/src/connectors/slack/index.ts | 11 ++- .../src/connectors/slack/lib/slack_client.ts | 6 +- .../connectors/slack/temporal/activities.ts | 13 +--- connectors/src/connectors/webcrawler/index.ts | 11 ++- .../connectors/webcrawler/temporal/client.ts | 2 +- connectors/src/lib/data_sources.ts | 5 +- connectors/src/lib/models/confluence.ts | 6 +- connectors/src/lib/models/intercom.ts | 6 +- connectors/src/lib/temporal.ts | 9 +-- connectors/src/lib/temporal_monitoring.ts | 5 +- front/components/Button.tsx | 3 +- .../DataSourceResourceSelectorTree.tsx | 5 +- front/components/app/blocks/Block.tsx | 4 +- .../components/assistant/AssistantDetails.tsx | 14 +--- .../components/assistant/AssistantPicker.tsx | 5 +- .../GalleryAssistantPreviewContainer.tsx | 7 +- .../assistant/RenderMessageMarkdown.tsx | 6 +- .../assistant/conversation/AgentMessage.tsx | 11 ++- .../conversation/AgentSuggestion.tsx | 6 +- .../assistant/conversation/Conversation.tsx | 8 +- .../conversation/ConversationMessage.tsx | 10 +-- .../conversation/ConversationTitle.tsx | 2 +- .../conversation/RetrievalAction.tsx | 5 +- .../conversation/input_bar/InputBar.tsx | 4 +- .../input_bar/InputBarContainer.tsx | 4 +- .../input_bar/editor/useCustomEditor.tsx | 9 +-- .../components/assistant/conversation/lib.ts | 6 +- .../assistant_builder/AssistantBuilder.tsx | 14 ++-- .../AssistantBuilderAvatarPicker.tsx | 4 +- .../AssistantBuilderDataSourceModal.tsx | 18 ++--- front/components/home/particles.tsx | 2 +- front/components/home/scrollingHeader.tsx | 2 +- front/components/poke/plans/form.tsx | 5 +- front/components/providers/AI21Setup.tsx | 4 +- front/components/providers/AnthropicSetup.tsx | 4 +- .../components/providers/AzureOpenAISetup.tsx | 4 +- .../providers/BrowserlessAPISetup.tsx | 4 +- front/components/providers/CohereSetup.tsx | 4 +- .../providers/GoogleVertexAISetup.tsx | 4 +- front/components/providers/MistralAISetup.tsx | 4 +- front/components/providers/OpenAISetup.tsx | 4 +- front/components/providers/SerpAPISetup.tsx | 4 +- front/components/providers/SerperSetup.tsx | 4 +- front/components/providers/TextSynthSetup.tsx | 4 +- front/components/sparkle/AppLayout.tsx | 8 +- .../actions/doc_tracker_retrieval.ts | 5 +- .../hooks/index.ts | 11 ++- front/lib/actions/helpers.ts | 10 +-- front/lib/actions/server.ts | 2 +- .../api/assistant/actions/database_query.ts | 5 +- .../lib/api/assistant/actions/dust_app_run.ts | 10 +-- front/lib/api/assistant/actions/retrieval.ts | 7 +- front/lib/api/assistant/agent.ts | 3 +- front/lib/api/assistant/configuration.ts | 78 +++++++++++-------- front/lib/api/assistant/conversation.ts | 5 +- front/lib/api/assistant/generation.ts | 10 ++- front/lib/api/assistant/global_agents.ts | 9 +-- front/lib/api/assistant/recent_authors.ts | 5 +- front/lib/api/assistant/user_relation.ts | 7 +- front/lib/api/data_sources.ts | 8 +- front/lib/extract_events_properties.ts | 5 +- front/lib/models/apps.ts | 6 +- .../assistant/actions/database_query.ts | 6 +- .../models/assistant/actions/dust_app_run.ts | 6 +- .../lib/models/assistant/actions/retrieval.ts | 6 +- front/lib/models/assistant/agent.ts | 6 +- front/lib/models/assistant/conversation.ts | 6 +- front/lib/models/data_source.ts | 6 +- front/lib/models/doc_tracker.ts | 6 +- front/lib/models/extract.ts | 11 +-- front/lib/models/plan.ts | 11 ++- front/lib/models/user.ts | 6 +- front/lib/models/workspace.ts | 6 +- front/lib/models/xp1.ts | 6 +- front/lib/plans/subscription.ts | 6 +- front/lib/swr.ts | 5 +- front/migrations/helpers.ts | 8 +- front/pages/api/poke/plans.ts | 11 ++- front/pages/api/stripe/webhook.ts | 13 +--- .../[name]/documents/[documentId]/index.ts | 4 +- .../agent_configurations/[aId]/index.ts | 7 +- .../assistant/agent_configurations/index.ts | 9 ++- .../[cId]/content_fragment/index.ts | 7 +- .../[cId]/messages/[mId]/retry.ts | 2 +- .../conversations/[cId]/messages/index.ts | 7 +- .../w/[wId]/assistant/conversations/index.ts | 7 +- .../[name]/documents/[documentId]/index.ts | 3 +- .../[name]/managed/permissions/index.ts | 9 +-- .../w/[wId]/data_sources/[name]/tables/csv.ts | 19 +++-- .../pages/api/w/[wId]/data_sources/managed.ts | 8 +- .../pages/api/w/[wId]/subscriptions/index.ts | 5 +- .../poke/[wId]/assistants/[aId]/index.tsx | 3 +- front/pages/poke/[wId]/index.tsx | 11 ++- front/pages/poke/index.tsx | 2 +- front/pages/poke/plans.tsx | 3 +- front/pages/w/[wId]/a/[aId]/execute/index.tsx | 6 +- front/pages/w/[wId]/a/index.tsx | 8 +- front/pages/w/[wId]/assistant/gallery.tsx | 5 +- .../[wId]/builder/assistants/[aId]/index.tsx | 5 +- .../pages/w/[wId]/builder/assistants/new.tsx | 10 ++- .../builder/data-sources/[name]/index.tsx | 15 ++-- .../builder/data-sources/[name]/upsert.tsx | 4 +- .../w/[wId]/builder/data-sources/managed.tsx | 20 ++--- front/pages/w/[wId]/join.tsx | 4 +- 120 files changed, 411 insertions(+), 476 deletions(-) diff --git a/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts b/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts index 86a169dae852..8224bd2cf41c 100644 --- a/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts +++ b/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts @@ -34,10 +34,13 @@ async function main() { console.log(`Connector ${c.id}: found ${files.length} files`); - const fileHash = files.reduce((acc, f) => { - acc[f.dustFileId] = f.id; - return acc; - }, {} as { [key: string]: number }); + const fileHash = files.reduce( + (acc, f) => { + acc[f.dustFileId] = f.id; + return acc; + }, + {} as { [key: string]: number } + ); // find dustProjectId from front based on workspaceId and connectorName const dsData = await front_sequelize.query( diff --git a/connectors/src/api/create_connector.ts b/connectors/src/api/create_connector.ts index d30e0920d242..2ee492740a00 100644 --- a/connectors/src/api/create_connector.ts +++ b/connectors/src/api/create_connector.ts @@ -2,11 +2,12 @@ import type { ConnectorProvider, CreateConnectorOAuthRequestBodySchema, CreateConnectorUrlRequestBodySchema, - Result} from "@dust-tt/types"; + Result, +} from "@dust-tt/types"; import { assertNever, ConnectorCreateRequestBodySchema, - isConnectorProvider + isConnectorProvider, } from "@dust-tt/types"; import type { Request, Response } from "express"; import { isLeft } from "fp-ts/lib/Either"; diff --git a/connectors/src/api/slack_channels_linked_with_agent.ts b/connectors/src/api/slack_channels_linked_with_agent.ts index 10023e39ef22..58b1231d511b 100644 --- a/connectors/src/api/slack_channels_linked_with_agent.ts +++ b/connectors/src/api/slack_channels_linked_with_agent.ts @@ -74,10 +74,13 @@ const _patchSlackChannelsLinkedWithAgentHandler = async ( const remoteChannels = ( await getChannels(parseInt(connectorId), false) ).flatMap((c) => (c.id && c.name ? [{ id: c.id, name: c.name }] : [])); - const remoteChannelsById = remoteChannels.reduce((acc, ch) => { - acc[ch.id] = ch; - return acc; - }, {} as Record); + const remoteChannelsById = remoteChannels.reduce( + (acc, ch) => { + acc[ch.id] = ch; + return acc; + }, + {} as Record + ); const createdChannels = await Promise.all( missingSlackChannelIds.map((slackChannelId) => { const remoteChannel = remoteChannelsById[slackChannelId]; diff --git a/connectors/src/connectors/github/lib/github_api.ts b/connectors/src/connectors/github/lib/github_api.ts index 95802bb32a47..f6b05ce0dd60 100644 --- a/connectors/src/connectors/github/lib/github_api.ts +++ b/connectors/src/connectors/github/lib/github_api.ts @@ -14,7 +14,8 @@ import { extract } from "tar"; import type { DiscussionCommentNode, - DiscussionNode} from "@connectors/connectors/github/lib/github_graphql"; + DiscussionNode, +} from "@connectors/connectors/github/lib/github_graphql"; import { ErrorPayloadSchema, GetDiscussionCommentRepliesPayloadSchema, diff --git a/connectors/src/connectors/github/temporal/activities.ts b/connectors/src/connectors/github/temporal/activities.ts index 38fd2926ec20..67d901857a26 100644 --- a/connectors/src/connectors/github/temporal/activities.ts +++ b/connectors/src/connectors/github/temporal/activities.ts @@ -6,7 +6,8 @@ import { Op } from "sequelize"; import type { GithubIssue as GithubIssueType, - GithubUser} from "@connectors/connectors/github/lib/github_api"; + GithubUser, +} from "@connectors/connectors/github/lib/github_api"; import { cleanUpProcessRepository, getDiscussion, diff --git a/connectors/src/connectors/github/temporal/client.ts b/connectors/src/connectors/github/temporal/client.ts index 00cc62df1334..fdfc7ed933be 100644 --- a/connectors/src/connectors/github/temporal/client.ts +++ b/connectors/src/connectors/github/temporal/client.ts @@ -1,9 +1,8 @@ import type { WorkflowExecutionDescription, - WorkflowHandle} from "@temporalio/client"; -import { - WorkflowNotFoundError, + WorkflowHandle, } from "@temporalio/client"; +import { WorkflowNotFoundError } from "@temporalio/client"; import { QUEUE_NAME } from "@connectors/connectors/github/temporal/config"; import { newWebhookSignal } from "@connectors/connectors/github/temporal/signals"; diff --git a/connectors/src/connectors/google_drive/index.ts b/connectors/src/connectors/google_drive/index.ts index 6b6adba83e8d..43fd3865225d 100644 --- a/connectors/src/connectors/google_drive/index.ts +++ b/connectors/src/connectors/google_drive/index.ts @@ -616,10 +616,13 @@ export async function retrieveGoogleDriveObjectsTitles( }, }); - const titles = googleDriveFiles.reduce((acc, curr) => { - acc[curr.driveFileId] = curr.name; - return acc; - }, {} as Record); + const titles = googleDriveFiles.reduce( + (acc, curr) => { + acc[curr.driveFileId] = curr.name; + return acc; + }, + {} as Record + ); return new Ok(titles); } diff --git a/connectors/src/connectors/google_drive/temporal/activities.ts b/connectors/src/connectors/google_drive/temporal/activities.ts index ebbca837f0b1..cbbabc7456aa 100644 --- a/connectors/src/connectors/google_drive/temporal/activities.ts +++ b/connectors/src/connectors/google_drive/temporal/activities.ts @@ -23,7 +23,7 @@ import { uuid4 } from "@temporalio/workflow"; import type { drive_v3 } from "googleapis"; import { google } from "googleapis"; import { OAuth2Client } from "googleapis-common"; -import type { CreationAttributes} from "sequelize"; +import type { CreationAttributes } from "sequelize"; import { literal, Op } from "sequelize"; import { registerWebhook } from "@connectors/connectors/google_drive/lib"; diff --git a/connectors/src/connectors/google_drive/temporal/client.ts b/connectors/src/connectors/google_drive/temporal/client.ts index e2bca60d6f68..ed13c94e4ee7 100644 --- a/connectors/src/connectors/google_drive/temporal/client.ts +++ b/connectors/src/connectors/google_drive/temporal/client.ts @@ -1,6 +1,6 @@ import type { ModelId } from "@dust-tt/types"; import { rateLimiter, RateLimitError } from "@dust-tt/types"; -import type { WorkflowHandle} from "@temporalio/client"; +import type { WorkflowHandle } from "@temporalio/client"; import { WorkflowNotFoundError } from "@temporalio/client"; import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config"; diff --git a/connectors/src/connectors/notion/index.ts b/connectors/src/connectors/notion/index.ts index 3f523550954a..9787cc9e902d 100644 --- a/connectors/src/connectors/notion/index.ts +++ b/connectors/src/connectors/notion/index.ts @@ -480,10 +480,13 @@ export async function retrieveNotionResourcesTitles( .concat( dbs.map((db) => ({ internalId: db.notionDatabaseId, title: db.title })) ) - .reduce((acc, { internalId, title }) => { - acc[internalId] = title ?? null; - return acc; - }, {} as Record); + .reduce( + (acc, { internalId, title }) => { + acc[internalId] = title ?? null; + return acc; + }, + {} as Record + ); return new Ok(titles); } diff --git a/connectors/src/connectors/notion/lib/cli.ts b/connectors/src/connectors/notion/lib/cli.ts index d4ee166b894f..6a8819d0d339 100644 --- a/connectors/src/connectors/notion/lib/cli.ts +++ b/connectors/src/connectors/notion/lib/cli.ts @@ -38,9 +38,8 @@ export async function searchNotionPagesForQuery({ page_size: 20, }); - const skippedDatabaseIds = await listSkippedDatabaseIdsForConnectorId( - connectorId - ); + const skippedDatabaseIds = + await listSkippedDatabaseIdsForConnectorId(connectorId); return pages.results.map((p) => ({ id: p.id, diff --git a/connectors/src/connectors/notion/lib/notion_api.ts b/connectors/src/connectors/notion/lib/notion_api.ts index 3ef84fcf92b5..af3c063194e3 100644 --- a/connectors/src/connectors/notion/lib/notion_api.ts +++ b/connectors/src/connectors/notion/lib/notion_api.ts @@ -1,12 +1,11 @@ import { cacheWithRedis } from "@dust-tt/types"; -import type { - LogLevel} from "@notionhq/client"; +import type { LogLevel } from "@notionhq/client"; import { APIResponseError, Client, isFullBlock, isFullDatabase, - isFullPage + isFullPage, } from "@notionhq/client"; import type { BlockObjectResponse, @@ -1177,7 +1176,7 @@ export async function* iteratePaginatedAPIWithRetries< Args extends { start_cursor?: string; }, - Item + Item, >( listFn: (args: Args) => Promise>, firstPageArgs: Args, diff --git a/connectors/src/connectors/notion/temporal/activities.ts b/connectors/src/connectors/notion/temporal/activities.ts index fd029a490422..f31f882b53cb 100644 --- a/connectors/src/connectors/notion/temporal/activities.ts +++ b/connectors/src/connectors/notion/temporal/activities.ts @@ -1578,10 +1578,13 @@ export async function renderAndUpsertPageFromCache({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion b.childDatabaseTitle!, })) - .reduce((acc, { id, title }) => { - acc[id] = title; - return acc; - }, {} as Record); + .reduce( + (acc, { id, title }) => { + acc[id] = title; + return acc; + }, + {} as Record + ); localLogger.info( "notionRenderAndUpsertPageFromCache: Retrieving child database pages from cache." diff --git a/connectors/src/connectors/notion/temporal/client.ts b/connectors/src/connectors/notion/temporal/client.ts index 33031665958f..dfe1546f5682 100644 --- a/connectors/src/connectors/notion/temporal/client.ts +++ b/connectors/src/connectors/notion/temporal/client.ts @@ -1,10 +1,9 @@ import type { ModelId } from "@dust-tt/types"; import type { WorkflowExecutionDescription, - WorkflowHandle} from "@temporalio/client"; -import { - WorkflowNotFoundError, + WorkflowHandle, } from "@temporalio/client"; +import { WorkflowNotFoundError } from "@temporalio/client"; import { QUEUE_NAME } from "@connectors/connectors/notion/temporal/config"; import { getWorkflowId } from "@connectors/connectors/notion/temporal/utils"; diff --git a/connectors/src/connectors/notion/temporal/workflows.ts b/connectors/src/connectors/notion/temporal/workflows.ts index a218f3912537..9a3d252830df 100644 --- a/connectors/src/connectors/notion/temporal/workflows.ts +++ b/connectors/src/connectors/notion/temporal/workflows.ts @@ -125,8 +125,8 @@ export async function notionSyncWorkflow({ runType: isGarbageCollectionRun ? "garbageCollection" : isInitialSync - ? "initialSync" - : "incrementalSync", + ? "initialSync" + : "incrementalSync", }, }); cursor = nextCursor; @@ -157,9 +157,8 @@ export async function notionSyncWorkflow({ // these are resources (pages/DBs) that we didn't get from the search API but that are child pages/DBs // of other pages that we did get from the search API. // We upsert those as well. - const discoveredResources = await getDiscoveredResourcesFromCache( - connectorId - ); + const discoveredResources = + await getDiscoveredResourcesFromCache(connectorId); await performUpserts({ connectorId, pageIds: discoveredResources.pageIds, diff --git a/connectors/src/connectors/slack/bot.ts b/connectors/src/connectors/slack/bot.ts index 84ff55889283..0aa4532a2922 100644 --- a/connectors/src/connectors/slack/bot.ts +++ b/connectors/src/connectors/slack/bot.ts @@ -5,16 +5,14 @@ import type { LightAgentConfigurationType, ModelId, RetrievalDocumentType, - UserMessageType} from "@dust-tt/types"; + UserMessageType, +} from "@dust-tt/types"; import type { AgentGenerationSuccessEvent, - PublicPostContentFragmentRequestBodySchema} from "@dust-tt/types"; -import { - sectionFullText -} from "@dust-tt/types"; -import { - DustAPI + PublicPostContentFragmentRequestBodySchema, } from "@dust-tt/types"; +import { sectionFullText } from "@dust-tt/types"; +import { DustAPI } from "@dust-tt/types"; import type { WebClient } from "@slack/web-api"; import type { MessageElement } from "@slack/web-api/dist/response/ConversationsHistoryResponse"; import type * as t from "io-ts"; diff --git a/connectors/src/connectors/slack/index.ts b/connectors/src/connectors/slack/index.ts index 50016b29aa3c..db7f27632be5 100644 --- a/connectors/src/connectors/slack/index.ts +++ b/connectors/src/connectors/slack/index.ts @@ -445,10 +445,13 @@ export async function retrieveSlackConnectorPermissions({ }, }), ]); - const localChannelsById = localChannels.reduce((acc, ch) => { - acc[ch.slackChannelId] = ch; - return acc; - }, {} as Record); + const localChannelsById = localChannels.reduce( + (acc, ch) => { + acc[ch.slackChannelId] = ch; + return acc; + }, + {} as Record + ); for (const remoteChannel of remoteChannels) { if (!remoteChannel.id || !remoteChannel.name) { diff --git a/connectors/src/connectors/slack/lib/slack_client.ts b/connectors/src/connectors/slack/lib/slack_client.ts index 379fd92e0d55..2a8e939132bd 100644 --- a/connectors/src/connectors/slack/lib/slack_client.ts +++ b/connectors/src/connectors/slack/lib/slack_client.ts @@ -3,11 +3,9 @@ import type { CodedError, UsersInfoResponse, WebAPIHTTPError, - WebAPIPlatformError} from "@slack/web-api"; -import { - ErrorCode, - WebClient, + WebAPIPlatformError, } from "@slack/web-api"; +import { ErrorCode, WebClient } from "@slack/web-api"; import type { WorkflowError } from "@connectors/lib/error"; import { ExternalOauthTokenError } from "@connectors/lib/error"; diff --git a/connectors/src/connectors/slack/temporal/activities.ts b/connectors/src/connectors/slack/temporal/activities.ts index 40f53f8e8585..97b1d47b6ed3 100644 --- a/connectors/src/connectors/slack/temporal/activities.ts +++ b/connectors/src/connectors/slack/temporal/activities.ts @@ -1,16 +1,11 @@ -import type { - CoreAPIDataSourceDocumentSection, - ModelId} from "@dust-tt/types"; -import { - cacheWithRedis -} from "@dust-tt/types"; +import type { CoreAPIDataSourceDocumentSection, ModelId } from "@dust-tt/types"; +import { cacheWithRedis } from "@dust-tt/types"; import type { CodedError, WebAPIPlatformError, - WebClient} from "@slack/web-api"; -import { - ErrorCode + WebClient, } from "@slack/web-api"; +import { ErrorCode } from "@slack/web-api"; import type { ConversationsHistoryResponse, MessageElement, diff --git a/connectors/src/connectors/webcrawler/index.ts b/connectors/src/connectors/webcrawler/index.ts index a0eb84df5710..e9f3366c6bd7 100644 --- a/connectors/src/connectors/webcrawler/index.ts +++ b/connectors/src/connectors/webcrawler/index.ts @@ -221,10 +221,13 @@ export async function retrieveWebCrawlerObjectsTitles( }, }); - const titles = googleDriveFiles.reduce((acc, curr) => { - acc[curr.url] = curr.url; - return acc; - }, {} as Record); + const titles = googleDriveFiles.reduce( + (acc, curr) => { + acc[curr.url] = curr.url; + return acc; + }, + {} as Record + ); return new Ok(titles); } diff --git a/connectors/src/connectors/webcrawler/temporal/client.ts b/connectors/src/connectors/webcrawler/temporal/client.ts index c06585521bb3..b78501e4cb99 100644 --- a/connectors/src/connectors/webcrawler/temporal/client.ts +++ b/connectors/src/connectors/webcrawler/temporal/client.ts @@ -1,6 +1,6 @@ import type { ModelId, Result } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; -import type { WorkflowHandle} from "@temporalio/client"; +import type { WorkflowHandle } from "@temporalio/client"; import { WorkflowNotFoundError } from "@temporalio/client"; import { Connector } from "@connectors/lib/models"; diff --git a/connectors/src/lib/data_sources.ts b/connectors/src/lib/data_sources.ts index 29b467df24c8..1d595ef22d73 100644 --- a/connectors/src/lib/data_sources.ts +++ b/connectors/src/lib/data_sources.ts @@ -1,9 +1,8 @@ import type { CoreAPIDataSourceDocumentSection, - PostDataSourceDocumentRequestBody} from "@dust-tt/types"; -import { - sectionFullText, + PostDataSourceDocumentRequestBody, } from "@dust-tt/types"; +import { sectionFullText } from "@dust-tt/types"; import type { AxiosRequestConfig, AxiosResponse } from "axios"; import axios from "axios"; import { fromMarkdown } from "mdast-util-from-markdown"; diff --git a/connectors/src/lib/models/confluence.ts b/connectors/src/lib/models/confluence.ts index d57f3733995b..af9f5776a017 100644 --- a/connectors/src/lib/models/confluence.ts +++ b/connectors/src/lib/models/confluence.ts @@ -2,11 +2,9 @@ import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { Connector, sequelize_conn } from "@connectors/lib/models"; diff --git a/connectors/src/lib/models/intercom.ts b/connectors/src/lib/models/intercom.ts index 63e9ac873b8c..ec2868ce468e 100644 --- a/connectors/src/lib/models/intercom.ts +++ b/connectors/src/lib/models/intercom.ts @@ -2,11 +2,9 @@ import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { Connector, sequelize_conn } from "@connectors/lib/models"; diff --git a/connectors/src/lib/temporal.ts b/connectors/src/lib/temporal.ts index 05d1d4b32640..26758688cf00 100644 --- a/connectors/src/lib/temporal.ts +++ b/connectors/src/lib/temporal.ts @@ -1,11 +1,6 @@ import type { ModelId } from "@dust-tt/types"; -import type { - ConnectionOptions} from "@temporalio/client"; -import { - Client, - Connection, - WorkflowNotFoundError, -} from "@temporalio/client"; +import type { ConnectionOptions } from "@temporalio/client"; +import { Client, Connection, WorkflowNotFoundError } from "@temporalio/client"; import { NativeConnection } from "@temporalio/worker"; import fs from "fs-extra"; diff --git a/connectors/src/lib/temporal_monitoring.ts b/connectors/src/lib/temporal_monitoring.ts index e50544fcf0cc..9ea1a272ff58 100644 --- a/connectors/src/lib/temporal_monitoring.ts +++ b/connectors/src/lib/temporal_monitoring.ts @@ -114,9 +114,8 @@ export class ActivityInboundLogInterceptor if (connectorId) { await syncFailed(connectorId, "oauth_token_revoked"); - const doNotCancelOnTokenRevoked = await getDoNotCancelOnTokenRevoked( - workflowId - ); + const doNotCancelOnTokenRevoked = + await getDoNotCancelOnTokenRevoked(workflowId); if (doNotCancelOnTokenRevoked) { this.logger.info( "Skipping cancelling workflow because of expired token." diff --git a/front/components/Button.tsx b/front/components/Button.tsx index 2a1db26b9171..44e180fef965 100644 --- a/front/components/Button.tsx +++ b/front/components/Button.tsx @@ -1,5 +1,4 @@ -import type { - Icon} from "@dust-tt/sparkle"; +import type { Icon } from "@dust-tt/sparkle"; import { Button, DropdownMenu, diff --git a/front/components/DataSourceResourceSelectorTree.tsx b/front/components/DataSourceResourceSelectorTree.tsx index 96f542ea01c4..8792ea2387d3 100644 --- a/front/components/DataSourceResourceSelectorTree.tsx +++ b/front/components/DataSourceResourceSelectorTree.tsx @@ -7,7 +7,10 @@ import { Spinner, } from "@dust-tt/sparkle"; import type { DataSourceType, WorkspaceType } from "@dust-tt/types"; -import type { ConnectorPermission, ConnectorResourceType } from "@dust-tt/types"; +import type { + ConnectorPermission, + ConnectorResourceType, +} from "@dust-tt/types"; import { CircleStackIcon, FolderIcon } from "@heroicons/react/20/solid"; import { useState } from "react"; diff --git a/front/components/app/blocks/Block.tsx b/front/components/app/blocks/Block.tsx index 8c5e100d6912..48bfddff4d6c 100644 --- a/front/components/app/blocks/Block.tsx +++ b/front/components/app/blocks/Block.tsx @@ -112,8 +112,8 @@ export default function Block({ readOnly ? "border-white ring-0 focus:border-white focus:ring-0" : nameError != "" - ? "border-orange-400 focus:border-orange-400 focus:ring-0" - : "border-white focus:border-gray-300 focus:ring-0" + ? "border-orange-400 focus:border-orange-400 focus:ring-0" + : "border-white focus:border-gray-300 focus:ring-0" )} readOnly={readOnly} value={block.name} diff --git a/front/components/assistant/AssistantDetails.tsx b/front/components/assistant/AssistantDetails.tsx index 71f7ed9dd03b..c7cddd553b0c 100644 --- a/front/components/assistant/AssistantDetails.tsx +++ b/front/components/assistant/AssistantDetails.tsx @@ -15,18 +15,12 @@ import type { ConnectorProvider, LightAgentConfigurationType, } from "@dust-tt/types"; -import type { - DustAppRunConfigurationType} from "@dust-tt/types"; -import type { - DataSourceConfiguration} from "@dust-tt/types"; +import type { DustAppRunConfigurationType } from "@dust-tt/types"; +import type { DataSourceConfiguration } from "@dust-tt/types"; import type { AgentConfigurationType } from "@dust-tt/types"; import type { WorkspaceType } from "@dust-tt/types"; -import { - isDustAppRunConfiguration, -} from "@dust-tt/types"; -import { - isRetrievalConfiguration, -} from "@dust-tt/types"; +import { isDustAppRunConfiguration } from "@dust-tt/types"; +import { isRetrievalConfiguration } from "@dust-tt/types"; import Link from "next/link"; import { useContext, useState } from "react"; import ReactMarkdown from "react-markdown"; diff --git a/front/components/assistant/AssistantPicker.tsx b/front/components/assistant/AssistantPicker.tsx index b511430cdde7..e14e119466d1 100644 --- a/front/components/assistant/AssistantPicker.tsx +++ b/front/components/assistant/AssistantPicker.tsx @@ -7,7 +7,10 @@ import { Searchbar, WrenchIcon, } from "@dust-tt/sparkle"; -import type { LightAgentConfigurationType, WorkspaceType } from "@dust-tt/types"; +import type { + LightAgentConfigurationType, + WorkspaceType, +} from "@dust-tt/types"; import Link from "next/link"; import { useEffect, useState } from "react"; diff --git a/front/components/assistant/GalleryAssistantPreviewContainer.tsx b/front/components/assistant/GalleryAssistantPreviewContainer.tsx index a3be96857d65..3438c35739e3 100644 --- a/front/components/assistant/GalleryAssistantPreviewContainer.tsx +++ b/front/components/assistant/GalleryAssistantPreviewContainer.tsx @@ -7,11 +7,8 @@ import type { } from "@dust-tt/types"; import { useContext, useEffect, useState } from "react"; -import type { - NotificationType} from "@app/components/sparkle/Notification"; -import { - SendNotificationsContext, -} from "@app/components/sparkle/Notification"; +import type { NotificationType } from "@app/components/sparkle/Notification"; +import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { isLargeModel } from "@app/lib/assistant"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; import type { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status"; diff --git a/front/components/assistant/RenderMessageMarkdown.tsx b/front/components/assistant/RenderMessageMarkdown.tsx index f08631638ccb..4c97b9e53386 100644 --- a/front/components/assistant/RenderMessageMarkdown.tsx +++ b/front/components/assistant/RenderMessageMarkdown.tsx @@ -7,7 +7,7 @@ import { import type { LightAgentConfigurationType } from "@dust-tt/types"; import type { RetrievalDocumentType } from "@dust-tt/types"; import dynamic from "next/dynamic"; -import type { ReactNode} from "react"; +import type { ReactNode } from "react"; import React, { useCallback, useEffect, useState } from "react"; import ReactMarkdown from "react-markdown"; import type { ReactMarkdownProps } from "react-markdown/lib/complex-types"; @@ -268,8 +268,8 @@ function MentionBlock({ !agentConfiguration || agentConfiguration?.status === "archived" ? "(This assistant was deleted)" : agentConfiguration?.status === "active" - ? "" - : "(This assistant is deactivated for this workspace)"; + ? "" + : "(This assistant is deactivated for this workspace)"; const tooltipLabel = agentConfiguration?.description || "" + " " + statusText; return ( diff --git a/front/components/assistant/conversation/AgentMessage.tsx b/front/components/assistant/conversation/AgentMessage.tsx index e25451f53edf..a57b2dc3b859 100644 --- a/front/components/assistant/conversation/AgentMessage.tsx +++ b/front/components/assistant/conversation/AgentMessage.tsx @@ -289,10 +289,13 @@ export function AgentMessage({ agentMessageToRender.action.documents ) { setReferences( - agentMessageToRender.action.documents.reduce((acc, d) => { - acc[d.reference] = d; - return acc; - }, {} as { [key: string]: RetrievalDocumentType }) + agentMessageToRender.action.documents.reduce( + (acc, d) => { + acc[d.reference] = d; + return acc; + }, + {} as { [key: string]: RetrievalDocumentType } + ) ); } }, [agentMessageToRender.action]); diff --git a/front/components/assistant/conversation/AgentSuggestion.tsx b/front/components/assistant/conversation/AgentSuggestion.tsx index ad46e2ccdf6a..75e2f3f13dac 100644 --- a/front/components/assistant/conversation/AgentSuggestion.tsx +++ b/front/components/assistant/conversation/AgentSuggestion.tsx @@ -3,11 +3,9 @@ import type { ConversationType, LightAgentConfigurationType, UserMessageType, - WorkspaceType} from "@dust-tt/types"; -import { - isAgentMention, - isUserMessageType + WorkspaceType, } from "@dust-tt/types"; +import { isAgentMention, isUserMessageType } from "@dust-tt/types"; import { useContext, useState } from "react"; import { AssistantPicker } from "@app/components/assistant/AssistantPicker"; diff --git a/front/components/assistant/conversation/Conversation.tsx b/front/components/assistant/conversation/Conversation.tsx index 9fdd691f1708..0fc2136733e9 100644 --- a/front/components/assistant/conversation/Conversation.tsx +++ b/front/components/assistant/conversation/Conversation.tsx @@ -1,16 +1,12 @@ import type { UserType, WorkspaceType } from "@dust-tt/types"; -import type { - AgentMention} from "@dust-tt/types"; +import type { AgentMention } from "@dust-tt/types"; import type { AgentGenerationCancelledEvent } from "@dust-tt/types"; import type { AgentMessageNewEvent, ConversationTitleEvent, UserMessageNewEvent, } from "@dust-tt/types"; -import { - isAgentMention, - isUserMessageType, -} from "@dust-tt/types"; +import { isAgentMention, isUserMessageType } from "@dust-tt/types"; import { useCallback, useEffect, useRef } from "react"; import { AgentMessage } from "@app/components/assistant/conversation/AgentMessage"; diff --git a/front/components/assistant/conversation/ConversationMessage.tsx b/front/components/assistant/conversation/ConversationMessage.tsx index 50e995b29afb..6ac9ab1a9e0c 100644 --- a/front/components/assistant/conversation/ConversationMessage.tsx +++ b/front/components/assistant/conversation/ConversationMessage.tsx @@ -4,14 +4,8 @@ import type { UserType, WorkspaceType } from "@dust-tt/types"; import type { MessageReactionType } from "@dust-tt/types"; import type { Emoji, EmojiMartData } from "@emoji-mart/data"; import Picker from "@emoji-mart/react"; -import type { - ComponentType, - MouseEventHandler} from "react"; -import { - useEffect, - useRef, - useState, -} from "react"; +import type { ComponentType, MouseEventHandler } from "react"; +import { useEffect, useRef, useState } from "react"; import React from "react"; import { mutate } from "swr"; diff --git a/front/components/assistant/conversation/ConversationTitle.tsx b/front/components/assistant/conversation/ConversationTitle.tsx index be54f624feb6..0952ba82789d 100644 --- a/front/components/assistant/conversation/ConversationTitle.tsx +++ b/front/components/assistant/conversation/ConversationTitle.tsx @@ -12,7 +12,7 @@ import { } from "@dust-tt/sparkle"; import type { WorkspaceType } from "@dust-tt/types"; import type { ConversationType } from "@dust-tt/types"; -import type { MouseEvent} from "react"; +import type { MouseEvent } from "react"; import React, { useRef, useState } from "react"; import { useSWRConfig } from "swr"; diff --git a/front/components/assistant/conversation/RetrievalAction.tsx b/front/components/assistant/conversation/RetrievalAction.tsx index 6a6ac2fe48ba..3e1df9356c8a 100644 --- a/front/components/assistant/conversation/RetrievalAction.tsx +++ b/front/components/assistant/conversation/RetrievalAction.tsx @@ -7,7 +7,10 @@ import { Spinner, Tooltip, } from "@dust-tt/sparkle"; -import type { RetrievalActionType, RetrievalDocumentType } from "@dust-tt/types"; +import type { + RetrievalActionType, + RetrievalDocumentType, +} from "@dust-tt/types"; import { Transition } from "@headlessui/react"; import { useState } from "react"; diff --git a/front/components/assistant/conversation/input_bar/InputBar.tsx b/front/components/assistant/conversation/input_bar/InputBar.tsx index d1749954e8fa..71044f6ccb7d 100644 --- a/front/components/assistant/conversation/input_bar/InputBar.tsx +++ b/front/components/assistant/conversation/input_bar/InputBar.tsx @@ -13,9 +13,7 @@ import { import { mutate } from "swr"; import { GenerationContext } from "@app/components/assistant/conversation/GenerationContextProvider"; -import type { - InputBarContainerProps, -} from "@app/components/assistant/conversation/input_bar/InputBarContainer"; +import type { InputBarContainerProps } from "@app/components/assistant/conversation/input_bar/InputBarContainer"; import InputBarContainer from "@app/components/assistant/conversation/input_bar/InputBarContainer"; import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { compareAgentsForSort } from "@app/lib/assistant"; diff --git a/front/components/assistant/conversation/input_bar/InputBarContainer.tsx b/front/components/assistant/conversation/input_bar/InputBarContainer.tsx index 174c625aec63..ab43ef145aaf 100644 --- a/front/components/assistant/conversation/input_bar/InputBarContainer.tsx +++ b/front/components/assistant/conversation/input_bar/InputBarContainer.tsx @@ -16,9 +16,7 @@ import React, { useRef, useState } from "react"; import { AssistantPicker } from "@app/components/assistant/AssistantPicker"; import useAssistantSuggestions from "@app/components/assistant/conversation/input_bar/editor/useAssistantSuggestions"; -import type { - CustomEditorProps, -} from "@app/components/assistant/conversation/input_bar/editor/useCustomEditor"; +import type { CustomEditorProps } from "@app/components/assistant/conversation/input_bar/editor/useCustomEditor"; import useCustomEditor from "@app/components/assistant/conversation/input_bar/editor/useCustomEditor"; import useHandleMentions from "@app/components/assistant/conversation/input_bar/editor/useHandleMentions"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx index 277de9409ad3..80671a513ea6 100644 --- a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx +++ b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx @@ -1,15 +1,12 @@ import Mention, { MentionPluginKey } from "@tiptap/extension-mention"; import Placeholder from "@tiptap/extension-placeholder"; -import type { Editor, JSONContent} from "@tiptap/react"; +import type { Editor, JSONContent } from "@tiptap/react"; import { useEditor } from "@tiptap/react"; import { StarterKit } from "@tiptap/starter-kit"; import { useMemo } from "react"; -import type { - EditorSuggestion} from "@app/components/assistant/conversation/input_bar/editor/suggestion"; -import { - makeGetAssistantSuggestions, -} from "@app/components/assistant/conversation/input_bar/editor/suggestion"; +import type { EditorSuggestion } from "@app/components/assistant/conversation/input_bar/editor/suggestion"; +import { makeGetAssistantSuggestions } from "@app/components/assistant/conversation/input_bar/editor/suggestion"; export interface EditorMention { id: string; diff --git a/front/components/assistant/conversation/lib.ts b/front/components/assistant/conversation/lib.ts index ff923b23410d..ba6a7fb53011 100644 --- a/front/components/assistant/conversation/lib.ts +++ b/front/components/assistant/conversation/lib.ts @@ -5,11 +5,9 @@ import type { MentionType, Result, UserType, - WorkspaceType} from "@dust-tt/types"; -import { - Err, - Ok + WorkspaceType, } from "@dust-tt/types"; +import { Err, Ok } from "@dust-tt/types"; import type * as t from "io-ts"; import type { NotificationType } from "@app/components/sparkle/Notification"; diff --git a/front/components/assistant_builder/AssistantBuilder.tsx b/front/components/assistant_builder/AssistantBuilder.tsx index 2c2bc683e17a..0b8e45dbdbac 100644 --- a/front/components/assistant_builder/AssistantBuilder.tsx +++ b/front/components/assistant_builder/AssistantBuilder.tsx @@ -18,28 +18,26 @@ import { import type { AgentConfigurationScope, ConnectorProvider, - DataSourceType} from "@dust-tt/types"; + DataSourceType, +} from "@dust-tt/types"; import type { UserType, WorkspaceType } from "@dust-tt/types"; -import type { - SupportedModel} from "@dust-tt/types"; +import type { SupportedModel } from "@dust-tt/types"; import type { TimeframeUnit } from "@dust-tt/types"; import type { AppType } from "@dust-tt/types"; import type { PlanType, SubscriptionType } from "@dust-tt/types"; import type { PostOrPatchAgentConfigurationRequestBodySchema } from "@dust-tt/types"; -import { - GEMINI_PRO_DEFAULT_MODEL_CONFIG, -} from "@dust-tt/types"; +import { GEMINI_PRO_DEFAULT_MODEL_CONFIG } from "@dust-tt/types"; import { CLAUDE_DEFAULT_MODEL_CONFIG, CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG, GPT_3_5_TURBO_MODEL_CONFIG, GPT_4_TURBO_MODEL_CONFIG, MISTRAL_MEDIUM_MODEL_CONFIG, - MISTRAL_SMALL_MODEL_CONFIG + MISTRAL_SMALL_MODEL_CONFIG, } from "@dust-tt/types"; import type * as t from "io-ts"; import { useRouter } from "next/router"; -import type { ReactNode} from "react"; +import type { ReactNode } from "react"; import { useCallback, useEffect, useState } from "react"; import React from "react"; import ReactTextareaAutosize from "react-textarea-autosize"; diff --git a/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx b/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx index 092d1809525b..4f09bd183fb8 100644 --- a/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx +++ b/front/components/assistant_builder/AssistantBuilderAvatarPicker.tsx @@ -9,10 +9,10 @@ import { Tab, } from "@dust-tt/sparkle"; import type { WorkspaceType } from "@dust-tt/types"; -import type { ChangeEvent} from "react"; +import type { ChangeEvent } from "react"; import { useRef, useState } from "react"; import React from "react"; -import type { Crop} from "react-image-crop"; +import type { Crop } from "react-image-crop"; import ReactCrop, { centerCrop, makeAspectCrop } from "react-image-crop"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx index 58687cf3fdbf..924c1b939c1e 100644 --- a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx +++ b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx @@ -13,11 +13,8 @@ import { Transition } from "@headlessui/react"; import * as React from "react"; import { useCallback, useEffect, useState } from "react"; -import type { - AssistantBuilderDataSourceConfiguration} from "@app/components/assistant_builder/AssistantBuilder"; -import { - CONNECTOR_PROVIDER_TO_RESOURCE_NAME, -} from "@app/components/assistant_builder/AssistantBuilder"; +import type { AssistantBuilderDataSourceConfiguration } from "@app/components/assistant_builder/AssistantBuilder"; +import { CONNECTOR_PROVIDER_TO_RESOURCE_NAME } from "@app/components/assistant_builder/AssistantBuilder"; import DataSourceResourceSelectorTree from "@app/components/DataSourceResourceSelectorTree"; import { CONNECTOR_CONFIGURATIONS } from "@app/lib/connector_providers"; import type { GetConnectorResourceParentsResponseBody } from "@app/pages/api/w/[wId]/data_sources/[name]/managed/parents"; @@ -218,10 +215,13 @@ function DataSourceResourceSelector({ } const json: GetConnectorResourceParentsResponseBody = await res.json(); setParentsById( - json.resources.reduce((acc, r) => { - acc[r.internalId] = new Set(r.parents); - return acc; - }, {} as Record>) + json.resources.reduce( + (acc, r) => { + acc[r.internalId] = new Set(r.parents); + return acc; + }, + {} as Record> + ) ); } catch (e) { setParentsAreError(true); diff --git a/front/components/home/particles.tsx b/front/components/home/particles.tsx index 02a5d7a5f177..c88798f003a1 100644 --- a/front/components/home/particles.tsx +++ b/front/components/home/particles.tsx @@ -1,4 +1,4 @@ -import type { RefObject} from "react"; +import type { RefObject } from "react"; import { useEffect } from "react"; import * as THREE from "three"; diff --git a/front/components/home/scrollingHeader.tsx b/front/components/home/scrollingHeader.tsx index fe71c2d02a36..f529ff1849b9 100644 --- a/front/components/home/scrollingHeader.tsx +++ b/front/components/home/scrollingHeader.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import type { ReactNode} from "react"; +import type { ReactNode } from "react"; import React, { useCallback, useEffect, useState } from "react"; // Define your scroll limit here diff --git a/front/components/poke/plans/form.tsx b/front/components/poke/plans/form.tsx index d23225ccc80e..986690b94895 100644 --- a/front/components/poke/plans/form.tsx +++ b/front/components/poke/plans/form.tsx @@ -12,10 +12,9 @@ import { import type { FreeBillingType, PaidBillingType, - PlanType} from "@dust-tt/types"; -import { - assertNever + PlanType, } from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; import { useCallback, useState } from "react"; import { classNames } from "@app/lib/utils"; diff --git a/front/components/providers/AI21Setup.tsx b/front/components/providers/AI21Setup.tsx index 6a8311d46daf..381afda6fc83 100644 --- a/front/components/providers/AI21Setup.tsx +++ b/front/components/providers/AI21Setup.tsx @@ -183,8 +183,8 @@ export default function AI21Setup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/AnthropicSetup.tsx b/front/components/providers/AnthropicSetup.tsx index e4b367d5d362..dc44bcc653e1 100644 --- a/front/components/providers/AnthropicSetup.tsx +++ b/front/components/providers/AnthropicSetup.tsx @@ -186,8 +186,8 @@ export default function AnthropicSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/AzureOpenAISetup.tsx b/front/components/providers/AzureOpenAISetup.tsx index 3017b711ef94..a597cd8a40e3 100644 --- a/front/components/providers/AzureOpenAISetup.tsx +++ b/front/components/providers/AzureOpenAISetup.tsx @@ -197,8 +197,8 @@ export default function AzureOpenAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/BrowserlessAPISetup.tsx b/front/components/providers/BrowserlessAPISetup.tsx index 33652d92031e..2225570a7dfb 100644 --- a/front/components/providers/BrowserlessAPISetup.tsx +++ b/front/components/providers/BrowserlessAPISetup.tsx @@ -191,8 +191,8 @@ export default function BrowserlessAPISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/CohereSetup.tsx b/front/components/providers/CohereSetup.tsx index 634e4cdce15b..24e94db850cc 100644 --- a/front/components/providers/CohereSetup.tsx +++ b/front/components/providers/CohereSetup.tsx @@ -183,8 +183,8 @@ export default function CohereSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/GoogleVertexAISetup.tsx b/front/components/providers/GoogleVertexAISetup.tsx index e1b8d2fb0dc5..78c78f30a59f 100644 --- a/front/components/providers/GoogleVertexAISetup.tsx +++ b/front/components/providers/GoogleVertexAISetup.tsx @@ -201,8 +201,8 @@ export default function GoogleVertexAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/MistralAISetup.tsx b/front/components/providers/MistralAISetup.tsx index bbf37ed0bdb4..1111bd8342fa 100644 --- a/front/components/providers/MistralAISetup.tsx +++ b/front/components/providers/MistralAISetup.tsx @@ -184,8 +184,8 @@ export default function MistralAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/OpenAISetup.tsx b/front/components/providers/OpenAISetup.tsx index 5264100e0f06..1db371032182 100644 --- a/front/components/providers/OpenAISetup.tsx +++ b/front/components/providers/OpenAISetup.tsx @@ -183,8 +183,8 @@ export default function OpenAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/SerpAPISetup.tsx b/front/components/providers/SerpAPISetup.tsx index 557336533769..23c4b165ae36 100644 --- a/front/components/providers/SerpAPISetup.tsx +++ b/front/components/providers/SerpAPISetup.tsx @@ -183,8 +183,8 @@ export default function SerpAPISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/SerperSetup.tsx b/front/components/providers/SerperSetup.tsx index 2050794e6031..724dda0fd8d2 100644 --- a/front/components/providers/SerperSetup.tsx +++ b/front/components/providers/SerperSetup.tsx @@ -183,8 +183,8 @@ export default function SerperSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/TextSynthSetup.tsx b/front/components/providers/TextSynthSetup.tsx index ed5b32cbd575..8885d49f9692 100644 --- a/front/components/providers/TextSynthSetup.tsx +++ b/front/components/providers/TextSynthSetup.tsx @@ -185,8 +185,8 @@ export default function TextSynthSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/sparkle/AppLayout.tsx b/front/components/sparkle/AppLayout.tsx index f304e81f5db3..75c295e8774e 100644 --- a/front/components/sparkle/AppLayout.tsx +++ b/front/components/sparkle/AppLayout.tsx @@ -21,12 +21,8 @@ import React from "react"; import WorkspacePicker from "@app/components/WorkspacePicker"; import { classNames } from "@app/lib/utils"; -import type { - SidebarNavigation, - TopNavigationId} from "./navigation"; -import { - topNavigation -} from "./navigation"; +import type { SidebarNavigation, TopNavigationId } from "./navigation"; +import { topNavigation } from "./navigation"; function NavigationBar({ user, diff --git a/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts b/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts index 00f55eaad704..b1737e45e0e2 100644 --- a/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts +++ b/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts @@ -15,9 +15,8 @@ export async function callDocTrackerRetrievalAction( const action = DustProdActionRegistry["doc-tracker-retrieval"]; const config = cloneBaseConfig(action.config); - config.SEMANTIC_SEARCH.data_sources = await getTrackableDataSources( - workspaceId - ); + config.SEMANTIC_SEARCH.data_sources = + await getTrackableDataSources(workspaceId); config.SEMANTIC_SEARCH.target_document_tokens = targetDocumentTokens; const res = await callAction({ diff --git a/front/documents_post_process_hooks/hooks/index.ts b/front/documents_post_process_hooks/hooks/index.ts index 4837200602ed..8780920afb0d 100644 --- a/front/documents_post_process_hooks/hooks/index.ts +++ b/front/documents_post_process_hooks/hooks/index.ts @@ -89,10 +89,13 @@ export const DOCUMENTS_POST_PROCESS_HOOKS = [ export const DOCUMENTS_POST_PROCESS_HOOK_BY_TYPE: Record< DocumentsPostProcessHookType, DocumentsPostProcessHook -> = DOCUMENTS_POST_PROCESS_HOOKS.reduce((acc, hook) => { - acc[hook.type] = hook; - return acc; -}, {} as Record); +> = DOCUMENTS_POST_PROCESS_HOOKS.reduce( + (acc, hook) => { + acc[hook.type] = hook; + return acc; + }, + {} as Record +); export async function getDocumentsPostUpsertHooksToRun( params: DocumentsPostProcessHookOnUpsertParams diff --git a/front/lib/actions/helpers.ts b/front/lib/actions/helpers.ts index 8c41d6edd782..1193509b556f 100644 --- a/front/lib/actions/helpers.ts +++ b/front/lib/actions/helpers.ts @@ -1,12 +1,8 @@ -import type { Action} from "@dust-tt/types"; -import type { - DustAPIErrorResponse, - DustAppConfigType} from "@dust-tt/types"; +import type { Action } from "@dust-tt/types"; +import type { DustAPIErrorResponse, DustAppConfigType } from "@dust-tt/types"; import type { Result } from "@dust-tt/types"; import { cloneBaseConfig } from "@dust-tt/types"; -import { - DustAPI -} from "@dust-tt/types"; +import { DustAPI } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; import { isRight } from "fp-ts/lib/Either"; import * as t from "io-ts"; diff --git a/front/lib/actions/server.ts b/front/lib/actions/server.ts index 63a95dc543be..2a0d0c934a3b 100644 --- a/front/lib/actions/server.ts +++ b/front/lib/actions/server.ts @@ -4,7 +4,7 @@ import { DustProdActionRegistry } from "@dust-tt/types"; import { DustAPI } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; -import type { Authenticator} from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { prodAPICredentialsForOwner } from "@app/lib/auth"; import logger from "@app/logger/logger"; import { statsDClient } from "@app/logger/withlogging"; diff --git a/front/lib/api/assistant/actions/database_query.ts b/front/lib/api/assistant/actions/database_query.ts index 80f19672cc0b..413b86b4699f 100644 --- a/front/lib/api/assistant/actions/database_query.ts +++ b/front/lib/api/assistant/actions/database_query.ts @@ -9,13 +9,14 @@ import type { DatabaseQuerySuccessEvent, ModelMessageType, Result, - UserMessageType} from "@dust-tt/types"; + UserMessageType, +} from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry, Err, isDatabaseQueryConfiguration, - Ok + Ok, } from "@dust-tt/types"; import { runActionStreamed } from "@app/lib/actions/server"; diff --git a/front/lib/api/assistant/actions/dust_app_run.ts b/front/lib/api/assistant/actions/dust_app_run.ts index bb7c736267f6..79b66493ed23 100644 --- a/front/lib/api/assistant/actions/dust_app_run.ts +++ b/front/lib/api/assistant/actions/dust_app_run.ts @@ -6,9 +6,7 @@ import type { ModelId, ModelMessageType, } from "@dust-tt/types"; -import type { - DustAppParameters, - DustAppRunActionType} from "@dust-tt/types"; +import type { DustAppParameters, DustAppRunActionType } from "@dust-tt/types"; import type { AgentActionSpecification, AgentConfigurationType, @@ -21,13 +19,11 @@ import type { import type { AppType, SpecificationType } from "@dust-tt/types"; import type { DatasetSchema } from "@dust-tt/types"; import type { Result } from "@dust-tt/types"; -import { - isDustAppRunConfiguration, -} from "@dust-tt/types"; +import { isDustAppRunConfiguration } from "@dust-tt/types"; import { DustAPI } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; -import type { Authenticator} from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { prodAPICredentialsForOwner } from "@app/lib/auth"; import { extractConfig } from "@app/lib/config"; import { AgentDustAppRunAction } from "@app/lib/models"; diff --git a/front/lib/api/assistant/actions/retrieval.ts b/front/lib/api/assistant/actions/retrieval.ts index f6f14b91d085..aae56d043fb0 100644 --- a/front/lib/api/assistant/actions/retrieval.ts +++ b/front/lib/api/assistant/actions/retrieval.ts @@ -9,7 +9,8 @@ import type { RetrievalActionType, RetrievalConfigurationType, RetrievalDocumentType, - TimeFrame} from "@dust-tt/types"; + TimeFrame, +} from "@dust-tt/types"; import type { AgentActionSpecification, AgentConfigurationType, @@ -20,9 +21,7 @@ import type { UserMessageType, } from "@dust-tt/types"; import type { Result } from "@dust-tt/types"; -import { - isRetrievalConfiguration -} from "@dust-tt/types"; +import { isRetrievalConfiguration } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; diff --git a/front/lib/api/assistant/agent.ts b/front/lib/api/assistant/agent.ts index dbcf0ecfc7bc..64c2f5143d8c 100644 --- a/front/lib/api/assistant/agent.ts +++ b/front/lib/api/assistant/agent.ts @@ -7,7 +7,8 @@ import type { AgentGenerationSuccessEvent, AgentMessageSuccessEvent, DatabaseQueryParamsEvent, - GenerationTokensEvent} from "@dust-tt/types"; + GenerationTokensEvent, +} from "@dust-tt/types"; import type { AgentActionSpecification, LightAgentConfigurationType, diff --git a/front/lib/api/assistant/configuration.ts b/front/lib/api/assistant/configuration.ts index ac8d054670ee..7f1156ebb32d 100644 --- a/front/lib/api/assistant/configuration.ts +++ b/front/lib/api/assistant/configuration.ts @@ -3,14 +3,16 @@ import type { AgentUserListStatus, LightAgentConfigurationType, Result, - SupportedModel} from "@dust-tt/types"; + SupportedModel, +} from "@dust-tt/types"; import type { DustAppRunConfigurationType } from "@dust-tt/types"; import type { AgentsGetViewType, DataSourceConfiguration, RetrievalConfigurationType, RetrievalQuery, - RetrievalTimeframe} from "@dust-tt/types"; + RetrievalTimeframe, +} from "@dust-tt/types"; import type { AgentActionConfigurationType, AgentConfigurationScope, @@ -19,17 +21,10 @@ import type { AgentStatus, } from "@dust-tt/types"; import type { DatabaseQueryConfigurationType } from "@dust-tt/types"; -import { - assertNever, - Err, - Ok -} from "@dust-tt/types"; -import { - isTemplatedQuery, - isTimeFrame -} from "@dust-tt/types"; +import { assertNever, Err, Ok } from "@dust-tt/types"; +import { isTemplatedQuery, isTimeFrame } from "@dust-tt/types"; import { isSupportedModel } from "@dust-tt/types"; -import type { Transaction} from "sequelize"; +import type { Transaction } from "sequelize"; import { Op, UniqueConstraintError } from "sequelize"; import { @@ -217,10 +212,13 @@ export async function getAgentConfigurations({ })(); function byId(list: T[]): Record { - return list.reduce((acc, item) => { - acc[item.id] = item; - return acc; - }, {} as Record); + return list.reduce( + (acc, item) => { + acc[item.id] = item; + return acc; + }, + {} as Record + ); } const configurationIds = agentConfigurations.map((a) => a.id); @@ -272,10 +270,13 @@ export async function getAgentConfigurations({ userId: user.id, }, }).then((relations) => - relations.reduce((acc, relation) => { - acc[relation.agentConfiguration] = relation; - return acc; - }, {} as Record) + relations.reduce( + (acc, relation) => { + acc[relation.agentConfiguration] = relation; + return acc; + }, + {} as Record + ) ) : Promise.resolve({} as Record), ]); @@ -290,12 +291,15 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce((acc, dsConfig) => { - acc[dsConfig.retrievalConfigurationId] = - acc[dsConfig.retrievalConfigurationId] || []; - acc[dsConfig.retrievalConfigurationId].push(dsConfig); - return acc; - }, {} as Record); + ).reduce( + (acc, dsConfig) => { + acc[dsConfig.retrievalConfigurationId] = + acc[dsConfig.retrievalConfigurationId] || []; + acc[dsConfig.retrievalConfigurationId].push(dsConfig); + return acc; + }, + {} as Record + ); const dataSourceIds = Object.values(agentDatasourceConfigurations) .flat() @@ -310,10 +314,13 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce((acc, ds) => { - acc[ds.id] = ds; - return acc; - }, {} as Record); + ).reduce( + (acc, ds) => { + acc[ds.id] = ds; + return acc; + }, + {} as Record + ); const workspaceIds = Object.values(dataSources).map((ds) => ds.workspaceId); const dataSourceWorkspaces = ( @@ -326,10 +333,13 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce((acc, ws) => { - acc[ws.id] = ws; - return acc; - }, {} as Record); + ).reduce( + (acc, ws) => { + acc[ws.id] = ws; + return acc; + }, + {} as Record + ); let agentConfigurationTypes: AgentConfigurationType[] = []; for (const agent of agentConfigurations) { diff --git a/front/lib/api/assistant/conversation.ts b/front/lib/api/assistant/conversation.ts index 07efd4bd75ba..ba9261f8758c 100644 --- a/front/lib/api/assistant/conversation.ts +++ b/front/lib/api/assistant/conversation.ts @@ -17,7 +17,8 @@ import type { ConversationWithoutContentType, MentionType, UserMessageContext, - UserMessageType} from "@dust-tt/types"; + UserMessageType, +} from "@dust-tt/types"; import type { PlanType } from "@dust-tt/types"; import type { Result } from "@dust-tt/types"; import type { @@ -34,7 +35,7 @@ import { isAgentMention, isAgentMessageType, isUserMention, - isUserMessageType + isUserMessageType, } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; import { Err, Ok } from "@dust-tt/types"; diff --git a/front/lib/api/assistant/generation.ts b/front/lib/api/assistant/generation.ts index 00cc9f10f177..d5597e8b3010 100644 --- a/front/lib/api/assistant/generation.ts +++ b/front/lib/api/assistant/generation.ts @@ -5,17 +5,19 @@ import type { GenerationSuccessEvent, GenerationTokensEvent, ModelConversationType, - ModelMessageType} from "@dust-tt/types"; + ModelMessageType, +} from "@dust-tt/types"; import type { AgentMessageType, ConversationType, - UserMessageType} from "@dust-tt/types"; + UserMessageType, +} from "@dust-tt/types"; import type { Result } from "@dust-tt/types"; import { GPT_4_32K_MODEL_ID, GPT_4_MODEL_CONFIG, isDatabaseQueryActionType, - isDustAppRunActionType + isDustAppRunActionType, } from "@dust-tt/types"; import { isRetrievalActionType, @@ -24,7 +26,7 @@ import { import { isAgentMessageType, isContentFragmentType, - isUserMessageType + isUserMessageType, } from "@dust-tt/types"; import { cloneBaseConfig, DustProdActionRegistry } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; diff --git a/front/lib/api/assistant/global_agents.ts b/front/lib/api/assistant/global_agents.ts index ea2d40090b8b..39bce3f88aa9 100644 --- a/front/lib/api/assistant/global_agents.ts +++ b/front/lib/api/assistant/global_agents.ts @@ -7,11 +7,10 @@ const readFileAsync = promisify(fs.readFile); import type { AgentConfigurationType, ConnectorProvider, - DataSourceType} from "@dust-tt/types"; -import type { GlobalAgentStatus, PlanType } from "@dust-tt/types"; -import { - GEMINI_PRO_DEFAULT_MODEL_CONFIG, + DataSourceType, } from "@dust-tt/types"; +import type { GlobalAgentStatus, PlanType } from "@dust-tt/types"; +import { GEMINI_PRO_DEFAULT_MODEL_CONFIG } from "@dust-tt/types"; import { CLAUDE_DEFAULT_MODEL_CONFIG, CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG, @@ -23,7 +22,7 @@ import { import { DustAPI } from "@dust-tt/types"; import { GLOBAL_AGENTS_SID } from "@app/lib/assistant"; -import type { Authenticator} from "@app/lib/auth"; +import type { Authenticator } from "@app/lib/auth"; import { prodAPICredentialsForOwner } from "@app/lib/auth"; import { GlobalAgentSettings } from "@app/lib/models/assistant/agent"; import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes"; diff --git a/front/lib/api/assistant/recent_authors.ts b/front/lib/api/assistant/recent_authors.ts index e9c94c72d421..718661b012e0 100644 --- a/front/lib/api/assistant/recent_authors.ts +++ b/front/lib/api/assistant/recent_authors.ts @@ -79,9 +79,8 @@ async function populateAuthorIdsFromDb({ agentId: string; workspaceId: string; }) { - const recentAuthorIdsWithVersion = await fetchRecentAuthorIdsWithVersion( - agentId - ); + const recentAuthorIdsWithVersion = + await fetchRecentAuthorIdsWithVersion(agentId); if (recentAuthorIdsWithVersion.length === 0) { return []; diff --git a/front/lib/api/assistant/user_relation.ts b/front/lib/api/assistant/user_relation.ts index d86a99680974..1e049b179bcd 100644 --- a/front/lib/api/assistant/user_relation.ts +++ b/front/lib/api/assistant/user_relation.ts @@ -1,12 +1,9 @@ import type { AgentUserListStatus, LightAgentConfigurationType, - Result} from "@dust-tt/types"; -import { - assertNever, - Err, - Ok + Result, } from "@dust-tt/types"; +import { assertNever, Err, Ok } from "@dust-tt/types"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; import type { Authenticator } from "@app/lib/auth"; diff --git a/front/lib/api/data_sources.ts b/front/lib/api/data_sources.ts index 189c4356f8cd..85fce95c6316 100644 --- a/front/lib/api/data_sources.ts +++ b/front/lib/api/data_sources.ts @@ -2,13 +2,9 @@ import type { APIError, ConnectorProvider, DataSourceType, - Result} from "@dust-tt/types"; -import { - ConnectorsAPI, - CoreAPI, - Err, - Ok + Result, } from "@dust-tt/types"; +import { ConnectorsAPI, CoreAPI, Err, Ok } from "@dust-tt/types"; import { Op } from "sequelize"; import { getMembers } from "@app/lib/api/workspace"; diff --git a/front/lib/extract_events_properties.ts b/front/lib/extract_events_properties.ts index 2b9ed9b460a1..bea66a285351 100644 --- a/front/lib/extract_events_properties.ts +++ b/front/lib/extract_events_properties.ts @@ -1,10 +1,9 @@ import type { EventSchemaPropertiesTypeForModel, EventSchemaPropertyType, - ExtractedEventPropertyType} from "@dust-tt/types"; -import { - eventSchemaPropertyAllTypes + ExtractedEventPropertyType, } from "@dust-tt/types"; +import { eventSchemaPropertyAllTypes } from "@dust-tt/types"; /** * We start with: diff --git a/front/lib/models/apps.ts b/front/lib/models/apps.ts index f601f160b8be..e3a30c4e37e1 100644 --- a/front/lib/models/apps.ts +++ b/front/lib/models/apps.ts @@ -4,11 +4,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { Workspace } from "@app/lib/models/workspace"; diff --git a/front/lib/models/assistant/actions/database_query.ts b/front/lib/models/assistant/actions/database_query.ts index c08483a0557d..e13d67cedd6d 100644 --- a/front/lib/models/assistant/actions/database_query.ts +++ b/front/lib/models/assistant/actions/database_query.ts @@ -1,11 +1,9 @@ import type { CreationOptional, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/assistant/actions/dust_app_run.ts b/front/lib/models/assistant/actions/dust_app_run.ts index c885776d34bb..76015e78e387 100644 --- a/front/lib/models/assistant/actions/dust_app_run.ts +++ b/front/lib/models/assistant/actions/dust_app_run.ts @@ -2,11 +2,9 @@ import type { DustAppParameters } from "@dust-tt/types"; import type { CreationOptional, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/assistant/actions/retrieval.ts b/front/lib/models/assistant/actions/retrieval.ts index 393964203b92..6bf54c7964f0 100644 --- a/front/lib/models/assistant/actions/retrieval.ts +++ b/front/lib/models/assistant/actions/retrieval.ts @@ -4,11 +4,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { DataSource } from "@app/lib/models/data_source"; diff --git a/front/lib/models/assistant/agent.ts b/front/lib/models/assistant/agent.ts index 783b260227ba..e74bcd7f2f37 100644 --- a/front/lib/models/assistant/agent.ts +++ b/front/lib/models/assistant/agent.ts @@ -12,11 +12,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { AgentDatabaseQueryConfiguration } from "@app/lib/models/assistant/actions/database_query"; diff --git a/front/lib/models/assistant/conversation.ts b/front/lib/models/assistant/conversation.ts index 07a433d97bbf..896efa880efd 100644 --- a/front/lib/models/assistant/conversation.ts +++ b/front/lib/models/assistant/conversation.ts @@ -10,11 +10,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { AgentDatabaseQueryAction } from "@app/lib/models/assistant/actions/database_query"; diff --git a/front/lib/models/data_source.ts b/front/lib/models/data_source.ts index 2f8c9370c0a5..f221ffa21776 100644 --- a/front/lib/models/data_source.ts +++ b/front/lib/models/data_source.ts @@ -4,11 +4,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { Workspace } from "@app/lib/models/workspace"; diff --git a/front/lib/models/doc_tracker.ts b/front/lib/models/doc_tracker.ts index d2357b4f8179..ff75fb0b7142 100644 --- a/front/lib/models/doc_tracker.ts +++ b/front/lib/models/doc_tracker.ts @@ -2,11 +2,9 @@ import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { DataSource } from "@app/lib/models/data_source"; diff --git a/front/lib/models/extract.ts b/front/lib/models/extract.ts index a611a85aa762..6356699cad7e 100644 --- a/front/lib/models/extract.ts +++ b/front/lib/models/extract.ts @@ -1,13 +1,14 @@ -import type { EventSchemaPropertyType, EventSchemaStatus } from "@dust-tt/types"; +import type { + EventSchemaPropertyType, + EventSchemaStatus, +} from "@dust-tt/types"; import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { User } from "@app/lib/models/user"; diff --git a/front/lib/models/plan.ts b/front/lib/models/plan.ts index ee321221c2d5..5665791de280 100644 --- a/front/lib/models/plan.ts +++ b/front/lib/models/plan.ts @@ -1,11 +1,12 @@ import type { FreeBillingType, PaidBillingType, - SubscriptionStatusType} from "@dust-tt/types"; + SubscriptionStatusType, +} from "@dust-tt/types"; import { FREE_BILLING_TYPES, PAID_BILLING_TYPES, - SUBSCRIPTION_STATUSES + SUBSCRIPTION_STATUSES, } from "@dust-tt/types"; import type { CreationOptional, @@ -13,11 +14,9 @@ import type { InferAttributes, InferCreationAttributes, NonAttribute, - Transaction} from "sequelize"; -import { - DataTypes, - Model + Transaction, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import { Workspace } from "@app/lib/models/workspace"; diff --git a/front/lib/models/user.ts b/front/lib/models/user.ts index bc437041411d..7b86445899d0 100644 --- a/front/lib/models/user.ts +++ b/front/lib/models/user.ts @@ -2,11 +2,9 @@ import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; diff --git a/front/lib/models/workspace.ts b/front/lib/models/workspace.ts index 2956a23f89c7..c7e455232148 100644 --- a/front/lib/models/workspace.ts +++ b/front/lib/models/workspace.ts @@ -4,11 +4,9 @@ import type { ForeignKey, InferAttributes, InferCreationAttributes, - NonAttribute} from "sequelize"; -import { - DataTypes, - Model + NonAttribute, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { front_sequelize } from "@app/lib/databases"; import type { Subscription } from "@app/lib/models/plan"; diff --git a/front/lib/models/xp1.ts b/front/lib/models/xp1.ts index 6f11dd00fd4b..0317906331f3 100644 --- a/front/lib/models/xp1.ts +++ b/front/lib/models/xp1.ts @@ -2,11 +2,9 @@ import type { CreationOptional, ForeignKey, InferAttributes, - InferCreationAttributes} from "sequelize"; -import { - DataTypes, - Model, + InferCreationAttributes, } from "sequelize"; +import { DataTypes, Model } from "sequelize"; import { xp1_sequelize } from "@app/lib/databases"; diff --git a/front/lib/plans/subscription.ts b/front/lib/plans/subscription.ts index e60e81669a2a..7821abf75f06 100644 --- a/front/lib/plans/subscription.ts +++ b/front/lib/plans/subscription.ts @@ -1,5 +1,9 @@ import type { WorkspaceType } from "@dust-tt/types"; -import type { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; +import type { + PlanInvitationType, + PlanType, + SubscriptionType, +} from "@dust-tt/types"; import { v4 as uuidv4 } from "uuid"; import type { Authenticator } from "@app/lib/auth"; diff --git a/front/lib/swr.ts b/front/lib/swr.ts index 67c9ea41fa2e..a91c0201dca0 100644 --- a/front/lib/swr.ts +++ b/front/lib/swr.ts @@ -4,7 +4,10 @@ import type { DataSourceType, } from "@dust-tt/types"; import type { WorkspaceType } from "@dust-tt/types"; -import type { ConversationMessageReactions, ConversationType } from "@dust-tt/types"; +import type { + ConversationMessageReactions, + ConversationType, +} from "@dust-tt/types"; import type { AppType } from "@dust-tt/types"; import type { RunRunType } from "@dust-tt/types"; import type { ConnectorPermission } from "@dust-tt/types"; diff --git a/front/migrations/helpers.ts b/front/migrations/helpers.ts index 8eff102cab91..080f19fc8739 100644 --- a/front/migrations/helpers.ts +++ b/front/migrations/helpers.ts @@ -14,10 +14,10 @@ type InferArgs = { [P in keyof T]: T[P] extends { type: "number" } ? number : T[P] extends { type: "boolean" } - ? boolean - : T[P] extends { type: "string" } - ? string - : never; + ? boolean + : T[P] extends { type: "string" } + ? string + : never; } & { execute?: boolean }; const defaultArgumentSpecs: ArgumentSpecs = { diff --git a/front/pages/api/poke/plans.ts b/front/pages/api/poke/plans.ts index a914545a3111..ff557f92e709 100644 --- a/front/pages/api/poke/plans.ts +++ b/front/pages/api/poke/plans.ts @@ -123,10 +123,13 @@ async function handler( await Promise.all( stripeProductIds.map((stripeProductId) => getProduct(stripeProductId)) ) - ).reduce((acc, product) => { - acc[product.id] = product; - return acc; - }, {} as { [key: string]: Stripe.Product }); + ).reduce( + (acc, product) => { + acc[product.id] = product; + return acc; + }, + {} as { [key: string]: Stripe.Product } + ); res.status(200).json({ plans: plans.map((plan) => ({ diff --git a/front/pages/api/stripe/webhook.ts b/front/pages/api/stripe/webhook.ts index fac173526ba4..c473c7d22fce 100644 --- a/front/pages/api/stripe/webhook.ts +++ b/front/pages/api/stripe/webhook.ts @@ -1,9 +1,5 @@ -import type { - ReturnedAPIErrorType} from "@dust-tt/types"; -import { - CoreAPI, - isRetrievalConfiguration -} from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { CoreAPI, isRetrievalConfiguration } from "@dust-tt/types"; import type { NextApiRequest, NextApiResponse } from "next"; import { pipeline, Writable } from "stream"; import Stripe from "stripe"; @@ -517,9 +513,8 @@ async function handler( endDate: new Date(), }); const workspaceId = activeSubscription.workspace.sId; - const auth = await Authenticator.internalAdminForWorkspace( - workspaceId - ); + const auth = + await Authenticator.internalAdminForWorkspace(workspaceId); await revokeUsersForDowngrade(auth); await archiveConnectedAgents(auth); await deleteConnectedDatasources(auth); diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts index 4f2b9b6a6264..080444747fda 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts @@ -1,6 +1,4 @@ -import type { - CoreAPILightDocument, - DataSourceType} from "@dust-tt/types"; +import type { CoreAPILightDocument, DataSourceType } from "@dust-tt/types"; import type { DocumentType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts index bb91fb679531..130886b830cb 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/[aId]/index.ts @@ -1,9 +1,6 @@ -import type { - AgentConfigurationType} from "@dust-tt/types"; +import type { AgentConfigurationType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - PostOrPatchAgentConfigurationRequestBodySchema, -} from "@dust-tt/types"; +import { PostOrPatchAgentConfigurationRequestBodySchema } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; import type { NextApiRequest, NextApiResponse } from "next"; diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts index f2ee52701ae4..62579b658dd0 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts @@ -3,11 +3,12 @@ import type { AgentConfigurationType, AgentGenerationConfigurationType, LightAgentConfigurationType, - Result} from "@dust-tt/types"; + Result, +} from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { GetAgentConfigurationsQuerySchema, - PostOrPatchAgentConfigurationRequestBodySchema + PostOrPatchAgentConfigurationRequestBodySchema, } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import type * as t from "io-ts"; @@ -90,8 +91,8 @@ async function handler( const viewParam = view ? view : conversationId - ? { conversationId } - : "all"; + ? { conversationId } + : "all"; if (viewParam === "admin_internal" && !auth.isDustSuperUser()) { return apiError(req, res, { status_code: 404, diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts index eb87e50d22c8..0a26c95c2ad7 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/content_fragment/index.ts @@ -1,9 +1,6 @@ -import type { - ContentFragmentType} from "@dust-tt/types"; +import type { ContentFragmentType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - InternalPostContentFragmentRequestBodySchema, -} from "@dust-tt/types"; +import { InternalPostContentFragmentRequestBodySchema } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import type * as t from "io-ts"; import * as reporter from "io-ts-reporters"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts index 56e9e3237e57..57f0a291ac20 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/[mId]/retry.ts @@ -1,4 +1,4 @@ -import type { AgentMessageType} from "@dust-tt/types"; +import type { AgentMessageType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { isAgentMessageType } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts index 33d81836ff28..56cf86b33dba 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts @@ -1,9 +1,6 @@ -import type { - UserMessageType} from "@dust-tt/types"; +import type { UserMessageType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - InternalPostMessagesRequestBodySchema -} from "@dust-tt/types"; +import { InternalPostMessagesRequestBodySchema } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; import type { NextApiRequest, NextApiResponse } from "next"; diff --git a/front/pages/api/w/[wId]/assistant/conversations/index.ts b/front/pages/api/w/[wId]/assistant/conversations/index.ts index 12778490989f..62d39b132c02 100644 --- a/front/pages/api/w/[wId]/assistant/conversations/index.ts +++ b/front/pages/api/w/[wId]/assistant/conversations/index.ts @@ -2,11 +2,10 @@ import type { ContentFragmentType, ConversationType, ConversationWithoutContentType, - UserMessageType} from "@dust-tt/types"; -import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - InternalPostConversationsRequestBodySchema + UserMessageType, } from "@dust-tt/types"; +import type { ReturnedAPIErrorType } from "@dust-tt/types"; +import { InternalPostConversationsRequestBodySchema } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as reporter from "io-ts-reporters"; import type { NextApiRequest, NextApiResponse } from "next"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts index c99c0a209abb..0889659b0424 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/documents/[documentId]/index.ts @@ -1,5 +1,4 @@ -import type { - CoreAPILightDocument} from "@dust-tt/types"; +import type { CoreAPILightDocument } from "@dust-tt/types"; import type { DocumentType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; import { diff --git a/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts b/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts index 6578224a697e..052dbde9f3de 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/managed/permissions/index.ts @@ -1,11 +1,6 @@ -import type { - ConnectorPermission, - ConnectorResource} from "@dust-tt/types"; +import type { ConnectorPermission, ConnectorResource } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - assertNever, - ConnectorsAPI, -} from "@dust-tt/types"; +import { assertNever, ConnectorsAPI } from "@dust-tt/types"; import { isLeft } from "fp-ts/lib/Either"; import * as t from "io-ts"; import * as reporter from "io-ts-reporters"; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts index 164bbee92cdc..075cf6867640 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts @@ -286,8 +286,8 @@ async function rowsFromCsv( return lowerV === "true" ? true : lowerV === "false" - ? false - : undefined; + ? false + : undefined; }, // string (v: string) => v, @@ -325,12 +325,15 @@ async function rowsFromCsv( const nbRows = (Object.values(parsedValuesByCol)[0] || []).length; const rows: CoreAPIRow[] = []; for (let i = 0; i < nbRows; i++) { - const record = header.reduce((acc, h) => { - const parsedValues = parsedValuesByCol[h]; - acc[h] = - parsedValues && parsedValues[i] !== undefined ? parsedValues[i] : ""; - return acc; - }, {} as Record); + const record = header.reduce( + (acc, h) => { + const parsedValues = parsedValuesByCol[h]; + acc[h] = + parsedValues && parsedValues[i] !== undefined ? parsedValues[i] : ""; + return acc; + }, + {} as Record + ); rows.push({ row_id: i.toString(), value: record }); } diff --git a/front/pages/api/w/[wId]/data_sources/managed.ts b/front/pages/api/w/[wId]/data_sources/managed.ts index 43adb8fbfa16..d2cd1dc7285a 100644 --- a/front/pages/api/w/[wId]/data_sources/managed.ts +++ b/front/pages/api/w/[wId]/data_sources/managed.ts @@ -1,11 +1,7 @@ -import type { - DataSourceType} from "@dust-tt/types"; +import type { DataSourceType } from "@dust-tt/types"; import type { ConnectorType } from "@dust-tt/types"; import type { ReturnedAPIErrorType } from "@dust-tt/types"; -import { - assertNever, - isConnectorProvider, -} from "@dust-tt/types"; +import { assertNever, isConnectorProvider } from "@dust-tt/types"; import { dustManagedCredentials } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; import { CoreAPI } from "@dust-tt/types"; diff --git a/front/pages/api/w/[wId]/subscriptions/index.ts b/front/pages/api/w/[wId]/subscriptions/index.ts index 4ae3c6d4e2bf..a0571292a5fb 100644 --- a/front/pages/api/w/[wId]/subscriptions/index.ts +++ b/front/pages/api/w/[wId]/subscriptions/index.ts @@ -51,9 +51,8 @@ async function handler( switch (req.method) { case "POST": try { - const { checkoutUrl, plan: newPlan } = await getCheckoutUrlForUpgrade( - auth - ); + const { checkoutUrl, plan: newPlan } = + await getCheckoutUrlForUpgrade(auth); return res.status(200).json({ checkoutUrl, plan: newPlan }); } catch (error) { logger.error({ error }, "Error while subscribing workspace to plan"); diff --git a/front/pages/poke/[wId]/assistants/[aId]/index.tsx b/front/pages/poke/[wId]/assistants/[aId]/index.tsx index 7537581098e2..437e423baca0 100644 --- a/front/pages/poke/[wId]/assistants/[aId]/index.tsx +++ b/front/pages/poke/[wId]/assistants/[aId]/index.tsx @@ -1,6 +1,5 @@ import { Avatar, ContextItem, Page } from "@dust-tt/sparkle"; -import type { - AgentConfigurationType} from "@dust-tt/types"; +import type { AgentConfigurationType } from "@dust-tt/types"; import type { WorkspaceType } from "@dust-tt/types"; import { isDustAppRunConfiguration, diff --git a/front/pages/poke/[wId]/index.tsx b/front/pages/poke/[wId]/index.tsx index 18125d05feab..a15464735a5c 100644 --- a/front/pages/poke/[wId]/index.tsx +++ b/front/pages/poke/[wId]/index.tsx @@ -9,12 +9,17 @@ import type { AgentConfigurationType, DataSourceType, LightAgentConfigurationType, - WorkspaceSegmentationType} from "@dust-tt/types"; + WorkspaceSegmentationType, +} from "@dust-tt/types"; import type { UserType, WorkspaceType } from "@dust-tt/types"; -import type { PlanInvitationType, PlanType, SubscriptionType } from "@dust-tt/types"; +import type { + PlanInvitationType, + PlanType, + SubscriptionType, +} from "@dust-tt/types"; import { isDustAppRunConfiguration, - isRetrievalConfiguration + isRetrievalConfiguration, } from "@dust-tt/types"; import { ConnectorsAPI } from "@dust-tt/types"; import { JsonViewer } from "@textea/json-viewer"; diff --git a/front/pages/poke/index.tsx b/front/pages/poke/index.tsx index 14af8ab289b5..a849ce183189 100644 --- a/front/pages/poke/index.tsx +++ b/front/pages/poke/index.tsx @@ -1,6 +1,6 @@ import type { UserType } from "@dust-tt/types"; import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; -import type { ChangeEvent} from "react"; +import type { ChangeEvent } from "react"; import React, { useState } from "react"; import PokeNavbar from "@app/components/poke/PokeNavbar"; diff --git a/front/pages/poke/plans.tsx b/front/pages/poke/plans.tsx index d1f736d7d664..150057e18599 100644 --- a/front/pages/poke/plans.tsx +++ b/front/pages/poke/plans.tsx @@ -12,8 +12,7 @@ import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import React from "react"; import { useSWRConfig } from "swr"; -import type { - EditingPlanType} from "@app/components/poke/plans/form"; +import type { EditingPlanType } from "@app/components/poke/plans/form"; import { Field, fromPlanType, diff --git a/front/pages/w/[wId]/a/[aId]/execute/index.tsx b/front/pages/w/[wId]/a/[aId]/execute/index.tsx index fc9feaf55cc8..019fdf6085da 100644 --- a/front/pages/w/[wId]/a/[aId]/execute/index.tsx +++ b/front/pages/w/[wId]/a/[aId]/execute/index.tsx @@ -1,6 +1,10 @@ import { Button, Tab } from "@dust-tt/sparkle"; import type { UserType, WorkspaceType } from "@dust-tt/types"; -import type { AppType, BlockRunConfig, SpecificationType } from "@dust-tt/types"; +import type { + AppType, + BlockRunConfig, + SpecificationType, +} from "@dust-tt/types"; import type { DatasetType } from "@dust-tt/types"; import type { SubscriptionType } from "@dust-tt/types"; import type { TraceType } from "@dust-tt/types"; diff --git a/front/pages/w/[wId]/a/index.tsx b/front/pages/w/[wId]/a/index.tsx index e512be0d3418..200435f93c2f 100644 --- a/front/pages/w/[wId]/a/index.tsx +++ b/front/pages/w/[wId]/a/index.tsx @@ -397,8 +397,8 @@ export function Providers({ owner }: { owner: WorkspaceType }) { configs[provider.providerId] ? "Edit" : provider.built - ? "Set up" - : "Coming Soon" + ? "Set up" + : "Coming Soon" } /> @@ -463,8 +463,8 @@ export function Providers({ owner }: { owner: WorkspaceType }) { configs[provider.providerId] ? "Edit" : provider.built - ? "Set up" - : "Coming Soon" + ? "Set up" + : "Coming Soon" } /> diff --git a/front/pages/w/[wId]/assistant/gallery.tsx b/front/pages/w/[wId]/assistant/gallery.tsx index f3dfc55a317a..6fda8ca90161 100644 --- a/front/pages/w/[wId]/assistant/gallery.tsx +++ b/front/pages/w/[wId]/assistant/gallery.tsx @@ -5,10 +5,9 @@ import type { PlanType, SubscriptionType, UserType, - WorkspaceType} from "@dust-tt/types"; -import { - assertNever + WorkspaceType, } from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx b/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx index 490e94b89048..10391e2b929f 100644 --- a/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx +++ b/front/pages/w/[wId]/builder/assistants/[aId]/index.tsx @@ -14,9 +14,10 @@ import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import type { AssistantBuilderInitialState, - BuilderFlow} from "@app/components/assistant_builder/AssistantBuilder"; + BuilderFlow, +} from "@app/components/assistant_builder/AssistantBuilder"; import AssistantBuilder, { - BUILDER_FLOWS + BUILDER_FLOWS, } from "@app/components/assistant_builder/AssistantBuilder"; import { getApps } from "@app/lib/api/app"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; diff --git a/front/pages/w/[wId]/builder/assistants/new.tsx b/front/pages/w/[wId]/builder/assistants/new.tsx index 6782ec546bee..90ef372e61e3 100644 --- a/front/pages/w/[wId]/builder/assistants/new.tsx +++ b/front/pages/w/[wId]/builder/assistants/new.tsx @@ -5,19 +5,21 @@ import type { PlanType, SubscriptionType, UserType, - WorkspaceType} from "@dust-tt/types"; + WorkspaceType, +} from "@dust-tt/types"; import { isDatabaseQueryConfiguration, isDustAppRunConfiguration, - isRetrievalConfiguration + isRetrievalConfiguration, } from "@dust-tt/types"; import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import type { AssistantBuilderInitialState, - BuilderFlow} from "@app/components/assistant_builder/AssistantBuilder"; + BuilderFlow, +} from "@app/components/assistant_builder/AssistantBuilder"; import AssistantBuilder, { - BUILDER_FLOWS + BUILDER_FLOWS, } from "@app/components/assistant_builder/AssistantBuilder"; import { getApps } from "@app/lib/api/app"; import { getAgentConfiguration } from "@app/lib/api/assistant/configuration"; 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 62e4901ab3ef..c1f9866456f4 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx @@ -17,18 +17,13 @@ import type { ConnectorProvider, DataSourceType, UserType, - WorkspaceType} from "@dust-tt/types"; + WorkspaceType, +} from "@dust-tt/types"; import type { PlanType, SubscriptionType } from "@dust-tt/types"; -import type { - ConnectorType} from "@dust-tt/types"; +import type { ConnectorType } from "@dust-tt/types"; import type { APIError } from "@dust-tt/types"; -import { - assertNever -} from "@dust-tt/types"; -import { - connectorIsUsingNango, - ConnectorsAPI -} from "@dust-tt/types"; +import { assertNever } from "@dust-tt/types"; +import { connectorIsUsingNango, ConnectorsAPI } from "@dust-tt/types"; import Nango from "@nangohq/frontend"; import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import { useRouter } from "next/router"; diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx index d9bf27434090..88e1244838c9 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx @@ -368,8 +368,8 @@ export default function DatasourceUpsert({ downloading ? "Downloading..." : uploading - ? "Uploading..." - : text + ? "Uploading..." + : text } onChange={(e) => setText(e.target.value)} /> diff --git a/front/pages/w/[wId]/builder/data-sources/managed.tsx b/front/pages/w/[wId]/builder/data-sources/managed.tsx index 058c92ffb96c..19efd15635ff 100644 --- a/front/pages/w/[wId]/builder/data-sources/managed.tsx +++ b/front/pages/w/[wId]/builder/data-sources/managed.tsx @@ -17,12 +17,8 @@ import type { WorkspaceType, } from "@dust-tt/types"; import type { PlanType, SubscriptionType } from "@dust-tt/types"; -import type { - ConnectorType} from "@dust-tt/types"; -import { - connectorIsUsingNango, - ConnectorsAPI -} from "@dust-tt/types"; +import type { ConnectorType } from "@dust-tt/types"; +import { connectorIsUsingNango, ConnectorsAPI } from "@dust-tt/types"; import Nango from "@nangohq/frontend"; import type { GetServerSideProps, InferGetServerSidePropsType } from "next"; import Link from "next/link"; @@ -353,8 +349,8 @@ function ConfirmationModal({ isLoading ? "Connecting..." : dataSource.connectorProvider === "google_drive" - ? "Acknowledge and Connect" - : "Connect" + ? "Acknowledge and Connect" + : "Connect" } /> @@ -620,10 +616,10 @@ export default function DataSourcesView({ const label = !ds.isBuilt ? "Preview" : !isLoadingByProvider[ - ds.connectorProvider as ConnectorProvider - ] && !ds.fetchConnectorError - ? "Connect" - : "Connecting..."; + ds.connectorProvider as ConnectorProvider + ] && !ds.fetchConnectorError + ? "Connect" + : "Connecting..."; if (!ds || !ds.connector) { return ( diff --git a/front/pages/w/[wId]/join.tsx b/front/pages/w/[wId]/join.tsx index a3559ee7281b..d0d2cceefa3d 100644 --- a/front/pages/w/[wId]/join.tsx +++ b/front/pages/w/[wId]/join.tsx @@ -60,8 +60,8 @@ export const getServerSideProps: GetServerSideProps<{ const onboardingType: OnboardingType = cId ? "domain_conversation_link" : token - ? "email_invite" - : "domain_invite_link"; + ? "email_invite" + : "domain_invite_link"; // Redirect to 404 if in a flow where we need allowed domain and domain is not allowed. if ( From a8da464d6674f819bc92746f448910b06e723a42 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Tue, 16 Jan 2024 18:32:39 +0100 Subject: [PATCH 4/6] :shirt: --- .../20231109_incident_gdrive_non_deleted_files.ts | 11 ++++------- .../src/api/slack_channels_linked_with_agent.ts | 11 ++++------- connectors/src/connectors/google_drive/index.ts | 11 ++++------- connectors/src/connectors/notion/index.ts | 11 ++++------- connectors/src/connectors/notion/lib/cli.ts | 5 +++-- connectors/src/connectors/notion/lib/notion_api.ts | 2 +- .../src/connectors/notion/temporal/activities.ts | 11 ++++------- .../src/connectors/notion/temporal/workflows.ts | 9 +++++---- connectors/src/connectors/slack/index.ts | 11 ++++------- connectors/src/connectors/webcrawler/index.ts | 11 ++++------- connectors/src/lib/temporal_monitoring.ts | 5 +++-- 11 files changed, 40 insertions(+), 58 deletions(-) diff --git a/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts b/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts index 8224bd2cf41c..86a169dae852 100644 --- a/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts +++ b/connectors/migrations/20231109_incident_gdrive_non_deleted_files.ts @@ -34,13 +34,10 @@ async function main() { console.log(`Connector ${c.id}: found ${files.length} files`); - const fileHash = files.reduce( - (acc, f) => { - acc[f.dustFileId] = f.id; - return acc; - }, - {} as { [key: string]: number } - ); + const fileHash = files.reduce((acc, f) => { + acc[f.dustFileId] = f.id; + return acc; + }, {} as { [key: string]: number }); // find dustProjectId from front based on workspaceId and connectorName const dsData = await front_sequelize.query( diff --git a/connectors/src/api/slack_channels_linked_with_agent.ts b/connectors/src/api/slack_channels_linked_with_agent.ts index 58b1231d511b..10023e39ef22 100644 --- a/connectors/src/api/slack_channels_linked_with_agent.ts +++ b/connectors/src/api/slack_channels_linked_with_agent.ts @@ -74,13 +74,10 @@ const _patchSlackChannelsLinkedWithAgentHandler = async ( const remoteChannels = ( await getChannels(parseInt(connectorId), false) ).flatMap((c) => (c.id && c.name ? [{ id: c.id, name: c.name }] : [])); - const remoteChannelsById = remoteChannels.reduce( - (acc, ch) => { - acc[ch.id] = ch; - return acc; - }, - {} as Record - ); + const remoteChannelsById = remoteChannels.reduce((acc, ch) => { + acc[ch.id] = ch; + return acc; + }, {} as Record); const createdChannels = await Promise.all( missingSlackChannelIds.map((slackChannelId) => { const remoteChannel = remoteChannelsById[slackChannelId]; diff --git a/connectors/src/connectors/google_drive/index.ts b/connectors/src/connectors/google_drive/index.ts index 43fd3865225d..6b6adba83e8d 100644 --- a/connectors/src/connectors/google_drive/index.ts +++ b/connectors/src/connectors/google_drive/index.ts @@ -616,13 +616,10 @@ export async function retrieveGoogleDriveObjectsTitles( }, }); - const titles = googleDriveFiles.reduce( - (acc, curr) => { - acc[curr.driveFileId] = curr.name; - return acc; - }, - {} as Record - ); + const titles = googleDriveFiles.reduce((acc, curr) => { + acc[curr.driveFileId] = curr.name; + return acc; + }, {} as Record); return new Ok(titles); } diff --git a/connectors/src/connectors/notion/index.ts b/connectors/src/connectors/notion/index.ts index 9787cc9e902d..3f523550954a 100644 --- a/connectors/src/connectors/notion/index.ts +++ b/connectors/src/connectors/notion/index.ts @@ -480,13 +480,10 @@ export async function retrieveNotionResourcesTitles( .concat( dbs.map((db) => ({ internalId: db.notionDatabaseId, title: db.title })) ) - .reduce( - (acc, { internalId, title }) => { - acc[internalId] = title ?? null; - return acc; - }, - {} as Record - ); + .reduce((acc, { internalId, title }) => { + acc[internalId] = title ?? null; + return acc; + }, {} as Record); return new Ok(titles); } diff --git a/connectors/src/connectors/notion/lib/cli.ts b/connectors/src/connectors/notion/lib/cli.ts index 6a8819d0d339..d4ee166b894f 100644 --- a/connectors/src/connectors/notion/lib/cli.ts +++ b/connectors/src/connectors/notion/lib/cli.ts @@ -38,8 +38,9 @@ export async function searchNotionPagesForQuery({ page_size: 20, }); - const skippedDatabaseIds = - await listSkippedDatabaseIdsForConnectorId(connectorId); + const skippedDatabaseIds = await listSkippedDatabaseIdsForConnectorId( + connectorId + ); return pages.results.map((p) => ({ id: p.id, diff --git a/connectors/src/connectors/notion/lib/notion_api.ts b/connectors/src/connectors/notion/lib/notion_api.ts index af3c063194e3..5bcef7108aee 100644 --- a/connectors/src/connectors/notion/lib/notion_api.ts +++ b/connectors/src/connectors/notion/lib/notion_api.ts @@ -1176,7 +1176,7 @@ export async function* iteratePaginatedAPIWithRetries< Args extends { start_cursor?: string; }, - Item, + Item >( listFn: (args: Args) => Promise>, firstPageArgs: Args, diff --git a/connectors/src/connectors/notion/temporal/activities.ts b/connectors/src/connectors/notion/temporal/activities.ts index f31f882b53cb..fd029a490422 100644 --- a/connectors/src/connectors/notion/temporal/activities.ts +++ b/connectors/src/connectors/notion/temporal/activities.ts @@ -1578,13 +1578,10 @@ export async function renderAndUpsertPageFromCache({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion b.childDatabaseTitle!, })) - .reduce( - (acc, { id, title }) => { - acc[id] = title; - return acc; - }, - {} as Record - ); + .reduce((acc, { id, title }) => { + acc[id] = title; + return acc; + }, {} as Record); localLogger.info( "notionRenderAndUpsertPageFromCache: Retrieving child database pages from cache." diff --git a/connectors/src/connectors/notion/temporal/workflows.ts b/connectors/src/connectors/notion/temporal/workflows.ts index 9a3d252830df..a218f3912537 100644 --- a/connectors/src/connectors/notion/temporal/workflows.ts +++ b/connectors/src/connectors/notion/temporal/workflows.ts @@ -125,8 +125,8 @@ export async function notionSyncWorkflow({ runType: isGarbageCollectionRun ? "garbageCollection" : isInitialSync - ? "initialSync" - : "incrementalSync", + ? "initialSync" + : "incrementalSync", }, }); cursor = nextCursor; @@ -157,8 +157,9 @@ export async function notionSyncWorkflow({ // these are resources (pages/DBs) that we didn't get from the search API but that are child pages/DBs // of other pages that we did get from the search API. // We upsert those as well. - const discoveredResources = - await getDiscoveredResourcesFromCache(connectorId); + const discoveredResources = await getDiscoveredResourcesFromCache( + connectorId + ); await performUpserts({ connectorId, pageIds: discoveredResources.pageIds, diff --git a/connectors/src/connectors/slack/index.ts b/connectors/src/connectors/slack/index.ts index db7f27632be5..50016b29aa3c 100644 --- a/connectors/src/connectors/slack/index.ts +++ b/connectors/src/connectors/slack/index.ts @@ -445,13 +445,10 @@ export async function retrieveSlackConnectorPermissions({ }, }), ]); - const localChannelsById = localChannels.reduce( - (acc, ch) => { - acc[ch.slackChannelId] = ch; - return acc; - }, - {} as Record - ); + const localChannelsById = localChannels.reduce((acc, ch) => { + acc[ch.slackChannelId] = ch; + return acc; + }, {} as Record); for (const remoteChannel of remoteChannels) { if (!remoteChannel.id || !remoteChannel.name) { diff --git a/connectors/src/connectors/webcrawler/index.ts b/connectors/src/connectors/webcrawler/index.ts index e9f3366c6bd7..a0eb84df5710 100644 --- a/connectors/src/connectors/webcrawler/index.ts +++ b/connectors/src/connectors/webcrawler/index.ts @@ -221,13 +221,10 @@ export async function retrieveWebCrawlerObjectsTitles( }, }); - const titles = googleDriveFiles.reduce( - (acc, curr) => { - acc[curr.url] = curr.url; - return acc; - }, - {} as Record - ); + const titles = googleDriveFiles.reduce((acc, curr) => { + acc[curr.url] = curr.url; + return acc; + }, {} as Record); return new Ok(titles); } diff --git a/connectors/src/lib/temporal_monitoring.ts b/connectors/src/lib/temporal_monitoring.ts index 9ea1a272ff58..e50544fcf0cc 100644 --- a/connectors/src/lib/temporal_monitoring.ts +++ b/connectors/src/lib/temporal_monitoring.ts @@ -114,8 +114,9 @@ export class ActivityInboundLogInterceptor if (connectorId) { await syncFailed(connectorId, "oauth_token_revoked"); - const doNotCancelOnTokenRevoked = - await getDoNotCancelOnTokenRevoked(workflowId); + const doNotCancelOnTokenRevoked = await getDoNotCancelOnTokenRevoked( + workflowId + ); if (doNotCancelOnTokenRevoked) { this.logger.info( "Skipping cancelling workflow because of expired token." From bfde1e1ffa27ef53a0ba085c552adb6ad532bbb9 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Wed, 17 Jan 2024 09:18:04 +0100 Subject: [PATCH 5/6] :tshirt: --- front/lib/plans/plan_codes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/lib/plans/plan_codes.ts b/front/lib/plans/plan_codes.ts index 4597322a38a0..23641a404a44 100644 --- a/front/lib/plans/plan_codes.ts +++ b/front/lib/plans/plan_codes.ts @@ -1,4 +1,4 @@ -import { PlanType } from "@dust-tt/types"; +import type { PlanType } from "@dust-tt/types"; // Current free plans: export const FREE_UPGRADED_PLAN_CODE = "FREE_UPGRADED_PLAN"; From 4020c66c07508a3e94fb02f31c37dfe9b3b36472 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Wed, 17 Jan 2024 09:23:29 +0100 Subject: [PATCH 6/6] :shirt: --- front/components/app/blocks/Block.tsx | 4 +- .../assistant/RenderMessageMarkdown.tsx | 4 +- .../assistant/conversation/AgentMessage.tsx | 11 ++-- .../AssistantBuilderDataSourceModal.tsx | 11 ++-- front/components/providers/AI21Setup.tsx | 4 +- front/components/providers/AnthropicSetup.tsx | 4 +- .../components/providers/AzureOpenAISetup.tsx | 4 +- .../providers/BrowserlessAPISetup.tsx | 4 +- front/components/providers/CohereSetup.tsx | 4 +- .../providers/GoogleVertexAISetup.tsx | 4 +- front/components/providers/MistralAISetup.tsx | 4 +- front/components/providers/OpenAISetup.tsx | 4 +- front/components/providers/SerpAPISetup.tsx | 4 +- front/components/providers/SerperSetup.tsx | 4 +- front/components/providers/TextSynthSetup.tsx | 4 +- .../actions/doc_tracker_retrieval.ts | 5 +- .../hooks/index.ts | 11 ++-- front/lib/api/assistant/configuration.ts | 59 +++++++------------ front/lib/api/assistant/recent_authors.ts | 5 +- front/migrations/helpers.ts | 8 +-- front/pages/api/poke/plans.ts | 11 ++-- front/pages/api/stripe/webhook.ts | 5 +- .../assistant/agent_configurations/index.ts | 4 +- .../w/[wId]/data_sources/[name]/tables/csv.ts | 19 +++--- .../pages/api/w/[wId]/subscriptions/index.ts | 5 +- front/pages/w/[wId]/a/index.tsx | 8 +-- .../builder/data-sources/[name]/upsert.tsx | 4 +- .../w/[wId]/builder/data-sources/managed.tsx | 12 ++-- front/pages/w/[wId]/join.tsx | 4 +- 29 files changed, 104 insertions(+), 130 deletions(-) diff --git a/front/components/app/blocks/Block.tsx b/front/components/app/blocks/Block.tsx index 48bfddff4d6c..8c5e100d6912 100644 --- a/front/components/app/blocks/Block.tsx +++ b/front/components/app/blocks/Block.tsx @@ -112,8 +112,8 @@ export default function Block({ readOnly ? "border-white ring-0 focus:border-white focus:ring-0" : nameError != "" - ? "border-orange-400 focus:border-orange-400 focus:ring-0" - : "border-white focus:border-gray-300 focus:ring-0" + ? "border-orange-400 focus:border-orange-400 focus:ring-0" + : "border-white focus:border-gray-300 focus:ring-0" )} readOnly={readOnly} value={block.name} diff --git a/front/components/assistant/RenderMessageMarkdown.tsx b/front/components/assistant/RenderMessageMarkdown.tsx index 4c97b9e53386..6d1d24d7d088 100644 --- a/front/components/assistant/RenderMessageMarkdown.tsx +++ b/front/components/assistant/RenderMessageMarkdown.tsx @@ -268,8 +268,8 @@ function MentionBlock({ !agentConfiguration || agentConfiguration?.status === "archived" ? "(This assistant was deleted)" : agentConfiguration?.status === "active" - ? "" - : "(This assistant is deactivated for this workspace)"; + ? "" + : "(This assistant is deactivated for this workspace)"; const tooltipLabel = agentConfiguration?.description || "" + " " + statusText; return ( diff --git a/front/components/assistant/conversation/AgentMessage.tsx b/front/components/assistant/conversation/AgentMessage.tsx index a57b2dc3b859..e25451f53edf 100644 --- a/front/components/assistant/conversation/AgentMessage.tsx +++ b/front/components/assistant/conversation/AgentMessage.tsx @@ -289,13 +289,10 @@ export function AgentMessage({ agentMessageToRender.action.documents ) { setReferences( - agentMessageToRender.action.documents.reduce( - (acc, d) => { - acc[d.reference] = d; - return acc; - }, - {} as { [key: string]: RetrievalDocumentType } - ) + agentMessageToRender.action.documents.reduce((acc, d) => { + acc[d.reference] = d; + return acc; + }, {} as { [key: string]: RetrievalDocumentType }) ); } }, [agentMessageToRender.action]); diff --git a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx index 924c1b939c1e..38ba33994490 100644 --- a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx +++ b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx @@ -215,13 +215,10 @@ function DataSourceResourceSelector({ } const json: GetConnectorResourceParentsResponseBody = await res.json(); setParentsById( - json.resources.reduce( - (acc, r) => { - acc[r.internalId] = new Set(r.parents); - return acc; - }, - {} as Record> - ) + json.resources.reduce((acc, r) => { + acc[r.internalId] = new Set(r.parents); + return acc; + }, {} as Record>) ); } catch (e) { setParentsAreError(true); diff --git a/front/components/providers/AI21Setup.tsx b/front/components/providers/AI21Setup.tsx index 381afda6fc83..6a8311d46daf 100644 --- a/front/components/providers/AI21Setup.tsx +++ b/front/components/providers/AI21Setup.tsx @@ -183,8 +183,8 @@ export default function AI21Setup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/AnthropicSetup.tsx b/front/components/providers/AnthropicSetup.tsx index dc44bcc653e1..e4b367d5d362 100644 --- a/front/components/providers/AnthropicSetup.tsx +++ b/front/components/providers/AnthropicSetup.tsx @@ -186,8 +186,8 @@ export default function AnthropicSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/AzureOpenAISetup.tsx b/front/components/providers/AzureOpenAISetup.tsx index a597cd8a40e3..3017b711ef94 100644 --- a/front/components/providers/AzureOpenAISetup.tsx +++ b/front/components/providers/AzureOpenAISetup.tsx @@ -197,8 +197,8 @@ export default function AzureOpenAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/BrowserlessAPISetup.tsx b/front/components/providers/BrowserlessAPISetup.tsx index 2225570a7dfb..33652d92031e 100644 --- a/front/components/providers/BrowserlessAPISetup.tsx +++ b/front/components/providers/BrowserlessAPISetup.tsx @@ -191,8 +191,8 @@ export default function BrowserlessAPISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/CohereSetup.tsx b/front/components/providers/CohereSetup.tsx index 24e94db850cc..634e4cdce15b 100644 --- a/front/components/providers/CohereSetup.tsx +++ b/front/components/providers/CohereSetup.tsx @@ -183,8 +183,8 @@ export default function CohereSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/GoogleVertexAISetup.tsx b/front/components/providers/GoogleVertexAISetup.tsx index 78c78f30a59f..e1b8d2fb0dc5 100644 --- a/front/components/providers/GoogleVertexAISetup.tsx +++ b/front/components/providers/GoogleVertexAISetup.tsx @@ -201,8 +201,8 @@ export default function GoogleVertexAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/MistralAISetup.tsx b/front/components/providers/MistralAISetup.tsx index 1111bd8342fa..bbf37ed0bdb4 100644 --- a/front/components/providers/MistralAISetup.tsx +++ b/front/components/providers/MistralAISetup.tsx @@ -184,8 +184,8 @@ export default function MistralAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/OpenAISetup.tsx b/front/components/providers/OpenAISetup.tsx index 1db371032182..5264100e0f06 100644 --- a/front/components/providers/OpenAISetup.tsx +++ b/front/components/providers/OpenAISetup.tsx @@ -183,8 +183,8 @@ export default function OpenAISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/SerpAPISetup.tsx b/front/components/providers/SerpAPISetup.tsx index 23c4b165ae36..557336533769 100644 --- a/front/components/providers/SerpAPISetup.tsx +++ b/front/components/providers/SerpAPISetup.tsx @@ -183,8 +183,8 @@ export default function SerpAPISetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/SerperSetup.tsx b/front/components/providers/SerperSetup.tsx index 724dda0fd8d2..2050794e6031 100644 --- a/front/components/providers/SerperSetup.tsx +++ b/front/components/providers/SerperSetup.tsx @@ -183,8 +183,8 @@ export default function SerperSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/components/providers/TextSynthSetup.tsx b/front/components/providers/TextSynthSetup.tsx index 8885d49f9692..ed5b32cbd575 100644 --- a/front/components/providers/TextSynthSetup.tsx +++ b/front/components/providers/TextSynthSetup.tsx @@ -185,8 +185,8 @@ export default function TextSynthSetup({ ? "Updating..." : "Update" : enableRunning - ? "Enabling..." - : "Enable" + ? "Enabling..." + : "Enable" } /> ) : ( diff --git a/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts b/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts index b1737e45e0e2..00f55eaad704 100644 --- a/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts +++ b/front/documents_post_process_hooks/hooks/document_tracker/suggest_changes/actions/doc_tracker_retrieval.ts @@ -15,8 +15,9 @@ export async function callDocTrackerRetrievalAction( const action = DustProdActionRegistry["doc-tracker-retrieval"]; const config = cloneBaseConfig(action.config); - config.SEMANTIC_SEARCH.data_sources = - await getTrackableDataSources(workspaceId); + config.SEMANTIC_SEARCH.data_sources = await getTrackableDataSources( + workspaceId + ); config.SEMANTIC_SEARCH.target_document_tokens = targetDocumentTokens; const res = await callAction({ diff --git a/front/documents_post_process_hooks/hooks/index.ts b/front/documents_post_process_hooks/hooks/index.ts index 8780920afb0d..4837200602ed 100644 --- a/front/documents_post_process_hooks/hooks/index.ts +++ b/front/documents_post_process_hooks/hooks/index.ts @@ -89,13 +89,10 @@ export const DOCUMENTS_POST_PROCESS_HOOKS = [ export const DOCUMENTS_POST_PROCESS_HOOK_BY_TYPE: Record< DocumentsPostProcessHookType, DocumentsPostProcessHook -> = DOCUMENTS_POST_PROCESS_HOOKS.reduce( - (acc, hook) => { - acc[hook.type] = hook; - return acc; - }, - {} as Record -); +> = DOCUMENTS_POST_PROCESS_HOOKS.reduce((acc, hook) => { + acc[hook.type] = hook; + return acc; +}, {} as Record); export async function getDocumentsPostUpsertHooksToRun( params: DocumentsPostProcessHookOnUpsertParams diff --git a/front/lib/api/assistant/configuration.ts b/front/lib/api/assistant/configuration.ts index 7f1156ebb32d..8631f67ae97d 100644 --- a/front/lib/api/assistant/configuration.ts +++ b/front/lib/api/assistant/configuration.ts @@ -212,13 +212,10 @@ export async function getAgentConfigurations({ })(); function byId(list: T[]): Record { - return list.reduce( - (acc, item) => { - acc[item.id] = item; - return acc; - }, - {} as Record - ); + return list.reduce((acc, item) => { + acc[item.id] = item; + return acc; + }, {} as Record); } const configurationIds = agentConfigurations.map((a) => a.id); @@ -270,13 +267,10 @@ export async function getAgentConfigurations({ userId: user.id, }, }).then((relations) => - relations.reduce( - (acc, relation) => { - acc[relation.agentConfiguration] = relation; - return acc; - }, - {} as Record - ) + relations.reduce((acc, relation) => { + acc[relation.agentConfiguration] = relation; + return acc; + }, {} as Record) ) : Promise.resolve({} as Record), ]); @@ -291,15 +285,12 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce( - (acc, dsConfig) => { - acc[dsConfig.retrievalConfigurationId] = - acc[dsConfig.retrievalConfigurationId] || []; - acc[dsConfig.retrievalConfigurationId].push(dsConfig); - return acc; - }, - {} as Record - ); + ).reduce((acc, dsConfig) => { + acc[dsConfig.retrievalConfigurationId] = + acc[dsConfig.retrievalConfigurationId] || []; + acc[dsConfig.retrievalConfigurationId].push(dsConfig); + return acc; + }, {} as Record); const dataSourceIds = Object.values(agentDatasourceConfigurations) .flat() @@ -314,13 +305,10 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce( - (acc, ds) => { - acc[ds.id] = ds; - return acc; - }, - {} as Record - ); + ).reduce((acc, ds) => { + acc[ds.id] = ds; + return acc; + }, {} as Record); const workspaceIds = Object.values(dataSources).map((ds) => ds.workspaceId); const dataSourceWorkspaces = ( @@ -333,13 +321,10 @@ export async function getAgentConfigurations({ }, }) : [] - ).reduce( - (acc, ws) => { - acc[ws.id] = ws; - return acc; - }, - {} as Record - ); + ).reduce((acc, ws) => { + acc[ws.id] = ws; + return acc; + }, {} as Record); let agentConfigurationTypes: AgentConfigurationType[] = []; for (const agent of agentConfigurations) { diff --git a/front/lib/api/assistant/recent_authors.ts b/front/lib/api/assistant/recent_authors.ts index 718661b012e0..e9c94c72d421 100644 --- a/front/lib/api/assistant/recent_authors.ts +++ b/front/lib/api/assistant/recent_authors.ts @@ -79,8 +79,9 @@ async function populateAuthorIdsFromDb({ agentId: string; workspaceId: string; }) { - const recentAuthorIdsWithVersion = - await fetchRecentAuthorIdsWithVersion(agentId); + const recentAuthorIdsWithVersion = await fetchRecentAuthorIdsWithVersion( + agentId + ); if (recentAuthorIdsWithVersion.length === 0) { return []; diff --git a/front/migrations/helpers.ts b/front/migrations/helpers.ts index 080f19fc8739..8eff102cab91 100644 --- a/front/migrations/helpers.ts +++ b/front/migrations/helpers.ts @@ -14,10 +14,10 @@ type InferArgs = { [P in keyof T]: T[P] extends { type: "number" } ? number : T[P] extends { type: "boolean" } - ? boolean - : T[P] extends { type: "string" } - ? string - : never; + ? boolean + : T[P] extends { type: "string" } + ? string + : never; } & { execute?: boolean }; const defaultArgumentSpecs: ArgumentSpecs = { diff --git a/front/pages/api/poke/plans.ts b/front/pages/api/poke/plans.ts index ff557f92e709..a914545a3111 100644 --- a/front/pages/api/poke/plans.ts +++ b/front/pages/api/poke/plans.ts @@ -123,13 +123,10 @@ async function handler( await Promise.all( stripeProductIds.map((stripeProductId) => getProduct(stripeProductId)) ) - ).reduce( - (acc, product) => { - acc[product.id] = product; - return acc; - }, - {} as { [key: string]: Stripe.Product } - ); + ).reduce((acc, product) => { + acc[product.id] = product; + return acc; + }, {} as { [key: string]: Stripe.Product }); res.status(200).json({ plans: plans.map((plan) => ({ diff --git a/front/pages/api/stripe/webhook.ts b/front/pages/api/stripe/webhook.ts index c473c7d22fce..88c01e437fdc 100644 --- a/front/pages/api/stripe/webhook.ts +++ b/front/pages/api/stripe/webhook.ts @@ -513,8 +513,9 @@ async function handler( endDate: new Date(), }); const workspaceId = activeSubscription.workspace.sId; - const auth = - await Authenticator.internalAdminForWorkspace(workspaceId); + const auth = await Authenticator.internalAdminForWorkspace( + workspaceId + ); await revokeUsersForDowngrade(auth); await archiveConnectedAgents(auth); await deleteConnectedDatasources(auth); diff --git a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts index 62579b658dd0..4688de27aac7 100644 --- a/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts +++ b/front/pages/api/w/[wId]/assistant/agent_configurations/index.ts @@ -91,8 +91,8 @@ async function handler( const viewParam = view ? view : conversationId - ? { conversationId } - : "all"; + ? { conversationId } + : "all"; if (viewParam === "admin_internal" && !auth.isDustSuperUser()) { return apiError(req, res, { status_code: 404, diff --git a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts index 075cf6867640..164bbee92cdc 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/tables/csv.ts @@ -286,8 +286,8 @@ async function rowsFromCsv( return lowerV === "true" ? true : lowerV === "false" - ? false - : undefined; + ? false + : undefined; }, // string (v: string) => v, @@ -325,15 +325,12 @@ async function rowsFromCsv( const nbRows = (Object.values(parsedValuesByCol)[0] || []).length; const rows: CoreAPIRow[] = []; for (let i = 0; i < nbRows; i++) { - const record = header.reduce( - (acc, h) => { - const parsedValues = parsedValuesByCol[h]; - acc[h] = - parsedValues && parsedValues[i] !== undefined ? parsedValues[i] : ""; - return acc; - }, - {} as Record - ); + const record = header.reduce((acc, h) => { + const parsedValues = parsedValuesByCol[h]; + acc[h] = + parsedValues && parsedValues[i] !== undefined ? parsedValues[i] : ""; + return acc; + }, {} as Record); rows.push({ row_id: i.toString(), value: record }); } diff --git a/front/pages/api/w/[wId]/subscriptions/index.ts b/front/pages/api/w/[wId]/subscriptions/index.ts index a0571292a5fb..4ae3c6d4e2bf 100644 --- a/front/pages/api/w/[wId]/subscriptions/index.ts +++ b/front/pages/api/w/[wId]/subscriptions/index.ts @@ -51,8 +51,9 @@ async function handler( switch (req.method) { case "POST": try { - const { checkoutUrl, plan: newPlan } = - await getCheckoutUrlForUpgrade(auth); + const { checkoutUrl, plan: newPlan } = await getCheckoutUrlForUpgrade( + auth + ); return res.status(200).json({ checkoutUrl, plan: newPlan }); } catch (error) { logger.error({ error }, "Error while subscribing workspace to plan"); diff --git a/front/pages/w/[wId]/a/index.tsx b/front/pages/w/[wId]/a/index.tsx index 200435f93c2f..e512be0d3418 100644 --- a/front/pages/w/[wId]/a/index.tsx +++ b/front/pages/w/[wId]/a/index.tsx @@ -397,8 +397,8 @@ export function Providers({ owner }: { owner: WorkspaceType }) { configs[provider.providerId] ? "Edit" : provider.built - ? "Set up" - : "Coming Soon" + ? "Set up" + : "Coming Soon" } /> @@ -463,8 +463,8 @@ export function Providers({ owner }: { owner: WorkspaceType }) { configs[provider.providerId] ? "Edit" : provider.built - ? "Set up" - : "Coming Soon" + ? "Set up" + : "Coming Soon" } /> diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx index 88e1244838c9..d9bf27434090 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx @@ -368,8 +368,8 @@ export default function DatasourceUpsert({ downloading ? "Downloading..." : uploading - ? "Uploading..." - : text + ? "Uploading..." + : text } onChange={(e) => setText(e.target.value)} /> diff --git a/front/pages/w/[wId]/builder/data-sources/managed.tsx b/front/pages/w/[wId]/builder/data-sources/managed.tsx index 19efd15635ff..ecfc4b8fef31 100644 --- a/front/pages/w/[wId]/builder/data-sources/managed.tsx +++ b/front/pages/w/[wId]/builder/data-sources/managed.tsx @@ -349,8 +349,8 @@ function ConfirmationModal({ isLoading ? "Connecting..." : dataSource.connectorProvider === "google_drive" - ? "Acknowledge and Connect" - : "Connect" + ? "Acknowledge and Connect" + : "Connect" } /> @@ -616,10 +616,10 @@ export default function DataSourcesView({ const label = !ds.isBuilt ? "Preview" : !isLoadingByProvider[ - ds.connectorProvider as ConnectorProvider - ] && !ds.fetchConnectorError - ? "Connect" - : "Connecting..."; + ds.connectorProvider as ConnectorProvider + ] && !ds.fetchConnectorError + ? "Connect" + : "Connecting..."; if (!ds || !ds.connector) { return ( diff --git a/front/pages/w/[wId]/join.tsx b/front/pages/w/[wId]/join.tsx index d0d2cceefa3d..a3559ee7281b 100644 --- a/front/pages/w/[wId]/join.tsx +++ b/front/pages/w/[wId]/join.tsx @@ -60,8 +60,8 @@ export const getServerSideProps: GetServerSideProps<{ const onboardingType: OnboardingType = cId ? "domain_conversation_link" : token - ? "email_invite" - : "domain_invite_link"; + ? "email_invite" + : "domain_invite_link"; // Redirect to 404 if in a flow where we need allowed domain and domain is not allowed. if (