Merge pull request #6202 from continuedev/dallin/no-barrel-files
No Barrel Exports
This commit is contained in:
commit
39bdcafe5c
57 changed files with 124 additions and 149 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint", "eslint-plugin-react"],
|
||||
"plugins": ["@typescript-eslint", "eslint-plugin-react", "no-barrel-files"],
|
||||
"parserOptions": {
|
||||
"project": ["tsconfig.json", "tsconfig.node.json"]
|
||||
},
|
||||
|
|
@ -13,7 +13,8 @@
|
|||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
"@typescript-eslint/no-floating-promises": "warn"
|
||||
"@typescript-eslint/no-floating-promises": "warn",
|
||||
"no-barrel-files/no-barrel-files": "error"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
|
|
|||
13
gui/package-lock.json
generated
13
gui/package-lock.json
generated
|
|
@ -90,6 +90,7 @@
|
|||
"@vitest/ui": "^2.1.3",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-no-barrel-files": "^1.2.1",
|
||||
"eslint-plugin-react": "^7.37.2",
|
||||
"jsdom": "^25.0.1",
|
||||
"postcss": "^8.4.21",
|
||||
|
|
@ -214,7 +215,7 @@
|
|||
},
|
||||
"../packages/config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.92",
|
||||
"version": "1.0.94",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
@ -5281,6 +5282,16 @@
|
|||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-no-barrel-files": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-no-barrel-files/-/eslint-plugin-no-barrel-files-1.2.1.tgz",
|
||||
"integrity": "sha512-WoZ48JXa99yptWwWWAKmuKNgvgA6tpSol6Cf0GzXs2Lg/JdBqe+CF58Bf8saEpYJRA+6+cTzP90nI7U7zoy5IQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/utils": "^8.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react": {
|
||||
"version": "7.37.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz",
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
"@vitest/ui": "^2.1.3",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-no-barrel-files": "^1.2.1",
|
||||
"eslint-plugin-react": "^7.37.2",
|
||||
"jsdom": "^25.0.1",
|
||||
"postcss": "^8.4.21",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./ConversationStarterCards";
|
||||
export { ConversationStarterCards } from "./ConversationStarterCards";
|
||||
|
|
|
|||
|
|
@ -7,12 +7,7 @@ import { selectSelectedChatModel } from "../../redux/slices/configSlice";
|
|||
import { setMode } from "../../redux/slices/sessionSlice";
|
||||
import { getFontSize, getMetaKeyLabel } from "../../util";
|
||||
import { useMainEditor } from "../mainInput/TipTapEditor";
|
||||
import {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
ListboxOption,
|
||||
ListboxOptions,
|
||||
} from "../ui/Listbox";
|
||||
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui";
|
||||
import { ModeIcon } from "./ModeIcon";
|
||||
|
||||
export function ModeSelect() {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./ModeSelect";
|
||||
export { ModeSelect } from "./ModeSelect";
|
||||
|
|
|
|||
|
|
@ -3,14 +3,12 @@ import { useAppSelector } from "../../redux/hooks";
|
|||
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
|
||||
import Alert from "../gui/Alert";
|
||||
import { ReusableCard } from "../ReusableCard";
|
||||
import {
|
||||
OnboardingCardLanding,
|
||||
OnboardingCardTabs,
|
||||
OnboardingLocalTab,
|
||||
OnboardingModelsAddOnTab,
|
||||
OnboardingProvidersTab,
|
||||
} from "./components";
|
||||
import { useOnboardingCard } from "./hooks";
|
||||
import { OnboardingCardLanding } from "./components/OnboardingCardLanding";
|
||||
import { OnboardingCardTabs } from "./components/OnboardingCardTabs";
|
||||
import { OnboardingLocalTab } from "./components/OnboardingLocalTab";
|
||||
import { OnboardingModelsAddOnTab } from "./components/OnboardingModelsAddOnTab";
|
||||
import { OnboardingProvidersTab } from "./components/OnboardingProvidersTab";
|
||||
import { useOnboardingCard } from "./hooks/useOnboardingCard";
|
||||
|
||||
export interface OnboardingCardState {
|
||||
show?: boolean;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ import { useContext } from "react";
|
|||
import { Button, SecondaryButton } from "../..";
|
||||
import { useAuth } from "../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { selectCurrentOrg } from "../../../redux";
|
||||
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
|
||||
import { selectFirstHubProfile } from "../../../redux/thunks";
|
||||
import { selectCurrentOrg } from "../../../redux/slices/profilesSlice";
|
||||
import { selectFirstHubProfile } from "../../../redux/thunks/selectFirstHubProfile";
|
||||
import { hasPassedFTL } from "../../../util/freeTrial";
|
||||
import { ToolTip } from "../../gui/Tooltip";
|
||||
import ContinueLogo from "../../svg/ContinueLogo";
|
||||
import { useOnboardingCard } from "../hooks";
|
||||
import { useOnboardingCard } from "../hooks/useOnboardingCard";
|
||||
|
||||
export function OnboardingCardLanding({
|
||||
onSelectConfigure,
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import { useAuth } from "../../../context/Auth";
|
|||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { useAppDispatch } from "../../../redux/hooks";
|
||||
import { setDialogMessage, setShowDialog } from "../../../redux/slices/uiSlice";
|
||||
import { updateSelectedModelByRole } from "../../../redux/thunks";
|
||||
import { useSubmitOnboarding } from "../hooks";
|
||||
import { updateSelectedModelByRole } from "../../../redux/thunks/updateSelectedModelByRole";
|
||||
import { useSubmitOnboarding } from "../hooks/useSubmitOnboarding";
|
||||
import OllamaModelDownload from "./OllamaModelDownload";
|
||||
import { OllamaStatus } from "./OllamaStatus";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { useContext, useEffect, useState } from "react";
|
|||
import { Button } from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { getLocalStorage } from "../../../util/localStorage";
|
||||
import { useOnboardingCard } from "../hooks";
|
||||
import { useOnboardingCard } from "../hooks/useOnboardingCard";
|
||||
|
||||
/**
|
||||
* Models Add-On tab component displaying pricing and tier information
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { OnboardingModes } from "core/protocol/core";
|
||||
import { FormProvider, useForm } from "react-hook-form";
|
||||
import { AddModelForm } from "../../../forms";
|
||||
import { AddModelForm } from "../../../forms/AddModelForm";
|
||||
import { providers } from "../../../pages/AddNewModel/configs/providers";
|
||||
import { useAppDispatch } from "../../../redux/hooks";
|
||||
import { setDialogMessage, setShowDialog } from "../../../redux/slices/uiSlice";
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
export * from "./OllamaCompletedStep";
|
||||
export * from "./OllamaModelDownload";
|
||||
export * from "./OllamaStatus";
|
||||
export * from "./OnboardingCardLanding";
|
||||
export * from "./OnboardingCardTabs";
|
||||
export * from "./OnboardingLocalTab";
|
||||
export * from "./OnboardingModelsAddOnTab";
|
||||
export * from "./OnboardingProvidersTab";
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export * from "./useSubmitOnboarding";
|
||||
export * from "./useOnboardingCard";
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
export * from "./OnboardingCard";
|
||||
export * from "./utils";
|
||||
export * from "./hooks/useOnboardingCard";
|
||||
export { useOnboardingCard } from "./hooks/useOnboardingCard";
|
||||
export { useSubmitOnboarding } from "./hooks/useSubmitOnboarding";
|
||||
export { OnboardingCard, type OnboardingCardState } from "./OnboardingCard";
|
||||
export {
|
||||
defaultOnboardingCardState,
|
||||
isNewUserOnboarding,
|
||||
type OnboardingStatus,
|
||||
} from "./utils";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
vscEditorBackground,
|
||||
} from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { useIdeMessengerRequest } from "../../../hooks";
|
||||
import { useIdeMessengerRequest } from "../../../hooks/useIdeMessengerRequest";
|
||||
import { useWebviewListener } from "../../../hooks/useWebviewListener";
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
import { selectCurrentToolCallApplyState } from "../../../redux/selectors/selectCurrentToolCall";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { AddModelForm } from "../../forms";
|
||||
import { AddModelForm } from "../../forms/AddModelForm";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { FREE_TRIAL_LIMIT_REQUESTS } from "../../util/freeTrial";
|
||||
import { ToolTip } from "../gui/Tooltip";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
|||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
|
||||
import { exitEdit } from "../../../../redux/thunks";
|
||||
import { exitEdit } from "../../../../redux/thunks/edit";
|
||||
import { getEditFilenameAndRangeText } from "../../util";
|
||||
|
||||
export function EditToolbar() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
import { useAppDispatch } from "../../../../redux/hooks";
|
||||
import { cancelStream } from "../../../../redux/thunks";
|
||||
import { cancelStream } from "../../../../redux/thunks/cancelStream";
|
||||
import { getAltKeyLabel, getMetaKeyLabel } from "../../../../util";
|
||||
import { Container, StopButton } from "./components";
|
||||
import { GeneratingIndicator } from "./GeneratingIndicator";
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ import { useEffect } from "react";
|
|||
import { useSelector } from "react-redux";
|
||||
import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
|
||||
import { selectCurrentToolCall } from "../../../../redux/selectors/selectCurrentToolCall";
|
||||
import {
|
||||
callCurrentTool,
|
||||
cancelCurrentToolCall,
|
||||
} from "../../../../redux/thunks";
|
||||
import { callCurrentTool } from "../../../../redux/thunks/callCurrentTool";
|
||||
import { cancelCurrentToolCall } from "../../../../redux/thunks/cancelCurrentToolCall";
|
||||
import { isJetBrains } from "../../../../util";
|
||||
import { BlockSettingsTopToolbar } from "./BlockSettingsTopToolbar";
|
||||
import { EditOutcomeToolbar } from "./EditOutcomeToolbar";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import styled from "styled-components";
|
||||
import { useAppDispatch } from "../../../../redux/hooks";
|
||||
import {
|
||||
callCurrentTool,
|
||||
cancelCurrentToolCall,
|
||||
} from "../../../../redux/thunks";
|
||||
import { callCurrentTool } from "../../../../redux/thunks/callCurrentTool";
|
||||
import { cancelCurrentToolCall } from "../../../../redux/thunks/cancelCurrentToolCall";
|
||||
import {
|
||||
getAltKeyLabel,
|
||||
getFontSize,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useAppDispatch } from "../../../../redux/hooks";
|
||||
import { cancelStream } from "../../../../redux/thunks";
|
||||
import { cancelStream } from "../../../../redux/thunks/cancelStream";
|
||||
import { getAltKeyLabel, getMetaKeyLabel, isJetBrains } from "../../../../util";
|
||||
import { Container, StopButton } from "./components";
|
||||
import { GeneratingIndicator } from "./GeneratingIndicator";
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export * from "./LumpToolbar";
|
||||
|
|
@ -5,7 +5,7 @@ import {
|
|||
vscInputBackground,
|
||||
} from "../..";
|
||||
import { useLump } from "./LumpContext";
|
||||
import { LumpToolbar } from "./LumpToolbar";
|
||||
import { LumpToolbar } from "./LumpToolbar/LumpToolbar";
|
||||
import { SelectedSection } from "./sections/SelectedSection";
|
||||
|
||||
const LumpDiv = styled.div`
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ModelDescription } from "core";
|
|||
import { useAuth } from "../../../../context/Auth";
|
||||
import ModelRoleSelector from "../../../../pages/config/ModelRoleSelector";
|
||||
import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
|
||||
import { updateSelectedModelByRole } from "../../../../redux/thunks";
|
||||
import { updateSelectedModelByRole } from "../../../../redux/thunks/updateSelectedModelByRole";
|
||||
import { isJetBrains } from "../../../../util";
|
||||
|
||||
export function ModelsSection() {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,12 @@ import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
|
|||
import { selectSelectedChatModel } from "../../../redux/slices/configSlice";
|
||||
import InputToolbar, { ToolbarOptions } from "../InputToolbar";
|
||||
import { ComboBoxItem } from "../types";
|
||||
import { DragOverlay, InputBoxDiv } from "./components";
|
||||
import { DragOverlay } from "./components/DragOverlay";
|
||||
import { InputBoxDiv } from "./components/StyledComponents";
|
||||
import { useMainEditor } from "./MainEditorProvider";
|
||||
import "./TipTapEditor.css";
|
||||
import { handleImageFile } from "./utils";
|
||||
import { createEditorConfig, getPlaceholderText } from "./utils/editorConfig";
|
||||
import { handleImageFile } from "./utils/imageUtils";
|
||||
import { useEditorEventHandlers } from "./utils/keyHandlers";
|
||||
|
||||
export interface TipTapEditorProps {
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
export * from "./DragOverlay";
|
||||
export * from "./ExpandableToolbarPreview";
|
||||
export * from "./StyledComponents";
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./CodeBlock";
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./PromptBlock";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export * from "./CodeBlock";
|
||||
export * from "./Mention";
|
||||
export * from "./Prompt";
|
||||
export * from "./SlashCommand";
|
||||
export { CodeBlock } from "./CodeBlock/CodeBlock";
|
||||
export { Mention } from "./Mention";
|
||||
export { PromptBlock } from "./Prompt/PromptBlock";
|
||||
export { SlashCommand } from "./SlashCommand";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
export * from "./extensions";
|
||||
export * from "./MainEditorProvider";
|
||||
export * from "./TipTapEditor";
|
||||
export * from "./utils";
|
||||
export { MainEditorProvider, useMainEditor } from "./MainEditorProvider";
|
||||
export { TipTapEditor } from "./TipTapEditor";
|
||||
export { resolveEditorContent } from "./utils/resolveEditorContent";
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ import { InputModifiers } from "core";
|
|||
import { modelSupportsImages } from "core/llm/autodetect";
|
||||
import { usePostHog } from "posthog-js/react";
|
||||
import { useRef } from "react";
|
||||
import {
|
||||
getContextProviderDropdownOptions,
|
||||
getSlashCommandDropdownOptions,
|
||||
} from ".";
|
||||
import { IIdeMessenger } from "../../../../context/IdeMessenger";
|
||||
import { useSubmenuContextProviders } from "../../../../context/SubmenuContextProviders";
|
||||
import { useInputHistory } from "../../../../hooks/useInputHistory";
|
||||
|
|
@ -25,8 +21,12 @@ import { selectSelectedChatModel } from "../../../../redux/slices/configSlice";
|
|||
import { AppDispatch } from "../../../../redux/store";
|
||||
import { exitEdit } from "../../../../redux/thunks/edit";
|
||||
import { getFontSize, isJetBrains } from "../../../../util";
|
||||
import * as ContinueExtensions from "../extensions";
|
||||
import { CodeBlock, Mention, PromptBlock, SlashCommand } from "../extensions";
|
||||
import { TipTapEditorProps } from "../TipTapEditor";
|
||||
import {
|
||||
getContextProviderDropdownOptions,
|
||||
getSlashCommandDropdownOptions,
|
||||
} from "./getSuggestion";
|
||||
import { handleImageFile } from "./imageUtils";
|
||||
|
||||
export function getPlaceholderText(
|
||||
|
|
@ -52,9 +52,7 @@ export function getPlaceholderText(
|
|||
export function hasValidEditorContent(json: JSONContent): boolean {
|
||||
// Check for prompt or code blocks
|
||||
const hasPromptOrCodeBlock = json.content?.some(
|
||||
(c) =>
|
||||
c.type === ContinueExtensions.PromptBlock.name ||
|
||||
c.type === ContinueExtensions.CodeBlock.name,
|
||||
(c) => c.type === PromptBlock.name || c.type === CodeBlock.name,
|
||||
);
|
||||
|
||||
// Check for text content
|
||||
|
|
@ -306,7 +304,7 @@ export function createEditorConfig(options: {
|
|||
},
|
||||
}),
|
||||
Text,
|
||||
ContinueExtensions.Mention.configure({
|
||||
Mention.configure({
|
||||
suggestion: getContextProviderDropdownOptions(
|
||||
availableContextProvidersRef,
|
||||
getSubmenuContextItemsRef,
|
||||
|
|
@ -317,7 +315,7 @@ export function createEditorConfig(options: {
|
|||
ideMessenger,
|
||||
),
|
||||
}),
|
||||
ContinueExtensions.SlashCommand.configure({
|
||||
SlashCommand.configure({
|
||||
suggestion: getSlashCommandDropdownOptions(
|
||||
availableSlashCommandsRef,
|
||||
onClose,
|
||||
|
|
@ -327,8 +325,8 @@ export function createEditorConfig(options: {
|
|||
props.inputId,
|
||||
),
|
||||
}),
|
||||
ContinueExtensions.PromptBlock,
|
||||
ContinueExtensions.CodeBlock,
|
||||
PromptBlock,
|
||||
CodeBlock,
|
||||
],
|
||||
editorProps: {
|
||||
attributes: {
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
export * from "./editorConfig";
|
||||
export * from "./getSuggestion";
|
||||
export * from "./imageUtils";
|
||||
export * from "./keyHandlers";
|
||||
export * from "./resolveEditorContent";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Editor } from "@tiptap/core";
|
||||
import { ContextProviderDescription } from "core";
|
||||
import * as ContinueExtensions from "../extensions";
|
||||
import { Mention } from "../extensions";
|
||||
|
||||
/**
|
||||
* inserts the current file context as a removable mention in the editor area
|
||||
|
|
@ -16,7 +16,7 @@ export function insertCurrentFileContextMention(
|
|||
);
|
||||
|
||||
if (foundCurrentFileProvider) {
|
||||
const node = editor.schema.nodes[ContinueExtensions.Mention.name].create({
|
||||
const node = editor.schema.nodes[Mention.name].create({
|
||||
name: foundCurrentFileProvider.displayTitle,
|
||||
description: foundCurrentFileProvider.description,
|
||||
id: foundCurrentFileProvider.title,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Editor } from "@tiptap/react";
|
||||
import { KeyboardEvent } from "react";
|
||||
import { getPlatform, isWebEnvironment } from "../../../util";
|
||||
import { CodeBlock } from "../TipTapEditor";
|
||||
import { CodeBlock } from "../TipTapEditor/extensions";
|
||||
|
||||
const isWebEnv = isWebEnvironment();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import { SetCodeToEditPayload } from "core";
|
||||
import { getUriPathBasename } from "core/util/uri";
|
||||
|
||||
export * from "./handleMetaKeyIssues";
|
||||
|
||||
export function getEditFilenameAndRangeText(code: SetCodeToEditPayload) {
|
||||
const fileName = getUriPathBasename(code.filepath);
|
||||
let title = `${fileName}`;
|
||||
|
|
|
|||
|
|
@ -9,17 +9,22 @@ import {
|
|||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { useAuth } from "../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { AddModelForm } from "../../forms";
|
||||
import { AddModelForm } from "../../forms/AddModelForm";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { EMPTY_CONFIG } from "../../redux/slices/configSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { updateSelectedModelByRole } from "../../redux/thunks";
|
||||
import { updateSelectedModelByRole } from "../../redux/thunks/updateSelectedModelByRole";
|
||||
import {
|
||||
fontSize,
|
||||
getMetaKeyLabel,
|
||||
isMetaEquivalentKeyPressed,
|
||||
} from "../../util";
|
||||
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui";
|
||||
import {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
ListboxOption,
|
||||
ListboxOptions,
|
||||
} from "../ui/Listbox";
|
||||
|
||||
interface ModelOptionProps {
|
||||
option: Option;
|
||||
|
|
|
|||
|
|
@ -7,35 +7,34 @@ import {
|
|||
ExclamationTriangleIcon,
|
||||
PlusIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import type { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useAuth } from "../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
|
||||
import {
|
||||
selectCurrentOrg,
|
||||
setSelectedOrgId,
|
||||
setSelectedProfile,
|
||||
} from "../../../redux";
|
||||
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
|
||||
} from "../../../redux/slices/profilesSlice";
|
||||
import {
|
||||
fontSize,
|
||||
getMetaKeyLabel,
|
||||
isLocalProfile,
|
||||
isMetaEquivalentKeyPressed,
|
||||
} from "../../../util";
|
||||
import { cn } from "../../../util/cn";
|
||||
import { ROUTES } from "../../../util/navigation";
|
||||
import { useLump } from "../../mainInput/Lump/LumpContext";
|
||||
import {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
ListboxOption,
|
||||
ListboxOptions,
|
||||
Transition,
|
||||
useFontSize,
|
||||
} from "../../ui";
|
||||
|
||||
import type { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { cn } from "../../../util/cn";
|
||||
import { ROUTES } from "../../../util/navigation";
|
||||
import { useLump } from "../../mainInput/Lump/LumpContext";
|
||||
import { useFontSize } from "../../ui/font";
|
||||
import AssistantIcon from "./AssistantIcon";
|
||||
interface AssistantSelectOptionProps {
|
||||
profile: ProfileDescription;
|
||||
|
|
|
|||
10
gui/src/components/ui/index.ts
Normal file
10
gui/src/components/ui/index.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export { Button } from "./Button";
|
||||
export { useFontSize } from "./font";
|
||||
export {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
ListboxOption,
|
||||
ListboxOptions,
|
||||
} from "./Listbox";
|
||||
export { Popover, PopoverButton, PopoverPanel } from "./Popover";
|
||||
export { Transition } from "./Transition";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export * from "./Combobox";
|
||||
export * from "./Listbox";
|
||||
export * from "./Popover";
|
||||
export * from "./Transition";
|
||||
|
|
@ -12,13 +12,13 @@ import React, {
|
|||
} from "react";
|
||||
import ConfirmationDialog from "../components/dialogs/ConfirmationDialog";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
import {
|
||||
selectCurrentOrg,
|
||||
selectSelectedProfile,
|
||||
setOrganizations,
|
||||
setSelectedOrgId,
|
||||
} from "../redux/";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
} from "../redux/slices/profilesSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { IdeMessengerContext } from "./IdeMessenger";
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
providers,
|
||||
} from "../pages/AddNewModel/configs/providers";
|
||||
import { useAppDispatch } from "../redux/hooks";
|
||||
import { updateSelectedModelByRole } from "../redux/thunks";
|
||||
import { updateSelectedModelByRole } from "../redux/thunks/updateSelectedModelByRole";
|
||||
|
||||
interface AddModelFormProps {
|
||||
onDone: () => void;
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export * from "./AddModelForm";
|
||||
|
|
@ -3,13 +3,6 @@ import { IdeMessengerContext } from "../context/IdeMessenger";
|
|||
|
||||
import { EDIT_MODE_STREAM_ID } from "core/edit/constants";
|
||||
import { FromCoreProtocol } from "core/protocol";
|
||||
import { useMainEditor } from "../components/mainInput/TipTapEditor";
|
||||
import {
|
||||
initializeProfilePreferences,
|
||||
setOrganizations,
|
||||
setSelectedOrgId,
|
||||
setSelectedProfile,
|
||||
} from "../redux";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
import { selectCurrentToolCallApplyState } from "../redux/selectors/selectCurrentToolCall";
|
||||
import { setConfigResult } from "../redux/slices/configSlice";
|
||||
|
|
@ -18,13 +11,21 @@ import {
|
|||
updateEditStateApplyState,
|
||||
} from "../redux/slices/editState";
|
||||
import { updateIndexingStatus } from "../redux/slices/indexingSlice";
|
||||
import {
|
||||
initializeProfilePreferences,
|
||||
setOrganizations,
|
||||
setSelectedOrgId,
|
||||
setSelectedProfile,
|
||||
} from "../redux/slices/profilesSlice";
|
||||
import {
|
||||
acceptToolCall,
|
||||
addContextItemsAtIndex,
|
||||
updateApplyState,
|
||||
} from "../redux/slices/sessionSlice";
|
||||
import { setTTSActive } from "../redux/slices/uiSlice";
|
||||
import { exitEdit, streamResponseAfterToolCall } from "../redux/thunks";
|
||||
import { exitEdit } from "../redux/thunks/edit";
|
||||
import { streamResponseAfterToolCall } from "../redux/thunks/streamResponseAfterToolCall";
|
||||
|
||||
import { cancelStream } from "../redux/thunks/cancelStream";
|
||||
import { refreshSessionMetadata } from "../redux/thunks/session";
|
||||
import { streamResponseThunk } from "../redux/thunks/streamResponse";
|
||||
|
|
@ -52,8 +53,6 @@ function ParallelListeners() {
|
|||
selectCurrentToolCallApplyState,
|
||||
);
|
||||
|
||||
const { mainEditor } = useMainEditor();
|
||||
|
||||
const handleConfigUpdate = useCallback(
|
||||
async (isInitial: boolean, result: FromCoreProtocol["configUpdate"][0]) => {
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export * from "./useIdeMessengerRequest";
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
import { SlashCommandDescription } from "core";
|
||||
import { usePostHog } from "posthog-js/react";
|
||||
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
import {
|
||||
bookmarkSlashCommand,
|
||||
selectBookmarkedSlashCommands,
|
||||
unbookmarkSlashCommand,
|
||||
} from "../redux";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
} from "../redux/slices/profilesSlice";
|
||||
|
||||
export function useBookmarkedSlashCommands() {
|
||||
const dispatch = useAppDispatch();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { UserCircleIcon } from "@heroicons/react/24/solid";
|
||||
import { isOnPremSession } from "core/control-plane/AuthTypes";
|
||||
import {
|
||||
Button,
|
||||
Popover,
|
||||
PopoverButton,
|
||||
PopoverPanel,
|
||||
Transition,
|
||||
} from "../../components/ui";
|
||||
import { Button } from "../../components/ui/Button";
|
||||
import { useAuth } from "../../context/Auth";
|
||||
import { selectCurrentOrg } from "../../redux";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectCurrentOrg } from "../../redux/slices/profilesSlice";
|
||||
import { ScopeSelect } from "./ScopeSelect";
|
||||
|
||||
export function AccountButton() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
|||
import {
|
||||
selectCurrentOrg,
|
||||
setSelectedOrgId,
|
||||
} from "../../redux/slices/profiles/slice";
|
||||
} from "../../redux/slices/profilesSlice";
|
||||
|
||||
interface ScopeSelectProps {
|
||||
onSelect?: () => void;
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ import {
|
|||
setDialogMessage,
|
||||
setShowDialog,
|
||||
} from "../../redux/slices/uiSlice";
|
||||
import { streamResponseThunk } from "../../redux/thunks";
|
||||
import { cancelStream } from "../../redux/thunks/cancelStream";
|
||||
import { streamEditThunk } from "../../redux/thunks/edit";
|
||||
import { loadLastSession } from "../../redux/thunks/session";
|
||||
import { streamResponseThunk } from "../../redux/thunks/streamResponse";
|
||||
import { isJetBrains, isMetaEquivalentKeyPressed } from "../../util";
|
||||
|
||||
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ import { GithubIcon } from "../../components/svg/GithubIcon";
|
|||
import ToggleDiv from "../../components/ToggleDiv";
|
||||
import { useAuth } from "../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { selectSelectedProfile } from "../../redux/";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { selectSelectedChatModel } from "../../redux/slices/configSlice";
|
||||
import { selectSelectedProfile } from "../../redux/slices/profilesSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { streamResponseThunk } from "../../redux/thunks";
|
||||
import { streamResponseThunk } from "../../redux/thunks/streamResponse";
|
||||
import { isLocalProfile } from "../../util";
|
||||
import { providers } from "../AddNewModel/configs/providers";
|
||||
import { ModelsAddOnLimitDialog } from "./ModelsAddOnLimitDialog";
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export * from "./slices";
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./profiles";
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./slice";
|
||||
|
|
@ -15,10 +15,10 @@ import { createFilter } from "redux-persist-transform-filter";
|
|||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
import storage from "redux-persist/lib/storage";
|
||||
import { IdeMessenger, IIdeMessenger } from "../context/IdeMessenger";
|
||||
import { profilesReducer } from "./slices";
|
||||
import configReducer from "./slices/configSlice";
|
||||
import editModeStateReducer from "./slices/editState";
|
||||
import indexingReducer from "./slices/indexingSlice";
|
||||
import { profilesReducer } from "./slices/profilesSlice";
|
||||
import sessionReducer from "./slices/sessionSlice";
|
||||
import tabsReducer from "./slices/tabsSlice";
|
||||
import uiReducer from "./slices/uiSlice";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
SlashCommandDescription,
|
||||
} from "core";
|
||||
import * as URI from "uri-js";
|
||||
import { resolveEditorContent } from "../../components/mainInput/TipTapEditor/utils";
|
||||
import { resolveEditorContent } from "../../components/mainInput/TipTapEditor";
|
||||
import { selectSelectedChatModel } from "../slices/configSlice";
|
||||
import { ThunkApiType } from "../store";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
export * from "./callCurrentTool";
|
||||
export * from "./cancelCurrentToolCall";
|
||||
export * from "./cancelStream";
|
||||
export * from "./edit";
|
||||
export * from "./gatherContext";
|
||||
export * from "./resetStateForNewMessage";
|
||||
export * from "./selectFirstHubProfile";
|
||||
export * from "./streamNormalInput";
|
||||
export * from "./streamResponse";
|
||||
export * from "./streamResponseAfterToolCall";
|
||||
export * from "./streamThunkWrapper";
|
||||
export * from "./updateSelectedModelByRole";
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { setSelectedProfile } from "../slices";
|
||||
import { setSelectedProfile } from "../slices/profilesSlice";
|
||||
import { ThunkApiType } from "../store";
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue