AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(frontend): copilot composer + menu with Skills/Scheduled/Integrations modals and guided creation flows (#13489)
Ubbe0ba6ad864bab
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsxindex 7079d68fb0..2623a0bd23 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx@@ -14,6 +14,7 @@ import { CopilotChatHost } from "./CopilotChatHost";import { ContextPanelAutoOpen } from "./components/ContextPanel/ContextPanelAutoOpen";import { ContextPanelToggle } from "./components/ContextPanel/ContextPanelToggle";import { ChatSidebar } from "./components/ChatSidebar/ChatSidebar";+import { CopilotModals } from "./components/CopilotModals/CopilotModals";import { FileDropZone } from "./components/FileDropZone/FileDropZone";import { MobileDrawer } from "./components/MobileDrawer/MobileDrawer";import { MobileHeader } from "./components/MobileHeader/MobileHeader";@@ -97,6 +98,7 @@ export function CopilotPage() {{isMobile && isArtifactsEnabled && <ArtifactPanel mobile />}{isMobile && !showNewLayout && <MobileDrawer />}<NotificationDialog />+ <CopilotModals /></SidebarProvider>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsxindex 6cafba24e4..116421dffc 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx@@ -92,7 +92,11 @@ vi.mock("@/lib/supabase/hooks/useSupabase", () => ({let mockSessionIdForQueryState: string | null = null;vi.mock("nuqs", () => ({parseAsString: {},- useQueryState: () => [mockSessionIdForQueryState, vi.fn()],+ parseAsStringLiteral: () => ({}),+ useQueryState: (key: string) =>+ key === "sessionId"+ ? [mockSessionIdForQueryState, vi.fn()]+ : [null, vi.fn()],}));// Build the base mock return value for useCopilotPagediff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsxindex 0bf65d9084..fabd8a6aef 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx@@ -86,6 +86,7 @@ vi.mock("@/lib/supabase/hooks/useSupabase", () => ({// sessionId is read via nuqs to key the chat-host subtree; stub it.vi.mock("nuqs", () => ({parseAsString: {},+ parseAsStringLiteral: () => ({}),useQueryState: () => [null, vi.fn()],}));diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsxindex 9b04f9fa48..3e09c9a544 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx@@ -6,6 +6,7 @@ import {PromptInputTextarea,PromptInputTools,} from "@/components/ai-elements/prompt-input";+import { isGuidedPrompt } from "@/components/contextual/guidedPrompts";import { toast } from "@/components/molecules/Toast/use-toast";import { InputGroup } from "@/components/ui/input-group";import {@@ -24,7 +25,7 @@ import {partitionAttachments,workspaceItemToAttachment,} from "../../helpers/workspaceAttachments";-import { AttachmentMenu } from "./components/AttachmentMenu";+import { ComposerPlusMenu } from "./components/ComposerPlusMenu";import { BlockCaret } from "./components/BlockCaret";import { DryRunToggleButton } from "./components/DryRunToggleButton";import { FileChips } from "./components/FileChips";@@ -221,6 +222,12 @@ export function ChatInput({!isRecording &&!isTranscribing;+ function handleClearGuidedPrompt() {+ // Only discard untouched guided prompts — never a draft the user typed+ // or edited themselves.+ if (isGuidedPrompt(value)) setValue("");+ }+function handleFilesSelected(newFiles: File[]) {setAttachments((prev) => [...prev,@@ -299,10 +306,10 @@ export function ChatInput({<PromptInputFooter><PromptInputTools>- <AttachmentMenu+ <ComposerPlusMenuonFilesSelected={handleFilesSelected}onUseWorkspaceFile={() => setIsPickerOpen(true)}- showWorkspaceOption={showWorkspaceFiles}+ onClearGuidedPrompt={handleClearGuidedPrompt}disabled={isBusy}/>{/* Mode and model are per-message settings sent with each stream request,diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsxindex 235555b0c4..a270859204 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx@@ -6,6 +6,10 @@ import {act,waitFor,} from "@/tests/integrations/test-utils";+import {+ NEW_SCHEDULED_TASK_PROMPT,+ NEW_SKILL_PROMPT,+} from "@/components/contextual/guidedPrompts";import type { UIMessage } from "ai";import { useRef } from "react";import { afterEach, describe, expect, it, vi } from "vitest";@@ -28,6 +32,11 @@ const mockSetCopilotLlmModel = vi.fn((model: string) => {mockCopilotLlmModel = model;});+let mockInitialPrompt: string | null = null;+const mockSetInitialPrompt = vi.fn((value: string | null) => {+ mockInitialPrompt = value;+});+vi.mock("@/app/(platform)/copilot/store", () => ({useCopilotUIStore: () => ({copilotMode: mockCopilotMode,@@ -38,8 +47,8 @@ vi.mock("@/app/(platform)/copilot/store", () => ({setCopilotLlmModel: mockSetCopilotLlmModel,isDryRun: false,setIsDryRun: vi.fn(),- initialPrompt: null,- setInitialPrompt: vi.fn(),+ initialPrompt: mockInitialPrompt,+ setInitialPrompt: mockSetInitialPrompt,}),}));@@ -141,8 +150,18 @@ vi.mock("@/components/ui/input-group", () => ({}) => <div className={className}>{children}</div>,}));-vi.mock("../components/AttachmentMenu", () => ({- AttachmentMenu: () => <div data-testid="attachment-menu" />,+vi.mock("../components/ComposerPlusMenu", () => ({+ ComposerPlusMenu: ({+ onClearGuidedPrompt,+ }: {+ onClearGuidedPrompt?: () => void;+ }) => (+ <button+ type="button"+ data-testid="attachment-menu"+ onClick={() => onClearGuidedPrompt?.()}+ />+ ),}));vi.mock("../components/FileChips", () => ({FileChips: () => null,@@ -177,6 +196,7 @@ afterEach(() => {mockCopilotMode = "extended_thinking";mockCopilotLlmModel = "standard";mockFlagValue = false;+ mockInitialPrompt = null;});describe("ChatInput mode toggle", () => {@@ -454,6 +474,77 @@ describe("ChatInput model toggle", () => {});});+describe("ChatInput guided prompt prefill", () => {+ it("prefills the composer and focuses it when an initial prompt arrives after mount", async () => {+ const { rerender } = render(<ChatInput onSend={mockOnSend} />);+ const textarea = screen.getByTestId("textarea") as HTMLTextAreaElement;+ textarea.blur();+ expect(document.activeElement).not.toBe(textarea);++ mockInitialPrompt = "Teach me a new skill";+ rerender(<ChatInput onSend={mockOnSend} />);++ await waitFor(() => {+ expect(textarea.value).toBe("Teach me a new skill");+ });+ expect(document.activeElement).toBe(textarea);+ expect(mockSetInitialPrompt).toHaveBeenCalledWith(null);+ });++ it("replaces the current draft when a new guided prompt arrives", async () => {+ const { rerender } = render(<ChatInput onSend={mockOnSend} />);+ const textarea = screen.getByTestId("textarea") as HTMLTextAreaElement;++ mockInitialPrompt = NEW_SKILL_PROMPT;+ rerender(<ChatInput onSend={mockOnSend} />);+ await waitFor(() => {+ expect(textarea.value).toBe(NEW_SKILL_PROMPT);+ });++ mockInitialPrompt = NEW_SCHEDULED_TASK_PROMPT;+ rerender(<ChatInput onSend={mockOnSend} />);+ await waitFor(() => {+ expect(textarea.value).toBe(NEW_SCHEDULED_TASK_PROMPT);+ });+ });++ it("clears an untouched guided prompt when the menu discards it", async () => {+ const { rerender } = render(<ChatInput onSend={mockOnSend} />);+ const textarea = screen.getByTestId("textarea") as HTMLTextAreaElement;++ mockInitialPrompt = NEW_SKILL_PROMPT;+ rerender(<ChatInput onSend={mockOnSend} />);+ await waitFor(() => {+ expect(textarea.value).toBe(NEW_SKILL_PROMPT);+ });++ fireEvent.click(screen.getByTestId("attachment-menu"));++ await waitFor(() => {+ expect(textarea.value).toBe("");+ });+ });++ it("keeps a user-edited draft when the menu asks to discard", async () => {+ const { rerender } = render(<ChatInput onSend={mockOnSend} />);+ const textarea = screen.getByTestId("textarea") as HTMLTextAreaElement;++ mockInitialPrompt = NEW_SKILL_PROMPT;+ rerender(<ChatInput onSend={mockOnSend} />);+ await waitFor(() => {+ expect(textarea.value).toBe(NEW_SKILL_PROMPT);+ });++ fireEvent.change(textarea, {+ target: { value: `${NEW_SKILL_PROMPT} plus my edits` },+ });++ fireEvent.click(screen.getByTestId("attachment-menu"));++ expect(textarea.value).toBe(`${NEW_SKILL_PROMPT} plus my edits`);+ });+});+describe("ChatInput submit behavior", () => {it("does not call onSend when textarea is empty", () => {const onSend = vi.fn().mockResolvedValue(undefined);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AttachmentMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AttachmentMenu.tsxdeleted file mode 100644index 65fbc3d6ef..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AttachmentMenu.tsx+++ /dev/null@@ -1,101 +0,0 @@-"use client";--import { Button } from "@/components/atoms/Button/Button";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,-} from "@/components/molecules/DropdownMenu/DropdownMenu";-import { cn } from "@/lib/utils";-import {- FolderOpen as FolderOpenIcon,- Plus as PlusIcon,- UploadSimple as UploadSimpleIcon,-} from "@phosphor-icons/react";-import { useRef } from "react";--interface Props {- onFilesSelected: (files: File[]) => void;- onUseWorkspaceFile?: () => void;- showWorkspaceOption?: boolean;- disabled?: boolean;-}--export function AttachmentMenu({- onFilesSelected,- onUseWorkspaceFile,- showWorkspaceOption = false,- disabled,-}: Props) {- const fileInputRef = useRef<HTMLInputElement>(null);-- function openFilePicker() {- fileInputRef.current?.click();- }-- function handleFileChange(e: React.ChangeEvent<HTMLInputElement>) {- const files = Array.from(e.target.files ?? []);- if (files.length > 0) {- onFilesSelected(files);- }- // Reset so the same file can be re-selected- e.target.value = "";- }-- const buttonClassName = cn(- "border-zinc-300 bg-white text-zinc-500 hover:border-zinc-400 hover:bg-zinc-50 hover:text-zinc-700",- disabled && "opacity-40",- );-- return (- <>- <input- ref={fileInputRef}- type="file"- multiple- className="hidden"- onChange={handleFileChange}- tabIndex={-1}- />- {showWorkspaceOption ? (- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button- type="button"- variant="icon"- size="icon"- aria-label="Attach file"- disabled={disabled}- className={buttonClassName}- >- <PlusIcon className="h-4 w-4" weight="bold" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="min-w-[14rem]">- <DropdownMenuItem onSelect={openFilePicker}>- <UploadSimpleIcon className="mr-2 h-4 w-4" />- Upload from Computer- </DropdownMenuItem>- <DropdownMenuItem onSelect={() => onUseWorkspaceFile?.()}>- <FolderOpenIcon className="mr-2 h-4 w-4" />- Use File from Workspace- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- ) : (- <Button- type="button"- variant="icon"- size="icon"- aria-label="Attach file"- disabled={disabled}- onClick={openFilePicker}- className={buttonClassName}- >- <PlusIcon className="h-4 w-4" weight="bold" />- </Button>- )}- </>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsxnew file mode 100644index 0000000000..0468285dd3--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsx@@ -0,0 +1,111 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+} from "@/components/molecules/DropdownMenu/DropdownMenu";+import { cn } from "@/lib/utils";+import {+ BookOpenIcon,+ CalendarDotsIcon,+ FolderOpenIcon,+ PaperclipIcon,+ PlugsConnectedIcon,+ PlusIcon,+} from "@phosphor-icons/react";+import { useComposerPlusMenu } from "./useComposerPlusMenu";++interface Props {+ onFilesSelected: (files: File[]) => void;+ onUseWorkspaceFile?: () => void;+ onClearGuidedPrompt?: () => void;+ disabled?: boolean;+}++export function ComposerPlusMenu({+ onFilesSelected,+ onUseWorkspaceFile,+ onClearGuidedPrompt,+ disabled,+}: Props) {+ const {+ fileInputRef,+ openModal,+ showWorkspaceOption,+ openFilePicker,+ handleFileChange,+ } = useComposerPlusMenu({ onFilesSelected });++ return (+ <>+ <input+ ref={fileInputRef}+ type="file"+ multiple+ className="hidden"+ onChange={handleFileChange}+ tabIndex={-1}+ />+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ type="button"+ variant="icon"+ size="icon"+ aria-label="Add files and more"+ data-testid="composer-plus-button"+ disabled={disabled}+ className={cn(+ "border-zinc-300 bg-white text-zinc-500 hover:border-zinc-400 hover:bg-zinc-50 hover:text-zinc-700",+ disabled && "opacity-40",+ )}+ >+ <PlusIcon className="h-4 w-4" weight="bold" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="min-w-[14rem]">+ <DropdownMenuItem+ onSelect={() => {+ onClearGuidedPrompt?.();+ openFilePicker();+ }}+ >+ <PaperclipIcon className="mr-2 h-4 w-4" />+ Attach file+ </DropdownMenuItem>+ {showWorkspaceOption && (+ <DropdownMenuItem+ onSelect={() => {+ onClearGuidedPrompt?.();+ onUseWorkspaceFile?.();+ }}+ >+ <FolderOpenIcon className="mr-2 h-4 w-4" />+ Use File from Workspace+ </DropdownMenuItem>+ )}+ <DropdownMenuItem+ onSelect={() => {+ onClearGuidedPrompt?.();+ openModal("integrations");+ }}+ >+ <PlugsConnectedIcon className="mr-2 h-4 w-4" />+ Integrations+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={() => openModal("skills")}>+ <BookOpenIcon className="mr-2 h-4 w-4" />+ Skills+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={() => openModal("scheduled")}>+ <CalendarDotsIcon className="mr-2 h-4 w-4" />+ Scheduled+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/AttachmentMenu.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/AttachmentMenu.test.tsxdeleted file mode 100644index 7dd7eb9887..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/AttachmentMenu.test.tsx+++ /dev/null@@ -1,53 +0,0 @@-import { fireEvent, render, screen } from "@/tests/integrations/test-utils";-import { afterEach, describe, expect, it, vi } from "vitest";-import { AttachmentMenu } from "../AttachmentMenu";--afterEach(() => {- vi.clearAllMocks();-});--describe("AttachmentMenu", () => {- it("renders a plain attach button when the workspace option is hidden", () => {- render(- <AttachmentMenu onFilesSelected={vi.fn()} showWorkspaceOption={false} />,- );- expect(screen.getByRole("button", { name: /attach file/i })).toBeTruthy();- // No dropdown menu items are exposed in the plain variant.- expect(screen.queryByText(/use file from workspace/i)).toBeNull();- });-- it("exposes both upload sources when the workspace option is enabled", async () => {- render(- <AttachmentMenu onFilesSelected={vi.fn()} showWorkspaceOption={true} />,- );- fireEvent.pointerDown(- screen.getByRole("button", { name: /attach file/i }),- { button: 0 },- );- expect(- await screen.findByRole("menuitem", { name: /upload from computer/i }),- ).toBeTruthy();- expect(- screen.getByRole("menuitem", { name: /use file from workspace/i }),- ).toBeTruthy();- });-- it("invokes onUseWorkspaceFile when the workspace item is chosen", async () => {- const onUseWorkspaceFile = vi.fn();- render(- <AttachmentMenu- onFilesSelected={vi.fn()}- onUseWorkspaceFile={onUseWorkspaceFile}- showWorkspaceOption={true}- />,- );- fireEvent.pointerDown(- screen.getByRole("button", { name: /attach file/i }),- { button: 0 },- );- fireEvent.click(- await screen.findByRole("menuitem", { name: /use file from workspace/i }),- );- expect(onUseWorkspaceFile).toHaveBeenCalledTimes(1);- });-});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ComposerPlusMenu.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ComposerPlusMenu.test.tsxnew file mode 100644index 0000000000..b6e823bc65--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ComposerPlusMenu.test.tsx@@ -0,0 +1,143 @@+import { fireEvent, render, screen } from "@/tests/integrations/test-utils";+import { afterEach, describe, expect, it, vi } from "vitest";+import { useCopilotModal } from "../../../../useCopilotModal";+import { ComposerPlusMenu } from "../ComposerPlusMenu";++let mockWorkspaceFilesFlag = false;+vi.mock("@/services/feature-flags/use-get-flag", () => ({+ Flag: { CHAT_WORKSPACE_FILES: "chat-workspace-files" },+ useGetFlag: () => mockWorkspaceFilesFlag,+}));++afterEach(() => {+ vi.clearAllMocks();+ mockWorkspaceFilesFlag = false;+});++function ModalProbe() {+ const { modal } = useCopilotModal();+ return <div data-testid="modal-probe">{modal ?? "none"}</div>;+}++function openMenu() {+ fireEvent.pointerDown(screen.getByTestId("composer-plus-button"), {+ button: 0,+ });+}++describe("ComposerPlusMenu", () => {+ it("lists the four actions in fixed order", async () => {+ render(<ComposerPlusMenu onFilesSelected={vi.fn()} />);+ openMenu();++ const items = await screen.findAllByRole("menuitem");+ expect(items.map((item) => item.textContent)).toEqual([+ "Attach file",+ "Integrations",+ "Skills",+ "Scheduled",+ ]);+ });++ it("selecting Skills opens the skills modal via query state", async () => {+ render(+ <>+ <ComposerPlusMenu onFilesSelected={vi.fn()} />+ <ModalProbe />+ </>,+ );+ openMenu();++ fireEvent.click(await screen.findByRole("menuitem", { name: /skills/i }));++ expect(screen.getByTestId("modal-probe").textContent).toBe("skills");+ });++ it("selecting Scheduled and Integrations open their modals", async () => {+ render(+ <>+ <ComposerPlusMenu onFilesSelected={vi.fn()} />+ <ModalProbe />+ </>,+ );+ openMenu();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: /scheduled/i }),+ );+ expect(screen.getByTestId("modal-probe").textContent).toBe("scheduled");++ openMenu();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: /integrations/i }),+ );+ expect(screen.getByTestId("modal-probe").textContent).toBe("integrations");+ });++ it("adds a flat workspace option after Attach file when its flag is enabled", async () => {+ mockWorkspaceFilesFlag = true;+ const onUseWorkspaceFile = vi.fn();+ render(+ <ComposerPlusMenu+ onFilesSelected={vi.fn()}+ onUseWorkspaceFile={onUseWorkspaceFile}+ />,+ );+ openMenu();++ const items = await screen.findAllByRole("menuitem");+ expect(items.map((item) => item.textContent)).toEqual([+ "Attach file",+ "Use File from Workspace",+ "Integrations",+ "Skills",+ "Scheduled",+ ]);++ fireEvent.click(+ screen.getByRole("menuitem", { name: /use file from workspace/i }),+ );+ expect(onUseWorkspaceFile).toHaveBeenCalledTimes(1);+ });++ it("clears the guided prompt for Attach file and Integrations but not Skills or Scheduled", async () => {+ const onClearGuidedPrompt = vi.fn();+ render(+ <ComposerPlusMenu+ onFilesSelected={vi.fn()}+ onClearGuidedPrompt={onClearGuidedPrompt}+ />,+ );++ openMenu();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: /attach file/i }),+ );+ expect(onClearGuidedPrompt).toHaveBeenCalledTimes(1);++ openMenu();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: /integrations/i }),+ );+ expect(onClearGuidedPrompt).toHaveBeenCalledTimes(2);++ openMenu();+ fireEvent.click(await screen.findByRole("menuitem", { name: /skills/i }));+ expect(onClearGuidedPrompt).toHaveBeenCalledTimes(2);++ openMenu();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: /scheduled/i }),+ );+ expect(onClearGuidedPrompt).toHaveBeenCalledTimes(2);+ });++ it("hides the workspace option when its flag is disabled", async () => {+ render(<ComposerPlusMenu onFilesSelected={vi.fn()} />);+ openMenu();++ await screen.findByRole("menuitem", { name: /attach file/i });+ expect(+ screen.queryByRole("menuitem", { name: /use file from workspace/i }),+ ).toBeNull();+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/useComposerPlusMenu.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/useComposerPlusMenu.tsnew file mode 100644index 0000000000..e27f5d64e0--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/useComposerPlusMenu.ts@@ -0,0 +1,34 @@+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";+import { ChangeEvent, useRef } from "react";+import { useCopilotModal } from "../../../useCopilotModal";++interface Args {+ onFilesSelected: (files: File[]) => void;+}++export function useComposerPlusMenu({ onFilesSelected }: Args) {+ const fileInputRef = useRef<HTMLInputElement>(null);+ const { openModal } = useCopilotModal();+ const showWorkspaceOption = useGetFlag(Flag.CHAT_WORKSPACE_FILES);++ function openFilePicker() {+ fileInputRef.current?.click();+ }++ function handleFileChange(e: ChangeEvent<HTMLInputElement>) {+ const files = Array.from(e.target.files ?? []);+ if (files.length > 0) {+ onFilesSelected(files);+ }+ // Reset so the same file can be re-selected+ e.target.value = "";+ }++ return {+ fileInputRef,+ openModal,+ showWorkspaceOption,+ openFilePicker,+ handleFileChange,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useChatInput.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useChatInput.tsindex 5f9b8dcbdd..7d42e67dbb 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useChatInput.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useChatInput.ts@@ -25,10 +25,19 @@ export function useChatInput({useEffect(function consumeInitialPrompt() {if (!initialPrompt) return;- setValue((prev) => (prev.length === 0 ? initialPrompt : prev));+ // Guided flows always replace the draft — picking "New skill" after+ // "New scheduled task" must swap the prompt, not keep the stale one.+ setValue(initialPrompt);setInitialPrompt(null);+ // Guided flows can prefill while the composer is already mounted+ // (e.g. from a copilot modal) — put the caret in the input so the+ // draft is immediately editable/sendable.+ const textarea = document.getElementById(+ inputId,+ ) as HTMLTextAreaElement | null;+ textarea?.focus();},- [initialPrompt, setInitialPrompt],+ [initialPrompt, setInitialPrompt, inputId],);useEffect(diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/CopilotModals.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/CopilotModals.tsxnew file mode 100644index 0000000000..963d3e5977--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/CopilotModals.tsx@@ -0,0 +1,62 @@+"use client";++import { IntegrationsPanel } from "@/components/contextual/IntegrationsPanel/IntegrationsPanel";+import { SchedulesPanel } from "@/components/contextual/SchedulesPanel/SchedulesPanel";+import { SkillsPanel } from "@/components/contextual/SkillsPanel/SkillsPanel";+import { Dialog } from "@/components/molecules/Dialog/Dialog";+import { useCopilotUIStore } from "../../store";+import { useCopilotModal } from "../../useCopilotModal";++export function CopilotModals() {+ const { modal, closeModal } = useCopilotModal();+ const setInitialPrompt = useCopilotUIStore((s) => s.setInitialPrompt);++ function handleGuidedPrompt(prompt: string) {+ closeModal();+ setInitialPrompt(prompt);+ }++ function handleOpenChange(open: boolean) {+ if (!open) closeModal();+ }++ return (+ <>+ <Dialog+ controlled={{ isOpen: modal === "skills", set: handleOpenChange }}+ styling={{ maxWidth: "44rem" }}+ title="AutoPilot skills"+ >+ <Dialog.Content>+ <SkillsPanel+ withHeading={false}+ onGuidedPrompt={handleGuidedPrompt}+ />+ </Dialog.Content>+ </Dialog>++ <Dialog+ controlled={{ isOpen: modal === "scheduled", set: handleOpenChange }}+ styling={{ maxWidth: "44rem" }}+ title="Scheduled"+ >+ <Dialog.Content>+ <SchedulesPanel+ withHeading={false}+ onGuidedPrompt={handleGuidedPrompt}+ />+ </Dialog.Content>+ </Dialog>++ <Dialog+ controlled={{ isOpen: modal === "integrations", set: handleOpenChange }}+ styling={{ maxWidth: "56rem" }}+ title="Third Party Integrations"+ >+ <Dialog.Content>+ <IntegrationsPanel withHeading={false} />+ </Dialog.Content>+ </Dialog>+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/__tests__/CopilotModals.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/__tests__/CopilotModals.test.tsxnew file mode 100644index 0000000000..4e713e77fe--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotModals/__tests__/CopilotModals.test.tsx@@ -0,0 +1,99 @@+import { getGetV1ListCredentialsMockHandler } from "@/app/api/__generated__/endpoints/integrations/integrations.msw";+import {+ getGetV1ListExecutionSchedulesForAUserMockHandler,+ getListCopilotFollowupSchedulesMockHandler,+} from "@/app/api/__generated__/endpoints/schedules/schedules.msw";+import { getListCopilotSkillsMockHandler } from "@/app/api/__generated__/endpoints/skills/skills.msw";+import { server } from "@/mocks/mock-server";+import { fireEvent, render, screen } from "@/tests/integrations/test-utils";+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";+import { useCopilotUIStore } from "../../../store";+import { useCopilotModal } from "../../../useCopilotModal";+import { CopilotModals } from "../CopilotModals";++function Harness() {+ const { openModal } = useCopilotModal();+ return (+ <>+ <button onClick={() => openModal("skills")}>open-skills</button>+ <button onClick={() => openModal("scheduled")}>open-scheduled</button>+ <button onClick={() => openModal("integrations")}>+ open-integrations+ </button>+ <CopilotModals />+ </>+ );+}++describe("CopilotModals", () => {+ beforeEach(() => {+ useCopilotUIStore.setState({ initialPrompt: null });+ server.use(+ getListCopilotSkillsMockHandler([]),+ getListCopilotFollowupSchedulesMockHandler([]),+ getGetV1ListExecutionSchedulesForAUserMockHandler([]),+ getGetV1ListCredentialsMockHandler([]),+ );+ });++ afterEach(() => {+ server.resetHandlers();+ });++ test("no modal renders by default", () => {+ render(<Harness />);+ expect(screen.queryByText("AutoPilot skills")).toBeNull();+ expect(screen.queryByText("Scheduled")).toBeNull();+ expect(screen.queryByText("Third Party Integrations")).toBeNull();+ });++ test("opens the skills modal with header actions and empty state", async () => {+ render(<Harness />);+ fireEvent.click(screen.getByText("open-skills"));++ expect(await screen.findByText("AutoPilot skills")).toBeDefined();+ expect(await screen.findByTestId("skills-empty")).toBeDefined();+ expect(screen.getByTestId("skill-new-button")).toBeDefined();+ expect(screen.getByTestId("skill-upload-button")).toBeDefined();+ });++ test("New skill closes the modal and prefills the composer store", async () => {+ render(<Harness />);+ fireEvent.click(screen.getByText("open-skills"));++ fireEvent.click(await screen.findByTestId("skill-new-button"));++ await vi.waitFor(() => {+ expect(useCopilotUIStore.getState().initialPrompt).toContain(+ "I want to teach you a new skill",+ );+ });+ await vi.waitFor(() => {+ expect(screen.queryByText("AutoPilot skills")).toBeNull();+ });+ });++ test("opens the scheduled modal and New scheduled task prefills the store", async () => {+ render(<Harness />);+ fireEvent.click(screen.getByText("open-scheduled"));++ expect(await screen.findByTestId("followups-empty")).toBeDefined();+ fireEvent.click(screen.getByTestId("schedule-new-button"));++ await vi.waitFor(() => {+ expect(useCopilotUIStore.getState().initialPrompt).toContain(+ "I want to create a new scheduled task",+ );+ });+ });++ test("opens the integrations modal with the Connect Service action", async () => {+ render(<Harness />);+ fireEvent.click(screen.getByText("open-integrations"));++ expect(await screen.findByText("Third Party Integrations")).toBeDefined();+ expect(+ (await screen.findAllByText("Connect Service")).length,+ ).toBeGreaterThan(0);+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotModal.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotModal.tsnew file mode 100644index 0000000000..a4a89877a9--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotModal.ts@@ -0,0 +1,21 @@+import { parseAsStringLiteral, useQueryState } from "nuqs";++export const COPILOT_MODALS = ["integrations", "skills", "scheduled"] as const;+export type CopilotModalType = (typeof COPILOT_MODALS)[number];++export function useCopilotModal() {+ const [modal, setModal] = useQueryState(+ "modal",+ parseAsStringLiteral(COPILOT_MODALS),+ );++ function openModal(next: CopilotModalType) {+ void setModal(next);+ }++ function closeModal() {+ void setModal(null);+ }++ return { modal, openModal, closeModal };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsxindex 7679a322d2..8455cb910c 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx@@ -7,6 +7,7 @@ import {import type { CopilotTurnJobInfo } from "@/app/api/__generated__/models/copilotTurnJobInfo";import type { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { server } from "@/mocks/mock-server";+import { http, HttpResponse } from "msw";import {fireEvent,render,@@ -16,6 +17,21 @@ import {import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import FollowupsPage from "../page";+const pushMock = vi.fn();+vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: pushMock,+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: () => "/library/followups",+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));+const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -77,6 +93,7 @@ function defaultGraphSchedulesHandler() {describe("FollowupsPage", () => {beforeEach(() => {toastMock.mockClear();+ pushMock.mockClear();});afterEach(() => {@@ -365,6 +382,55 @@ describe("FollowupsPage", () => {});});+ test("header shows New scheduled task button in empty state and starts the guided flow", async () => {+ server.use(+ getListCopilotFollowupSchedulesMockHandler([]),+ defaultGraphSchedulesHandler(),+ );++ render(<FollowupsPage />);+ await screen.findByTestId("followups-empty");++ fireEvent.click(screen.getByTestId("schedule-new-button"));++ await vi.waitFor(() => {+ expect(pushMock).toHaveBeenCalledWith(+ expect.stringContaining("/copilot#prompt="),+ );+ });+ const url = pushMock.mock.calls[0][0] as string;+ expect(decodeURIComponent(url.split("#prompt=")[1])).toContain(+ "I want to create a new scheduled task",+ );+ });++ test("empty state shows the spec copy", async () => {+ server.use(+ getListCopilotFollowupSchedulesMockHandler([]),+ defaultGraphSchedulesHandler(),+ );++ render(<FollowupsPage />);++ const empty = await screen.findByTestId("followups-empty");+ expect(empty.textContent).toContain("Nothing scheduled yet");+ expect(empty.textContent).toContain("schedule an agent from the builder");+ });++ test("copilot follow-up rows show a New chat badge when they fire into a new chat", async () => {+ server.use(+ getListCopilotFollowupSchedulesMockHandler([+ makeFollowup({ id: "f1", session_id: null as unknown as string }),+ ]),+ defaultGraphSchedulesHandler(),+ );++ render(<FollowupsPage />);++ const badge = await screen.findByTestId("followup-kind-badge");+ expect(badge.textContent).toBe("New chat");+ });+test("unified page sorts items by next_run_time ascending", async () => {const soon = new Date(Date.now() + 5 * 60 * 1000).toISOString(); // 5 minconst later = new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString(); // 2 h@@ -394,4 +460,38 @@ describe("FollowupsPage", () => {expect(within(items[0]).getByText("Sooner agent")).toBeDefined();expect(within(items[1]).getByText("Later followup")).toBeDefined();});++ test("one failed source keeps the other's schedules visible with a partial-error warning", async () => {+ server.use(+ getListCopilotFollowupSchedulesMockHandler([+ makeFollowup({ id: "f1", message: "Still visible followup" }),+ ]),+ http.get("http://localhost:3000/api/proxy/api/schedules", () =>+ HttpResponse.error(),+ ),+ );++ render(<FollowupsPage />);++ const list = await screen.findByTestId("followups-list");+ expect(within(list).getByText("Still visible followup")).toBeDefined();+ expect(await screen.findByTestId("schedules-partial-error")).toBeDefined();+ });++ test("shows the full error state only when both sources fail", async () => {+ server.use(+ http.get("http://localhost:3000/api/proxy/api/schedules/followups", () =>+ HttpResponse.error(),+ ),+ http.get("http://localhost:3000/api/proxy/api/schedules", () =>+ HttpResponse.error(),+ ),+ );++ render(<FollowupsPage />);++ expect(await screen.findByText(/scheduled items/i)).toBeDefined();+ expect(screen.queryByTestId("followups-list")).toBeNull();+ expect(screen.queryByTestId("schedules-partial-error")).toBeNull();+ });});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx b/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsxindex ef3940f0d5..7584449912 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx@@ -2,22 +2,21 @@import { useEffect } from "react";import Link from "next/link";+import { useRouter } from "next/navigation";import { ArrowLeftIcon } from "@phosphor-icons/react";-import { Text } from "@/components/atoms/Text/Text";-import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";-import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";-import { EmptyFollowups } from "./components/EmptyFollowups/EmptyFollowups";-import { FollowupListItem } from "./components/FollowupListItem/FollowupListItem";-import { GraphScheduleListItem } from "./components/GraphScheduleListItem/GraphScheduleListItem";-import { useFollowupsPage } from "./useFollowupsPage";+import { SchedulesPanel } from "@/components/contextual/SchedulesPanel/SchedulesPanel";export default function FollowupsPage() {- const { schedules, isLoading, error } = useFollowupsPage();+ const router = useRouter();useEffect(() => {document.title = "Scheduled – AutoGPT Platform";}, []);+ function handleGuidedPrompt(prompt: string) {+ router.push(`/copilot#prompt=${encodeURIComponent(prompt)}`);+ }+return (<main className="container min-h-screen space-y-6 pb-20 pt-16 sm:px-8 md:px-12"><Link@@ -28,51 +27,7 @@ export default function FollowupsPage() {<ArrowLeftIcon size={14} weight="bold" />Back to Library</Link>- <header className="flex flex-col gap-2">- <Text variant="h2">Scheduled</Text>- <Text variant="body" className="!text-zinc-500">- Every automated job in one place — follow-up messages your copilot- will send itself AND recurring agent runs from the builder. Open a row- to jump into the session / agent, or cancel one you no longer need.- </Text>- </header>-- {error ? (- <ErrorCard- responseError={{- message:- error instanceof Error- ? error.message- : "Failed to load schedules",- }}- context="scheduled items"- />- ) : isLoading ? (- <div- className="flex items-center justify-center py-16"- data-testid="followups-loading"- >- <LoadingSpinner />- </div>- ) : schedules.length === 0 ? (- <EmptyFollowups />- ) : (- <ul- className="flex flex-col gap-3"- data-testid="followups-list"- aria-label="Scheduled items"- >- {schedules.map((schedule) => (- <li key={`${schedule.kind}:${schedule.item.id}`}>- {schedule.kind === "copilot_turn" ? (- <FollowupListItem followup={schedule.item} />- ) : (- <GraphScheduleListItem schedule={schedule.item} />- )}- </li>- ))}- </ul>- )}+ <SchedulesPanel onGuidedPrompt={handleGuidedPrompt} /></main>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsxindex 1a1eae30f0..752f927c46 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx@@ -19,6 +19,21 @@ import {import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import SkillsPage from "../page";+const pushMock = vi.fn();+vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: pushMock,+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: () => "/library/skills",+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));+const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -43,6 +58,7 @@ function makeSkill(overrides: Partial<CopilotSkillInfo>): CopilotSkillInfo {describe("SkillsPage", () => {beforeEach(() => {toastMock.mockClear();+ pushMock.mockClear();});afterEach(() => {@@ -332,6 +348,70 @@ describe("SkillsPage", () => {});});+ test("header shows New skill button in empty state and it starts the guided flow", async () => {+ server.use(getListCopilotSkillsMockHandler([]));++ render(<SkillsPage />);+ await screen.findByTestId("skills-empty");++ fireEvent.click(screen.getByTestId("skill-new-button"));++ await vi.waitFor(() => {+ expect(pushMock).toHaveBeenCalledWith(+ expect.stringContaining("/copilot#prompt="),+ );+ });+ const url = pushMock.mock.calls[0][0] as string;+ expect(decodeURIComponent(url.split("#prompt=")[1])).toContain(+ "I want to teach you a new skill",+ );+ });++ test("empty state shows the spec copy", async () => {+ server.use(getListCopilotSkillsMockHandler([]));++ render(<SkillsPage />);++ const empty = await screen.findByTestId("skills-empty");+ expect(empty.textContent).toContain("No skills yet");+ expect(empty.textContent).toContain(+ "then it'll reach for it automatically",+ );+ });++ test("uploaded skill shows a New badge", async () => {+ server.use(+ getListCopilotSkillsMockHandler([+ makeSkill({+ name: "uploaded_skill",+ description: "An uploaded recipe.",+ triggers: [],+ }),+ ]),+ getUploadCopilotSkillMockHandler201({+ name: "uploaded_skill",+ description: "An uploaded recipe.",+ triggers: [],+ }),+ );++ render(<SkillsPage />);+ await screen.findAllByTestId("skill-row");+ expect(screen.queryByTestId("skill-new-badge")).toBeNull();++ const input = screen.getByTestId("skill-upload-input");+ const file = new File(+ [+ "---\nname: uploaded_skill\ndescription: An uploaded recipe.\n---\n\n# Body\n",+ ],+ "uploaded_skill.md",+ { type: "text/markdown" },+ );+ fireEvent.change(input, { target: { files: [file] } });++ expect(await screen.findByTestId("skill-new-badge")).toBeDefined();+ });+test("shows a destructive toast when the delete API fails", async () => {server.use(getListCopilotSkillsMockHandler([makeSkill({ name: "oauth_flow" })]),diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/UploadSkillButton.tsx b/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/UploadSkillButton.tsxdeleted file mode 100644index 225f1b350e..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/UploadSkillButton.tsx+++ /dev/null@@ -1,33 +0,0 @@-"use client";--import { Button } from "@/components/atoms/Button/Button";-import { UploadSimpleIcon } from "@phosphor-icons/react";-import { useUploadSkillButton } from "./useUploadSkillButton";--export function UploadSkillButton() {- const { fileInputRef, isUploading, openFilePicker, handleFileChange } =- useUploadSkillButton();-- return (- <>- <input- ref={fileInputRef}- type="file"- accept=".md,.markdown,text/markdown"- className="hidden"- onChange={handleFileChange}- data-testid="skill-upload-input"- />- <Button- variant="primary"- size="small"- onClick={openFilePicker}- loading={isUploading}- data-testid="skill-upload-button"- >- <UploadSimpleIcon className="mr-1 h-4 w-4" />- Upload skill- </Button>- </>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx b/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsxindex 7fe6ba0b26..2adff48cf8 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx@@ -2,22 +2,21 @@import { useEffect } from "react";import Link from "next/link";+import { useRouter } from "next/navigation";import { ArrowLeftIcon } from "@phosphor-icons/react";-import { Text } from "@/components/atoms/Text/Text";-import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";-import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";-import { EmptySkills } from "./components/EmptySkills/EmptySkills";-import { SkillListItem } from "./components/SkillListItem/SkillListItem";-import { UploadSkillButton } from "./components/UploadSkillButton/UploadSkillButton";-import { useSkillsPage } from "./useSkillsPage";+import { SkillsPanel } from "@/components/contextual/SkillsPanel/SkillsPanel";export default function SkillsPage() {- const { skills, isLoading, error } = useSkillsPage();+ const router = useRouter();useEffect(() => {document.title = "AutoPilot skills – AutoGPT Platform";}, []);+ function handleGuidedPrompt(prompt: string) {+ router.push(`/copilot#prompt=${encodeURIComponent(prompt)}`);+ }+return (<main className="container min-h-screen space-y-6 pb-20 pt-16 sm:px-8 md:px-12"><Link@@ -28,50 +27,7 @@ export default function SkillsPage() {<ArrowLeftIcon size={14} weight="bold" />Back to Library</Link>- <header className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">- <div className="flex flex-col gap-2">- <Text variant="h2">AutoPilot skills</Text>- <Text variant="body" className="!text-zinc-500">- Reusable procedures your AutoPilot has distilled from past sessions.- Review what it remembers, upload your own, download one to share, or- delete a skill you no longer want it to reach for.- </Text>- </div>- <div className="flex-shrink-0">- <UploadSkillButton />- </div>- </header>-- {error ? (- <ErrorCard- responseError={{- message:- error instanceof Error ? error.message : "Failed to load skills",- }}- context="AutoPilot skills"- />- ) : isLoading ? (- <div- className="flex items-center justify-center py-16"- data-testid="skills-loading"- >- <LoadingSpinner />- </div>- ) : skills.length === 0 ? (- <EmptySkills />- ) : (- <ul- className="flex flex-col gap-3"- data-testid="skills-list"- aria-label="AutoPilot skills"- >- {skills.map((skill) => (- <li key={skill.name}>- <SkillListItem skill={skill} />- </li>- ))}- </ul>- )}+ <SkillsPanel onGuidedPrompt={handleGuidedPrompt} /></main>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/page.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/integrations/page.tsxindex a2f5be7b16..c7570796ba 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/integrations/page.tsx@@ -1,22 +1,7 @@"use client";-import { useState } from "react";--import { ConnectServiceDialog } from "./components/ConnectServiceDialog/ConnectServiceDialog";-import { IntegrationsHeader } from "./components/IntegrationsHeader/IntegrationsHeader";-import { IntegrationsList } from "./components/IntegrationsList/IntegrationsList";+import { IntegrationsPanel } from "@/components/contextual/IntegrationsPanel/IntegrationsPanel";export default function SettingsIntegrationsPage() {- const [isConnectOpen, setIsConnectOpen] = useState(false);-- return (- <>- <IntegrationsHeader onConnect={() => setIsConnectOpen(true)} />- <IntegrationsList />- <ConnectServiceDialog- open={isConnectOpen}- onOpenChange={setIsConnectOpen}- />- </>- );+ return <IntegrationsPanel />;}diff --git a/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/IntegrationsPanel.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/IntegrationsPanel.tsxnew file mode 100644index 0000000000..d7a720efcf--- /dev/null+++ b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/IntegrationsPanel.tsx@@ -0,0 +1,28 @@+"use client";++import { useState } from "react";+import { ConnectServiceDialog } from "./components/ConnectServiceDialog/ConnectServiceDialog";+import { IntegrationsHeader } from "./components/IntegrationsHeader/IntegrationsHeader";+import { IntegrationsList } from "./components/IntegrationsList/IntegrationsList";++interface Props {+ withHeading?: boolean;+}++export function IntegrationsPanel({ withHeading = true }: Props) {+ const [isConnectOpen, setIsConnectOpen] = useState(false);++ return (+ <>+ <IntegrationsHeader+ onConnect={() => setIsConnectOpen(true)}+ withTitle={withHeading}+ />+ <IntegrationsList />+ <ConnectServiceDialog+ open={isConnectOpen}+ onOpenChange={setIsConnectOpen}+ />+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/__tests__/helpers.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/__tests__/helpers.test.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/__tests__/helpers.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/ConnectServiceDialog.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/ConnectServiceDialog.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/ConnectServiceDialog.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/ConnectServiceDialog.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/__tests__/helpers.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/__tests__/helpers.test.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/__tests__/helpers.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/ApiKeyConnectForm.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/ApiKeyConnectForm.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/ApiKeyConnectForm.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/ApiKeyConnectForm.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/DetailView.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/DetailView.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/DetailView.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/DetailView.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/McpConnectPanel.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/McpConnectPanel.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/McpConnectPanel.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/McpConnectPanel.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/MethodPanel.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/MethodPanel.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/MethodPanel.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/MethodPanel.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/OAuthConnectButton.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/OAuthConnectButton.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/OAuthConnectButton.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/OAuthConnectButton.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/ProviderAvatar.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/ProviderAvatar.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/ProviderAvatar.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/ProviderAvatar.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/UnsupportedNotice.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/UnsupportedNotice.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/UnsupportedNotice.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/UnsupportedNotice.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/McpConnectPanel.test.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/McpConnectPanel.test.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/McpConnectPanel.test.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/McpConnectPanel.test.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/helpers.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/helpers.test.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/helpers.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/useOAuthConnect.test.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/useOAuthConnect.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/__tests__/useOAuthConnect.test.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/__tests__/useOAuthConnect.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/helpers.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/helpers.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/schema.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/schema.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/schema.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/schema.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/useApiKeyConnectForm.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/useApiKeyConnectForm.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/useApiKeyConnectForm.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/useApiKeyConnectForm.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/useOAuthConnect.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/useOAuthConnect.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/DetailView/useOAuthConnect.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/DetailView/useOAuthConnect.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/ListView.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/ListView.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/ListView.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/ListView.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/ProviderRow.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/ProviderRow.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/components/ProviderRow.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/components/ProviderRow.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/helpers.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/helpers.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/useConnectServiceDialog.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useConnectServiceDialog.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/useConnectServiceDialog.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useConnectServiceDialog.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/useMeasuredHeight.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useMeasuredHeight.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ConnectServiceDialog/useMeasuredHeight.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useMeasuredHeight.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/CredentialRow/CredentialRow.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/CredentialRow/CredentialRow.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/CredentialRow/CredentialRow.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/CredentialRow/CredentialRow.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/DeleteConfirmDialog/DeleteConfirmDialog.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/DeleteConfirmDialog/DeleteConfirmDialog.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/DeleteConfirmDialog/DeleteConfirmDialog.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/DeleteConfirmDialog/DeleteConfirmDialog.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/DeleteConfirmDialog/__tests__/DeleteConfirmDialog.test.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/DeleteConfirmDialog/__tests__/DeleteConfirmDialog.test.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/DeleteConfirmDialog/__tests__/DeleteConfirmDialog.test.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/DeleteConfirmDialog/__tests__/DeleteConfirmDialog.test.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsHeader/IntegrationsHeader.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsHeader/IntegrationsHeader.tsxsimilarity index 81%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsHeader/IntegrationsHeader.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsHeader/IntegrationsHeader.tsxindex a0f291a1a7..dfbac932b6 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsHeader/IntegrationsHeader.tsx+++ b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsHeader/IntegrationsHeader.tsx@@ -6,15 +6,18 @@ import { Text } from "@/components/atoms/Text/Text";interface Props {onConnect: () => void;+ withTitle?: boolean;}-export function IntegrationsHeader({ onConnect }: Props) {+export function IntegrationsHeader({ onConnect, withTitle = true }: Props) {return (<div className="flex flex-col items-start gap-4 pb-6 pl-4 sm:flex-row sm:items-start sm:justify-between"><div className="flex min-w-0 flex-col">- <Text variant="h4" as="h1" className="leading-[28px] text-[#1F1F20]">- Third Party Integrations- </Text>+ {withTitle && (+ <Text variant="h4" as="h1" className="leading-[28px] text-[#1F1F20]">+ Third Party Integrations+ </Text>+ )}<Text variant="body" className="mt-4 max-w-[600px] text-[#505057]">Manage the 3rd party accounts you've connected to AutoGPT. Theseare services that can be used by your agents — like Gmail for sendingdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsHeader/__tests__/IntegrationsHeader.test.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsHeader/__tests__/IntegrationsHeader.test.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsHeader/__tests__/IntegrationsHeader.test.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsHeader/__tests__/IntegrationsHeader.test.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/IntegrationsList.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/IntegrationsList.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/IntegrationsList.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/IntegrationsList.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/IntegrationsListSkeleton.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/IntegrationsListSkeleton.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/IntegrationsListSkeleton.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/IntegrationsListSkeleton.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/__tests__/IntegrationsListSkeleton.test.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/__tests__/IntegrationsListSkeleton.test.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/__tests__/IntegrationsListSkeleton.test.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/__tests__/IntegrationsListSkeleton.test.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/__tests__/useIntegrationsSelection.test.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/__tests__/useIntegrationsSelection.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/__tests__/useIntegrationsSelection.test.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/__tests__/useIntegrationsSelection.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/useIntegrationsList.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/useIntegrationsList.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/useIntegrationsList.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/useIntegrationsList.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/useIntegrationsSelection.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/useIntegrationsSelection.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsList/useIntegrationsSelection.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsList/useIntegrationsSelection.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsListEmpty/IntegrationsListEmpty.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsListEmpty/IntegrationsListEmpty.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsListEmpty/IntegrationsListEmpty.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsListEmpty/IntegrationsListEmpty.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsListEmpty/__tests__/IntegrationsListEmpty.test.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsListEmpty/__tests__/IntegrationsListEmpty.test.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsListEmpty/__tests__/IntegrationsListEmpty.test.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsListEmpty/__tests__/IntegrationsListEmpty.test.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsSearch/IntegrationsSearch.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsSearch/IntegrationsSearch.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsSearch/IntegrationsSearch.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsSearch/IntegrationsSearch.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsSelectionBar/IntegrationsSelectionBar.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsSelectionBar/IntegrationsSelectionBar.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/IntegrationsSelectionBar/IntegrationsSelectionBar.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/IntegrationsSelectionBar/IntegrationsSelectionBar.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ProviderGroup/ProviderGroup.tsx b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ProviderGroup/ProviderGroup.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/ProviderGroup/ProviderGroup.tsxrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/ProviderGroup/ProviderGroup.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/hooks/useDeleteIntegration.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/hooks/useDeleteIntegration.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/components/hooks/useDeleteIntegration.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/components/hooks/useDeleteIntegration.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/settings/integrations/helpers.ts b/autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/settings/integrations/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/IntegrationsPanel/helpers.tsdiff --git a/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/SchedulesPanel.tsx b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/SchedulesPanel.tsxnew file mode 100644index 0000000000..0a475d83f9--- /dev/null+++ b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/SchedulesPanel.tsx@@ -0,0 +1,96 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";+import { Text } from "@/components/atoms/Text/Text";+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";+import { PlusIcon } from "@phosphor-icons/react";+import { NEW_SCHEDULED_TASK_PROMPT } from "../guidedPrompts";+import { EmptyFollowups } from "./components/EmptyFollowups/EmptyFollowups";+import { FollowupListItem } from "./components/FollowupListItem/FollowupListItem";+import { GraphScheduleListItem } from "./components/GraphScheduleListItem/GraphScheduleListItem";+import { useSchedulesPanel } from "./useSchedulesPanel";++interface Props {+ onGuidedPrompt: (prompt: string) => void;+ withHeading?: boolean;+}++export function SchedulesPanel({ onGuidedPrompt, withHeading = true }: Props) {+ const { schedules, isLoading, error, partialError } = useSchedulesPanel();++ return (+ <section className="space-y-6">+ <header className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">+ <div className="flex min-w-0 flex-col gap-2">+ {withHeading && <Text variant="h2">Scheduled</Text>}+ <Text variant="body" className="!text-zinc-500">+ Every automated job in one place — follow-up messages your AutoPilot+ will send itself AND recurring agent runs from the builder. Open a+ row to jump into the session / agent, or cancel one you no longer+ need.+ </Text>+ </div>+ <div className="flex flex-shrink-0 items-center gap-2">+ <Button+ variant="primary"+ size="small"+ onClick={() => onGuidedPrompt(NEW_SCHEDULED_TASK_PROMPT)}+ data-testid="schedule-new-button"+ >+ <PlusIcon className="mr-1 h-4 w-4" />+ New scheduled task+ </Button>+ </div>+ </header>++ {partialError && (+ <Text+ variant="body"+ className="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 !text-amber-700"+ data-testid="schedules-partial-error"+ >+ Some scheduled items couldn't be loaded — showing the ones that+ did. Refresh to try again.+ </Text>+ )}++ {error ? (+ <ErrorCard+ responseError={{+ message:+ error instanceof Error+ ? error.message+ : "Failed to load schedules",+ }}+ context="scheduled items"+ />+ ) : isLoading ? (+ <div+ className="flex items-center justify-center py-16"+ data-testid="followups-loading"+ >+ <LoadingSpinner />+ </div>+ ) : schedules.length === 0 ? (+ <EmptyFollowups />+ ) : (+ <ul+ className="flex flex-col gap-3"+ data-testid="followups-list"+ aria-label="Scheduled items"+ >+ {schedules.map((schedule) => (+ <li key={`${schedule.kind}:${schedule.item.id}`}>+ {schedule.kind === "copilot_turn" ? (+ <FollowupListItem followup={schedule.item} />+ ) : (+ <GraphScheduleListItem schedule={schedule.item} />+ )}+ </li>+ ))}+ </ul>+ )}+ </section>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/EmptyFollowups/EmptyFollowups.tsx b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/EmptyFollowups/EmptyFollowups.tsxsimilarity index 61%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/EmptyFollowups/EmptyFollowups.tsxrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/EmptyFollowups/EmptyFollowups.tsxindex f8a75d2099..40380eed50 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/EmptyFollowups/EmptyFollowups.tsx+++ b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/EmptyFollowups/EmptyFollowups.tsx@@ -1,5 +1,5 @@import { Text } from "@/components/atoms/Text/Text";-import { ClockClockwiseIcon } from "@phosphor-icons/react";+import { CalendarDotsIcon } from "@phosphor-icons/react";export function EmptyFollowups() {return (@@ -8,15 +8,15 @@ export function EmptyFollowups() {data-testid="followups-empty"><div className="flex h-12 w-12 items-center justify-center rounded-full bg-yellow-50">- <ClockClockwiseIcon size={24} className="text-yellow-700" />+ <CalendarDotsIcon size={24} className="text-yellow-700" /></div><Text variant="h4" className="text-zinc-900">- Nothing scheduled+ Nothing scheduled yet</Text><Text variant="body" className="max-w-md !text-zinc-500">- Ask your copilot to schedule a follow-up, or add a recurring schedule to- an agent from the builder — both will show up here so you can review or- cancel them.+ Recurring agent runs and your AutoPilot's follow-up messages show+ up here. Hit <strong>New scheduled task</strong> to set one up, or+ schedule an agent from the builder.</Text></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/FollowupListItem.tsx b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/FollowupListItem.tsxsimilarity index 92%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/FollowupListItem.tsxrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/FollowupListItem.tsxindex 89277eb1cf..d6e2b8fb7f 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/FollowupListItem.tsx+++ b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/FollowupListItem.tsx@@ -30,9 +30,15 @@ export function FollowupListItem({ followup }: Props) {fullMessage,} = useFollowupListItem({ followup });- const sessionLabel = followup.session_id- ? `Session ${followup.session_id.slice(0, 8)}`- : "New chat";+ const kindBadgeLabel = followup.session_id ? "Same chat" : "New chat";+ const kindBadge = (+ <span+ className="rounded-full bg-zinc-100 px-2 py-0.5 text-xs text-zinc-600"+ data-testid="followup-kind-badge"+ >+ {kindBadgeLabel}+ </span>+ );const detailContent = (<>@@ -59,9 +65,7 @@ export function FollowupListItem({ followup }: Props) {{recurrenceLabel}</Text><span className="text-zinc-300">•</span>- <Text variant="small" className="!text-zinc-400">- {sessionLabel}- </Text>+ {kindBadge}</div></div></>@@ -129,9 +133,7 @@ export function FollowupListItem({ followup }: Props) {{recurrenceLabel}</Text><span className="text-zinc-300">•</span>- <Text variant="small" className="!text-zinc-400">- {sessionLabel}- </Text>+ {kindBadge}</div><preclassName="max-h-[60vh] overflow-auto rounded-medium bg-zinc-50 p-3 text-sm text-zinc-800"@@ -152,7 +154,7 @@ export function FollowupListItem({ followup }: Props) {<Dialog.Content><div className="flex flex-col gap-4"><Text variant="large">- Delete this scheduled follow-up? The copilot will not send the+ Delete this scheduled follow-up? AutoPilot will not send themessage and you can recreate it from chat if needed.</Text><Dialog.Footer>diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/helpers.test.ts b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/helpers.test.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/helpers.test.tsrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/helpers.test.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/helpers.ts b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/helpers.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/useFollowupListItem.ts b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/useFollowupListItem.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/FollowupListItem/useFollowupListItem.tsrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/FollowupListItem/useFollowupListItem.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/GraphScheduleListItem/GraphScheduleListItem.tsx b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/GraphScheduleListItem/GraphScheduleListItem.tsxsimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/GraphScheduleListItem/GraphScheduleListItem.tsxrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/GraphScheduleListItem/GraphScheduleListItem.tsxdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/components/GraphScheduleListItem/useGraphScheduleListItem.ts b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/GraphScheduleListItem/useGraphScheduleListItem.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/components/GraphScheduleListItem/useGraphScheduleListItem.tsrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/components/GraphScheduleListItem/useGraphScheduleListItem.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/useFollowupsPage.ts b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/useSchedulesPanel.tssimilarity index 80%rename from autogpt_platform/frontend/src/app/(platform)/library/followups/useFollowupsPage.tsrename to autogpt_platform/frontend/src/components/contextual/SchedulesPanel/useSchedulesPanel.tsindex 1e5fe777b3..fa3e0a2ffe 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/useFollowupsPage.ts+++ b/autogpt_platform/frontend/src/components/contextual/SchedulesPanel/useSchedulesPanel.ts@@ -16,7 +16,7 @@ function nextRunMs(item: { next_run_time?: string | null }): number {return Number.isNaN(t) ? Number.POSITIVE_INFINITY : t;}-export function useFollowupsPage() {+export function useSchedulesPanel() {// Followups (copilot_turn) — the scheduled-message side of the// feature. Stored via ``schedule_followup`` MCP tool.const copilotQuery = useListCopilotFollowupSchedules({@@ -46,13 +46,20 @@ export function useFollowupsPage() {(a, b) => nextRunMs(a.item) - nextRunMs(b.item),);+ const isLoading = copilotQuery.isLoading || graphQuery.isLoading;+ const fetchError = copilotQuery.error ?? graphQuery.error;+return {// Backwards-compat alias — ``followups`` was the only-copilot// collection name before unification. Existing tests still// reference it.followups: copilotQuery.data ?? [],schedules,- isLoading: copilotQuery.isLoading || graphQuery.isLoading,- error: copilotQuery.error ?? graphQuery.error,+ isLoading,+ // The two sources are independent — only hard-fail once both have+ // settled and there is nothing to show; a partial failure keeps the+ // loaded list visible and surfaces a non-blocking warning instead.+ error: !isLoading && schedules.length === 0 ? fetchError : null,+ partialError: !isLoading && schedules.length > 0 ? fetchError : null,};}diff --git a/autogpt_platform/frontend/src/components/contextual/SkillsPanel/SkillsPanel.tsx b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/SkillsPanel.tsxnew file mode 100644index 0000000000..fbc62471b9--- /dev/null+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/SkillsPanel.tsx@@ -0,0 +1,95 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";+import { Text } from "@/components/atoms/Text/Text";+import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from "@/components/atoms/Tooltip/BaseTooltip";+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";+import { PlusIcon } from "@phosphor-icons/react";+import { NEW_SKILL_PROMPT } from "../guidedPrompts";+import { EmptySkills } from "./components/EmptySkills/EmptySkills";+import { SkillListItem } from "./components/SkillListItem/SkillListItem";+import { UploadSkillButton } from "./components/UploadSkillButton/UploadSkillButton";+import { useSkillsPanel } from "./useSkillsPanel";++interface Props {+ onGuidedPrompt: (prompt: string) => void;+ withHeading?: boolean;+}++export function SkillsPanel({ onGuidedPrompt, withHeading = true }: Props) {+ const { skills, isLoading, error, newSkillName, handleSkillUploaded } =+ useSkillsPanel();++ return (+ <section className="space-y-6">+ <header className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">+ <div className="flex min-w-0 flex-col gap-2">+ {withHeading && <Text variant="h2">AutoPilot skills</Text>}+ <Text variant="body" className="!text-zinc-500">+ Reusable procedures your AutoPilot has distilled from past sessions.+ Review what it remembers, import a new skill, or delete one you no+ longer want it to reach for.+ </Text>+ </div>+ <div className="flex flex-shrink-0 items-center gap-2">+ <UploadSkillButton onUploaded={handleSkillUploaded} />+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="primary"+ size="small"+ onClick={() => onGuidedPrompt(NEW_SKILL_PROMPT)}+ data-testid="skill-new-button"+ >+ <PlusIcon className="mr-1 h-4 w-4" />+ New skill+ </Button>+ </TooltipTrigger>+ <TooltipContent side="bottom">+ Teach AutoPilot a new skill in chat+ </TooltipContent>+ </Tooltip>+ </div>+ </header>++ {error ? (+ <ErrorCard+ responseError={{+ message:+ error instanceof Error ? error.message : "Failed to load skills",+ }}+ context="AutoPilot skills"+ />+ ) : isLoading ? (+ <div+ className="flex items-center justify-center py-16"+ data-testid="skills-loading"+ >+ <LoadingSpinner />+ </div>+ ) : skills.length === 0 ? (+ <EmptySkills />+ ) : (+ <ul+ className="flex flex-col gap-3"+ data-testid="skills-list"+ aria-label="AutoPilot skills"+ >+ {skills.map((skill) => (+ <li key={skill.name}>+ <SkillListItem+ skill={skill}+ isNew={skill.name === newSkillName}+ />+ </li>+ ))}+ </ul>+ )}+ </section>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/EmptySkills/EmptySkills.tsx b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/EmptySkills/EmptySkills.tsxsimilarity index 71%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/EmptySkills/EmptySkills.tsxrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/EmptySkills/EmptySkills.tsxindex 5f5a4c2768..ddc7f3ed8b 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/EmptySkills/EmptySkills.tsx+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/EmptySkills/EmptySkills.tsx@@ -14,8 +14,10 @@ export function EmptySkills() {No skills yet</Text><Text variant="body" className="max-w-md !text-zinc-500">- Your copilot will distill skills here as it works through tasks worth- remembering. They appear automatically — no setup needed.+ Your AutoPilot distills reusable procedures from past sessions. Hit{" "}+ <strong>New skill</strong> to teach it one in chat, or{" "}+ <strong>Upload skill</strong> to import one you've saved — then+ it'll reach for it automatically.</Text></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/SkillListItem.tsx b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsxsimilarity index 91%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/SkillListItem.tsxrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsxindex c2d38a0370..249ffa3cb5 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/SkillListItem.tsx+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsx@@ -1,6 +1,7 @@"use client";import type { CopilotSkillInfo } from "@/app/api/__generated__/models/copilotSkillInfo";+import { Badge } from "@/components/atoms/Badge/Badge";import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";import { Dialog } from "@/components/molecules/Dialog/Dialog";@@ -16,9 +17,10 @@ import { useSkillListItem } from "./useSkillListItem";interface Props {skill: CopilotSkillInfo;+ isNew?: boolean;}-export function SkillListItem({ skill }: Props) {+export function SkillListItem({ skill, isNew = false }: Props) {const {descriptionPreview,triggers,@@ -48,9 +50,18 @@ export function SkillListItem({ skill }: Props) {<BookOpenIcon size={18} className="text-violet-700" weight="bold" /></div><div className="flex min-w-0 flex-col gap-1">- <Text variant="body-medium" className="break-words">- {skill.name}- </Text>+ <div className="flex items-center gap-2">+ <Text variant="body-medium" className="break-words">+ {skill.name}+ </Text>+ {isNew && (+ <span data-testid="skill-new-badge">+ <Badge variant="success" size="small">+ New+ </Badge>+ </span>+ )}+ </div><Text variant="small" className="!text-zinc-500">{descriptionPreview}</Text>@@ -177,8 +188,8 @@ export function SkillListItem({ skill }: Props) {<Dialog.Content><div className="flex flex-col gap-4"><Text variant="large">- Delete the skill <strong>{skill.name}</strong>? Your copilot will- forget this procedure and can re-distill it later if needed.+ Delete the skill <strong>{skill.name}</strong>? Your AutoPilot+ will forget this procedure and can re-distill it later if needed.</Text><Dialog.Footer><Buttondiff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/helpers.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/helpers.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/useSkillListItem.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/useSkillListItem.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/SkillListItem/useSkillListItem.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/useSkillListItem.tsdiff --git a/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/UploadSkillButton.tsx b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/UploadSkillButton.tsxnew file mode 100644index 0000000000..fb08dc6b52--- /dev/null+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/UploadSkillButton.tsx@@ -0,0 +1,49 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from "@/components/atoms/Tooltip/BaseTooltip";+import { UploadSimpleIcon } from "@phosphor-icons/react";+import { useUploadSkillButton } from "./useUploadSkillButton";++interface Props {+ onUploaded?: (name: string) => void;+}++export function UploadSkillButton({ onUploaded }: Props) {+ const { fileInputRef, isUploading, openFilePicker, handleFileChange } =+ useUploadSkillButton({ onUploaded });++ return (+ <>+ <input+ ref={fileInputRef}+ type="file"+ accept=".md,.markdown,text/markdown"+ className="hidden"+ onChange={handleFileChange}+ data-testid="skill-upload-input"+ />+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="secondary"+ size="small"+ onClick={openFilePicker}+ loading={isUploading}+ data-testid="skill-upload-button"+ >+ <UploadSimpleIcon className="mr-1 h-4 w-4" />+ Upload skill+ </Button>+ </TooltipTrigger>+ <TooltipContent side="bottom">+ Import a skill file you've exported+ </TooltipContent>+ </Tooltip>+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/getSkillUploadError.test.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/__tests__/getSkillUploadError.test.tssimilarity index 95%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/getSkillUploadError.test.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/__tests__/getSkillUploadError.test.tsindex a46f71c9d0..7186e19750 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/getSkillUploadError.test.ts+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/__tests__/getSkillUploadError.test.ts@@ -1,8 +1,5 @@import { describe, expect, test } from "vitest";-import {- getSkillUploadError,- MAX_SKILL_DESCRIPTION_CHARS,-} from "../components/UploadSkillButton/helpers";+import { getSkillUploadError, MAX_SKILL_DESCRIPTION_CHARS } from "../helpers";function md(frontmatter: string, body = "# Body\n\ncontent"): string {return `---\n${frontmatter}\n---\n\n${body}`;diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/helpers.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/helpers.tssimilarity index 100%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/helpers.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/helpers.tsdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/useUploadSkillButton.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/useUploadSkillButton.tssimilarity index 90%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/useUploadSkillButton.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/useUploadSkillButton.tsindex 7793a70f6a..1033e148d1 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/components/UploadSkillButton/useUploadSkillButton.ts+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/UploadSkillButton/useUploadSkillButton.ts@@ -7,7 +7,11 @@ import { useQueryClient } from "@tanstack/react-query";import { useRef } from "react";import { getSkillUploadError } from "./helpers";-export function useUploadSkillButton() {+interface Args {+ onUploaded?: (name: string) => void;+}++export function useUploadSkillButton({ onUploaded }: Args = {}) {const { toast } = useToast();const queryClient = useQueryClient();const fileInputRef = useRef<HTMLInputElement>(null);@@ -44,6 +48,9 @@ export function useUploadSkillButton() {const name =result.status === 201 ? result.data.name : (file.name ?? "skill");toast({ title: `Skill "${name}" uploaded` });+ if (result.status === 201) {+ onUploaded?.(result.data.name);+ }queryClient.invalidateQueries({queryKey: getListCopilotSkillsQueryKey(),});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/useSkillsPage.ts b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/useSkillsPanel.tssimilarity index 63%rename from autogpt_platform/frontend/src/app/(platform)/library/skills/useSkillsPage.tsrename to autogpt_platform/frontend/src/components/contextual/SkillsPanel/useSkillsPanel.tsindex 3e0657eac3..76626a64a8 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/useSkillsPage.ts+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/useSkillsPanel.ts@@ -1,7 +1,9 @@import { useListCopilotSkills } from "@/app/api/__generated__/endpoints/skills/skills";import { okData } from "@/app/api/helpers";+import { useState } from "react";-export function useSkillsPage() {+export function useSkillsPanel() {+ const [newSkillName, setNewSkillName] = useState<string | null>(null);const query = useListCopilotSkills({query: {select: (res) => okData(res) ?? [],@@ -12,5 +14,7 @@ export function useSkillsPage() {skills: query.data ?? [],isLoading: query.isLoading,error: query.error,+ newSkillName,+ handleSkillUploaded: setNewSkillName,};}diff --git a/autogpt_platform/frontend/src/components/contextual/guidedPrompts.ts b/autogpt_platform/frontend/src/components/contextual/guidedPrompts.tsnew file mode 100644index 0000000000..86e49bc4c5--- /dev/null+++ b/autogpt_platform/frontend/src/components/contextual/guidedPrompts.ts@@ -0,0 +1,15 @@+export const NEW_SKILL_PROMPT = `I want to teach you a new skill, with the goal being that you fully learn and understand my process, including its edge-cases and gotchas. When you have all the info needed from me (without making assumptions), I want you to run the tool to create a new skill with all this information.++To start, ask me what I want to teach you.`;++export const NEW_SCHEDULED_TASK_PROMPT = `I want to create a new scheduled task. You will need to collect the following information from me:+- The schedule frequency+- and all necessary context of the task itself++Don't make any assumptions and make sure that the task instructions are unambiguous. You should also ask me whether or not each scheduled task should start a new session or continue in the same session.++Start by asking me about the task itself.`;++export function isGuidedPrompt(text: string) {+ return text === NEW_SKILL_PROMPT || text === NEW_SCHEDULED_TASK_PROMPT;+}