diff --git a/ui/app/(prowler)/lighthouse/_actions/index.ts b/ui/app/(prowler)/lighthouse/_actions/index.ts new file mode 100644 index 0000000000..9d89b59a59 --- /dev/null +++ b/ui/app/(prowler)/lighthouse/_actions/index.ts @@ -0,0 +1 @@ +export * from "./lighthouse-v2"; diff --git a/ui/actions/lighthouse-v2/lighthouse-v2.adapter.test.ts b/ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.test.ts similarity index 100% rename from ui/actions/lighthouse-v2/lighthouse-v2.adapter.test.ts rename to ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.test.ts diff --git a/ui/actions/lighthouse-v2/lighthouse-v2.adapter.ts b/ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.ts similarity index 99% rename from ui/actions/lighthouse-v2/lighthouse-v2.adapter.ts rename to ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.ts index 10b1c151b7..60a7c5ba2f 100644 --- a/ui/actions/lighthouse-v2/lighthouse-v2.adapter.ts +++ b/ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.ts @@ -11,7 +11,7 @@ import { type LighthouseV2SupportedModel, type LighthouseV2SupportedProvider, type LighthouseV2Task, -} from "@/types/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_types"; export interface JsonApiResource { id: string; diff --git a/ui/app/(prowler)/lighthouse/_components/ai-elements/chain-of-thought.tsx b/ui/app/(prowler)/lighthouse/_components/ai-elements/chain-of-thought.tsx new file mode 100644 index 0000000000..35e0539b4a --- /dev/null +++ b/ui/app/(prowler)/lighthouse/_components/ai-elements/chain-of-thought.tsx @@ -0,0 +1,230 @@ +"use client"; + +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { + BrainIcon, + ChevronDownIcon, + DotIcon, + type LucideIcon, +} from "lucide-react"; +import type { ComponentProps, ReactNode } from "react"; +import { createContext, useContext } from "react"; + +import { Badge } from "@/components/shadcn/badge/badge"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/shadcn/collapsible"; +import { cn } from "@/lib/utils"; + +type ChainOfThoughtContextValue = { + isOpen: boolean; + setIsOpen: (open: boolean) => void; +}; + +const ChainOfThoughtContext = createContext( + null, +); + +const useChainOfThought = () => { + const context = useContext(ChainOfThoughtContext); + if (!context) { + throw new Error( + "ChainOfThought components must be used within ChainOfThought", + ); + } + return context; +}; + +export type ChainOfThoughtProps = ComponentProps<"div"> & { + open?: boolean; + defaultOpen?: boolean; + onOpenChange?: (open: boolean) => void; +}; + +export function ChainOfThought({ + className, + open, + defaultOpen = false, + onOpenChange, + children, + ...props +}: ChainOfThoughtProps) { + const [isOpen, setIsOpen] = useControllableState({ + prop: open, + defaultProp: defaultOpen, + onChange: onOpenChange, + }); + + const chainOfThoughtContext = { isOpen, setIsOpen }; + + return ( + +
+ {children} +
+
+ ); +} + +export type ChainOfThoughtHeaderProps = ComponentProps< + typeof CollapsibleTrigger +>; + +export function ChainOfThoughtHeader({ + className, + children, + ...props +}: ChainOfThoughtHeaderProps) { + const { isOpen, setIsOpen } = useChainOfThought(); + + return ( + + + + + {children ?? "Chain of Thought"} + + + + + ); +} + +export type ChainOfThoughtStepProps = ComponentProps<"div"> & { + icon?: LucideIcon; + label: ReactNode; + description?: ReactNode; + status?: "complete" | "active" | "pending"; +}; + +export function ChainOfThoughtStep({ + className, + icon: Icon = DotIcon, + label, + description, + status = "complete", + children, + ...props +}: ChainOfThoughtStepProps) { + const statusStyles = { + complete: "text-muted-foreground", + active: "text-foreground", + pending: "text-muted-foreground/50", + }; + + return ( +
+
+ +
+
+
+
{label}
+ {description && ( +
{description}
+ )} + {children} +
+
+ ); +} + +export type ChainOfThoughtSearchResultsProps = ComponentProps<"div">; + +export function ChainOfThoughtSearchResults({ + className, + ...props +}: ChainOfThoughtSearchResultsProps) { + return ( +
+ ); +} + +export type ChainOfThoughtSearchResultProps = ComponentProps; + +export function ChainOfThoughtSearchResult({ + className, + children, + ...props +}: ChainOfThoughtSearchResultProps) { + return ( + + {children} + + ); +} + +export type ChainOfThoughtContentProps = ComponentProps< + typeof CollapsibleContent +>; + +export function ChainOfThoughtContent({ + className, + children, + ...props +}: ChainOfThoughtContentProps) { + const { isOpen } = useChainOfThought(); + + return ( + + + {children} + + + ); +} + +export type ChainOfThoughtImageProps = ComponentProps<"div"> & { + caption?: string; +}; + +export function ChainOfThoughtImage({ + className, + children, + caption, + ...props +}: ChainOfThoughtImageProps) { + return ( +
+
+ {children} +
+ {caption &&

{caption}

} +
+ ); +} diff --git a/ui/components/ai-elements/conversation.tsx b/ui/app/(prowler)/lighthouse/_components/ai-elements/conversation.tsx similarity index 100% rename from ui/components/ai-elements/conversation.tsx rename to ui/app/(prowler)/lighthouse/_components/ai-elements/conversation.tsx diff --git a/ui/components/lighthouse-v2/chat/index.ts b/ui/app/(prowler)/lighthouse/_components/chat/index.ts similarity index 100% rename from ui/components/lighthouse-v2/chat/index.ts rename to ui/app/(prowler)/lighthouse/_components/chat/index.ts diff --git a/ui/components/lighthouse-v2/config/index.ts b/ui/app/(prowler)/lighthouse/_components/config/index.ts similarity index 100% rename from ui/components/lighthouse-v2/config/index.ts rename to ui/app/(prowler)/lighthouse/_components/config/index.ts diff --git a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.test.tsx similarity index 99% rename from ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx rename to ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.test.tsx index de2ac354a4..20d0586492 100644 --- a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.test.tsx @@ -6,7 +6,7 @@ import type { LighthouseV2Configuration, LighthouseV2SupportedModel, LighthouseV2SupportedProvider, -} from "@/types/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_types"; import { LighthouseV2ConfigPage } from "./lighthouse-v2-config-page"; @@ -30,7 +30,7 @@ vi.mock("next/navigation", () => ({ }), })); -vi.mock("@/actions/lighthouse-v2/lighthouse-v2", () => ({ +vi.mock("@/app/(prowler)/lighthouse/_actions", () => ({ createLighthouseV2Configuration: createConfigurationMock, deleteLighthouseV2Configuration: deleteConfigurationMock, testLighthouseV2ConfigurationConnection: testConnectionMock, diff --git a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx similarity index 99% rename from ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx rename to ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx index 37b7428b5f..8d435ea8b3 100644 --- a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx @@ -28,7 +28,17 @@ import { deleteLighthouseV2Configuration, testLighthouseV2ConfigurationConnection, updateLighthouseV2Configuration, -} from "@/actions/lighthouse-v2/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_actions"; +import { + LIGHTHOUSE_V2_PROVIDER_TYPE, + type LighthouseV2Configuration, + type LighthouseV2ConfigurationInput, + type LighthouseV2ConfigurationUpdateInput, + type LighthouseV2Credentials, + type LighthouseV2ProviderType, + type LighthouseV2SupportedModel, + type LighthouseV2SupportedProvider, +} from "@/app/(prowler)/lighthouse/_types"; import { Alert, AlertDescription, AlertTitle } from "@/components/shadcn/alert"; import { Badge } from "@/components/shadcn/badge/badge"; import { Button } from "@/components/shadcn/button/button"; @@ -45,16 +55,6 @@ import { } from "@/components/shadcn/select/select"; import { Textarea } from "@/components/shadcn/textarea/textarea"; import { cn } from "@/lib/utils"; -import { - LIGHTHOUSE_V2_PROVIDER_TYPE, - type LighthouseV2Configuration, - type LighthouseV2ConfigurationInput, - type LighthouseV2ConfigurationUpdateInput, - type LighthouseV2Credentials, - type LighthouseV2ProviderType, - type LighthouseV2SupportedModel, - type LighthouseV2SupportedProvider, -} from "@/types/lighthouse-v2"; interface LighthouseV2ConfigPageProps { configurations: LighthouseV2Configuration[]; diff --git a/ui/components/lighthouse-v2/history/index.ts b/ui/app/(prowler)/lighthouse/_components/history/index.ts similarity index 100% rename from ui/components/lighthouse-v2/history/index.ts rename to ui/app/(prowler)/lighthouse/_components/history/index.ts diff --git a/ui/components/lighthouse-v2/history/lighthouse-v2-session-history.test.tsx b/ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.test.tsx similarity index 99% rename from ui/components/lighthouse-v2/history/lighthouse-v2-session-history.test.tsx rename to ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.test.tsx index b5de3c5bb1..ef7d910690 100644 --- a/ui/components/lighthouse-v2/history/lighthouse-v2-session-history.test.tsx +++ b/ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.test.tsx @@ -6,7 +6,7 @@ import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import type { LighthouseV2Session } from "@/types/lighthouse-v2"; +import type { LighthouseV2Session } from "@/app/(prowler)/lighthouse/_types"; import { LighthouseV2SessionHistory } from "./lighthouse-v2-session-history"; diff --git a/ui/components/lighthouse-v2/history/lighthouse-v2-session-history.tsx b/ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.tsx similarity index 98% rename from ui/components/lighthouse-v2/history/lighthouse-v2-session-history.tsx rename to ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.tsx index b9610d18fd..dac2dc545c 100644 --- a/ui/components/lighthouse-v2/history/lighthouse-v2-session-history.tsx +++ b/ui/app/(prowler)/lighthouse/_components/history/lighthouse-v2-session-history.tsx @@ -3,6 +3,7 @@ import { Archive, Plus } from "lucide-react"; import { useState } from "react"; +import type { LighthouseV2Session } from "@/app/(prowler)/lighthouse/_types"; import { Button } from "@/components/shadcn/button/button"; import { Modal } from "@/components/shadcn/modal"; import { SearchInput } from "@/components/shadcn/search-input/search-input"; @@ -12,7 +13,6 @@ import { TooltipTrigger, } from "@/components/shadcn/tooltip"; import { cn } from "@/lib/utils"; -import type { LighthouseV2Session } from "@/types/lighthouse-v2"; const SESSION_HISTORY_GROUP_LABEL = "Older"; diff --git a/ui/components/lighthouse-v2/navigation/index.ts b/ui/app/(prowler)/lighthouse/_components/navigation/index.ts similarity index 100% rename from ui/components/lighthouse-v2/navigation/index.ts rename to ui/app/(prowler)/lighthouse/_components/navigation/index.ts diff --git a/ui/components/lighthouse-v2/navigation/lighthouse-v2-navigation-mode-sync.test.tsx b/ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-navigation-mode-sync.test.tsx similarity index 100% rename from ui/components/lighthouse-v2/navigation/lighthouse-v2-navigation-mode-sync.test.tsx rename to ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-navigation-mode-sync.test.tsx diff --git a/ui/components/lighthouse-v2/navigation/lighthouse-v2-navigation-mode-sync.tsx b/ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-navigation-mode-sync.tsx similarity index 100% rename from ui/components/lighthouse-v2/navigation/lighthouse-v2-navigation-mode-sync.tsx rename to ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-navigation-mode-sync.tsx diff --git a/ui/components/lighthouse-v2/navigation/lighthouse-v2-sidebar-chat.tsx b/ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-sidebar-chat.tsx similarity index 92% rename from ui/components/lighthouse-v2/navigation/lighthouse-v2-sidebar-chat.tsx rename to ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-sidebar-chat.tsx index 434e00e2f5..15b0293fbc 100644 --- a/ui/components/lighthouse-v2/navigation/lighthouse-v2-sidebar-chat.tsx +++ b/ui/app/(prowler)/lighthouse/_components/navigation/lighthouse-v2-sidebar-chat.tsx @@ -7,7 +7,9 @@ import { useState } from "react"; import { archiveLighthouseV2Session, getLighthouseV2Sessions, -} from "@/actions/lighthouse-v2/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_actions"; +import { LIGHTHOUSE_V2_SESSIONS_CHANGED_EVENT } from "@/app/(prowler)/lighthouse/_lib/session-events"; +import type { LighthouseV2Session } from "@/app/(prowler)/lighthouse/_types"; import { Button } from "@/components/shadcn/button/button"; import { Tooltip, @@ -15,8 +17,6 @@ import { TooltipTrigger, } from "@/components/shadcn/tooltip"; import { useMountEffect } from "@/hooks/use-mount-effect"; -import { LIGHTHOUSE_V2_SESSIONS_CHANGED_EVENT } from "@/lib/lighthouse-v2/session-events"; -import type { LighthouseV2Session } from "@/types/lighthouse-v2"; import { LighthouseV2SessionHistory } from "../history"; diff --git a/ui/lib/lighthouse-v2/event-reducer.test.ts b/ui/app/(prowler)/lighthouse/_lib/event-reducer.test.ts similarity index 100% rename from ui/lib/lighthouse-v2/event-reducer.test.ts rename to ui/app/(prowler)/lighthouse/_lib/event-reducer.test.ts diff --git a/ui/lib/lighthouse-v2/event-reducer.ts b/ui/app/(prowler)/lighthouse/_lib/event-reducer.ts similarity index 98% rename from ui/lib/lighthouse-v2/event-reducer.ts rename to ui/app/(prowler)/lighthouse/_lib/event-reducer.ts index 8208cfd73f..1dd6830917 100644 --- a/ui/lib/lighthouse-v2/event-reducer.ts +++ b/ui/app/(prowler)/lighthouse/_lib/event-reducer.ts @@ -1,7 +1,7 @@ import { LIGHTHOUSE_V2_SSE_EVENT, type LighthouseV2SSEEvent, -} from "@/types/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_types"; export const LIGHTHOUSE_V2_STREAM_STATUS = { IDLE: "idle", diff --git a/ui/lib/lighthouse-v2/session-events.ts b/ui/app/(prowler)/lighthouse/_lib/session-events.ts similarity index 100% rename from ui/lib/lighthouse-v2/session-events.ts rename to ui/app/(prowler)/lighthouse/_lib/session-events.ts diff --git a/ui/types/lighthouse-v2/config.ts b/ui/app/(prowler)/lighthouse/_types/config.ts similarity index 100% rename from ui/types/lighthouse-v2/config.ts rename to ui/app/(prowler)/lighthouse/_types/config.ts diff --git a/ui/types/lighthouse-v2/events.ts b/ui/app/(prowler)/lighthouse/_types/events.ts similarity index 100% rename from ui/types/lighthouse-v2/events.ts rename to ui/app/(prowler)/lighthouse/_types/events.ts diff --git a/ui/types/lighthouse-v2/index.ts b/ui/app/(prowler)/lighthouse/_types/index.ts similarity index 100% rename from ui/types/lighthouse-v2/index.ts rename to ui/app/(prowler)/lighthouse/_types/index.ts diff --git a/ui/app/(prowler)/lighthouse/page.tsx b/ui/app/(prowler)/lighthouse/page.tsx index a5b8e4d05a..070f7ee7fc 100644 --- a/ui/app/(prowler)/lighthouse/page.tsx +++ b/ui/app/(prowler)/lighthouse/page.tsx @@ -7,18 +7,20 @@ import { import { getLighthouseV2Configurations, getLighthouseV2Messages, + getLighthouseV2Session, getLighthouseV2SupportedModels, -} from "@/actions/lighthouse-v2/lighthouse-v2"; -import { LighthouseIcon } from "@/components/icons/Icons"; -import { Chat } from "@/components/lighthouse-v1"; -import { LighthouseV2ChatPage } from "@/components/lighthouse-v2/chat"; -import { LighthouseV2NavigationModeSync } from "@/components/lighthouse-v2/navigation"; -import { ContentLayout } from "@/components/ui"; -import { isCloud } from "@/lib/shared/env"; +} from "@/app/(prowler)/lighthouse/_actions"; +import { LighthouseV2ChatPage } from "@/app/(prowler)/lighthouse/_components/chat"; +import { LighthouseV2NavigationModeSync } from "@/app/(prowler)/lighthouse/_components/navigation"; +import { buildLighthouseV2StreamUrl } from "@/app/(prowler)/lighthouse/_lib/stream-url"; import type { LighthouseV2ProviderType, LighthouseV2SupportedModel, -} from "@/types/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_types"; +import { LighthouseIcon } from "@/components/icons/Icons"; +import { Chat } from "@/components/lighthouse-v1"; +import { ContentLayout } from "@/components/ui"; +import { isCloud } from "@/lib/shared/env"; export const dynamic = "force-dynamic"; @@ -63,9 +65,20 @@ export default async function AIChatbot({ LighthouseV2ProviderType, LighthouseV2SupportedModel[] >; - const initialMessages = activeSessionId - ? await getLighthouseV2Messages(activeSessionId) - : { data: [] }; + const [initialMessages, activeSession] = activeSessionId + ? await Promise.all([ + getLighthouseV2Messages(activeSessionId), + getLighthouseV2Session(activeSessionId), + ]) + : [{ data: [] }, undefined]; + const initialActiveTaskId = + activeSession && "data" in activeSession + ? (activeSession.data.activeTaskId ?? null) + : null; + const initialStreamUrl = + activeSessionId && initialActiveTaskId + ? buildLighthouseV2StreamUrl(activeSessionId) + : undefined; const chatRouteKey = activeSessionId ?? initialPrompt ?? "new"; return ( @@ -80,6 +93,8 @@ export default async function AIChatbot({ initialMessages={ "data" in initialMessages ? initialMessages.data : [] } + initialActiveTaskId={initialActiveTaskId} + initialStreamUrl={initialStreamUrl} initialPrompt={initialPrompt} />
diff --git a/ui/app/(prowler)/lighthouse/settings/page.tsx b/ui/app/(prowler)/lighthouse/settings/page.tsx index f2d64b6876..7b2e80ff36 100644 --- a/ui/app/(prowler)/lighthouse/settings/page.tsx +++ b/ui/app/(prowler)/lighthouse/settings/page.tsx @@ -4,18 +4,18 @@ import { getLighthouseV2Configurations, getLighthouseV2SupportedModels, getLighthouseV2SupportedProviders, -} from "@/actions/lighthouse-v2/lighthouse-v2"; +} from "@/app/(prowler)/lighthouse/_actions"; +import { LighthouseV2ConfigPage } from "@/app/(prowler)/lighthouse/_components/config"; +import type { + LighthouseV2ProviderType, + LighthouseV2SupportedModel, +} from "@/app/(prowler)/lighthouse/_types"; import { LighthouseSettings, LLMProvidersTable, } from "@/components/lighthouse-v1"; -import { LighthouseV2ConfigPage } from "@/components/lighthouse-v2/config"; import { ContentLayout } from "@/components/ui"; import { isCloud } from "@/lib/shared/env"; -import type { - LighthouseV2ProviderType, - LighthouseV2SupportedModel, -} from "@/types/lighthouse-v2"; export const dynamic = "force-dynamic"; diff --git a/ui/components/ai-elements/actions.tsx b/ui/components/lighthouse-v1/ai-elements/actions.tsx similarity index 100% rename from ui/components/ai-elements/actions.tsx rename to ui/components/lighthouse-v1/ai-elements/actions.tsx diff --git a/ui/components/ai-elements/chain-of-thought.tsx b/ui/components/lighthouse-v1/ai-elements/chain-of-thought.tsx similarity index 100% rename from ui/components/ai-elements/chain-of-thought.tsx rename to ui/components/lighthouse-v1/ai-elements/chain-of-thought.tsx diff --git a/ui/components/lighthouse-v1/ai-elements/conversation.tsx b/ui/components/lighthouse-v1/ai-elements/conversation.tsx new file mode 100644 index 0000000000..ec96807893 --- /dev/null +++ b/ui/components/lighthouse-v1/ai-elements/conversation.tsx @@ -0,0 +1,121 @@ +"use client"; + +import { ArrowDownIcon } from "lucide-react"; +import type { ComponentProps, ReactNode } from "react"; +import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom"; + +import { Button } from "@/components/shadcn/button/button"; +import { cn } from "@/lib/utils"; + +export type ConversationProps = ComponentProps; + +export const Conversation = ({ className, ...props }: ConversationProps) => ( + +); + +type ConversationContentChildren = + | ReactNode + | ((context: ReturnType) => ReactNode); + +export type ConversationContentProps = Omit< + ComponentProps<"div">, + "children" | "ref" +> & { + children?: ConversationContentChildren; + scrollClassName?: string; +}; + +export const ConversationContent = ({ + children, + className, + scrollClassName, + ...props +}: ConversationContentProps) => { + const context = useStickToBottomContext(); + const { contentRef, scrollRef } = context; + + return ( +
+
+ {typeof children === "function" ? children(context) : children} +
+
+ ); +}; + +export type ConversationEmptyStateProps = ComponentProps<"div"> & { + title?: string; + description?: string; + icon?: ReactNode; +}; + +export const ConversationEmptyState = ({ + className, + title = "No messages yet", + description = "Start a conversation to see messages here", + icon, + children, + ...props +}: ConversationEmptyStateProps) => ( +
+ {children ?? ( + <> + {icon &&
{icon}
} +
+

{title}

+ {description && ( +

{description}

+ )} +
+ + )} +
+); + +export type ConversationScrollButtonProps = ComponentProps; + +export const ConversationScrollButton = ({ + className, + ...props +}: ConversationScrollButtonProps) => { + const { isAtBottom, scrollToBottom } = useStickToBottomContext(); + + const handleScrollToBottom = () => { + scrollToBottom(); + }; + + return ( + !isAtBottom && ( + + ) + ); +}; diff --git a/ui/components/ai-elements/dropdown-menu.tsx b/ui/components/lighthouse-v1/ai-elements/dropdown-menu.tsx similarity index 100% rename from ui/components/ai-elements/dropdown-menu.tsx rename to ui/components/lighthouse-v1/ai-elements/dropdown-menu.tsx diff --git a/ui/components/ai-elements/input-group.tsx b/ui/components/lighthouse-v1/ai-elements/input-group.tsx similarity index 100% rename from ui/components/ai-elements/input-group.tsx rename to ui/components/lighthouse-v1/ai-elements/input-group.tsx diff --git a/ui/components/ai-elements/input.tsx b/ui/components/lighthouse-v1/ai-elements/input.tsx similarity index 100% rename from ui/components/ai-elements/input.tsx rename to ui/components/lighthouse-v1/ai-elements/input.tsx diff --git a/ui/components/ai-elements/prompt-input.tsx b/ui/components/lighthouse-v1/ai-elements/prompt-input.tsx similarity index 100% rename from ui/components/ai-elements/prompt-input.tsx rename to ui/components/lighthouse-v1/ai-elements/prompt-input.tsx diff --git a/ui/components/ai-elements/select.tsx b/ui/components/lighthouse-v1/ai-elements/select.tsx similarity index 100% rename from ui/components/ai-elements/select.tsx rename to ui/components/lighthouse-v1/ai-elements/select.tsx diff --git a/ui/components/ai-elements/textarea.tsx b/ui/components/lighthouse-v1/ai-elements/textarea.tsx similarity index 100% rename from ui/components/ai-elements/textarea.tsx rename to ui/components/lighthouse-v1/ai-elements/textarea.tsx diff --git a/ui/components/ai-elements/tooltip.tsx b/ui/components/lighthouse-v1/ai-elements/tooltip.tsx similarity index 100% rename from ui/components/ai-elements/tooltip.tsx rename to ui/components/lighthouse-v1/ai-elements/tooltip.tsx diff --git a/ui/components/lighthouse-v1/chain-of-thought-display.tsx b/ui/components/lighthouse-v1/chain-of-thought-display.tsx index df89e9e085..ff1864bedb 100644 --- a/ui/components/lighthouse-v1/chain-of-thought-display.tsx +++ b/ui/components/lighthouse-v1/chain-of-thought-display.tsx @@ -10,7 +10,7 @@ import { ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtStep, -} from "@/components/ai-elements/chain-of-thought"; +} from "@/components/lighthouse-v1/ai-elements/chain-of-thought"; import { CHAIN_OF_THOUGHT_ACTIONS, type ChainOfThoughtEvent, diff --git a/ui/components/lighthouse-v1/chat.tsx b/ui/components/lighthouse-v1/chat.tsx index b773f037ac..ce6e7b98f5 100644 --- a/ui/components/lighthouse-v1/chat.tsx +++ b/ui/components/lighthouse-v1/chat.tsx @@ -10,7 +10,7 @@ import { Conversation, ConversationContent, ConversationScrollButton, -} from "@/components/ai-elements/conversation"; +} from "@/components/lighthouse-v1/ai-elements/conversation"; import { PromptInput, PromptInputBody, @@ -18,7 +18,7 @@ import { PromptInputTextarea, PromptInputToolbar, PromptInputTools, -} from "@/components/ai-elements/prompt-input"; +} from "@/components/lighthouse-v1/ai-elements/prompt-input"; import { ERROR_PREFIX, MESSAGE_ROLES, diff --git a/ui/components/lighthouse-v1/message-item.tsx b/ui/components/lighthouse-v1/message-item.tsx index 42f52e2b98..dd8e71d4f6 100644 --- a/ui/components/lighthouse-v1/message-item.tsx +++ b/ui/components/lighthouse-v1/message-item.tsx @@ -6,7 +6,10 @@ import { Copy, RotateCcw } from "lucide-react"; import { defaultRehypePlugins, Streamdown } from "streamdown"; -import { Action, Actions } from "@/components/ai-elements/actions"; +import { + Action, + Actions, +} from "@/components/lighthouse-v1/ai-elements/actions"; import { ChainOfThoughtDisplay } from "@/components/lighthouse-v1/chain-of-thought-display"; import { extractChainOfThoughtEvents, diff --git a/ui/components/ui/sidebar/menu.test.tsx b/ui/components/ui/sidebar/menu.test.tsx index 73a3340673..a73faf40ec 100644 --- a/ui/components/ui/sidebar/menu.test.tsx +++ b/ui/components/ui/sidebar/menu.test.tsx @@ -34,7 +34,7 @@ vi.mock("@/lib/menu-list", () => ({ getMenuList: () => [], })); -vi.mock("@/components/lighthouse-v2/navigation", () => ({ +vi.mock("@/app/(prowler)/lighthouse/_components/navigation", () => ({ LighthouseV2SidebarChat: () =>
, })); diff --git a/ui/components/ui/sidebar/menu.tsx b/ui/components/ui/sidebar/menu.tsx index ee6ea09cca..3faba34030 100644 --- a/ui/components/ui/sidebar/menu.tsx +++ b/ui/components/ui/sidebar/menu.tsx @@ -4,8 +4,8 @@ import { Divider } from "@heroui/divider"; import Link from "next/link"; import { usePathname } from "next/navigation"; +import { LighthouseV2SidebarChat } from "@/app/(prowler)/lighthouse/_components/navigation"; import { InfoIcon, ProwlerShort } from "@/components/icons"; -import { LighthouseV2SidebarChat } from "@/components/lighthouse-v2/navigation"; import { Button } from "@/components/shadcn/button/button"; import { Tooltip,